[hidden] { display: none !important; }

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-dark); }

.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;
  justify-content: center;
  width: 100%;
}

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

.prompt-banner {
  width: 100%;
  text-align: center;
  margin-bottom: 16px;
}

.progress-label {
  display: inline-block;
  background: linear-gradient(135deg, #8dd6a8, #5fbf87);
  color: white;
  font-weight: bold;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
}

/* ---------- Decks ---------- */
.deck-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  width: 100%;
  margin-bottom: 24px;
}

.deck-card {
  width: 108px;
  min-height: 118px;
  border-radius: 16px;
  padding: 10px 6px 8px;
  text-align: center;
  border: 3px dashed #cfd8e3;
  background: #f7fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.deck-card.kind-animal { background: #f0faf3; }
.deck-card.kind-sport { background: #eef7ff; }

.deck-card .deck-emoji {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 6px;
}

.deck-card .deck-name {
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--text);
  min-height: 2.2em;
}

.deck-card .deck-slots {
  margin-top: 6px;
  min-height: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.deck-slot-item {
  font-size: 1.3rem;
  background: white;
  border-radius: 8px;
  padding: 2px 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

.deck-card.drag-over {
  border-color: var(--secondary);
  transform: scale(1.05);
  background: #e3f3ff;
}

.deck-card.correct-flash {
  border-color: #4d9c6c;
  background: #d9f5e3;
  animation: deckPop 0.4s ease;
}

.deck-card.wrong-flash {
  border-color: #d94b4b;
  background: #ffe3e3;
  animation: deckShake 0.4s ease;
}

@keyframes deckPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes deckShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ---------- Item tray ---------- */
.item-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  width: 100%;
  min-height: 90px;
  padding: 14px;
  border-radius: 16px;
  background: #fff8ec;
  border: 2px solid #ffe4b8;
}

.item-piece {
  width: 78px;
  border-radius: 14px;
  background: white;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  padding: 8px 4px 6px;
  text-align: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.item-piece .item-emoji {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 4px;
}

.item-piece .item-name {
  font-size: 0.68rem;
  font-weight: bold;
  color: var(--text);
}

.item-piece.dragging {
  opacity: 0.9;
  cursor: grabbing;
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);
}

#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; }
  .deck-card { width: 92px; min-height: 108px; }
  .item-piece { width: 68px; }
}
