:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e8f0eb;
  background: #edf1f5;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-height: 100dvh; margin: 0; padding: 16px; display: grid; place-items: center; overflow-x: clip; background: #edf1f5; }
.layout { width: 420px; max-width: 100%; height: min(900px, calc(100dvh - 32px)); min-height: 0; position: relative; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; border-radius: 20px; background: #121a1d; color: #e8f0eb; box-shadow: 0 0 0 1px #dce2ea, 0 18px 50px #1d293917; margin: 0; padding: 22px 20px 36px; }
.layout::-webkit-scrollbar { display: none; }
.layout > * { min-width: 0; }
.site-header { margin-bottom: 22px; }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: #e8f0eb; text-decoration: none; font-size: .78rem; font-weight: 850; letter-spacing: .12em; }
.brand:hover { color: #9aecb6; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #466358; border-radius: 8px; background: #203129; color: #adff96; font: 800 1.2rem/1 ui-monospace, Consolas, monospace; letter-spacing: 0; }
.header-tagline { min-width: 0; margin: 0; color: #a8bbb5; font-size: .72rem; font-weight: 750; letter-spacing: .04em; text-align: right; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.08; letter-spacing: -.07em; overflow-wrap: anywhere; margin: 0; font-weight: 850; }
.intro { color: #aebfba; line-height: 1.45; margin: 10px 0 0; font-size: .74rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
h2 { margin: 0; font-size: 1.03rem; letter-spacing: -.025em; }
.live-label { color: #9aecb6; font-size: .72rem; font-weight: 850; letter-spacing: .13em; display: flex; align-items: center; gap: 7px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #42b89f; }
.board { position: relative; display: flex; align-items: center; min-width: 0; min-height: 210px; overflow: hidden; border: 6px solid #586261; border-radius: 9px; background: #080d0a; box-shadow: inset 0 0 0 3px #202a25, inset 0 0 28px #000, 0 11px 25px rgba(21, 34, 40, .18); }
.board::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background-image: radial-gradient(circle, rgba(0, 0, 0, .7) 1px, transparent 1.5px); background-size: 5px 5px; opacity: .46; }
.board p { display: flex; flex: none; width: max-content; max-width: none; margin: 0; color: #85ff5d; font: 700 clamp(2rem, 8vw, 2.85rem)/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .025em; white-space: nowrap; text-shadow: 0 0 5px #55f43d, 0 0 18px rgba(88, 253, 60, .55); }
.ticker-group { display: inline-block; flex: none; }
.board p.is-scrolling { animation: ticker var(--ticker-duration, 18s) linear infinite; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.board-end { text-align: center; color: #aebfba; font-size: .75rem; margin: 8px 0 0; }
.attempt-section { margin-top: 24px; }
.countdown-block { text-align: center; padding: 14px 0 18px; border-top: 1px solid #354348; }
.countdown-block h2 { color: #aebfba; font-size: .9rem; font-weight: 650; }
.countdown { font-family: inherit; font-size: clamp(2rem, 5vw, 2.7rem); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.04em; white-space: nowrap; margin: 6px 0; }
.round-status { min-height: 1.4em; color: #aebfba; font-size: .75rem; margin: 0; }
form label { display: block; font-weight: 750; margin-bottom: 7px; font-size: .9rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
input { display: block; width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid #728780; border-radius: 9px; background: #f5f8f6; color: #17232c; font: inherit; font-size: 1rem; }
input[aria-invalid="true"] { border-color: #ffac81; }
.input-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; color: #aebfba; font-size: .7rem; margin: 8px 0 12px; }
.input-meta p { margin: 0; }
#remaining { flex: none; }
button { width: 100%; min-height: 50px; border: 0; border-radius: 9px; background: #45b978; color: #0d2017; font: inherit; font-size: 1.02rem; font-weight: 760; cursor: pointer; }
button[hidden] { display: none; }
button:hover:not(:disabled) { background: #6bd493; }
button:disabled { background: #52625c; color: #d8e0dc; cursor: not-allowed; }
:focus-visible { outline: 3px solid #ba6a22; outline-offset: 3px; }
.result { min-height: 0; margin-top: 20px; }
.result:not(:empty) { border: 1px solid #4a765f; background: #20362b; border-radius: 10px; padding: 14px 16px; }
.result[data-state="error"] { border-color: #92684e; background: #3a2a23; }
.result h2 { font-size: 1rem; margin-bottom: 6px; }
.result p { margin: 0; font-size: .88rem; line-height: 1.45; }
.rules { margin-top: 26px; padding-top: 16px; border-top: 1px solid #354348; color: #aebfba; font-size: .7rem; line-height: 1.5; }
.rules p { margin: 0 0 7px; }
.rules strong { color: #e8f0eb; }
.site-footer { margin-top: 32px; padding-top: 18px; border-top: 1px solid #354348; }
.site-footer p { margin: 0; color: #a0b3ad; font-size: .75rem; text-align: center; }
.not-found-layout { min-height: 0; }
.not-found { padding: 36px 0 48px; }
.not-found h1 { font-size: clamp(2rem, 8vw, 3.5rem); white-space: normal; overflow-wrap: anywhere; }
.not-found > p:not(.error-code) { color: #aebfba; line-height: 1.6; }
.error-code { color: #9aecb6; font: 800 1rem/1 ui-monospace, Consolas, monospace; letter-spacing: .12em; }
.back-link { display: inline-flex; align-items: center; min-height: 48px; margin-top: 16px; padding: 0 20px; border-radius: 9px; background: #45b978; color: #0d2017; font-weight: 750; text-decoration: none; }
.back-link:hover { background: #6bd493; }
@media (max-width: 599px) {
  body { display: block; padding: 0; background: #121a1d; }
  .layout { width: 100%; height: 100dvh; border-radius: 0; box-shadow: none; padding: 16px 14px 40px; }
  .layout, .layout * { user-select: auto !important; -webkit-user-select: auto !important; }
  h1 { font-size: clamp(1.45rem, 5.7vw, 2rem); }
  .section-heading { margin-bottom: 8px; }
  .board { min-height: 200px; }
  .countdown { font-size: clamp(2rem, 9vw, 2.7rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .board { overflow-x: auto; }
  .board p.is-scrolling { animation: none !important; transform: none !important; }
}
