/*
 * Night Court — Design System (ds)
 *
 * Tokens:
 *   --ds-bg #0A0F0D, --ds-surface #111917, --ds-surface-2 #17211E
 *   --ds-line rgba(236,239,230,.10), --ds-line-strong rgba(236,239,230,.18)
 *   --ds-ink #ECEFE6, --ds-ink-2 62%, --ds-ink-3 38%
 *   --ds-volt #C8FF3D, --ds-pine #1F5D46, --ds-cyan #4CC9F0, --ds-pink #FF4D8D
 *   --ds-ease cubic-bezier(.22,1,.36,1), --ds-t-fast 160ms, --ds-t 320ms, --ds-t-slow 640ms, --ds-t-xl 900ms
 *
 * Components:
 *   .ds-grain, .ds-topbar, .ds-brand, .nav, .nav-dock-pill, .nav-ico
 *   .ds-hero, .ds-hero-date, .ds-hero-meta, .ds-hero-location, .ds-hero-court
 *   .ds-control, .ds-select-wrap, .ds-panel, .stats-table-wrap, .stats-table
 *   .ds-preloader, .sheet-root / .sheet-*, .player-name-tooltip, #error
 */

@view-transition {
  navigation: auto;
}

:root {
  color-scheme: dark;
  --ds-bg: #0a0f0d;
  --ds-surface: #111917;
  --ds-surface-2: #17211e;
  --ds-line: rgba(236, 239, 230, 0.1);
  --ds-line-strong: rgba(236, 239, 230, 0.18);
  --ds-ink: #ecefe6;
  --ds-ink-2: rgba(236, 239, 230, 0.62);
  --ds-ink-3: rgba(236, 239, 230, 0.56);
  --ds-volt: #c8ff3d;
  --ds-pine: #1f5d46;
  --ds-cyan: #4cc9f0;
  --ds-pink: #ff4d8d;
  --ds-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ds-t-fast: 160ms;
  --ds-t: 320ms;
  --ds-t-slow: 640ms;
  --ds-t-xl: 900ms;
  --ds-font-display: "Big Shoulders Display", system-ui, sans-serif;
  --ds-font-body: "Zen Kaku Gothic New", system-ui, sans-serif;
  --ds-font-mono: "JetBrains Mono", ui-monospace, monospace;
  --dock-x: 0px;
  --dock-w: 0px;
  --topbar-h: 56px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 239, 230, 0.25) transparent;
}

body.ds {
  margin: 0;
  min-height: 100dvh;
  overflow-x: clip;
  background: var(--ds-bg);
  color: var(--ds-ink);
  font-family: var(--ds-font-body);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.ds ::selection {
  background: color-mix(in srgb, var(--ds-volt) 35%, transparent);
  color: var(--ds-ink);
}

.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;
}

/* Grain */
.ds-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Topbar */
.ds-topbar {
  view-transition-name: topbar;
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--ds-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ds-line);
}

.ds-scroll-progress {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  height: 2px;
  z-index: 41;
  background: var(--ds-volt);
  transform-origin: left center;
  pointer-events: none;
}

@supports (animation-timeline: scroll()) {
  .ds-scroll-progress {
    animation: ds-scroll-progress linear both;
    animation-timeline: scroll(root);
    animation-range: 0 100%;
  }

  @keyframes ds-scroll-progress {
    from {
      transform: scaleX(0);
    }
    to {
      transform: scaleX(1);
    }
  }
}

@supports not (animation-timeline: scroll()) {
  .ds-scroll-progress {
    display: none;
  }
}

.ds-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
  color: var(--ds-ink);
  font-family: var(--ds-font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  line-height: 1;
}

.ds-brand b {
  color: var(--ds-volt);
  font-weight: 900;
}

.nav-home {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ds-line-strong);
  background: var(--ds-surface);
  color: var(--ds-ink-2);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color var(--ds-t-fast) var(--ds-ease), color var(--ds-t-fast) var(--ds-ease), transform var(--ds-t-fast) var(--ds-ease);
}

.nav-home:hover {
  color: var(--ds-ink);
  border-color: var(--ds-volt);
}

.nav-home:active {
  transform: scale(0.97);
}

/* Nav / Dock */
nav.nav {
  view-transition-name: dock;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;
  height: 64px;
  padding: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ds-surface) 72%, transparent);
  border: 1px solid var(--ds-line-strong);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.nav-dock-pill {
  position: absolute;
  top: 6px;
  left: var(--dock-x);
  width: var(--dock-w);
  height: calc(100% - 12px);
  border-radius: 999px;
  background: var(--ds-volt);
  z-index: 0;
  opacity: 0;
  transition:
    left 420ms cubic-bezier(0.34, 1.56, 0.64, 1),
    width 420ms cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity var(--ds-t-fast) var(--ds-ease);
  pointer-events: none;
}

nav.nav a {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 4px 6px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ds-ink-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: color var(--ds-t-fast) var(--ds-ease), transform var(--ds-t-fast) var(--ds-ease);
}

nav.nav a .nav-ico {
  display: flex;
  width: 22px;
  height: 22px;
}

nav.nav a .nav-ico svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

nav.nav a.active {
  color: var(--ds-bg);
}

nav.nav a.active .nav-ico svg {
  stroke: var(--ds-bg);
}

nav.nav a:focus-visible {
  outline: 2px solid var(--ds-volt);
  outline-offset: 2px;
}

nav.nav a:active {
  transform: scale(0.96);
}

nav.nav a.is-dock-active .ds-nav-stroke {
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: ds-nav-icon-draw 520ms var(--ds-ease) forwards;
}

@keyframes ds-nav-icon-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 767px) {
  :root {
    --topbar-h: 56px;
  }

  .ds-topbar {
    min-height: 56px;
    height: 56px;
    padding: 0 16px;
    padding-top: max(0px, env(safe-area-inset-top));
  }
}

@media (min-width: 768px) {
  :root {
    --topbar-h: 72px;
  }

  .ds-topbar {
    height: 72px;
    min-height: 72px;
    padding: 0 24px;
    padding-top: max(0px, env(safe-area-inset-top));
    align-items: center;
  }

  nav.nav {
    position: fixed;
    top: 14px;
    left: 50%;
    right: auto;
    bottom: auto;
    width: min(480px, calc(100vw - 32px));
    max-width: 480px;
    height: 44px;
    margin: 0;
    padding: 4px;
    transform: translateX(-50%);
    border-radius: 999px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
  }

  .nav-dock-pill {
    top: 4px;
    height: calc(100% - 8px);
  }

  nav.nav a {
    flex-direction: row;
    gap: 6px;
    font-size: 12px;
  }
}

/* Main */
#wrap {
  padding: 0 16px calc(112px + env(safe-area-inset-bottom));
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  #wrap {
    padding-bottom: 40px;
  }
}

@media (min-width: 1024px) {
  #wrap {
    padding-left: 48px;
    padding-right: 48px;
    max-width: 1280px;
  }
}

/* Hero */
.ds-hero {
  position: relative;
  padding: 8px 0 12px;
  overflow: hidden;
  contain: layout style;
}

body[data-page="daily"] .ds-hero {
  min-height: 300px;
}

@media (min-width: 768px) {
  body[data-page="daily"] .ds-hero {
    min-height: 340px;
  }
}

.ds-hero-ambient {
  position: absolute;
  inset: -40% -20% -20%;
  pointer-events: none;
  z-index: 0;
}

.ds-hero-ambient::before,
.ds-hero-ambient::after {
  content: "";
  position: absolute;
  width: min(520px, 90vw);
  height: min(520px, 70vh);
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.35;
  animation: ds-ambient-drift 20s var(--ds-ease) infinite alternate;
}

.ds-hero-ambient::before {
  left: -10%;
  top: 0;
  background: radial-gradient(circle, var(--ds-pine) 0%, transparent 70%);
}

.ds-hero-ambient::after {
  right: -5%;
  bottom: -10%;
  animation-delay: -10s;
  background: radial-gradient(circle, color-mix(in srgb, var(--ds-pine) 60%, var(--ds-bg)) 0%, transparent 72%);
}

@keyframes ds-ambient-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(24px, -18px, 0);
  }
}

.ds-hero-grid {
  position: relative;
  z-index: 1;
}

.ds-hero-court {
  position: absolute;
  inset: -20% -10% auto;
  height: 140%;
  pointer-events: none;
  opacity: 0.07;
  color: var(--ds-volt);
  z-index: 0;
  will-change: transform;
  contain: strict;
}

.ds-hero-court svg {
  width: 100%;
  height: 100%;
}

@keyframes ds-court-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.ds-hero-kicker {
  margin: 0 0 4px;
  font-family: var(--ds-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ds-ink-3);
}

.ds-hero-date {
  margin: 0;
  font-family: var(--ds-font-display);
  font-weight: 900;
  font-size: clamp(5.5rem, 34vw, 14rem);
  line-height: 0.82;
  letter-spacing: -0.02em;
  color: var(--ds-ink);
  min-height: calc(clamp(5.5rem, 34vw, 14rem) * 0.82);
}

.ds-date-chars {
  display: inline-flex;
  align-items: flex-end;
}

.ds-date-char {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: 0.82;
}

.ds-date-char.is-entering .ds-date-char-inner {
  display: block;
  transform: translateY(110%);
  animation: ds-date-rise 640ms var(--ds-ease) forwards;
}

@keyframes ds-date-rise {
  to {
    transform: translateY(0);
  }
}

.ds-date-char-slot {
  display: block;
  position: relative;
  overflow: hidden;
  height: 1em;
}

.ds-date-char-inner,
.ds-date-char-in,
.ds-date-char-out {
  display: block;
}

.ds-date-char.is-rolling .ds-date-char-out {
  animation: ds-date-roll-out 380ms var(--ds-ease) forwards;
}

.ds-date-char.is-rolling .ds-date-char-in {
  animation: ds-date-roll-in 380ms var(--ds-ease) forwards;
}

@keyframes ds-date-roll-out {
  to {
    transform: translateY(-100%);
  }
}

@keyframes ds-date-roll-in {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@supports (animation-timeline: scroll()) {
  .ds-hero-date {
    animation: ds-hero-shrink linear both;
    animation-timeline: scroll();
    animation-range: 0 140px;
  }

  @keyframes ds-hero-shrink {
    from {
      transform: scale(1);
      opacity: 1;
    }
    to {
      transform: scale(0.72);
      opacity: 0.55;
    }
  }
}

.ds-hero-meta {
  margin: 6px 0 12px;
  min-height: 1.25em;
  font-family: var(--ds-font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ds-ink-2);
}

.ds-hero-location-row {
  min-height: 28px;
  margin: 0 0 16px;
}

.ds-hero-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ds-ink-2);
}

.ds-hero-pin {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--ds-volt);
}

.ds-hero-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ds-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ds-select-wrap select {
  appearance: none;
  min-height: 44px;
  padding: 0 40px 0 16px;
  border-radius: 999px;
  border: 1px solid var(--ds-line-strong);
  background: var(--ds-surface);
  color: var(--ds-ink);
  font-family: var(--ds-font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--ds-t-fast) var(--ds-ease), box-shadow var(--ds-t-fast) var(--ds-ease), transform var(--ds-t-fast) var(--ds-ease);
}

.ds-select-wrap select:active {
  transform: scale(0.97);
}

.ds-select-wrap select:focus-visible {
  outline: none;
  border-color: var(--ds-volt);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ds-volt) 45%, transparent);
}

.ds-select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ds-ink-2);
  border-bottom: 2px solid var(--ds-ink-2);
  transform: rotate(45deg) translateY(-2px);
  pointer-events: none;
}

.subtitle {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ds-ink-3);
  max-width: 36em;
}

@media (min-width: 768px) {
  .ds-hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px 32px;
    align-items: end;
  }

  .ds-hero-date {
    font-size: clamp(9rem, 18vw, 18rem);
    min-height: calc(clamp(9rem, 18vw, 18rem) * 0.82);
  }

  .ds-hero-col-right {
    padding-bottom: 8px;
  }
}

/* Marquee */
.ds-marquee {
  position: relative;
  height: 56px;
  margin: 8px -16px 20px;
  overflow: hidden;
  border-block: 1px solid var(--ds-line);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

@media (min-width: 1024px) {
  .ds-marquee {
    margin-left: -48px;
    margin-right: -48px;
  }
}

.ds-marquee-track {
  display: flex;
  width: max-content;
  height: 100%;
  visibility: hidden;
  animation: ds-marquee var(--ds-marquee-duration, 28s) linear infinite;
}

.ds-marquee.is-ready .ds-marquee-track {
  visibility: visible;
}

.ds-marquee-item {
  flex-shrink: 0;
  padding: 0 1.5rem;
  font-family: var(--ds-font-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  line-height: 56px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  -webkit-text-stroke: 1px var(--ds-ink-3);
  color: transparent;
}

.ds-marquee-item--volt {
  -webkit-text-stroke: 0;
  color: var(--ds-volt);
}

@keyframes ds-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Panels & tables */
.mock-content-region,
.stats-tables {
  min-width: 0;
}

.stats-team-panel {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.stats-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.stats-team-title {
  margin: 0;
  padding: 0 0 0 11px;
  border: none;
  border-left: 4px solid var(--team-color, var(--ds-line-strong));
  font-family: var(--ds-font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--team-color, var(--ds-ink));
}

.stats-player-count {
  font-family: var(--ds-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ds-ink-3);
  white-space: nowrap;
}

.stats-panel-rule {
  height: 1px;
  margin-bottom: 14px;
  background: var(--ds-line-strong);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 640ms var(--ds-ease);
}

.stats-panel-rule.is-visible {
  transform: scaleX(1);
}

.stats-event-location {
  display: none;
}

.stats-table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
  border: 1px solid var(--ds-line);
  background: var(--ds-surface);
  overscroll-behavior-x: contain;
}

.stats-table-wrap--tall {
  max-height: calc(100dvh - var(--topbar-h) - var(--sticky-bar-h, 0px) - 112px);
  overflow: auto;
}

.stats-table-wrap.has-scroll:not(.at-end)::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--ds-surface));
}

.stats-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.stats-table th,
.stats-table td {
  padding: 0 10px;
  text-align: center;
  white-space: nowrap;
  border: none;
  border-bottom: 1px solid var(--ds-line);
  vertical-align: middle;
}

.stats-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 40px;
  background: var(--ds-surface);
  color: var(--ds-ink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats-table tbody tr {
  height: 52px;
  position: relative;
}

@media (min-width: 768px) {
  .stats-table tbody tr.is-spotlight {
    background: radial-gradient(
      120px circle at var(--mx, 50%) var(--my, 50%),
      color-mix(in srgb, var(--ds-volt) 8%, transparent),
      transparent 70%
    );
  }
}

.stats-table td.col-name {
  text-align: left;
  font-weight: 700;
  font-size: 14px;
}

.stats-table td.col-pct {
  color: var(--ds-ink-2);
  font-family: var(--ds-font-mono);
  font-size: 13px;
}

.stats-table td.col-pts {
  position: relative;
  overflow: hidden;
  padding-bottom: 10px;
}

.stats-table td.col-pts::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 6px;
  height: 3px;
  width: calc(var(--pct, 0) * 1%);
  max-width: calc(100% - 16px);
  min-width: 0;
  background: linear-gradient(90deg, var(--ds-volt), transparent);
  border-radius: 999px;
  pointer-events: none;
}

.stats-table td.col-pts .num {
  font-family: var(--ds-font-display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  color: var(--ds-ink);
}

.stats-table td.col-pts small {
  font-family: var(--ds-font-body);
  font-size: 10px;
  font-weight: 700;
  color: var(--ds-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stats-table td:not(.col-name):not(.col-pts) {
  font-family: var(--ds-font-mono);
  font-size: 13px;
}

.stats-table td.stat-max {
  color: var(--ds-volt);
  text-shadow: 0 0 12px color-mix(in srgb, var(--ds-volt) 35%, transparent);
}

.stats-table td.stat-max .num {
  color: var(--ds-volt);
  text-shadow: 0 0 12px color-mix(in srgb, var(--ds-volt) 35%, transparent);
}

.stats-table thead th.col-no,
.stats-table td.col-no,
.stats-table tfoot td.col-no {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 3rem;
  background: var(--ds-surface);
}

.stats-table thead th.col-name,
.stats-table td.col-name,
.stats-table tfoot td.col-name {
  position: sticky;
  left: 3rem;
  z-index: 2;
  min-width: 6.5rem;
  max-width: 9rem;
  background: var(--ds-surface);
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.2);
}

.stats-table thead th.col-no {
  z-index: 5;
}

.stats-table thead th.col-name {
  z-index: 5;
  text-align: left;
}

.jersey-no-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: -8px;
  padding: 4px 8px;
  border: 1px solid var(--ds-line);
  border-radius: 10px;
  background: var(--ds-surface-2);
  color: var(--ds-ink);
  font-family: var(--ds-font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--ds-t-fast) var(--ds-ease), color var(--ds-t-fast) var(--ds-ease);
}

.jersey-no-btn:hover,
.jersey-no-btn:focus-visible {
  border-color: var(--ds-volt);
  outline: none;
}

.stats-table tfoot td {
  border-top: 1px solid var(--ds-line-strong);
  border-bottom: none;
  height: 48px;
  font-family: var(--ds-font-display);
  font-weight: 800;
  font-size: 15px;
}

.stats-table tfoot td.col-pts .num {
  font-size: 20px;
}

.row-even {
  background: transparent;
}

/* Error */
#error {
  display: none;
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ds-pink) 50%, transparent);
  background: color-mix(in srgb, var(--ds-pink) 12%, var(--ds-surface));
  color: var(--ds-ink);
  font-size: 14px;
  font-weight: 700;
}

/* Bottom sheet */
.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.sheet-root:not([hidden]) {
  pointer-events: auto;
}

.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88vh, 640px);
  background: rgba(17, 25, 23, 0.92);
  backdrop-filter: blur(20px);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--ds-line-strong);
  transform: translateY(100%);
}

.sheet-grabber {
  width: 40px;
  height: 4px;
  margin: 10px auto 6px;
  border-radius: 999px;
  background: var(--ds-line-strong);
}

.sheet-content {
  padding: 8px 20px 28px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  overflow-y: auto;
}

.sheet-metric-label {
  margin: 0 0 4px;
  font-family: var(--ds-font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ds-ink-3);
}

.sheet-metric-name,
.sheet-title {
  margin: 0 0 16px;
  font-family: var(--ds-font-display);
  font-weight: 900;
  font-size: 2.25rem;
  line-height: 1;
  color: var(--ds-ink);
}

.sheet-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.sheet-stat,
.ds-sheet-tile {
  padding: 14px 12px;
  border-radius: 12px;
  background: var(--ds-surface-2);
  border: 1px solid var(--ds-line);
}

.sheet-stat .lbl {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-ink-3);
}

.sheet-stat .val {
  font-family: var(--ds-font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ds-ink);
}

.sheet-desc {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ds-ink-2);
}

/* Tooltip */
.player-name-tooltip {
  position: fixed;
  z-index: 90;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--ds-volt);
  background: var(--ds-surface-2);
  color: var(--ds-ink);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

/* Preloader */
.ds-preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ds-bg);
  clip-path: inset(0 0 0 0);
  transition: clip-path var(--ds-t-slow) var(--ds-ease);
}

.ds-preloader.is-exiting {
  clip-path: inset(0 0 100% 0);
}

.ds-preloader-brand {
  display: flex;
  gap: 0.06em;
  font-family: var(--ds-font-display);
  font-weight: 900;
  font-size: clamp(2rem, 12vw, 4.5rem);
  letter-spacing: 0.08em;
  color: var(--ds-ink);
}

.ds-preloader-brand span {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  animation: ds-char-in var(--ds-t-slow) var(--ds-ease) forwards;
}

@keyframes ds-char-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ds-preloader-counter {
  position: absolute;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  font-family: var(--ds-font-display);
  font-weight: 800;
  font-size: clamp(3rem, 18vw, 7rem);
  line-height: 1;
  color: color-mix(in srgb, var(--ds-volt) 35%, var(--ds-ink-3));
  letter-spacing: -0.02em;
}

/* Scrollbar */
body.ds * {
  scrollbar-width: thin;
  scrollbar-color: var(--ds-line-strong) transparent;
}

body.ds *::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body.ds *::-webkit-scrollbar-thumb {
  background: var(--ds-line-strong);
  border-radius: 999px;
}

/* Footer */
.ds-footer {
  margin-top: 48px;
  padding: 32px 0 calc(112px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ds-line);
}

.ds-footer.ds-footer--defer {
  visibility: hidden;
  content-visibility: hidden;
  height: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top: none;
  pointer-events: none;
}

.ds-footer.ds-footer--revealing {
  visibility: visible;
  content-visibility: visible;
  height: auto;
  overflow: visible;
  margin-top: 48px;
  padding: 32px 0 calc(112px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ds-line);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 320ms var(--ds-ease), transform 320ms var(--ds-ease);
}

.ds-footer.ds-footer--revealing.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .ds-footer,
  .ds-footer.ds-footer--revealing {
    padding-bottom: 48px;
  }
}

body[data-page="daily"] #statsTables {
  min-height: 1px;
}

.ds-footer-word {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.04em;
  margin: 0 0 20px;
  font-family: var(--ds-font-display);
  font-weight: 900;
  font-size: min(calc((100vw - 32px) / 5), 15rem);
  line-height: 0.8;
  letter-spacing: 0.04em;
  text-align: center;
}

.ds-footer-char {
  display: inline-block;
  overflow: hidden;
  -webkit-text-stroke: 1px var(--ds-ink-3);
  color: transparent;
  transform: translateY(110%);
  transition:
    color 640ms var(--ds-ease),
    -webkit-text-stroke-color 640ms var(--ds-ease),
    transform 640ms var(--ds-ease);
}

.ds-footer.is-visible .ds-footer-char {
  transform: translateY(0);
  color: var(--ds-volt);
  -webkit-text-stroke-color: transparent;
}

.ds-footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  font-family: var(--ds-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ds-ink-3);
}

.ds-footer-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--ds-line-strong);
  background: var(--ds-surface);
  color: var(--ds-ink-2);
  font-family: var(--ds-font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color var(--ds-t-fast) var(--ds-ease), color var(--ds-t-fast) var(--ds-ease), transform var(--ds-t-fast) var(--ds-ease);
}

.ds-footer-top:hover {
  border-color: var(--ds-volt);
  color: var(--ds-ink);
}

.ds-footer-top:active {
  transform: scale(0.97);
}

.ds-footer-top svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ds-footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--ds-line-strong);
  color: var(--ds-ink-2);
  text-decoration: none;
  transition: border-color var(--ds-t-fast) var(--ds-ease), color var(--ds-t-fast) var(--ds-ease), transform var(--ds-t-fast) var(--ds-ease);
}

.ds-footer-link:hover {
  border-color: var(--ds-volt);
  color: var(--ds-ink);
}

.ds-footer-link:active {
  transform: scale(0.97);
}

/* View transitions */
::view-transition-old(root) {
  animation: ds-vt-out 180ms var(--ds-ease) both;
}

::view-transition-new(root) {
  animation: ds-vt-in 400ms var(--ds-ease) both;
}

@keyframes ds-vt-out {
  to {
    opacity: 0;
  }
}

@keyframes ds-vt-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .nav-dock-pill {
    transition: none;
  }

  .ds-preloader {
    display: none !important;
  }

  /* マーキーは装飾ティッカーとして動かす（速度は半分に抑える） */
  .ds-marquee-track {
    animation-duration: calc(var(--ds-marquee-duration, 28s) * 2) !important;
    animation-iteration-count: infinite !important;
  }

  .ds-hero-ambient::before,
  .ds-hero-ambient::after {
    animation: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .ds-topbar,
  nav.nav,
  .sheet {
    backdrop-filter: none;
    background: var(--ds-surface);
  }
}
