:root {
  color-scheme: light;
  --ink: #15231d;
  --muted: #68736d;
  --cream: #f3f0e7;
  --paper: #fffdf8;
  --green: #1e7253;
  --green-dark: #14523b;
  --orange: #f06f3d;
  --line: #dcd9cf;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .25;
  background-image: radial-gradient(#849087 0.55px, transparent 0.55px);
  background-size: 6px 6px;
}

.shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.brand { color: var(--ink); text-decoration: none; font: 700 1.1rem "Space Grotesk"; letter-spacing: .16em; display: flex; align-items: center; gap: 10px; }
.brand-ball { width: 20px; height: 20px; border-radius: 50%; background: var(--orange); box-shadow: inset -3px -2px 0 rgb(0 0 0 / 10%); }
.status { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.status span { width: 8px; height: 8px; border-radius: 50%; background: #c89b35; }
.status.online span { background: #35a46b; }
.status.offline span { background: #d05b44; }

.hero { padding: 78px 0 54px; }
.eyebrow { color: var(--green); font-size: .75rem; font-weight: 700; letter-spacing: .18em; margin: 0 0 12px; }
h1, h2 { font-family: "Space Grotesk", sans-serif; margin: 0; }
h1 { font-size: clamp(3.3rem, 8vw, 6.6rem); line-height: .92; letter-spacing: -.06em; max-width: 850px; }
h1 em { color: var(--green); font-style: normal; }
.intro { color: var(--muted); font-size: 1.1rem; line-height: 1.65; max-width: 520px; margin: 30px 0 0; }

.score-card { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 5vw, 52px); box-shadow: 0 22px 70px rgb(31 47 39 / 8%); }
.score-heading { display: flex; justify-content: space-between; align-items: end; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); letter-spacing: -.04em; }
.text-button { background: none; border: 0; border-bottom: 1px solid var(--ink); padding: 4px 0; color: var(--ink); cursor: pointer; font: 600 .85rem "DM Sans"; }

.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(18px, 5vw, 65px); align-items: center; padding: 48px 0 34px; }
.player { text-align: center; }
.player label { display: block; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.player input { width: 100%; border: 0; border-bottom: 1px solid transparent; background: transparent; text-align: center; color: var(--ink); font: 600 clamp(1.15rem, 2.5vw, 1.45rem) "Space Grotesk"; padding: 8px; }
.player input:focus { outline: 0; border-bottom-color: var(--green); }
.score-button { display: block; width: min(100%, 260px); aspect-ratio: 1.25; margin: 18px auto 12px; border: 0; border-radius: 18px; background: var(--green); color: white; cursor: pointer; font: 700 clamp(4.5rem, 11vw, 8rem) "Space Grotesk"; transition: transform .12s ease, background .12s ease; }
.player-two .score-button { background: var(--orange); }
.score-button:hover { transform: translateY(-3px); background: var(--green-dark); }
.player-two .score-button:hover { background: #d95c2d; }
.score-button:active { transform: translateY(1px) scale(.98); }
.player > span { color: var(--muted); font-size: .75rem; }
.versus { color: #9ca39f; font: 700 .75rem "Space Grotesk"; letter-spacing: .12em; }
.match-message { margin: 0; padding-top: 24px; border-top: 1px solid var(--line); color: var(--green); text-align: center; font-weight: 700; }

.history { padding: 80px 0; display: grid; grid-template-columns: .75fr 1.25fr; gap: 60px; }
.history-list { border-top: 1px solid var(--line); }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.history-item strong { font-family: "Space Grotesk"; font-size: 1.05rem; }
.history-item p, .history-item time, .empty { color: var(--muted); font-size: .85rem; margin: 5px 0 0; }
.history-score { color: var(--green); font: 700 1.35rem "Space Grotesk"; }
footer { background: var(--ink); color: #cdd5d0; text-align: center; padding: 34px 20px; font-size: .85rem; }

@media (max-width: 700px) {
  .shell { width: min(100% - 24px, 1080px); }
  .hero { padding: 58px 0 42px; }
  .status { font-size: 0; }
  .score-card { border-radius: 18px; }
  .scoreboard { gap: 10px; }
  .score-button { border-radius: 13px; aspect-ratio: 1; }
  .player > span { display: none; }
  .history { grid-template-columns: 1fr; gap: 28px; padding: 60px 0; }
}

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