/* style.css - FaiSim Live: a Melee / Slippi Online inspired theme. Deep-blue menu backdrop, slanted menu buttons and
   badges, player-port scoreboard, stage-strike vote tiles. Original shapes only: no game or Slippi artwork. */

@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/rubik.woff2') format('woff2');
}

@font-face {
  font-family: 'Rubik';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/rubik-italic.woff2') format('woff2');
}

:root {
  --bg-0: #03050d;
  --bg-1: #060b20;
  --bg-2: #0b1536;
  --panel: rgba(9, 16, 42, 0.88);
  --line: rgba(110, 145, 255, 0.18);
  --line-2: rgba(110, 145, 255, 0.34);
  --text: #f3f6ff;
  --muted: #a4b1d8;
  --faint: #6f7ca8;
  --slp: #3ee07f;
  --slp-2: #17a957;
  --slp-ink: #06240f;
  --gold: #ffcb3d;
  --gold-2: #ff9d1a;
  --gold-ink: #2b1700;
  --p1: #ee2f45;
  --p1-2: #9e1026;
  --p2: #2f7bff;
  --p2-2: #1541b3;
  --live: #ff3048;
  --warn: #ffb547;
  --danger: #ff5a6a;
  --skew: -12deg;
  --gutter: 16px;
  --topbar-h: 60px;
  --font: 'Rubik', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app [hidden] {
  display: none !important;
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

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

a {
  color: var(--slp);
}

.icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
}

/* ------------------------------------------------------------------ the menu backdrop */

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  isolation: isolate;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 50% -10%, rgba(47, 96, 255, 0.34), transparent 70%),
    radial-gradient(60% 50% at 100% 100%, rgba(62, 224, 127, 0.1), transparent 70%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
}

.backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(118deg, rgba(140, 170, 255, 0.045) 0 1px, transparent 1px 18px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
  mask-image: linear-gradient(180deg, #000, transparent 85%);
}

.ring {
  position: absolute;
  top: -38vmax;
  left: 50%;
  width: 90vmax;
  height: 90vmax;
  margin-left: -45vmax;
  border-radius: 50%;
  border: 2px dashed rgba(110, 145, 255, 0.1);
  animation: spin 160s linear infinite;
}

.ring-2 {
  top: -30vmax;
  width: 74vmax;
  height: 74vmax;
  margin-left: -37vmax;
  border: 1px solid rgba(110, 145, 255, 0.08);
  animation-duration: 220s;
  animation-direction: reverse;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  background: rgba(4, 7, 20, 0.78);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
}

.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--slp), rgba(62, 224, 127, 0.25) 35%, rgba(47, 123, 255, 0.35) 70%, transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  filter: drop-shadow(0 4px 14px rgba(62, 224, 127, 0.4));
}

.brand-name {
  font-size: 21px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.brand-tag {
  padding: 1px 9px;
  transform: skewX(var(--skew));
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.viewers {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pill {
  --tone: #5b8cff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 13px;
  transform: skewX(var(--skew));
  background: color-mix(in srgb, var(--tone) 18%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--tone) 70%, transparent);
  color: color-mix(in srgb, var(--tone) 55%, white);
  font-size: 12.5px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}

.pill[data-tone='live'] {
  --tone: var(--live);
  background: linear-gradient(90deg, var(--live), #c0102a);
  border-color: var(--live);
  color: #fff;
  box-shadow: 0 0 22px rgba(255, 48, 72, 0.45);
}

.pill[data-tone='live'] i {
  background: #fff;
  animation: pulse 1.6s ease-out infinite;
}

.pill[data-tone='online'] {
  --tone: var(--slp);
}

.pill[data-tone='offline'] {
  --tone: #7d879f;
}

.pill[data-tone='warn'] {
  --tone: var(--warn);
}

.pill[data-tone='connecting'] i,
.pill[data-tone='warn'] i {
  animation: blink 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.75);
  }
  75%,
  100% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }
}

@keyframes blink {
  50% {
    opacity: 0.2;
  }
}

/* ------------------------------------------------------------------ layout */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-content: start;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px var(--gutter) 36px;
}

.layout:focus {
  outline: none;
}

@media (min-width: 1100px) {
  .app[data-ranked='true'] .layout {
    grid-template-columns: minmax(0, 1fr) 380px;
    width: min(1540px, 100%);
    align-items: start;
    padding: 26px 26px 40px;
  }

  .app[data-theater='true'] .layout,
  .app[data-theater='true'][data-ranked='true'] .layout {
    grid-template-columns: minmax(0, 1fr);
    width: min(1880px, 100%);
  }

  .app[data-theater='true'][data-ranked='true'] .side {
    width: min(760px, 100%);
    justify-self: center;
  }
}

.stage,
.side {
  display: grid;
  gap: 14px;
  min-width: 0;
  align-content: start;
}

/* ------------------------------------------------------------------ the player */

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #02030a;
  border: 2px solid rgba(110, 145, 255, 0.32);
  box-shadow: 0 0 0 5px rgba(3, 5, 16, 0.85), 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 60px -10px rgba(47, 96, 255, 0.35);
  isolation: isolate;
}

/* Corner brackets, like a menu's selection frame. */
.player::after {
  content: '';
  position: absolute;
  inset: 6px;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(var(--slp), var(--slp)) top left / 26px 3px no-repeat,
    linear-gradient(var(--slp), var(--slp)) top left / 3px 26px no-repeat,
    linear-gradient(var(--slp), var(--slp)) bottom right / 26px 3px no-repeat,
    linear-gradient(var(--slp), var(--slp)) bottom right / 3px 26px no-repeat;
  opacity: 0.85;
}

.player[data-mode='video']::after {
  opacity: 0;
  transition: opacity 0.6s 1.5s;
}

.app[data-theater='true'] .player {
  width: min(100%, calc((100vh - var(--topbar-h) - 150px) * 16 / 9));
  justify-self: center;
}

@media (max-width: 639px) {
  .layout {
    padding-top: 0;
    gap: 16px;
  }

  .player {
    width: calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter));
    border-radius: 0;
    border-width: 0 0 2px;
    box-shadow: none;
  }
}

.player-frame,
.video-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-frame {
  z-index: 1;
}

.poster {
  --tone: #5b8cff;
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(55% 65% at 50% 40%, color-mix(in srgb, var(--tone) 22%, transparent), transparent 72%),
    repeating-linear-gradient(118deg, rgba(140, 170, 255, 0.05) 0 1px, transparent 1px 14px),
    linear-gradient(180deg, #0b1540, #04071a);
  transition: opacity 0.35s ease, visibility 0.35s;
}

.poster:focus {
  outline: none;
}

.player[data-mode='video'] .poster {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.poster[data-tone='live'] {
  --tone: var(--live);
}

.poster[data-tone='online'] {
  --tone: var(--slp);
}

.poster[data-tone='offline'] {
  --tone: #56617d;
}

.poster[data-tone='warn'] {
  --tone: var(--warn);
}

.poster[data-tone='error'] {
  --tone: var(--danger);
}

.poster-art {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(60px, 11vw, 100px);
  aspect-ratio: 1;
  margin-bottom: clamp(4px, 1.4vw, 14px);
}

.poster-art svg {
  position: relative;
  width: 62%;
  height: 62%;
  filter: drop-shadow(0 10px 28px color-mix(in srgb, var(--tone) 50%, transparent));
}

.poster[data-tone='offline'] .poster-art svg,
.poster[data-tone='error'] .poster-art svg {
  filter: grayscale(0.8) brightness(0.8);
}

.pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--tone) 65%, transparent);
  opacity: 0;
  animation: ring-out 2.8s ease-out infinite;
}

.pulse + .pulse {
  animation-delay: 1.4s;
}

.poster[data-tone='offline'] .pulse,
.poster[data-tone='error'] .pulse {
  animation: none;
  opacity: 0.2;
}

.poster[data-tone='offline'] .pulse + .pulse,
.poster[data-tone='error'] .pulse + .pulse {
  display: none;
}

@keyframes ring-out {
  0% {
    transform: scale(0.55);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.poster-kicker {
  margin: 0;
  padding: 2px 12px;
  transform: skewX(var(--skew));
  background: color-mix(in srgb, var(--tone) 85%, black);
  color: #fff;
  font-size: 12px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.poster-title {
  margin: 4px 0 0;
  max-width: 24ch;
  font-size: clamp(1.35rem, 3vw, 2.4rem);
  line-height: 1.08;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
  text-wrap: balance;
}

/* "Searching" dots while waiting for FaiSim or the page's connection. */
.poster[data-tone='online'] .poster-title::after,
.poster[data-tone='connecting'] .poster-title::after {
  content: '';
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: dots 1.6s steps(4, end) infinite;
}

@keyframes dots {
  0% {
    content: '';
  }
  25% {
    content: '.';
  }
  50% {
    content: '..';
  }
  75% {
    content: '...';
  }
}

.poster-text {
  margin: 6px 0 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  text-wrap: pretty;
}

.poster-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.poster-actions:empty {
  display: none;
}

@media (max-width: 480px) {
  .poster {
    padding: 14px;
    gap: 3px;
  }

  .poster-art {
    width: 48px;
    margin-bottom: 2px;
  }

  .poster-kicker {
    font-size: 10.5px;
  }

  .poster-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

.unmute {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 68px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  transform: translateX(-50%) skewX(var(--skew));
  border: 0;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  color: var(--gold-ink);
  font: italic 800 15px/1 var(--font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(0, 0, 0, 0.35);
}

.unmute:hover {
  filter: brightness(1.08);
}

@media (max-width: 480px) {
  .unmute {
    bottom: 12px;
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }
}

/* ------------------------------------------------------------------ the player-port scoreboard */

.hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
}

.port {
  --c1: var(--p1);
  --c2: var(--p1-2);
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 76px;
  padding: 10px 30px 10px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 48%),
    linear-gradient(90deg, var(--c2), var(--c1));
  clip-path: polygon(0 0, 100% 0, calc(100% - 22px) 100%, 0 100%);
  border-radius: 6px 0 0 6px;
}

.port-opp {
  --c1: var(--p2);
  --c2: var(--p2-2);
  justify-content: flex-end;
  padding: 10px 16px 10px 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 48%),
    linear-gradient(270deg, var(--c2), var(--c1));
  clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%);
  border-radius: 0 6px 6px 0;
  text-align: right;
}

.port-tag {
  flex: none;
  padding: 2px 7px;
  border-radius: 5px;
  background: #fff;
  color: var(--c2);
  font-size: 13px;
  font-style: italic;
  font-weight: 900;
}

.port-who {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.port-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(15px, 2vw, 21px);
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

.port-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 600;
}

.port-sub:empty {
  display: none;
}

/* Wins, drawn like the in-game damage numbers. */
.port-score {
  margin-left: auto;
  font-size: clamp(38px, 5.4vw, 60px);
  font-style: italic;
  font-weight: 900;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  color: #fff;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.55);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}

.port-opp .port-score {
  margin-left: 0;
  margin-right: auto;
}

.hud[data-lead='bot'] .port-opp .port-score,
.hud[data-lead='opp'] .port-bot .port-score {
  opacity: 0.6;
}

.hud-mid {
  z-index: 1;
  display: grid;
  place-items: center;
  margin: 0 -14px;
  padding: 0 4px;
}

.hud-vs {
  font-size: clamp(22px, 3vw, 32px);
  font-style: italic;
  font-weight: 900;
  color: var(--gold);
  -webkit-text-stroke: 2px #1b1000;
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
}

@media (max-width: 639px) {
  .port {
    gap: 8px;
    min-height: 62px;
    padding: 8px 22px 8px 10px;
  }

  .port-opp {
    padding: 8px 10px 8px 22px;
  }

  .port-tag {
    display: none;
  }

  .port-sub {
    font-size: 11.5px;
  }
}

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

.status-text {
  margin: 0;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.stage-actions {
  display: flex;
  flex: none;
  gap: 10px;
  margin-left: auto;
}

#open-video[data-provider='youtube'] .icon-twitch,
#open-video[data-provider='twitch'] .icon-youtube {
  display: none;
}

@media (max-width: 1099px) {
  .stage-actions .theater-btn {
    display: none;
  }
}

.notices {
  display: grid;
  gap: 8px;
}

.notices:empty {
  display: none;
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-left: 4px solid var(--warn);
  background: rgba(255, 181, 71, 0.1);
  font-size: 14px;
}

.notice-dot {
  display: none;
}

/* ------------------------------------------------------------------ buttons and badges */

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  transform: skewX(var(--skew));
  border: 1.5px solid rgba(140, 170, 255, 0.45);
  background: linear-gradient(180deg, #2442a3, #152a70);
  color: #fff;
  font: italic 800 14px/1 var(--font);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 18px -8px rgba(0, 0, 0, 0.8);
  transition: background 0.12s, color 0.12s, border-color 0.12s, filter 0.12s;
  -webkit-tap-highlight-color: transparent;
}

/* The menu's highlighted entry. */
.menu-btn:hover:not(:disabled),
.menu-btn:focus-visible {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  color: var(--gold-ink);
}

.menu-btn:active:not(:disabled) {
  filter: brightness(0.92);
}

.menu-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 14px;
  transform: skewX(var(--skew));
  border: 1.5px solid var(--line-2);
  background: rgba(10, 18, 48, 0.7);
  color: var(--text);
  font: italic 700 13px/1 var(--font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.chip-btn:hover {
  border-color: var(--slp);
  color: var(--slp);
}

.chip-btn[aria-pressed='true'] {
  border-color: var(--slp);
  background: rgba(62, 224, 127, 0.14);
}

#open-video[data-provider='twitch'] .icon-twitch {
  color: #b38aff;
}

.chip {
  --tone: #7d879f;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 12px;
  transform: skewX(var(--skew));
  background: color-mix(in srgb, var(--tone) 20%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--tone) 65%, transparent);
  color: color-mix(in srgb, var(--tone) 50%, white);
  font-size: 12px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip:empty {
  display: none;
}

.chip[data-tone='live'] {
  --tone: var(--live);
}

.chip[data-tone='online'] {
  --tone: var(--slp);
}

.chip[data-tone='vote'] {
  --tone: var(--gold);
}

.meter {
  display: block;
  height: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  transform: skewX(var(--skew));
}

.meter i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--slp-2), var(--slp));
  transition: width 0.25s linear;
}

/* ------------------------------------------------------------------ ranked: the game-setup panel */

.ranked {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1.5px solid var(--line-2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(62, 224, 127, 0.07), transparent 120px),
    repeating-linear-gradient(118deg, rgba(140, 170, 255, 0.035) 0 1px, transparent 1px 14px),
    var(--panel);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
}

.ranked::before {
  content: '';
  position: absolute;
  top: -1.5px;
  left: 18px;
  width: 90px;
  height: 4px;
  background: var(--slp);
  transform: skewX(var(--skew));
}

.ranked-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ranked-head h2 {
  margin: 0;
  font-size: 30px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}

.ranked-status {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.ranked-status:empty {
  display: none;
}

.ranked-queue {
  display: grid;
  gap: 10px;
}

/* Ranked | Unranked, like two menu entries: the chosen one lit gold. */
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 4px;
}

.mode-tab {
  min-height: 38px;
  transform: skewX(var(--skew));
  border: 1.5px solid var(--line-2);
  background: rgba(10, 18, 48, 0.75);
  color: var(--muted);
  font: italic 900 15px/1 var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mode-tab:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--text);
}

.mode-tab[aria-pressed='true'] {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  color: var(--gold-ink);
}

.mode-tab:disabled:not([aria-pressed='true']) {
  opacity: 0.35;
  cursor: not-allowed;
}

.ranked-help {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.ranked-add {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  padding: 0 4px;
}

.add-btn {
  flex-direction: column;
  gap: 2px;
  min-height: 64px;
  padding: 8px 6px;
}

.add-n {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.add-word {
  font-size: 11.5px;
  font-weight: 700;
  opacity: 0.8;
}

.deadline {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border-left: 4px solid var(--warn);
  background: rgba(255, 181, 71, 0.08);
}

.deadline-text {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.deadline .meter i {
  background: var(--warn);
}

.deadline[data-urgent='true'] .deadline-text {
  color: var(--warn);
}

.ranked-note {
  margin: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 13.5px;
}

.vote {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1.5px solid var(--line-2);
  border-radius: 6px;
  background: rgba(3, 6, 18, 0.6);
}

.vote[data-open='true'] {
  border-color: rgba(255, 203, 61, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 203, 61, 0.1), 0 0 30px -10px rgba(255, 203, 61, 0.4);
}

.vote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vote-head h3 {
  margin: 0;
  font-size: 17px;
  font-style: italic;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

/* The in-game timer. */
.vote-clock {
  flex: none;
  font-size: 28px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fff;
  -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.6);
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.vote[data-urgent='true'] .vote-clock {
  color: var(--live);
}

/* The next-game vote has no countdown: it says, quietly, that it runs until the game ends. */
.vote[data-until='game'] .vote-clock {
  flex: 0 1 auto;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
  -webkit-text-stroke: 0;
}

.vote-meter i {
  background: linear-gradient(90deg, var(--gold-2), var(--gold));
}

.vote[data-urgent='true'] .vote-meter i {
  background: var(--live);
}

.vote-status {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.vote-status:empty {
  display: none;
}

.vote-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.vote-options[data-kind='character'],
.vote-options[data-kind='next'] {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}

/* The "next" vote's Rematch | New opponent pair, on a row of its own above the characters. */
.opt-pair {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(140, 170, 255, 0.18);
}

.opt-pair .opt {
  min-height: 72px;
}

.opt-pair .opt-art {
  max-width: 28px;
  aspect-ratio: 1;
}

/* A stage (or character) tile of the strike screen. */
.opt {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 88px;
  padding: 10px 6px 12px;
  overflow: hidden;
  border: 2px solid rgba(140, 170, 255, 0.25);
  border-radius: 6px;
  background: linear-gradient(180deg, #13225a, #0a1334);
  color: var(--text);
  font: 700 12.5px/1.15 var(--font);
  text-align: center;
  cursor: pointer;
  isolation: isolate;
  transition: border-color 0.12s, transform 0.1s, background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.opt:hover:not(:disabled) {
  border-color: var(--gold);
  background: linear-gradient(180deg, #1c2f78, #0f1b48);
}

.opt:active:not(:disabled) {
  transform: scale(0.97);
}

.opt:disabled {
  cursor: default;
}

.opt-art {
  width: 100%;
  max-width: 76px;
  height: auto;
  aspect-ratio: 64 / 36;
  color: #8fb0ff;
}

.opt-glyph {
  font-size: 30px;
  font-style: italic;
  font-weight: 900;
  line-height: 1.1;
  color: rgba(143, 176, 255, 0.55);
}

.opt-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.opt-count {
  position: absolute;
  top: 5px;
  right: 7px;
  font-size: 13px;
  font-style: italic;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.opt[data-leading='true'] .opt-count {
  color: var(--gold);
}

.opt-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.opt-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--slp);
  transition: width 0.35s ease;
}

/* Your pick: highlighted, with a "YOU" token like a character-select coin. */
.opt[aria-pressed='true'] {
  border-color: var(--slp);
  background: linear-gradient(180deg, #145236, #0a2a1f);
  box-shadow: 0 0 18px -4px rgba(62, 224, 127, 0.6);
}

.opt[aria-pressed='true'] .opt-art {
  color: #b9f5cf;
}

.opt[data-mine='true']::after {
  content: 'YOU';
  position: absolute;
  top: 5px;
  left: 6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7dfbb0, var(--slp-2));
  color: var(--slp-ink);
  font-size: 8.5px;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Struck or unavailable: a red cross over the tile. */
.opt[data-unavailable='true'] {
  opacity: 0.55;
}

.opt[data-unavailable='true']::before {
  content: '';
  position: absolute;
  inset: 12px 18%;
  z-index: 2;
  background:
    linear-gradient(to top right, transparent calc(50% - 3px), var(--danger) calc(50% - 3px), var(--danger) calc(50% + 3px), transparent calc(50% + 3px)),
    linear-gradient(to top left, transparent calc(50% - 3px), var(--danger) calc(50% - 3px), var(--danger) calc(50% + 3px), transparent calc(50% + 3px));
}

.vote:not([data-open='true']) .opt:disabled:not([data-unavailable='true']) {
  opacity: 0.7;
}

.vote-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 26px;
}

.vote-voters {
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 600;
}

.ranked-last {
  margin: 0;
  padding: 6px 12px;
  border-left: 4px solid var(--slp);
  background: rgba(62, 224, 127, 0.07);
  font-size: 13.5px;
  font-weight: 600;
}

.ranked-fine {
  margin: 0;
  color: var(--faint);
  font-size: 12px;
}

/* ------------------------------------------------------------------ footer */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 18px max(var(--gutter), env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  color: var(--faint);
  font-size: 12.5px;
}

.footer p {
  margin: 0;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.footer-meta span:empty {
  display: none;
}

.noscript {
  margin: 40px auto;
  max-width: 480px;
  padding: 16px;
  text-align: center;
  color: var(--text);
}

@media (max-width: 639px) {
  .topbar {
    --topbar-h: 54px;
    height: 54px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .brand-name {
    font-size: 18px;
  }

  .ranked {
    padding: 16px 14px;
  }

  .ranked-head h2 {
    font-size: 26px;
  }
}

@media (max-width: 480px) {
  .brand-tag {
    display: none;
  }
}

@media (max-width: 380px) {
  .viewers {
    display: none;
  }
}

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