/* howtoreadaclock.com – shared styles */
:root {
  --bg: #fff8ec;
  --paper: #ffffff;
  --ink: #23263a;
  --muted: #5d6178;
  --line: #eadfca;
  --brand: #2f6fde;
  --brand-ink: #ffffff;
  --hour: #ff5a36;
  --minute: #2f6fde;
  --right: #1f9d6b;
  --right-bg: #e3f7ee;
  --wrong: #d64545;
  --wrong-bg: #fdeaea;
  --sun: #ffc93c;
  --radius: 18px;
  --shadow: 0 2px 0 rgba(35, 38, 58, .06), 0 10px 30px rgba(35, 38, 58, .08);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font); }
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: .2em 0 .3em; }
h2 { font-size: clamp(1.45rem, 3.2vw, 2rem); margin: 2.2em 0 .5em; }
h3 { font-size: 1.2rem; margin: 1.6em 0 .4em; }
p, ul, ol { margin: 0 0 1em; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* header / footer */
.site-header { padding: 14px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.brand svg { width: 34px; height: 34px; }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.site-nav a:hover { background: var(--paper); }
@media (max-width: 620px) { .site-nav .opt { display: none; } }

.site-footer { margin-top: 64px; padding: 36px 0 28px; background: #fff3dc; border-top: 2px solid var(--line); font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; }
.site-footer h2 { font-size: 1rem; margin: 0 0 .5em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .25em 0; }
.footer-bottom { margin-top: 24px; color: var(--muted); }

/* hero */
.hero { text-align: center; padding: 8px 0 18px; }
.hero p { color: var(--muted); font-size: 1.12rem; max-width: 640px; margin-inline: auto; }

/* ---------- clock ---------- */
.clock { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.clock-rim { fill: #ffd56a; }
.clock-face { fill: #fffdf7; stroke: #ffe7a6; stroke-width: 2; }
.tick { stroke: #c9c3b4; stroke-width: 1.4; stroke-linecap: round; }
.tick--5 { stroke: #8f8a7c; stroke-width: 3; }
.clock-num { font: 800 19px var(--font); fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.clock-min { font: 700 10.5px var(--font); fill: var(--minute); text-anchor: middle; dominant-baseline: central; }
.hand--hour { fill: var(--hour); }
.hand--minute { fill: var(--minute); }
.clock-cap { fill: var(--ink); }
.clock-cap-dot { fill: #ffd56a; }
.clock-ghost .hand { opacity: .35; }
.clock--interactive { cursor: grab; }
.clock--interactive .hand-group { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .18)); }
.clock--interactive.dragging-hour, .clock--interactive.dragging-minute { cursor: grabbing; }
.dragging-hour .hand-group--hour .hand, .dragging-minute .hand-group--minute .hand { filter: brightness(1.12); }
.clock--small .clock-num { font-size: 20px; }

/* ---------- game ---------- */
.game { position: relative; background: var(--paper); border-radius: 28px; box-shadow: var(--shadow); padding: clamp(14px, 3vw, 28px); border: 3px solid #ffe2a0; }
.game-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.game-bar h2 { margin: 0; font-size: 1.25rem; }
.game-bar-right { display: flex; align-items: center; gap: 10px; }
.score { font-weight: 800; color: #b07a00; background: #fff4d0; border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.icon-btn { border: 0; background: #f3efe6; border-radius: 999px; width: 42px; height: 42px; font-size: 1.2rem; cursor: pointer; }

.levels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 18px; }
@media (max-width: 760px) { .levels { grid-template-columns: repeat(3, 1fr); } }
.level-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; border: 2px solid var(--line); background: #fffdf8; border-radius: 14px; padding: 8px 4px; cursor: pointer; font: inherit; color: var(--ink); line-height: 1.2; }
.level-btn:hover { border-color: #ffd36b; }
.level-btn.is-active { border-color: var(--brand); background: #eef4ff; box-shadow: inset 0 0 0 1px var(--brand); }
.level-num { font-weight: 900; font-size: 1.15rem; }
.level-name { font-size: .8rem; font-weight: 700; text-align: center; }
.level-stars { color: #e0a800; font-size: .85rem; letter-spacing: 1px; }
.level-btn--explore .level-stars { color: var(--muted); letter-spacing: 0; font-size: .72rem; }

.stage { display: grid; grid-template-columns: minmax(240px, 400px) 1fr; gap: clamp(16px, 4vw, 40px); align-items: center; }
@media (max-width: 760px) {
  .stage { grid-template-columns: 1fr; gap: 10px; }
  .clock-box { width: min(300px, 64vw, 38vh); margin-inline: auto; }
  .game .legend { font-size: .78rem; gap: 10px; }
  .prompt { margin-bottom: 8px; }
  .choice { min-height: 70px; padding: 8px; }
  .choice-digital { font-size: 1.6rem; }
  .game-bar { margin-bottom: 10px; }
  .levels { margin-bottom: 10px; }
  .level-btn { padding: 6px 2px; }
}
.legend { display: flex; justify-content: center; gap: 14px; font-size: .9rem; font-weight: 700; margin-top: 6px; white-space: nowrap; }
.legend span::before { content: ""; display: inline-block; width: 22px; height: 7px; border-radius: 4px; margin-right: 6px; vertical-align: middle; }
.legend .lg-hour::before { background: var(--hour); width: 15px; }
.legend .lg-min::before { background: var(--minute); }

.prompt { font-size: clamp(1.4rem, 3.5vw, 1.9rem); font-weight: 900; margin: 0 0 12px; }
.target { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; background: #eef4ff; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; }
.target-digital { font-size: 2.4rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.target-words { font-size: 1.15rem; font-weight: 700; color: var(--muted); flex: 1; }
.say { border: 0; background: #fff; border-radius: 999px; width: 42px; height: 42px; font-size: 1.15rem; cursor: pointer; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { border: 3px solid var(--line); background: #fffdf8; border-radius: var(--radius); padding: 12px 10px; cursor: pointer; font: inherit; color: var(--ink); display: flex; flex-direction: column; align-items: center; transition: transform .08s, border-color .15s; min-height: 84px; justify-content: center; }
.choice:hover:not(:disabled) { border-color: var(--brand); transform: translateY(-2px); }
.choice-digital { font-size: 1.9rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.choice-words { font-size: .86rem; color: var(--muted); font-weight: 700; text-align: center; }
.choice.is-right { border-color: var(--right); background: var(--right-bg); animation: pop .35s; }
.choice.is-wrong { border-color: var(--wrong); background: var(--wrong-bg); opacity: .75; animation: shake .35s; }
.choice:disabled { cursor: default; }

.set-controls { display: grid; gap: 12px; }
.nudges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.nudge-group { background: #fbf7ef; border-radius: var(--radius); padding: 8px 10px; text-align: center; }
.nudge-group .nudge-label { display: block; font-size: .85rem; font-weight: 800; margin-bottom: 4px; }
.nudge-group.is-hour .nudge-label { color: var(--hour); }
.nudge-group.is-min .nudge-label { color: var(--minute); }
.nudge-group button { width: 48px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font: 900 1.3rem var(--font); cursor: pointer; color: var(--ink); }
.readout { text-align: center; color: var(--muted); font-weight: 700; }
.readout strong { color: var(--ink); font-size: 1.3rem; font-variant-numeric: tabular-nums; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 14px 26px; font: 900 1.1rem var(--font); cursor: pointer; background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 0 #1f50a8; text-decoration: none; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #1f50a8; }
.btn:disabled { opacity: .5; cursor: default; }
.btn--go { background: #22a86f; box-shadow: 0 4px 0 #137a4e; }
.btn--go:active { box-shadow: 0 2px 0 #137a4e; }
.btn--ghost { background: #f3efe6; color: var(--ink); box-shadow: 0 4px 0 #ddd5c4; }
.btn--block { width: 100%; }

.feedback { min-height: 1.6em; margin: 14px 0 10px; font-weight: 700; border-radius: 14px; }
.feedback.is-right, .feedback.is-wrong { padding: 10px 14px; }
.feedback.is-right { background: var(--right-bg); color: #10603f; }
.feedback.is-wrong { background: var(--wrong-bg); color: #8f2525; }
.tip { font-size: .92rem; color: var(--muted); margin: 12px 0 0; }
.tip::before { content: "💡 "; }

.progress { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #ece4d3; }
.dot.is-current { box-shadow: 0 0 0 3px var(--sun); }
.dot.is-right { background: var(--right); }
.dot.is-wrong { background: var(--wrong); }

.level-end { position: absolute; inset: 0; background: rgba(255, 248, 236, .94); border-radius: 26px; display: grid; place-items: center; text-align: center; padding: 20px; z-index: 2; }
.level-end[hidden] { display: none; }
.end-card { max-width: 420px; }
.end-stars { font-size: 3.6rem; color: #f2b400; letter-spacing: 6px; line-height: 1; animation: pop .5s; }
.end-card h3 { font-size: 1.7rem; margin: .4em 0 .2em; }
.end-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

.explore-readout { text-align: center; background: #eef4ff; border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.explore-readout .big { display: block; font-size: 3rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.explore-readout .words { font-size: 1.2rem; font-weight: 700; color: var(--muted); }
.toggles { display: grid; gap: 8px; margin: 12px 0; }
.toggles label { display: flex; gap: 10px; align-items: center; font-weight: 700; cursor: pointer; }
.toggles input { width: 22px; height: 22px; accent-color: var(--brand); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.noscript { background: var(--wrong-bg); padding: 12px 16px; border-radius: 12px; }

@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .choice, .end-stars { animation: none !important; transition: none; } }

/* ---------- article content ---------- */
.content { background: var(--paper); border-radius: 28px; padding: clamp(18px, 4vw, 44px); box-shadow: var(--shadow); margin-top: 40px; }
.content > h2:first-child { margin-top: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 52px; margin-bottom: 1.1em; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--sun); font-weight: 900; display: grid; place-items: center; }
.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 18px 0 24px; }
.examples figure { margin: 0; background: #fffaf0; border-radius: var(--radius); padding: 12px; text-align: center; border: 2px solid var(--line); }
.examples figcaption { font-weight: 800; margin-top: 6px; line-height: 1.3; }
.examples figcaption small { display: block; font-weight: 700; color: var(--muted); font-size: .85rem; }
.example-clock { width: 140px; margin: 0 auto; }
.callout { background: #eef4ff; border-left: 6px solid var(--brand); border-radius: 12px; padding: 14px 18px; margin: 18px 0; }
.callout--warm { background: #fff4d0; border-color: var(--sun); }
.hour-word { color: var(--hour); font-weight: 800; }
.min-word { color: var(--minute); font-weight: 800; }
table.times { border-collapse: collapse; width: 100%; margin: 12px 0 20px; font-size: .98rem; }
table.times th, table.times td { border-bottom: 2px solid var(--line); padding: 8px 10px; text-align: left; }
table.times th { background: #fffaf0; }
.faq details { border: 2px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 10px; background: #fffdf8; }
.faq summary { font-weight: 800; cursor: pointer; }
.faq details[open] summary { margin-bottom: 6px; }
.cta { text-align: center; margin: 28px 0 0; }
.breadcrumbs { font-size: .9rem; color: var(--muted); margin: 6px 0 0; }
.breadcrumbs a { color: var(--muted); }

@media (max-width: 480px) {
  .brand { font-size: .98rem; white-space: nowrap; gap: 8px; }
  .brand svg { width: 28px; height: 28px; }
  .site-nav { flex-wrap: nowrap; gap: 0; }
  .site-nav a { padding: 6px 8px; }
}
