/* Cap Guesser's own screens, drawn as live HTML inside the page's visuals (page CSS: inside a visual only).
   The same tokens as play.css, so the landing page and the game read as one product. */
:root {
  --cg-close: var(--x-close, #4f6238);  /* close guesses */
  --cg-near: var(--x-near, #8a6a1f);
  --cg-far: var(--x-far, #9a4635);
  --cg-on-close: var(--x-on-close, #ffffff);
  --cg-paper: var(--x-paper, color-mix(in oklab, var(--p-bg) 45%, #ffffff));
  --cg-ink: var(--p-ink);
  --cg-muted: var(--p-muted);
  --cg-rule: color-mix(in oklab, var(--p-ink) 16%, transparent);
}
.is-close { --t: var(--cg-close); }
.is-near { --t: var(--cg-near); }
.is-far { --t: var(--cg-far); }

/* shared bits of the round screen */
.cg-strong { color: var(--cg-ink); font-weight: 500; }
.cg-word { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; color: var(--cg-ink); }
.cg-round-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--cg-muted); }
.cg-company { margin-top: 14px; font-family: var(--font-display); font-weight: 500; font-size: 34px; line-height: 1; letter-spacing: -0.035em; color: var(--cg-ink); }
.cg-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--cg-muted); }
.cg-ticker { padding: 1px 6px; border: 1px solid var(--cg-rule); border-radius: 4px; font-family: var(--font-mono); font-size: 11px; color: var(--cg-ink); }
.cg-facts { margin-top: 12px; font-size: 13px; line-height: 1.45; color: var(--cg-muted); }
.cg-clue { margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--cg-ink); }
.cg-label { margin-top: 18px; text-align: center; font-size: 11px; color: var(--cg-muted); }
.cg-guess { text-align: center; font-family: var(--font-display); font-weight: 500; font-size: 40px; line-height: 1.1; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; color: var(--cg-ink); }
.cg-guess.is-empty { color: var(--cg-rule); }

/* the log ruler with its handle; --x is the guess, --a the answer (0 to 100%) */
.cg-scale { position: relative; margin: 14px 8px 0; padding-top: 22px; }
.cg-ruler { display: block; width: 100%; height: 32px; overflow: visible; stroke: var(--cg-ink); stroke-width: 1; }
#cg-ruler line { vector-effect: non-scaling-stroke; }
#cg-ruler .mi { opacity: 0.45; }
.cg-thumb { position: absolute; top: 22px; left: var(--x); width: 16px; height: 32px; margin-left: -8px; border-radius: 5px; background: var(--cg-ink); box-shadow: 0 0 0 2px var(--cg-paper), 0 0 0 3px var(--cg-ink); }
.cg-needle { position: absolute; top: 22px; left: var(--x); width: 2px; height: 32px; margin-left: -1px; background: var(--cg-ink); }
.cg-pin { position: absolute; top: 0; left: var(--a); height: 54px; border-left: 2px solid var(--cg-close); }
.cg-pin b { position: absolute; top: 0; left: 0; transform: translateX(-50%); padding: 1px 7px; border-radius: 4px; background: var(--cg-close); color: var(--cg-on-close); font-size: 11px; font-weight: 500; white-space: nowrap; }
.cg-band { position: absolute; top: 35px; left: var(--x); width: calc(var(--a) - var(--x)); height: 6px; border-radius: 3px; background: var(--cg-close); opacity: 0.35; }
.cg-ticks { position: relative; height: 16px; margin-top: 4px; font-family: var(--font-mono); font-size: 10px; color: var(--cg-muted); }
.cg-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.cg-ticks span:first-child { transform: none; }
.cg-ticks span:last-child { transform: translateX(-100%); }

/* the hero phone: the game's own screen, cut by the frame's foot */
.hero__media[data-cg-play] { isolation: isolate; }
.cg-phone { position: absolute; z-index: 1; top: 48px; right: 48px; width: 300px; height: calc(100% + 24px); padding: 10px; border-radius: 44px; background: var(--x-bezel, #23231f); }
.cg-phone__screen { height: 100%; padding: 16px 18px; border-radius: 34px; background: var(--cg-paper); overflow: hidden; }
.cg-bar { display: flex; justify-content: space-between; align-items: center; height: 28px; margin-bottom: 12px; font-size: 15px; }
.cg-bar__icons { display: flex; gap: 8px; }
.cg-bar__icons i { width: 18px; height: 18px; border: 1.5px solid var(--cg-ink); border-radius: 50%; }
.cg-progress { display: grid; grid-template-columns: 1fr 2fr 2fr 2fr 3fr; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.cg-progress li { height: 5px; border-radius: 3px; background: var(--cg-rule); }
.cg-progress li.is-close { background: var(--cg-close); }
.cg-progress li.is-now { background: var(--cg-ink); }
.cg-lock { display: grid; place-items: center; height: 46px; margin-top: 18px; border-radius: 10px; background: var(--cg-ink); color: var(--cg-paper); font-size: 14px; font-weight: 500; }
.hero__media .ly-float { width: 236px; }
@media (max-width: 1279px) { .hero__media .ly-float { display: none; } .cg-phone { right: 50%; transform: translateX(50%); } }
@media (max-width: 1023px) { .cg-phone { top: 24px; width: 280px; } }

/* the app frame: the finished day beside the open round */
.cg-intro { font-size: var(--t-lead); line-height: 1.5; max-width: 52ch; }
.app.ui { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-top: var(--s-7); background: var(--u-bg); border: 1px solid var(--u-border); border-radius: var(--u-r); box-shadow: var(--u-shadow); --u-bg: var(--cg-paper); }
.app > .app__pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.app > .app__pane + .app__pane { border-left: 1px solid var(--u-line); }
.app > .app__pane::after { content: ""; position: absolute; inset: auto 0 0 0; height: 64px; background: linear-gradient(transparent, var(--u-bg)); pointer-events: none; }
@media (min-width: 1024px) and (max-width: 1279px) { .app.ui { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
@media (max-width: 1023px) {
  .app.ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app > .app__pane--list { max-height: 252px; }
  .app > .app__pane--list::after { display: none; }
  .app > .app__pane + .app__pane { border-left: 0; border-top: 1px solid var(--u-line); }
}
@media (max-width: 639px) {
  .app.ui { grid-template-rows: minmax(0, 1fr); }
  .app > .app__pane--list { display: none; }
  .app > .app__pane + .app__pane { border-top: 0; }
}
.cg-list { padding: 20px 0 0; }
.cg-list__head { display: flex; justify-content: space-between; padding: 0 24px 14px; font-size: 13px; color: var(--cg-muted); border-bottom: 1px solid var(--u-line); }
.cg-list__rows { margin: 0; padding: 0; list-style: none; }
.cg-list__rows li { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 14px 24px 16px; border-bottom: 1px solid var(--u-line); }
.cg-list__rows li.is-open { background: color-mix(in oklab, var(--cg-close) 9%, var(--u-bg)); box-shadow: inset 3px 0 0 var(--cg-close); }
.cg-list__name { font-size: 14px; font-weight: 500; color: var(--cg-ink); }
.cg-list__name em { margin-left: 6px; font-style: normal; font-size: 12px; color: var(--cg-muted); font-weight: 400; }
.cg-list__sub { grid-column: 1; font-size: 12px; color: var(--cg-muted); font-variant-numeric: tabular-nums; }
.cg-chip { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--t); }
.cg-bar-line { grid-column: 1 / -1; height: 3px; margin-top: 10px; border-radius: 2px; background: var(--cg-rule); overflow: hidden; }
.cg-bar-line i { display: block; height: 100%; background: var(--t); }
.cg-list__total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 24px; font-size: 13px; color: var(--cg-muted); }
.cg-total { font-family: var(--font-display); font-size: 32px; font-weight: 500; letter-spacing: -0.035em; color: var(--cg-ink); }
.cg-total small { margin-left: 4px; font-size: 13px; letter-spacing: 0; color: var(--cg-muted); }
.cg-open { padding: 20px 40px 0; max-width: 620px; }
.cg-open .cg-company { font-size: 44px; }
.cg-open .cg-scale { margin-top: 28px; }
.cg-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 0; padding: 14px 0; border-top: 1px solid var(--u-line); border-bottom: 1px solid var(--u-line); }
.cg-result dt { font-size: 12px; color: var(--cg-muted); }
.cg-result dd { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--cg-ink); }
.cg-result dd.is-actual { color: var(--cg-close); }
.cg-result dd.cg-sub { font-family: var(--font-text); font-size: 13px; letter-spacing: 0; color: var(--cg-muted); }
.cg-result__pts { text-align: right; }
.cg-source { margin-top: 12px; font-size: 12px; color: var(--cg-muted); }
@media (max-width: 639px) { .cg-open { padding: 18px 18px 0; } .cg-open .cg-company { font-size: 34px; } .cg-result dd { font-size: 20px; } }

/* small screens on the card panels: one solid tile each, cut by the panel's foot where it runs on */
.cg-tile, .cg-card, .cg-bubble, .cg-stat, .cg-stats, .cg-next {
  position: absolute; background: var(--cg-paper); color: var(--cg-ink); border: 1px solid var(--cg-rule); border-radius: 12px;
  box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 8px 24px -8px rgb(0 0 0 / .14);
}
.cg-tile { left: 24px; right: 24px; top: 40px; padding: 18px 16px 16px; }
.cg-tile--slide .cg-guess { font-size: 36px; }
.cg-tile--table, .cg-tile--weights { bottom: -1px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.cg-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.cg-table th { text-align: left; font-weight: 400; font-size: 12px; color: var(--cg-muted); padding: 0 0 8px; }
.cg-table th + th, .cg-table td + td { text-align: right; }
.cg-table td { padding: 8px 0; border-top: 1px solid var(--cg-rule); }
.cg-table tr.is-mark td { color: var(--cg-close); font-weight: 500; }
.cg-weights { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cg-weights li { flex: var(--w) 1 0; display: grid; gap: 6px; font-size: 12px; color: var(--cg-muted); }
.cg-weights li::before { content: ""; order: 1; height: calc(var(--w) * 26px); border-radius: 4px; background: color-mix(in oklab, var(--cg-ink) 14%, transparent); align-self: end; }
.cg-weights li.is-last::before { background: var(--cg-close); }
.cg-weights b { order: 0; font-weight: 500; font-size: 14px; color: var(--cg-ink); font-variant-numeric: tabular-nums; }
.cg-weights span { order: 2; font-family: var(--font-mono); font-size: 11px; }
.cg-weights { align-items: end; min-height: 120px; }
.cg-weights__sum { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--cg-rule); font-size: 13px; color: var(--cg-muted); }
.cg-weights__sum b { font-family: var(--font-display); font-size: 28px; font-weight: 500; letter-spacing: -0.03em; color: var(--cg-ink); }

/* the share image, as the game draws it (4:5), cut by the panel's foot */
.cg-card { left: 40px; top: 40px; width: min(420px, calc(100% - 80px)); padding: 24px 26px; }
.cg-card__head { display: flex; justify-content: space-between; font-size: 15px; }
.cg-card__head > span:last-child { display: grid; text-align: right; font-weight: 500; }
.cg-card__head small { font-size: 12px; font-weight: 400; color: var(--cg-muted); }
.cg-card__total { margin-top: 12px; font-family: var(--font-display); font-size: 88px; font-weight: 500; line-height: 0.95; letter-spacing: -0.05em; }
.cg-card__total small { margin-left: 4px; font-size: 18px; letter-spacing: 0; color: var(--cg-muted); }
.cg-card__rows { margin: 18px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--cg-rule); }
.cg-card__rows li { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--cg-rule); font-size: 14px; font-weight: 500; }
.cg-card__rows em { margin-left: 6px; font-style: normal; font-weight: 400; font-size: 12px; color: var(--cg-muted); }
.cg-card__rows b { font-weight: 500; font-variant-numeric: tabular-nums; }
.cg-card__rows .t-close { color: var(--cg-close); }
.cg-card__rows .t-near { color: var(--cg-near); }
.cg-card__rows i { grid-column: 1 / -1; height: 4px; margin-top: 8px; border-radius: 2px; background: var(--cg-rule); overflow: hidden; }
.cg-card__rows s { display: block; height: 100%; background: var(--t); text-decoration: none; }
@media (min-width: 1024px) { .cg-card { left: auto; right: 40px; } }
.cg-card::before { content: ""; }

.cg-bubble { left: 24px; right: 24px; top: 40px; padding: 14px 16px; border-radius: 16px 16px 4px 16px; font-size: 14px; line-height: 1.55; font-variant-numeric: tabular-nums; }
.cg-squares { display: inline-flex; gap: 3px; vertical-align: -2px; }
.cg-squares i { width: 14px; height: 14px; border-radius: 3px; background: var(--t); }

.cg-stat { left: 24px; right: 24px; top: auto; bottom: -1px; padding: 22px 20px 32px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.cg-stat__big { font-family: var(--font-display); font-size: 56px; font-weight: 500; line-height: 1; letter-spacing: -0.04em; }
.cg-stat__big small { margin-left: 8px; font-family: var(--font-text); font-size: 14px; letter-spacing: 0; color: var(--cg-muted); }
.cg-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 18px 0 0; padding: 0; list-style: none; }
.cg-week li { aspect-ratio: 1; border-radius: 6px; background: color-mix(in oklab, var(--cg-ink) 14%, transparent); }
.cg-week li.on.today { background: var(--cg-close); }

.cg-stats { left: 24px; right: 24px; top: auto; bottom: -1px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0; padding: 0; overflow: hidden; }
.cg-stats div { display: flex; flex-direction: column-reverse; padding: 14px 16px; border-bottom: 1px solid var(--cg-rule); }
.cg-stats div:nth-child(odd) { border-right: 1px solid var(--cg-rule); }
.cg-stats dt { font-size: 12px; color: var(--cg-muted); }
.cg-stats dd { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cg-stats div:nth-child(3) dd { color: var(--cg-close); }

.cg-next { left: 24px; right: 24px; top: auto; bottom: -1px; padding: 28px 16px 40px; text-align: center; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.cg-next__label { font-size: 13px; color: var(--cg-muted); }
.cg-next__time { margin-top: 4px; font-family: var(--font-mono); font-size: 36px; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

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