* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Georgia, 'Times New Roman', serif;
  background: linear-gradient(160deg, #f4efe3 0%, #e6d8bd 100%);
  color: #3a3320; min-height: 100vh;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.game {
  max-width: 720px; margin: 24px auto; padding: 20px 20px 24px;
  background: #fffdf5; border: 1.5px solid #c99a4a; border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
.game-head { text-align: center; }
.game-head h1 { margin: 4px 0 2px; font-size: 26px; color: #b0402f; }
.game-sub { margin: 0 0 12px; color: #8a6a3a; font-size: 15px; }
.game-sub b { color: #b0402f; }

.controls { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-bottom: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip {
  font: inherit; font-size: 14px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid #cbb488; background: #fff; color: #6a4a1a; font-weight: 600;
}
.chip.is-on { background: #f0d0a0; border-color: #d64534; color: #7a3010; }
.chip:disabled { opacity: 0.45; cursor: default; }

.progress {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 560px; margin: 4px auto 10px; font-size: 15px; color: #6a4a1a; font-weight: 600;
}
#score-text { color: #b0402f; }

.board-wrap { position: relative; }
.board {
  background: #fffef9; border: 1.4px solid #e6d5aa; border-radius: 14px;
  padding: 18px 14px;
  min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.instr { margin: 0 0 10px; font-size: 16px; font-weight: 700; color: #7a3010; text-align: center; }
.eq-stage { width: 100%; display: flex; justify-content: center; align-items: center; }
.eq-stage svg { max-width: 100%; height: auto; touch-action: none; }

.ms-stick { cursor: grab; }
.ms-stick.dragging { cursor: grabbing; }
.ms-stick.picked line:last-of-type { stroke: #e77; }
.ms-slot-hot { fill: none; }

.verdict { min-height: 24px; margin: 12px 0 0; font-size: 17px; font-weight: 700; text-align: center; }
.verdict.ok { color: #1a8a3a; }
.verdict.no { color: #c0552f; }

.tools { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.tool {
  font: inherit; font-size: 15px; font-weight: 700; padding: 10px 18px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid #cbb488; background: #fff; color: #6a4a1a;
}
.tool:hover { border-color: #d64534; }
.tool-next { background: #eab04f; border-color: #a5301f; color: #5a2408; }

.win { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(60,45,25,0.45); border-radius: 16px; }
.win[hidden] { display: none; }
.win-card { background: #fffdf5; border: 2px solid #d64534; border-radius: 18px; padding: 26px 30px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.win-emoji { font-size: 52px; }
.win-title { font-size: 22px; font-weight: 800; color: #b0402f; margin: 6px 0; }
.win-result { color: #6a4a1a; font-size: 16px; margin-bottom: 6px; }
.win-stars { font-size: 30px; margin-bottom: 14px; }
.win-btn { background: #eab04f; border-color: #a5301f; color: #5a2408; }

.game-foot { text-align: center; color: #a08a5a; font-size: 13px; margin-top: 16px; line-height: 1.5; }

@keyframes pulse { 0%,100% { opacity: 0.25; } 50% { opacity: 0.9; } }
.hint-slot { animation: pulse 0.9s ease-in-out infinite; }
.hint-stick line:last-of-type { stroke: #2a8; }
