/* Duo web chess clock. Loaded after ../styles.css; every selector here is namespaced
   so it never collides with the marketing page (.clock, .side, .time, .state). */

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body { overflow-x: hidden; }

.tool { --topbar: 66px; --head: 48px; }
.tool-head { height: var(--head); padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1400px; margin: 0 auto; }
.tool-head h1 { font-size: 1.05rem; letter-spacing: -0.01em; }
.tool-head p { margin: 0; font-size: .82rem; font-weight: 600; color: var(--muted); font-family: 'Space Grotesk', sans-serif; letter-spacing: .04em; text-transform: uppercase; }

.stage { height: calc(100vh - var(--topbar) - var(--head)); height: calc(100dvh - var(--topbar) - var(--head)); min-height: 440px; padding: 0 16px 16px; max-width: 1400px; margin: 0 auto; }

/* ---------- the clock ---------- */
.cc {
  --ink: #0f0f0e; --bone: #f7f6f3; --red: #d92b17; --line: #d8d7d3;
  position: relative; height: 100%; border-radius: 22px; overflow: hidden; border: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; grid-template-areas: "b" "w";
  box-shadow: var(--shadow); font-family: 'Space Grotesk', system-ui, sans-serif; background: var(--bone);
}
.cc:fullscreen { border-radius: 0; border: 0; width: 100%; height: 100%; }
.cc:-webkit-full-screen { border-radius: 0; border: 0; width: 100%; height: 100%; }
@media (orientation: landscape) {
  .cc { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; grid-template-areas: "w b"; }
}

.half {
  position: relative; container-type: size; overflow: hidden; cursor: pointer; outline: none;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; transition: transform .15s ease-out;
}
.half--w { grid-area: w; background: #f7f6f3; --dg: #0f0f0e; --mut: #8a8983; color: var(--dg); }
.half--b { grid-area: b; background: #0d0d0c; --dg: #e8e7e3; --mut: #6f6e6b; color: var(--dg); }
.half.pressed { transform: scale(.99); }
.half:focus-visible { outline: 3px solid var(--red); outline-offset: -6px; }
.half.low.half--w { background: radial-gradient(circle at 50% 50%, rgba(217,43,23,.14), transparent 75%), #faede9; }
.half.low.half--b { background: radial-gradient(circle at 50% 50%, rgba(217,43,23,.22), transparent 75%), #0d0d0c; }

/* accent edge on the seam side of the running half */
.half::before { content: ""; position: absolute; background: var(--red); opacity: 0; z-index: 2; }
.half.active::before { opacity: 1; }
.half--w::before { top: 0; left: 0; right: 0; height: 3px; }
.half--b::before { bottom: 0; left: 0; right: 0; height: 3px; }
.half--w.low::before, .half--b.low::before { height: 5px; }
@media (orientation: landscape) {
  .half--w::before { top: 0; bottom: 0; left: auto; right: 0; width: 3px; height: auto; }
  .half--b::before { top: 0; bottom: 0; left: 0; right: auto; width: 3px; height: auto; }
  .half--w.low::before, .half--b.low::before { width: 5px; height: auto; }
}

.half-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; }
@media (orientation: portrait) {
  .cc.table .half--b .half-in { transform: rotate(180deg); }
}

.nm { font-size: 11px; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--mut); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 4px; }
.cc[data-phase="idle"] .nm { cursor: text; border-bottom: 1px dashed currentColor; padding-bottom: 3px; margin-bottom: 3px; }
.cc:not([data-phase="idle"]) .nm { pointer-events: none; }

.dg {
  --fs: clamp(40px, min(calc((100cqw - 32px) / 3.7), 34cqh), 96px);
  font-size: var(--fs); line-height: 1; font-weight: 400; letter-spacing: -0.02em; width: 3.3em; text-align: center; white-space: nowrap;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; color: var(--dg); pointer-events: none;
}
.half.active .dg { font-size: calc(var(--fs) * 1.125); font-weight: 500; }
.half.long .dg { width: auto; font-size: calc(var(--fs) * .8); }
.half.active.long .dg { font-size: calc(var(--fs) * .9); }
.half.low .dg, .half.flagged .dg { color: var(--red); }

.st { min-height: 28px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; pointer-events: none; }
.state { font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--mut); opacity: .85; }
.half.active .state { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--red); opacity: 1; }
.badge { font-size: 12px; font-weight: 400; color: var(--mut); border: 1px solid currentColor; border-radius: 999px; padding: 2px 10px; }
.badge.wait { font-weight: 700; color: var(--red); border-color: transparent; background: rgba(217,43,23,.18); }
.cn { position: absolute; top: 14px; right: 20px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); opacity: .85; pointer-events: none; }
.half--w .cn { top: 44px; }
@media (orientation: portrait) { .cc.table .half--b .cn { top: 44px; } }
@media (orientation: landscape) { .half--w .cn { top: 14px; } }

.seam { position: absolute; z-index: 1; pointer-events: none; background: rgba(120,120,115,.35); left: 0; right: 0; top: 50%; height: 1px; }
@media (orientation: landscape) { .seam { left: 50%; right: auto; top: 0; bottom: 0; width: 1px; height: auto; } }

/* ---------- centre bar ---------- */
.centre { position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(360px, calc(100% - 24px)); display: flex; justify-content: center; }
.rail { display: flex; align-items: center; gap: 10px; width: 100%; }
.zen { display: flex; gap: 14px; }
@media (orientation: landscape) { .zen { flex-direction: row; } }
.disc { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: #f7f6f3; display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 7px rgba(0,0,0,.28); padding: 0; color: #0f0f0e; touch-action: manipulation; }
.disc svg, .mini svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.disc svg.fill { fill: currentColor; stroke: none; }
.disc--big { width: 56px; height: 56px; border: 2px solid var(--red); color: var(--red); }
.pill { flex: 1 1 auto; min-width: 0; height: 54px; border-radius: 999px; border: 2px solid var(--red); background: #f7f6f3; color: #0f0f0e; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; box-shadow: 0 2px 8px rgba(0,0,0,.25); padding: 0 12px; font-family: inherit; touch-action: manipulation; }
.pill b { font-size: 18px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill i { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.disc:focus-visible, .pill:focus-visible, .mini:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.util { position: absolute; z-index: 6; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 8px; }
.cc[data-phase="running"] .util { display: none; }
.mini { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(120,120,115,.45); background: rgba(247,246,243,.9); color: #0f0f0e; display: grid; place-items: center; cursor: pointer; padding: 0; }
.mini .mute { display: none; }
.mini[aria-pressed="false"] .wave { display: none; }
.mini[aria-pressed="false"] .mute { display: inline; }

/* ---------- overlays ---------- */
.overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(0,0,0,.45); padding: 16px; }
.overlay--over { padding: 0; background: #f7f6f3; }
.panel { width: min(330px, 100%); max-height: 100%; overflow: auto; background: #0d0d0c; color: #f7f6f3; border-radius: 20px; padding: 22px 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.kicker { color: #f7f6f3; font-size: 13px; font-weight: 700; letter-spacing: .4em; text-transform: uppercase; text-align: center; margin: 0 0 6px; }
.adj { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 8px; }
.adj-n { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #8d8c87; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adj-t { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 4.4em; text-align: center; }
.adj button { height: 38px; min-width: 52px; border-radius: 10px; border: 1px solid #3a3a37; background: transparent; color: #f7f6f3; font: 600 13px inherit; font-family: inherit; cursor: pointer; }
.act { height: 52px; border-radius: 13px; border: 0; background: #f7f6f3; color: #0f0f0e; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16px; cursor: pointer; padding: 0 16px; display: flex; align-items: center; justify-content: center; gap: 10px; touch-action: manipulation; }
.act--red { background: var(--red, #d92b17); color: #fff; }
.act--ink { background: #0f0f0e; color: #f7f6f3; height: 56px; border-radius: 14px; }
.act--line { background: transparent; color: #0f0f0e; border: 1.5px solid #0f0f0e; }
.act--paper { background: #fbfaf8; border: 1px solid #d8d7d3; }
.act--inkchip { background: #0d0d0c; color: #f7f6f3; }
.act:focus-visible, .adj button:focus-visible, .x:focus-visible { outline: 3px solid #d92b17; outline-offset: 2px; }
.dotw, .dotb { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.dotw { border: 2px solid #0f0f0e; background: #f7f6f3; }
.dotb { background: #f7f6f3; }
.hint { margin: 4px 0 0; text-align: center; font-size: 13px; color: #8d8c87; line-height: 1.45; }
.sheet .hint { color: #6d6a61; text-align: left; }
.panel .hint { font-size: 12px; }

.over { width: 100%; height: 100%; display: grid; grid-template-rows: minmax(150px, 34%) 1fr; }
.over-ink { background: #0d0d0c; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #6f6e6b; padding: 16px; }
.over-flag { width: 30px; height: 30px; fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.over-big { font-size: clamp(40px, 12vmin, 64px); font-weight: 500; letter-spacing: -.02em; line-height: 1; color: #6f6e6b; font-variant-numeric: tabular-nums; }
.over-sub { font-size: 11px; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.over-res { border-top: 3px solid var(--red); padding: 22px 24px; display: flex; flex-direction: column; justify-content: center; gap: 12px; overflow: auto; color: #0f0f0e; }
.over-res h2 { font-size: clamp(1.8rem, 6vmin, 2.75rem); letter-spacing: -.02em; line-height: 1.05; }
.over-res h2 em { font-style: normal; color: var(--red); }
.over-line { margin: 0; font-size: .95rem; color: #6d6a61; line-height: 1.4; }
.over-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.over-app { font-size: .9rem; font-weight: 600; color: #b02212; }
@media (orientation: landscape) {
  .over { grid-template-rows: none; grid-template-columns: 38% 1fr; }
  .over-res { border-top: 0; border-left: 3px solid var(--red); }
}
.over-res .act { max-width: 420px; }

/* ---------- sheets (native dialog) ---------- */
dialog.sheet { border: 0; padding: 0; border-radius: 20px; background: #f7f6f3; color: #0f0f0e; width: min(520px, calc(100% - 24px)); max-height: min(760px, 92vh); max-height: min(760px, 92dvh); box-shadow: 0 8px 24px rgba(0,0,0,.3); font-family: 'Space Grotesk', system-ui, sans-serif; overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet--sm { width: min(380px, calc(100% - 24px)); }
dialog.sheet::backdrop { background: rgba(0,0,0,.45); }
.sheet-in { padding: 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; max-height: inherit; flex: 1 1 auto; min-height: 0; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; }
.sheet-h h2 { font-size: 1.6rem; letter-spacing: -.02em; }
.x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #ecebe6; font-size: 24px; line-height: 1; cursor: pointer; color: #0f0f0e; }
.lab { font-size: 11px; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: #8a8983; margin: 8px 0 0; }
.sheet-f { position: sticky; bottom: -20px; background: #f7f6f3; padding: 12px 0 0; margin-top: auto; display: grid; }
.sheet-f--row { grid-template-columns: auto 1fr 1.4fr; gap: 10px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #d8d7d3; background: #fbfaf8; font-family: inherit; font-weight: 600; font-size: 15px; cursor: pointer; color: #0f0f0e; flex: 1 1 auto; }
.tab[aria-selected="true"] { background: #0f0f0e; color: #f7f6f3; border-color: #0f0f0e; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { text-align: left; background: #fbfaf8; border: 1px solid #d8d7d3; border-radius: 14px; padding: 14px; cursor: pointer; font-family: inherit; color: #0f0f0e; min-width: 0; }
.card b { display: block; font-size: 26px; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.card b.sm { font-size: 17px; }
.card span { display: block; margin-top: 4px; font-size: 12px; color: #6d6a61; }
.card[aria-selected="true"] { border: 2px solid var(--red); padding: 13px; }
.card:focus-visible, .tab:focus-visible, .dashed:focus-visible, .lock-row:focus-visible { outline: 3px solid #d92b17; outline-offset: 2px; }
.locked { display: grid; gap: 8px; }
.lock-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px dashed #c4c2bc; color: #6d6a61; text-decoration: none; font-size: 14px; background: #f1f0ec; }
.lock-row b { color: #0f0f0e; display: block; }
.lock-row em { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #b02212; text-align: right; flex: 0 0 auto; }
.saved { display: grid; gap: 8px; }
.saved-row { display: flex; align-items: stretch; gap: 8px; }
.saved-row .card { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; }
.saved-row .card b { font-size: 18px; }
.saved-row .card span { margin: 0; }
.saved-row .mini2 { width: 44px; border-radius: 12px; border: 1px solid #d8d7d3; background: #fbfaf8; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 600; color: #0f0f0e; }
.dashed { display: block; text-align: center; padding: 14px; border: 1.5px dashed #b9b7b0; border-radius: 14px; background: transparent; font-family: inherit; font-weight: 600; font-size: 15px; color: #0f0f0e; cursor: pointer; text-decoration: none; }
.dashed--link { color: #b02212; font-size: 14px; }

.fld { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: #6d6a61; min-width: 0; }
.fld input, .fld select { height: 48px; border-radius: 12px; border: 1px solid #d8d7d3; background: #fbfaf8; padding: 0 12px; font: 500 17px 'Space Grotesk', sans-serif; letter-spacing: 0; text-transform: none; color: #0f0f0e; width: 100%; min-width: 0; }
.fld input:focus-visible, .fld select:focus-visible, .chk input:focus-visible, .sw input:focus-visible { outline: 3px solid #d92b17; outline-offset: 2px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chk, .sw { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; font-weight: 600; cursor: pointer; line-height: 1.3; }
.chk input, .sw input { width: 22px; height: 22px; accent-color: #d92b17; flex: 0 0 auto; margin: 1px 0 0; }
.chk small, .sw small { display: block; font-weight: 400; font-size: 13px; color: #6d6a61; margin-top: 2px; }
.err { margin: 0; color: #b02212; font-size: 14px; font-weight: 600; }

.sumbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sumbar div { background: #fbfaf8; border: 1px solid #d8d7d3; border-radius: 12px; padding: 10px 12px; }
.sumbar b { display: block; font-size: 24px; letter-spacing: -.02em; }
.sumbar span { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #6d6a61; }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist li { background: #fbfaf8; border: 1px solid #d8d7d3; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.4; }
.hist li strong { font-size: 15px; display: block; }
.hist li small { color: #6d6a61; font-size: 12px; }

/* ---------- below the clock ---------- */
.cta-slot { padding: 4px 0 24px; }
.cta-card { background: var(--card, #fbfaf8); border: 1px solid var(--line, #d8d7d3); border-left: 4px solid #d92b17; border-radius: 20px; padding: 26px 28px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta-card > div { flex: 1 1 340px; }
.cta-card h2 { font-size: 1.5rem; margin: 8px 0; }
.cta-card p { margin: 0; color: var(--muted, #6d6a61); font-size: 1rem; }
.cta-card p.eyebrow { color: var(--accent-ink, #b02212); }
.cta-card .btn { flex: 0 0 auto; }
.cc-sec { padding: 56px 0; }
.cc-final { padding-top: 24px; }
.cc-final .more { text-align: center; margin: 24px 0 0; font-size: 1rem; }
.read { max-width: 820px; }
.read h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: 10px 0 14px; }
.read h2:not(:first-of-type) { margin-top: 48px; }
.read p { margin: 0 0 16px; }
.steps { margin: 0 0 8px; padding-left: 22px; }
.steps li { margin: 0 0 10px; }
kbd { font-family: 'Space Grotesk', monospace; font-size: .85em; font-weight: 600; background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; color: var(--ink); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0 0 20px; }
.trio article { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.trio h3 { font-size: 1.15rem; margin-bottom: 8px; }
.trio p { font-size: 1rem; margin: 0 0 10px; }
.trio .ex { color: var(--muted); font-size: .96rem; margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.tc { width: 100%; border-collapse: collapse; font-size: 1rem; min-width: 480px; }
.tc th, .tc td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.tc thead th { font-family: 'Space Grotesk', sans-serif; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tc tbody th { font-family: 'Space Grotesk', sans-serif; color: var(--ink); }
.tc tr:last-child th, .tc tr:last-child td { border-bottom: 0; }

@media (max-width: 900px) { .trio { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .tool { --topbar: 66px; }
  .tool-head p { display: none; }
  .cc-sec { padding: 44px 0; }
  .cta-card { padding: 22px 20px; }
  .cards { grid-template-columns: 1fr; }
  .sheet-f--row { grid-template-columns: 1fr 1fr; }
  .sheet-f--row .act--ink { grid-column: 1 / -1; }
  .topnav a:not(.hide-sm) { font-size: .92rem; }
}
@media (max-width: 400px) { .topnav { gap: 10px; } .brand { font-size: 1.1rem; } .brand img { width: 30px; height: 30px; } }

@media (prefers-reduced-motion: reduce) { .half { transition: none; } }
