/* ==========================================================================
   TICK-TOCK TIME
   Layout for the four telling-the-time games. Shared chrome (screens, top
   bar, score pill, chips, answer buttons, settings, confetti) lives in
   kids-common.css. The clock faces are SVGs drawn by clock-engine.js.
   ========================================================================= */

.game-btn.mode-read { background: #3f8fd9; }
.game-btn.mode-set { background: #d94a3d; }
.game-btn.mode-match { background: #7f77dd; }
.game-btn.mode-later { background: #1d9e75; }

#scr-play {
  align-items: stretch;
}

/* Five ages have to sit on one row on a phone. */
#level-chips .chip {
  min-width: 54px;
  padding: 7px 6px;
}

#level-chips .chip-note {
  white-space: nowrap;
  font-size: 0.7rem;
}

/* ===================== Clock faces ===================== */

.clock {
  line-height: 0;
}

.clock .clock-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 3px 2px rgba(60, 52, 137, 0.2));
}

.clock.big {
  width: min(240px, 64vw);
  height: min(240px, 64vw);
}

.clock.mid {
  width: min(160px, 42vw);
  height: min(160px, 42vw);
}

/* The clock that is dragged. touch-action: none stops the page scrolling
   under a finger that is turning a hand. */
.clock.settable {
  touch-action: none;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.clock.settable:active {
  cursor: grabbing;
}

.clock .held {
  stroke-width: 11;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.35));
}

.clock .hand-minute.held {
  stroke-width: 7;
}

/* ===================== Match the clock ===================== */

/* An LCD-ish read-out, so it looks like the clock on a cooker or a phone. */
.digital {
  background: #23263a;
  color: #8ff0a4;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 3.6rem;
  font-weight: 700;
  letter-spacing: 4px;
  padding: 10px 26px;
  border-radius: 16px;
  border: 5px solid #4a4f6d;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.6);
}

.digital.h24 {
  color: #ffd27a;
}

/* ===================== What time will it be? ===================== */

.later-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.later-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 150px;
  text-align: center;
}

.later-emoji {
  font-size: 2.6rem;
  line-height: 1;
}

.later-gap {
  background: var(--kids-amber-pale);
  color: var(--kids-amber);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 1rem;
  font-weight: 900;
}

.later-q {
  font-size: 1.5rem;
}

/* ===================== Answers ===================== */

.clock-answers {
  max-width: 460px;
}

.time-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 140px;
  font-size: 1.25rem;
  line-height: 1.2;
}

/* Four time buttons make a tidy 2 x 2. */
.clock-answers.four {
  max-width: 320px;
}

.clock-answers.four .time-btn {
  flex: 1 1 130px;
  min-width: 130px;
}

.opt-words {
  font-weight: 900;
}

.opt-digital {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--kids-muted);
}

/* Three classes, so it beats ".clock-answers.four .time-btn" above, which
   would otherwise stretch each clock to the full row. */
.clock-answers .time-btn.clock-btn {
  min-width: 0;
  width: 116px;
  height: 116px;
  padding: 6px;
  flex: 0 0 auto;
}

.clock-answers.mode-match.four {
  max-width: 260px;
}

.clock-answers .time-btn.clock-btn .clock-svg {
  width: 100%;
  height: 100%;
}

/* ===================== Set the clock ===================== */

.set-controls {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.step-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.step-label {
  min-width: 96px;
  font-size: 0.95rem;
  font-weight: 900;
  text-align: right;
  line-height: 1.1;
}

.step-label small {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.8;
}

.step-label.hour { color: #d94a3d; }
.step-label.minute { color: #1c6fb3; }

.step-btn {
  min-width: 58px;
  min-height: 52px;
  border-radius: 14px;
  border: 3px solid;
  background: var(--kids-card);
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 900;
  cursor: pointer;
}

.step-btn.hour { border-color: #f0b3ad; color: #d94a3d; }
.step-btn.minute { border-color: #a9cbeb; color: #1c6fb3; }

.step-btn:active {
  transform: scale(0.93);
}

.step-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}

.done-btn {
  margin-top: 4px;
}

@media (max-width: 380px) {
  .digital { font-size: 2.8rem; padding: 8px 18px; }
  .time-btn { font-size: 1.1rem; }
  .clock-answers .time-btn.clock-btn { width: 100px; height: 100px; }
}
