[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: 1100px;
  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 {
  position: relative;
  width: min(320px, 78vw);
  aspect-ratio: 1 / 2;
  background: #fbfbfb;
  border-radius: 10px;
  overflow: visible;
}

.board svg.body-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.target-zone {
  position: absolute;
  width: 20%;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0.4;
  filter: grayscale(0.3);
  transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

.target-zone svg {
  width: 100%;
  height: 100%;
  display: block;
}

.target-zone.filled {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
}

.organ-label {
  position: absolute;
  transform: translate(-50%, 0);
  font-size: 0.7rem;
  font-weight: bold;
  color: var(--primary-dark);
  background: rgba(255,255,255,0.9);
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.organ-label.show { opacity: 1; }

.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 320px;
  min-width: 280px;
  max-width: 460px;
  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 {
  position: relative;
  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;
}

.tray .organ-piece {
  position: relative;
}

.organ-piece {
  position: absolute;
  width: 74px;
  height: 74px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.25));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.organ-piece svg { width: 100%; height: 100%; }

.organ-piece .tray-label {
  font-size: 0.68rem;
  font-weight: bold;
  color: var(--text);
  text-align: center;
  margin-top: 2px;
}

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

.organ-piece.placed {
  cursor: default;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

#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; }
}
