[hidden] { display: none !important; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--primary-dark);
  text-align: center;
  flex: 1;
}

.screen {
  padding: 10px 20px 50px;
  display: flex;
  justify-content: center;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  text-align: center;
}

.card h2 { margin-top: 0; color: var(--primary-dark); }

.choice-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px 0 20px;
}

.choice-btn {
  flex: 1 1 120px;
  border: 3px solid transparent;
  background: #f1f1f1;
  border-radius: 16px;
  padding: 14px 10px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.choice-btn .label { font-size: 0.85rem; }
.choice-btn.selected { border-color: var(--primary); background: #fff0eb; }

/* ---------- Game layout ---------- */
.game-wrap {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 24px;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.board-area {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.board {
  width: min(560px, 90vw);
  aspect-ratio: 800 / 524.3;
  background: #d6ecff;
  border-radius: 10px;
  overflow: hidden;
}

.board svg {
  width: 100%;
  height: 100%;
  display: block;
}

.country-outline {
  fill: #eaf4ff;
  stroke: #2b6cb0;
  stroke-width: 3;
  stroke-linejoin: round;
  pointer-events: none;
}

.target-shape {
  fill: #d7dee6;
  stroke: #9aa7b5;
  stroke-width: 1.2;
  transition: fill 0.3s ease, stroke 0.3s ease;
}

.target-shape.filled {
  stroke: #ffffff;
  stroke-width: 2;
}

.target-label {
  font-size: 8px;
  font-weight: 800;
  fill: #33404d;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 2.2px;
  stroke-linejoin: round;
}

.tray-area {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  flex: 1 1 360px;
  min-width: 300px;
  max-width: 520px;
  display: flex;
  flex-direction: column;
}

.tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 0.95rem;
  gap: 8px;
}

.progress-label {
  background: #fff0eb;
  color: var(--primary-dark);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.tray {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: center;
  gap: 14px;
  padding: 14px;
  flex: 1 1 auto;
  min-height: 260px;
  max-height: 65vh;
  overflow-y: auto;
  background: #fbfbfb;
  border-radius: 12px;
  margin-bottom: 12px;
}

.state-piece {
  width: 84px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.2));
}

.state-piece svg {
  width: 100%;
  height: 64px;
  display: block;
}

.piece-shape {
  stroke: #333;
  stroke-width: 1.5;
}

.piece-label {
  font-size: 0.65rem;
  font-weight: bold;
  color: var(--text);
  text-align: center;
  margin-top: 2px;
  line-height: 1.1;
}

.state-piece.dragging {
  cursor: grabbing;
  z-index: 999;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.35));
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1200;
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 30, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1300;
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .topbar h1 { font-size: 1.25rem; }
}
