@font-face {
  font-family: Outfit;
  src: url("fonts/outfit-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #10281f;
  --card: rgba(23, 50, 41, 0.82);
  --line: rgba(216, 232, 206, 0.14);
  --lime: #d7fa78;
  --ink: #f4f7f2;
  --muted: #8ea497;
  --soft: #c5d2c8;
  --dim: #d7dfd8;
  --danger: #ffd0c2;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: Outfit, "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #10281f;
  font-weight: 430;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  background:
    repeating-linear-gradient(112deg, transparent 0 86px, rgba(180, 214, 170, 0.045) 86px 87px),
    repeating-linear-gradient(18deg, transparent 0 128px, rgba(180, 214, 170, 0.035) 128px 129px),
    radial-gradient(900px 560px at 78% 8%, rgba(46, 92, 68, 0.55), transparent 60%);
}

#app { position: relative; z-index: 1; min-height: 100dvh; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

::selection { background: var(--lime); color: #14261c; }

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(18px, env(safe-area-inset-top)) 22px max(8px, env(safe-area-inset-bottom));
}

.shell:has(nav) {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

main { flex: 1; min-height: 0; }

.shell:has(nav) main {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 18px;
}

.boot {
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--lime);
}

.word {
  color: var(--ink);
  font-weight: 650;
  letter-spacing: 0.2em;
  font-size: 22px;
  line-height: 1;
}

.sub {
  color: var(--muted);
  letter-spacing: 0.22em;
  font-size: 9px;
  margin-top: 5px;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top, .brand, .top-actions { display: flex; align-items: center; }
.top { justify-content: space-between; gap: 12px; }
.brand { gap: 12px; color: var(--lime); }
.top-actions { gap: 8px; }

.mark { display: flex; color: var(--lime); }

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(215, 250, 120, 0.4);
  border-radius: 999px;
  padding: 6px 10px 6px 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--lime);
  font-weight: 600;
}

.live i {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(215, 250, 120, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 7px rgba(215, 250, 120, 0); }
}

.watch-toggle, .text-btn {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 8px;
}

.text-btn { padding: 10px 0; letter-spacing: 0.02em; }

.court {
  margin: 26px 0 0;
  color: var(--muted);
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 600;
}

h1 {
  font-size: 56px;
  line-height: 0.92;
  font-weight: 560;
  letter-spacing: -0.04em;
  margin: 8px 0 10px;
}

h2 {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 28px 0 4px;
}

.match-name {
  color: var(--soft);
  font-size: 18px;
  margin: 0;
  font-weight: 450;
}

.cards { display: grid; gap: 12px; margin-top: 22px; }

.scorecard {
  position: relative;
  width: 100%;
  min-height: 112px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 18px 18px 20px 18px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  color: inherit;
  user-select: none;
}

.scorecard:active { transform: scale(0.985); border-color: rgba(215, 250, 120, 0.45); }

.who { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }

.names {
  font-size: 20px;
  font-weight: 560;
  letter-spacing: -0.02em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--lime);
  display: inline-block;
  margin-right: 8px;
  transform: translateY(-1px);
}

.role {
  margin: 6px 0 0 15px;
  letter-spacing: 0.16em;
  font-size: 10px;
  color: var(--muted);
}

.pts {
  position: relative;
  font-size: 72px;
  font-weight: 550;
  letter-spacing: -0.05em;
  line-height: 0.8;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
  padding: 0 8px 8px 0;
}

.pts.dim { color: var(--dim); }

.pts.pop { animation: pop 180ms ease; }

@keyframes pop {
  40% { transform: scale(1.08); }
}

.plus {
  position: absolute;
  right: 16px;
  bottom: 8px;
  color: rgba(215, 250, 120, 0.55);
  font-size: 18px;
}

.setline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 26px;
}

.setline .k, .k {
  color: var(--muted);
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.setline .n {
  margin-top: 4px;
  font-size: 42px;
  font-weight: 550;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.pills {
  margin-top: 4px;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-size: 13px;
}

.tag {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin: 26px 0 0;
  font-size: 14px;
}

.tag .line { border-bottom: 1px solid rgba(215, 250, 120, 0.4); padding-bottom: 2px; }
.tag svg { color: var(--lime); flex: none; }

.keys { display: none; color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.narrow, .wide-copy { width: min(440px, 100%); margin: 0 auto; }
.wide-copy { width: min(720px, 100%); }

.stack { display: grid; gap: 10px; margin-top: 22px; }

.btn {
  height: 54px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 620;
  width: 100%;
}

.btn.lime { background: var(--lime); color: #14261c; }
.btn.ghost { background: transparent; color: var(--ink); border-color: rgba(215, 250, 120, 0.38); }
.btn:active { transform: scale(0.99); }

.field { display: block; margin: 0 0 14px; }
.field > span, .field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  background: rgba(23, 50, 41, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  height: 52px;
  padding: 0 14px;
  font-size: 16px;
}

textarea { height: auto; min-height: 132px; padding: 12px 14px; resize: vertical; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  min-width: 52px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(215, 250, 120, 0.22);
  background: transparent;
  color: var(--ink);
}

.chip.on { background: var(--lime); color: #14261c; border-color: var(--lime); font-weight: 650; }

.hint { color: var(--muted); font-size: 14px; line-height: 1.45; }
.hint.center { text-align: center; }
.error { color: var(--danger); margin: 4px 0 8px; }

.eyebrow {
  color: var(--lime);
  font-weight: 650;
  font-size: 28px;
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin: 8px 0 28px;
}

.welcome-card { width: min(440px, 100%); }

.how {
  position: fixed;
  z-index: 30;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: flex-start;
  max-width: 100%;
  pointer-events: none;
}

.how-tab,
.how-panel { pointer-events: auto; }

.how-tab {
  writing-mode: vertical-rl;
  border: 1px solid rgba(215, 250, 120, 0.35);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: #173229;
  color: var(--lime);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 650;
  padding: 18px 11px;
}

.how-panel {
  width: min(300px, calc(100vw - 72px));
  margin: 0 0 0 10px;
  padding: 14px 14px 8px;
  border-radius: 16px;
  background: rgba(16, 40, 31, 0.96);
  border: 1px solid rgba(216, 232, 206, 0.16);
}

.how-k {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.how-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(216, 232, 206, 0.14);
  padding: 12px 2px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 620;
  line-height: 1.3;
}

.how-item[aria-expanded="true"] { color: var(--lime); }

.how-copy {
  margin: 0 0 10px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.45;
}

.built {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.shell > .built { margin-top: auto; padding-top: 16px; }
.shell:has(nav) > .built { margin-top: 0; padding: 8px 0 2px; }
.built a {
  display: inline-flex;
  line-height: 0;
  border-radius: 6px;
}
.built a:focus-visible { outline-offset: 4px; }
.built img { height: 34px; width: auto; display: block; }
.login-form { margin-top: 18px; }
.login-form .btn { margin-top: 2px; }
.welcome-card > .hint { margin: 14px 0 0; }

.quiet { color: var(--soft); font-size: 18px; margin: 0 0 8px; }

.final-k { letter-spacing: 0.18em; color: var(--muted); font-size: 12px; font-weight: 650; margin: 18px 0 0; }
.final-name { font-size: 32px; font-weight: 560; margin: 6px 0; letter-spacing: -0.03em; }
.final-sets {
  font-size: 64px;
  line-height: 0.9;
  margin: 0;
  color: var(--lime);
  font-weight: 550;
  letter-spacing: -0.04em;
}
.final-detail, .final-lost { color: var(--soft); margin: 6px 0; }
.saved { color: var(--lime); margin-top: 12px; }

.nav {
  flex: none;
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  padding: 10px 0 max(4px, env(safe-area-inset-bottom));
  background: #10281f;
  border-top: 1px solid rgba(216, 232, 206, 0.1);
  z-index: 2;
}

.nav button {
  background: transparent;
  border: 0;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 14px;
}

.nav button.on { color: var(--lime); }

.row {
  width: 100%;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  margin-top: 10px;
}

.rank { color: var(--lime); font-size: 18px; font-weight: 620; }
.pname { display: block; font-size: 17px; font-weight: 560; }
.rating {
  margin-left: 8px;
  color: var(--lime);
  font-weight: 620;
  font-size: 14px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.meta { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.pts-col { font-size: 32px; font-weight: 560; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pts-col.lime { color: var(--lime); }

.result {
  margin-top: 14px;
  padding: 14px 16px 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(12, 32, 25, 0.55);
}

.result-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 18px; }
.result-line strong { font-size: 28px; font-weight: 560; color: var(--lime); letter-spacing: -0.03em; }
.result-b { color: var(--muted); margin: 2px 0 0; }

.banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  margin-top: 14px;
  background: rgba(215, 250, 120, 0.08);
  border: 1px solid rgba(215, 250, 120, 0.28);
  color: var(--ink);
  border-radius: 14px;
  padding: 12px;
}

.live.mini { padding: 4px 8px; font-size: 10px; }

.code {
  font-size: 34px;
  letter-spacing: 0.28em;
  font-weight: 620;
  margin: 6px 0 12px;
}

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

.comp, .fixture {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
}
.comp {
  width: 100%;
  text-align: left;
}
.comp b { display: block; font-size: 17px; font-weight: 560; }
.comp span { color: var(--muted); font-size: 13px; }
.fixture .btn { margin-top: 12px; height: 46px; }
.fixture .hint { margin: 8px 0 0; }

.member em {
  color: var(--lime);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-left: 8px;
}

.note {
  margin-top: 22px;
  padding-top: 8px;
  color: var(--soft);
  line-height: 1.45;
}

.note p { margin: 8px 0; }

.quick-add { display: flex; gap: 8px; align-items: center; }
.quick-add input { flex: 1; }
.quick-add .btn { width: auto; padding: 0 16px; }

.actions { display: flex; gap: 18px; align-items: center; }

.notice {
  background: rgba(215, 250, 120, 0.12);
  color: var(--lime);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
}

.dialog-back {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: rgba(6, 16, 12, 0.72);
  display: grid;
  place-items: center;
  padding: 22px;
}

.dialog {
  width: min(380px, 100%);
  background: #173229;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
}

.dialog p { margin-top: 0; font-size: 18px; }

.switcher { display: flex; gap: 8px; margin-top: 16px; }

.watch-screen { display: grid; justify-items: center; padding-top: 12px; }

.watch { width: 250px; }

.band {
  height: 58px;
  background: linear-gradient(90deg, #74887c, #b7c7bb 42%, #849688);
}

.band.top { border-radius: 18px 18px 8px 8px; }
.band.bottom { border-radius: 8px 8px 18px 18px; }

.face {
  position: relative;
  z-index: 1;
  margin: -16px 14px;
  background: #101614;
  border-radius: 36px;
  padding: 18px 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.face-top, .face-score, .face-games {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.face-top {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #c9d4cc;
}

.face-top span:last-child { text-align: right; }

.face-k {
  text-align: center;
  margin-top: 16px;
  letter-spacing: 0.18em;
  font-size: 10px;
  color: #8d9c93;
}

.half, .face-score .colon {
  background: none;
  border: 0;
  color: var(--dim);
  padding: 6px 0 4px;
  text-align: center;
}

.half.lime, .half.lime .big { color: var(--lime); }

.big {
  font-size: 64px;
  font-weight: 550;
  letter-spacing: -0.05em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.colon { font-size: 42px; color: #edf2ee; padding: 0 2px; }

.face-games { color: #edf2ee; font-size: 22px; font-weight: 560; text-align: center; }
.face-games b { font-weight: 560; text-align: center; }
.face-games span {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #8d9c93;
  font-weight: 600;
  padding: 0 8px;
}

.face-tap {
  text-align: center;
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #8d9c93;
}

.poster-foot { display: none; }

@media (min-width: 900px) {
  .welcome {
    display: grid;
    grid-template-columns: 240px minmax(320px, 440px);
    gap: 64px;
    align-items: center;
    max-width: 860px;
    margin: 0 auto;
    min-height: 0;
    flex: 1;
  }
  .eyebrow { margin-bottom: 0; font-size: 34px; }
}

@media (min-width: 1100px) {
  .poster {
    width: min(1120px, 100%);
    margin: 12px auto 0;
    display: grid;
    grid-template-columns: 170px minmax(380px, 460px) 280px;
    gap: 20px 56px;
    align-items: start;
  }
  .poster-copy {
    color: var(--lime);
    font-weight: 650;
    font-size: 32px;
    line-height: 0.95;
    margin: 8px 0 0;
  }
  .watch-col { padding-top: 168px; }
  .poster-foot { display: block; text-align: center; color: var(--muted); margin: 26px 0 0; }
  .keys { display: block; }
  .watch-toggle { display: none; }
}

@media (max-height: 760px) {
  h1 { font-size: 46px; }
  .pts { font-size: 60px; }
  .scorecard { min-height: 96px; }
  .setline .n { font-size: 34px; }
  .court { margin-top: 16px; }
}

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