.cc-game { max-width: 640px; margin: 1rem auto 3rem; padding: 0 1rem; position: relative; z-index: 1; }

.panel {
  background: var(--card); border: 3px solid var(--card-border); border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2rem); box-shadow: var(--shadow); text-align: center;
  backdrop-filter: blur(10px);
}
.panel.hidden { display: none; }
.panel h1, .panel h2 {
  font-family: var(--font-display); font-weight: 600;
  margin: 0.25rem 0 0.5rem; font-size: clamp(1.8rem, 5vw, 2.8rem);
  background: linear-gradient(95deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 0.1em;
}
.cc-icon { font-size: 4rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3)); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.tagline { margin: 0 0 1.25rem; color: var(--text-soft); font-weight: 600; }

/* ===== Level picker ===== */
.levels { border: none; margin: 0 0 1.25rem; padding: 0; }
.levels legend {
  font-weight: 800; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-soft); margin-bottom: 0.6rem; padding: 0;
}
.level-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
@media (max-width: 330px) { .level-grid { grid-template-columns: 1fr; } }

.level-btn {
  font: inherit; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  padding: 0.85rem 0.6rem; border-radius: var(--radius-sm);
  border: 3px solid transparent; background: rgba(127,127,127,0.14); color: var(--text);
  transition: transform 0.15s var(--ease-pop), border-color 0.15s ease, background 0.15s ease;
}
.level-btn:hover { transform: translateY(-3px); }
.level-btn[aria-pressed="true"] {
  border-color: var(--primary); background: color-mix(in srgb, var(--primary) 18%, transparent);
}
.level-emoji { font-size: 1.7rem; line-height: 1; }
.level-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.level-sub { font-size: 0.72rem; color: var(--text-soft); font-weight: 600; line-height: 1.25; }

.setup-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; align-items: center; }
.btn-primary {
  font-family: var(--font-display); font-weight: 600; padding: 0.7rem 1.6rem;
  border-radius: var(--radius-pill); border: none;
  background: linear-gradient(95deg, var(--primary), var(--accent)); color: #fff; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.15s var(--ease-pop); font-size: 1.1rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.btn-primary:hover { transform: translateY(-3px) scale(1.03); }
.btn-secondary {
  display: inline-block; margin-left: 0.75rem; padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill); text-decoration: none; color: var(--text);
  background: var(--card); border: 2px solid var(--card-border); font-weight: 700;
}
.best-line { margin: 1rem 0 0; color: var(--text-soft); font-weight: 700; font-size: 0.9rem; min-height: 1.2em; }

/* ===== HUD ===== */
.cc-header { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-bottom: 0.75rem; }
.hud { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,0.15); border-radius: 12px; padding: 0.5rem; }
.hud-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-soft); font-weight: 700; }
.hud-value { font-size: 1.15rem; font-weight: 800; color: var(--text); }

.question { font-size: clamp(1.2rem, 3.5vw, 1.6rem) !important; margin: 0 0 0.75rem !important; }

/* ===== Coins =====
   Sizes are roughly true to life, so the dime really is the smallest disc on
   screen while being worth more than the nickel beside it. */
.coins {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 0.5rem; min-height: 72px; margin-bottom: 0.5rem;
  padding: 0.75rem; border-radius: var(--radius-sm); background: rgba(0,0,0,0.12);
}

.coin {
  position: relative;   /* the counted tick is positioned against this */
  border: none; background: none; padding: 0; cursor: pointer; line-height: 0;
  border-radius: 50%; flex: 0 0 auto;
  transition: transform 0.15s var(--ease-pop), filter 0.2s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}
.coin:hover { transform: translateY(-3px) scale(1.06); }
.coin svg { width: 100%; height: 100%; display: block; }
.coin-face { font-family: var(--font-display); font-weight: 600; font-size: 32px; fill: #221e33; }
.coin-name { font-family: var(--font-body); font-weight: 800; font-size: 17px; fill: #453f57; letter-spacing: 0.5px; }

/* A counted coin is dimmed and ticked, so a child can see what is left. */
.coin.counted { filter: none; opacity: 0.5; }
.coin.counted::after {
  content: "✓";
  position: absolute; right: -2px; bottom: -2px;
  width: 1.15rem; height: 1.15rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #2e8b3a; color: #fff;
  font-size: 0.8rem; font-weight: 900; line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.running {
  margin: 0 0 0.85rem; font-weight: 800; font-size: 0.95rem; color: var(--text-soft);
  min-height: 1.3em;
}

/* ===== Choices ===== */
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin-bottom: 0.5rem; }

.choice {
  font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  padding: 0.8rem 0.5rem; border-radius: var(--radius-sm);
  border: 3px solid var(--card-border); background: rgba(255,255,255,0.9); color: #2b2640;
  transition: transform 0.15s var(--ease-pop), border-color 0.15s ease, background 0.2s ease;
}
.choice:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--primary); }
.choice:disabled { cursor: default; }
.choice { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; }

.choice.right { background: #d8f5dd; border-color: #2e8b3a; }
.choice.wrong { background: #ffdcd9; border-color: #d94a41; }

.feedback { min-height: 1.6em; font-weight: 800; margin: 0.5rem 0 0; }
.feedback.good { color: #2e8b3a; }
.feedback.bad { color: #d94a41; }
[data-theme="pandora"] .feedback.good { color: #7ce49a; }
[data-theme="pandora"] .feedback.bad { color: #ff9a92; }

/* ===== Wrong-answer explanation =====
   Light surface like the coins themselves, so it stays legible in both themes. */
.explain {
  text-align: left; margin: 0.75rem 0 0.25rem;
  background: rgba(255,255,255,0.94); color: #2b2640;
  border: 2px solid var(--card-border); border-left: 6px solid var(--primary);
  border-radius: var(--radius-sm); padding: 0.9rem 1rem;
}
.explain[hidden] { display: none; }
.explain h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  margin: 0 0 0.45rem; color: var(--primary-dark);
}
.explain ul { margin: 0; padding-left: 1.15rem; }
.explain li { margin-bottom: 0.4rem; line-height: 1.5; font-weight: 600; font-size: 0.95rem; }
.explain li:last-child { margin-bottom: 0; }
.ink-coin { color: #8a4b23; }
[data-theme="pandora"] .explain h3 { color: #2a6fa5; }
[data-theme="wolfpack"] .explain h3 { color: #a82a60; }

.next-pile { margin-top: 0.85rem; }
.next-pile[hidden] { display: none; }

.final-score { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; margin: 0.25rem 0 0.5rem; }

@media (max-width: 380px) {
  .coins { gap: 0.35rem; padding: 0.5rem; }
}
