.clock-game {
  background: #e1ebe5;
  height: 100dvh;
}
.dark .clock-game { background: #0e1a18; }
.clock-game-header {
  background: linear-gradient(110deg, #193d35, #18312d);
  border-bottom: 1px solid #6c8d81;
  color: #f7efde;
  gap: .5rem;
  justify-content: space-between;
  padding: .45rem clamp(.5rem, 2vw, 2rem);
}
.clock-game-tools { display: flex; gap: clamp(.26rem, .8vw, .7rem); }
.clock-game-tools button {
  display: flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid #6a8b80;
  background: #2a5047;
  border-radius: .68rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  justify-content: center;
  padding: .35rem .5rem;
  color: #fffaf0;
  font-size: clamp(.8rem, 1.45vw, 1.18rem);
  font-weight: 800;
}
.clock-game-tools button:hover { background: #39665b; }
.clock-game-tools svg { width: clamp(1rem, 1.8vw, 1.55rem); height: auto; }
.clock-game-title { font-size: clamp(1.05rem, 2.4vw, 2rem); font-weight: 900; text-align: center; }
.clock-progress {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: .38em;
  white-space: nowrap;
  padding: .35em .65em;
  border: 1px solid #6a8b80;
  border-radius: 99px;
  color: #e9eddd;
  font-size: clamp(.76rem, 1.55vw, 1.2rem);
  font-weight: 800;
}
.clock-progress strong { color: #ffe0a5; font-size: 1.23em; }

.clock-panels {
  display: grid;
  grid-template-columns: repeat(var(--clock-seats, 1), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(.4rem, .65vw, .85rem);
  min-height: 0;
  flex: 1;
  padding: clamp(.4rem, .65vw, .85rem);
}
.clock-panels[data-count="2"] { --clock-seats: 2; }
.clock-panels[data-count="3"] { --clock-seats: 3; }
.clock-panels[data-count="4"] { --clock-seats: 4; }
.clock-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f4f4e9;
  border-width: 2px;
  border-style: solid;
  border-radius: clamp(.65rem, 1.1vw, 1.35rem);
  box-shadow: 0 4px 12px #122e2921;
  --clock-scene: radial-gradient(ellipse at 50% 42%, #fbfaf1 9%, #ecf0e3 69%, #dfe9df);
  --clock-text: #253e36;
  --clock-swatch-hour: #19334b;
  --clock-swatch-minute: #a53532;
  --clock-option: #fdfdf3;
  --clock-option-hover: #e2f1e4;
  --clock-option-border: #789c87;
  --clock-tray: #dce8df;
}
.dark .clock-panel {
  background: #182d28;
  --clock-scene: radial-gradient(ellipse at 50% 44%, #30473f, #1b312b 68%, #122720);
  --clock-text: #f1f4de;
  --clock-swatch-hour: #9ebfe7;
  --clock-swatch-minute: #ff9d95;
  --clock-option: #2b4a40;
  --clock-option-hover: #3a6254;
  --clock-option-border: #679787;
  --clock-tray: #182e28;
}
.clock-seat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  padding: clamp(.27rem, .6vw, .65rem) clamp(.45rem, .8vw, .8rem);
  border-bottom: 1px solid #8ea899;
  background: #ffffffca;
  z-index: 1;
  flex: none;
}
.dark .clock-seat { background: #1c2d2a; border-color: #5b796c; }
.clock-seat-name {
  display: flex;
  align-items: center;
  gap: .35em;
  min-width: 0;
  font-size: clamp(.83rem, 1.36vw, 1.36rem);
  font-weight: 900;
}
.clock-seat-name svg { width: 1.08em; height: 1.08em; flex: none; }
.clock-score { display: grid; text-align: center; min-width: 2.5rem; color: var(--clock-text); line-height: 1; }
.clock-score small { font-size: clamp(.56rem, .83vw, .8rem); font-weight: 800; }
.clock-score strong { font-size: clamp(1.04rem, 1.57vw, 1.67rem); }
.clock-panel .ild-round-stage,
.clock-panel .ild-round-question { min-width: 0; }
.clock-board {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  color: var(--clock-text);
}
.clock-scene {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  gap: clamp(.24rem, .64vh, .7rem);
  padding: clamp(.36rem, 1.3vh, 1rem) .35rem;
  background: var(--clock-scene);
  text-align: center;
}
.clock-scene h2 {
  margin: 0;
  font-size: clamp(.98rem, 2.57vh, 1.7rem);
  font-weight: 900;
  line-height: 1.15;
}
.clock-mount {
  container-type: size;
  display: grid;
  place-items: center;
  min-height: 0;
  min-width: 0;
}
.clock-dial {
  display: block;
  width: min(100cqw, 100cqh, 36rem);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 clamp(1px, 1vh, 10px) clamp(2px, 1vh, 12px) #081f1a43);
}
.clock-major { stroke: #304740; stroke-width: 2.25; stroke-linecap: round; }
.clock-minor { stroke: #5b6a61; stroke-width: .85; stroke-linecap: round; }
.clock-number { fill: #20342f; font-size: 17.4px; font-weight: 900; font-variant-numeric: tabular-nums; }
.clock-hour { fill: #19334b; stroke: #0c2438; stroke-width: .6; }
.clock-minute { fill: #a53532; stroke: #642424; stroke-width: .5; }
.clock-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .12rem clamp(.55rem, 1.2vw, 1.2rem);
  font-size: clamp(.67rem, 1.5vh, .98rem);
  font-weight: 800;
  line-height: 1.2;
}
.clock-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.clock-legend i { display: block; height: .23rem; border-radius: 99px; }
.clock-legend-hour { width: .75rem; background: var(--clock-swatch-hour, #19334b); }
.clock-legend-minute { width: 1.16rem; background: var(--clock-swatch-minute, #a53532); }
.clock-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  padding: clamp(.32rem, .6vw, .72rem);
  gap: clamp(.3rem, .6vw, .7rem);
  border-top: 1px solid #72968980;
  background: var(--clock-tray);
}
.clock-choices button {
  min-width: 0;
  min-height: clamp(2.55rem, 7.5vh, 5.25rem);
  border: 1px solid var(--clock-option-border);
  border-radius: clamp(.48rem, .95vw, .95rem);
  background: var(--clock-option);
  color: var(--clock-text);
  box-shadow: 0 2px 0 var(--clock-option-border);
  font-size: clamp(1.15rem, 2.5vw, 2.7rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
@media (hover: hover) {
  .clock-choices button:not(:disabled):hover { background: var(--clock-option-hover); }
}
.clock-choices button:not(:disabled):active { box-shadow: inset 0 2px 0 var(--clock-option-border); }
.clock-thinking { grid-column: 1 / -1; text-align: center; padding: .65em; font-weight: 800; }
.clock-game button:focus-visible, .clock-example button:focus-visible, .clock-example-link:focus-visible {
  outline: 3px solid #bc7f1f;
  outline-offset: 2px;
}

.clock-example-link, .clock-example-actions button {
  border: 1px solid #7b9d8d;
  background: #244a40;
  color: #fffaf0;
  padding: .58em 1.12em;
  min-height: 2.5rem;
  font-weight: 850;
  border-radius: .72rem;
}
.clock-example-link { margin-top: clamp(.7rem, 2.4vh, 1.65rem); }
.clock-example-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: .65rem;
  background: #10231dd1;
}
.clock-example {
  display: grid;
  width: min(29rem, 100%);
  max-height: calc(100dvh - 1.3rem);
  overflow: auto;
  justify-items: center;
  gap: .52rem;
  padding: clamp(.65rem, 2.1vh, 1.5rem);
  border: 1px solid #94afa1;
  border-radius: 1.3rem;
  background: #f5f6ea;
  color: #253e36;
  text-align: center;
  box-shadow: 0 18px 58px #06150e88;
}
.clock-example h2 { margin: 0; font-size: clamp(1.25rem, 3vh, 1.85rem); font-weight: 900; line-height: 1.15; }
.clock-example p { margin: 0; font-weight: 700; }
.clock-example-visual { width: min(70vw, 41dvh, 15.6rem); }
.clock-example-visual .clock-dial { width: 100%; }
.clock-example-times { color: #214b3e; font-size: 1.3rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.clock-example-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.clock-example-actions button:last-child { background: #e2ebe0; color: #244a40; }
.clock-demo-hour, .clock-demo-minute { transform-box: view-box; transform-origin: center; }
.clock-demo-hour { animation: clock-example-hour 2.1s both; }
.clock-demo-minute { animation: clock-example-minute 2.1s both; }
@keyframes clock-example-hour {
  0%, 22% { transform: rotate(90deg); }
  83%, 100% { transform: rotate(92.5deg); }
}
@keyframes clock-example-minute {
  0%, 22% { transform: rotate(0deg); }
  83%, 100% { transform: rotate(30deg); }
}
@media (max-width: 760px), (max-height: 530px) {
  .clock-game-title { font-size: clamp(.78rem, 2.3vw, 1.12rem); line-height: 1.1; }
  .clock-game-tools button span { display: none; }
  .clock-panel .ild-finish-content { margin: .25rem; padding: .45rem; }
}
@media (orientation: portrait) and (max-width: 850px) {
  .clock-panels[data-count="3"], .clock-panels[data-count="4"] { --clock-seats: 2; }
  .clock-choices button { font-size: clamp(1.05rem, 4.8vw, 1.6rem); }
}
@media (orientation: landscape) and (max-height: 530px) {
  .clock-panels[data-count="1"] .clock-board, .clock-panels[data-count="2"] .clock-board {
    grid-template: minmax(0, 1fr) / minmax(0, 1fr) minmax(0, .77fr);
  }
  .clock-panels[data-count="1"] .clock-choices, .clock-panels[data-count="2"] .clock-choices {
    grid-template-rows: repeat(2, minmax(0, 1fr));
    align-content: center;
    max-height: 10rem;
    align-self: center;
    border: 0;
    background: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .clock-demo-hour, .clock-demo-minute, .clock-choices button { animation: none; transition: none; }
}
