/* Chrono live: brand tokens (chrono:brand) and phone-first layout. One ground: black. */
:root {
  --black: #000000;
  --white: #ffffff;
  --blue: #195faa;
  --yellow: #f0c11a;
  --red: #de2e34;
  --line: rgba(255, 255, 255, 0.22);
  --muted: rgba(255, 255, 255, 0.72);
  --font:
    "Gotham", "Proxima Nova", "Montserrat", system-ui, -apple-system,
    "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: 20px;
  --tap: 52px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--black);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button,
a {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px)
    calc(env(safe-area-inset-right) + var(--gutter))
    calc(env(safe-area-inset-bottom) + 16px)
    calc(env(safe-area-inset-left) + var(--gutter));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}

.logo {
  display: block;
  height: 26px;
  width: auto;
}

.progress-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.progress {
  height: 4px;
  margin-top: 12px;
  background: var(--line);
}

.progress > span {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: var(--yellow);
  transition: width 220ms cubic-bezier(0.2, 0, 0, 1);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 28px;
}

h1,
h2 {
  margin: 0 0 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 22px;
}

h1:focus,
h2:focus {
  outline: none;
}

p {
  margin: 0 0 14px;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--yellow);
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: var(--tap);
  padding: 14px 16px;
  text-align: left;
  font-size: 17px;
  line-height: 1.3;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    transform 120ms ease;
}

.option .key {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.option:active {
  transform: scale(0.98);
}

.option[aria-pressed="true"] {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--black);
}

.option[aria-pressed="true"] .key {
  border-color: var(--black);
}

@media (hover: hover) {
  .option:hover {
    border-color: var(--white);
  }
  .btn:hover {
    filter: brightness(1.08);
  }
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn-primary {
  background: var(--yellow);
  color: var(--black);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line);
}

.btn-link {
  min-height: 44px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.btn:focus-visible,
.option:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.stage-hero {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 8px 0 16px;
}

.stage-num {
  font-size: 96px;
  font-weight: 800;
  line-height: 0.9;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}

.stage-name {
  font-size: 32px;
  font-weight: 700;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 8px 0 6px;
}

.stage-grid .option {
  justify-content: center;
  padding: 0;
  min-height: var(--tap);
  font-size: 20px;
  font-weight: 700;
}

.callout {
  margin-top: 16px;
  padding: 16px;
  border-left: 4px solid var(--blue);
  background: rgba(25, 95, 170, 0.18);
}

.callout strong {
  display: block;
  margin-bottom: 4px;
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 4px solid var(--red);
  background: rgba(222, 46, 52, 0.16);
}

.notice[hidden] {
  display: none;
}

.center {
  margin: auto 0;
  text-align: left;
}

.symbol {
  width: 44px;
  height: auto;
  margin-bottom: 20px;
}

.foot {
  padding-top: 18px;
  font-size: 12px;
  color: var(--muted);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.enter {
  animation: enter 200ms cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ------------------------------------------------------------------ host (laptop first) */
.host .shell {
  max-width: 980px;
}

.host-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 820px) {
  .host-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 14px;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line);
}

.pill.on {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--black);
}

.pill.warn {
  background: var(--red);
  border-color: var(--red);
}

.big-total {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.histogram {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  height: 200px;
  margin: 18px 0 6px;
}

.bar {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.bar .fill {
  width: 100%;
  height: var(--h, 0%);
  min-height: 2px;
  background: var(--blue);
  transition: height 300ms cubic-bezier(0.2, 0, 0, 1);
}

.bar .n {
  font-weight: 700;
}

.bar-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
}

.host-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.host-actions .btn {
  font-size: 15px;
}

.log {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.log li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.url {
  word-break: break-all;
  font-weight: 700;
  color: var(--yellow);
}

table.rounds {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

table.rounds td,
table.rounds th {
  padding: 6px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
