.tt-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;
}
.tt-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 ===== */
.tt-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; }

/* ===== Clock face =====
   Fixed ink colours rather than theme variables: the face is always a light
   dial, so theme text colours (near-white in Pandora) would vanish on it. */
.clock { margin: 0 auto 1rem; width: min(260px, 70vw); }
.clock svg { width: 100%; height: auto; display: block; }

.clock-face { fill: #fdfcff; stroke: var(--primary); stroke-width: 4; }
.clock-num { font-family: var(--font-display); font-weight: 600; font-size: 17px; fill: #2b2640; }
.tick { stroke: #9d97b5; stroke-width: 1.5; }
.tick-big { stroke: #5d5676; stroke-width: 3; stroke-linecap: round; }
.hand-hour { stroke: #2b2640; stroke-width: 8; stroke-linecap: round; }
.hand-min { stroke: var(--primary-dark); stroke-width: 5; stroke-linecap: round; }
.clock-pin { fill: var(--accent); stroke: #2b2640; stroke-width: 2; }

/* Pandora's --primary-dark is a pale blue meant for dark cards; on the white
   dial the minute hand needs its own ink. */
[data-theme="pandora"] .hand-min { stroke: #2a6fa5; }

/* ===== 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-digital { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; }
.choice-words { font-size: 0.8rem; font-weight: 700; color: #5d5676; }

.choice.right { background: #d8f5dd; border-color: #2e8b3a; }
.choice.right .choice-words { color: #1f6b2a; }
.choice.wrong { background: #ffdcd9; border-color: #d94a41; }
.choice.wrong .choice-words { color: #a5322b; }

.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 on purpose, like the clock face: this is a page of reading and
   it has to stay 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; }

/* Name each hand in the colour it is drawn on the dial. */
.ink-hour { color: #221e33; }
.ink-min  { color: #b0246a; }
[data-theme="pandora"] .explain h3 { color: #2a6fa5; }
[data-theme="pandora"] .ink-min { color: #1f5f93; }
[data-theme="wolfpack"] .explain h3 { color: #a82a60; }

.next-clock { margin-top: 0.85rem; }
.next-clock[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) {
  .choices { grid-template-columns: 1fr; }
  .choice { flex-direction: row; gap: 0.5rem; justify-content: center; }
}
