@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #120d0e;
  --surface: #211719;
  --ink: #f4e9d6;
  --muted: #c6b7a0;
  --gold: #d9ad68;
  --gold-hi: #f5d894;
  --red: #a12a35;
  --line: rgba(221, 177, 107, .39);
  --brocade: url('./assets/ti26-brocade.png');
  --gold-brocade: url('./assets/ti26-gold-brocade.png');
  --font-ui: 'Barlow', Arial, sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-family: var(--font-ui);
  font-size: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-width: 0;
  overflow-x: clip;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 630px 430px at 50% 720px, rgba(159, 94, 50, .2), transparent 78%),
    radial-gradient(ellipse 540px 390px at 13% 260px, rgba(122, 42, 42, .22), transparent 80%),
    linear-gradient(90deg, rgba(6, 4, 5, .45), transparent 20%, transparent 80%, rgba(6, 4, 5, .45)),
    linear-gradient(rgba(18, 11, 13, .78), rgba(18, 11, 13, .88)),
    var(--brocade);
  background-size: auto, auto, auto, auto, 760px 760px;
}
body::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 76px;
  right: 0;
  left: 0;
  height: 950px;
  background-image:
    radial-gradient(ellipse 380px 270px at 27% 32%, rgba(198, 93, 58, .22), transparent 78%),
    radial-gradient(ellipse 550px 310px at 53% 76%, rgba(227, 159, 76, .19), transparent 80%),
    linear-gradient(90deg, rgba(18, 10, 11, .9), rgba(30, 16, 15, .78) 28%, rgba(28, 15, 14, .76) 70%, rgba(18, 10, 11, .9)),
    var(--gold-brocade);
  background-size: auto, auto, auto, 1380px 1380px;
  background-position: center, center, center, center top;
  opacity: .36;
  mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
  pointer-events: none;
  animation: ambient-light 32s ease-in-out infinite alternate;
}
@keyframes ambient-light {
  from { opacity: .3; transform: translate3d(-12px, 0, 0); }
  to { opacity: .39; transform: translate3d(12px, -7px, 0); }
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: #a12a35; color: #fff; }
[hidden] { display: none !important; }
.skip-link { position: absolute; z-index: 10; top: -4rem; left: 1rem; padding: .75rem 1rem; color: var(--bg); background: var(--ink); }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(rgba(13, 8, 9, .80), rgba(13, 8, 9, .86)), var(--brocade);
  background-size: auto, 650px 650px;
}
.header-inner {
  max-width: 1260px;
  min-height: 76px;
  margin: auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.wordmark { position: relative; isolation: isolate; display: inline-flex; flex: none; align-items: center; padding: 5px 0; }
.wordmark img { width: 144px; height: auto; }
.wordmark::after {
  content: '';
  position: absolute;
  inset: 5px 0;
  background-image: var(--brocade);
  background-position: center;
  background-size: 220px 220px;
  mask-image: url('./assets/pride-text.svg');
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
  mix-blend-mode: multiply;
  opacity: .18;
  pointer-events: none;
}
.site-header nav { display: flex; align-items: center; gap: 28px; }
.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #dfd0ba;
  font: 700 .92rem var(--font-display);
  letter-spacing: .07em;
  text-transform: uppercase;
  transition: color .2s ease;
}
.site-header nav a:hover, .site-header nav a:focus-visible { color: var(--gold-hi); }

.page-shell { max-width: 1260px; margin: auto; padding: 24px 28px 72px; overflow-x: clip; }
.intro-data, .podium-place, .table-frame, .input-shell, .lineup-section, .lineup-card, .mobile-rank-card, .player-dialog {
  background-image: linear-gradient(rgba(20, 11, 13, .69), rgba(20, 11, 13, .75)), var(--brocade);
  background-size: auto, 710px 710px;
}
.lineup-section { position: relative; border: 1px solid var(--line); box-shadow: inset 0 0 30px rgba(0,0,0,.2), 0 12px 30px rgba(0,0,0,.12); }
.lineup-section::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(238, 191, 116, .28);
  pointer-events: none;
}
.intro-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 380px); align-items: center; gap: 24px; min-height: 440px; }
.intro-copy { position: relative; display: flex; align-items: center; gap: clamp(20px, 2.6vw, 38px); min-width: 0; min-height: 440px; }
.intro-copy::before { content: ''; position: absolute; z-index: -1; left: -25px; top: 0; width: min(45%, 280px); height: 100%; background: radial-gradient(ellipse at center, rgba(151, 66, 49, .13), transparent 72%); pointer-events: none; }
.intro-banner { position: relative; flex: none; width: 420px; height: 420px; margin-inline: -72px -60px; perspective: 900px; filter: drop-shadow(0 13px 14px rgba(0, 0, 0, .38)); }
.intro-banner img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.intro-banner__base { z-index: 3; clip-path: inset(0 0 73% 0); }
.intro-banner__side { z-index: 3; }
.intro-banner__side--left { clip-path: inset(26% 67% 0 0); }
.intro-banner__side--right { clip-path: inset(26% 0 0 67%); }
.intro-banner__fabric { z-index: 1; clip-path: inset(24% 30% 0 30%); transform-origin: 50% 26%; backface-visibility: hidden; animation: banner-fabric-wave 8.8s cubic-bezier(.47, .02, .53, .98) infinite; }
@keyframes banner-fabric-wave {
  0%, 100% { transform: translate3d(0, 0, 0) rotateX(0) rotateY(0) skewX(0) scale(1); filter: brightness(1); }
  18% { transform: translate3d(3px, -1px, 19px) rotateX(-2.5deg) rotateY(3.2deg) skewX(.8deg) scale(1.01, .996); filter: brightness(1.045); }
  42% { transform: translate3d(-2px, 1px, -16px) rotateX(2.1deg) rotateY(-2.8deg) skewX(-.8deg) scale(.997, 1.007); filter: brightness(.97); }
  64% { transform: translate3d(2px, 0, 11px) rotateX(-1.6deg) rotateY(2.4deg) skewX(.55deg) scale(1.004, .998); filter: brightness(1.025); }
  82% { transform: translate3d(-1px, 1px, -5px) rotateX(.7deg) rotateY(-1.1deg) skewX(-.3deg) scale(.999, 1.003); filter: brightness(.994); }
}
@supports not (clip-path: inset(10%)) {
  .intro-banner__base { clip-path: none; }
  .intro-banner__side, .intro-banner__fabric { display: none; }
}
.intro-title { min-width: 0; max-width: 410px; padding: 16px 0 10px; }
.eyebrow { display: block; color: var(--gold-hi); font: 700 .77rem/1.2 var(--font-display); letter-spacing: .16em; text-transform: uppercase; }
.eyebrow span { padding: 0 .45em; color: #b58d59; }
.intro-copy h1 { margin: 14px 0 14px; color: var(--ink); font: 800 clamp(2.8rem, 4.4vw, 3.8rem)/.96 var(--font-display); letter-spacing: .01em; text-wrap: balance; }
.intro-copy h1 span { color: #dfb977; }
.intro-lead { max-width: 31ch; margin: 0 0 27px; color: #e5d4bb; font: 500 1.01rem/1.42 var(--font-ui); text-wrap: pretty; }
.hero-create-room { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 10px 21px; border: 1px solid #e2bc78; border-radius: 3px; background-image: linear-gradient(rgba(124, 73, 32, .28), rgba(69, 33, 20, .53)), var(--gold-brocade); background-size: auto, 270px 270px; color: #fff3d5; font: 800 .9rem/1.1 var(--font-display); letter-spacing: .045em; text-transform: uppercase; box-shadow: inset 0 0 0 1px rgba(255, 228, 174, .35), 0 4px 12px rgba(0, 0, 0, .22); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, filter .18s ease; touch-action: manipulation; }
.hero-create-room svg { width: 19px; height: 19px; fill: none; stroke: #ffe0a1; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero-create-room:hover:not(:disabled) { transform: translateY(-1px); border-color: #ffe0a1; filter: brightness(1.12); box-shadow: inset 0 0 0 1px rgba(255, 236, 186, .65), 0 0 16px rgba(245, 202, 117, .48), 0 0 32px rgba(202, 128, 52, .24), 0 7px 16px rgba(0, 0, 0, .3); }
.hero-create-room:active:not(:disabled) { transform: translateY(0); }
.hero-create-room:disabled { cursor: wait; opacity: .65; }
.hero-room-status { max-width: 32ch; margin: 8px 0 0; color: #ffc7bd; font-size: .8rem; line-height: 1.3; }
.hero-room-status[data-tone="info"], .hero-room-status[data-tone="success"] { color: var(--gold-hi); }
.intro-data { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 15px; min-width: 0; padding: 22px 23px 19px; border: 1px solid var(--line); box-shadow: inset 0 0 30px rgba(0, 0, 0, .17), 0 12px 30px rgba(0, 0, 0, .12); }
.intro-data::before { content: ''; position: absolute; inset: 6px; border: 1px dashed rgba(238, 191, 116, .25); pointer-events: none; }
.intro-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.intro-metrics > div { display: grid; grid-template-columns: 28px auto; grid-template-rows: auto auto; align-items: center; column-gap: 8px; min-width: 0; }
.intro-metrics svg { grid-row: 1 / 3; width: 26px; height: 26px; fill: none; stroke: #e8bd76; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.intro-metrics dd { grid-column: 2; grid-row: 1; margin: 0; color: #f5d894; font: 800 1.88rem/.95 var(--font-display); }
.intro-metrics dt { grid-column: 2; grid-row: 2; margin-top: 2px; color: var(--ink); font: 600 .76rem/1.15 var(--font-ui); }
.scoring { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 6px 12px; padding-top: 9px; border-top: 1px solid rgba(223, 178, 111, .3); }
.scoring > span { grid-column: 1 / -1; color: var(--muted); font: 700 .72rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.scoring > div { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.scoring svg { flex: none; width: 17px; height: 17px; margin-right: 3px; fill: none; stroke: #dcb56e; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.scoring > div span { color: var(--ink); font-size: .77rem; }
.scoring strong { margin-left: 3px; color: var(--gold-hi); font: 800 1.01rem var(--font-display); font-variant-numeric: tabular-nums; }
#ranking-source { display: block; color: var(--muted); font-size: .7rem; line-height: 1.25; }

.podium-section, .ranking-section { scroll-margin-top: 18px; }
.podium-section { margin-top: 12px; }
.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; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.section-heading h2, .lineup-head h2 { margin: 0; font: 800 clamp(1.7rem, 2.5vw, 2.1rem)/1.1 var(--font-display); }
.section-heading p { margin: 0; color: var(--muted); font-size: .86rem; }
.podium-grid { position: relative; isolation: isolate; display: grid; grid-template-columns: 1fr 1.14fr 1fr; align-items: end; gap: 8px; padding: 256px 8px 10px; }
.podium-grid::before { content: ''; position: absolute; z-index: -1; inset: 3px 15% 8px; background: radial-gradient(ellipse at 50% 70%, rgba(211, 153, 71, .19), transparent 66%); pointer-events: none; }
.podium-grid::after { content: ''; position: absolute; z-index: 4; right: 0; bottom: 0; left: 0; height: 8px; border: 1px solid rgba(242, 197, 116, .65); background: var(--gold-brocade) center / 480px 480px; box-shadow: 0 8px 18px rgba(0, 0, 0, .3); pointer-events: none; }
.podium-place {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  min-width: 0;
  height: 99px;
  padding: 7px;
  overflow: visible;
  border: 1px solid #a9814f;
  border-top: 3px solid #e8c27b;
  border-radius: 4px 4px 0 0;
  background-image: linear-gradient(rgba(59, 27, 23, .34), rgba(27, 14, 14, .66)), var(--gold-brocade);
  background-size: auto, 420px 420px;
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 226, 169, .27), 0 16px 28px rgba(0, 0, 0, .28);
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.podium-place::before { content: ''; position: absolute; z-index: 3; top: -3px; right: -1px; left: -1px; height: 8px; border: 1px solid rgba(255, 224, 157, .78); background: var(--gold-brocade) center / 420px 420px; box-shadow: 0 2px 4px rgba(0, 0, 0, .45); pointer-events: none; }
.podium-place::after { content: ''; position: absolute; right: -1px; bottom: 0; left: -1px; height: 8px; border: 1px solid rgba(239, 191, 111, .44); background: linear-gradient(90deg, #422219, #a36d3b 50%, #422219); pointer-events: none; }
.podium-place:hover, .podium-place:focus-visible { border-color: var(--gold-hi); transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(255, 226, 169, .55), 0 21px 34px rgba(0, 0, 0, .4); }
.lineup-card:hover { transform: translateY(-2px); }
.podium-place.place-first { grid-column: 2; grid-row: 1; z-index: 3; height: 119px; border-color: #f2cf85; border-top-color: #ffe2a3; background-image: linear-gradient(rgba(142, 78, 38, .12), rgba(43, 21, 16, .49)), var(--gold-brocade); background-size: auto, 500px 500px; }
.podium-place.place-second { grid-column: 1; grid-row: 1; }
.podium-place.place-third { grid-column: 3; grid-row: 1; height: 91px; }
.place-figure { position: absolute; right: 0; bottom: calc(100% - 2px); left: 0; display: flex; justify-content: center; align-items: end; height: 151px; pointer-events: none; }
.place-first .place-figure { height: 251px; }
.place-third .place-figure { height: 133px; }
.place-figure img { display: block; max-width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.place-figure .player-silhouette { opacity: .58; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .65)); }
.place-figure .player-photo { position: absolute; bottom: 0; left: 50%; width: auto; max-width: none; opacity: 0; transform: translateX(-50%); filter: drop-shadow(0 8px 13px rgba(0, 0, 0, .65)); transition: opacity .2s; }
.place-figure.has-image .player-photo { opacity: 1; }
.place-figure.has-image .player-silhouette { opacity: 0; }
.place-plaque { position: relative; z-index: 2; display: grid; grid-template-columns: 61px minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; margin-bottom: 7px; padding: 5px 13px; border: 1px solid rgba(241, 203, 137, .66); background: rgba(20, 11, 13, .84); box-shadow: inset 0 0 0 2px rgba(105, 64, 40, .47), 0 3px 8px rgba(0, 0, 0, .3); }
.place-first .place-plaque { grid-template-columns: 77px minmax(0, 1fr); gap: 15px; }
.place-number { color: #fff0c4; font: 800 3.05rem/.9 var(--font-display); text-align: center; text-shadow: 0 2px 0 #6a3f24, 0 5px 14px rgba(0, 0, 0, .57); }
.place-first .place-number { font-size: 4.1rem; }
.place-identity { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; gap: 3px; padding-left: 10px; border-left: 1px solid rgba(238, 191, 116, .35); }
.place-identity strong { color: #fff0d3; font: 800 1.35rem/1 var(--font-display); overflow-wrap: anywhere; text-wrap: balance; }
.place-first .place-identity strong { font-size: 1.75rem; }
.player-name-with-medal { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; max-width: 100%; }
.player-name-with-medal > strong, .player-name-with-medal > h2, .player-name-with-medal > span { min-width: 0; }
.player-medal { display: block; flex: none; width: 30px; height: 30px; object-fit: contain; transform: scale(1.2); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55)); }
.place-identity .player-name-with-medal { justify-content: flex-start; }
.place-identity .player-medal { width: 34px; height: 34px; }
.place-score { display: flex; align-items: baseline; gap: 5px; color: var(--gold-hi); white-space: nowrap; }
.place-score b { font: 800 1.55rem/1 var(--font-display); }
.place-first .place-score b { font-size: 1.95rem; }
.place-score small { color: #d9c49e; font: 700 .72rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; }

.ranking-section { margin-top: 60px; }
.rank-toolbar { position: relative; z-index: 3; display: flex; align-items: end; gap: 12px; margin: 0 0 13px; }
.search-field, .sort-field { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font: 700 .86rem var(--font-display); letter-spacing: .04em; }
.search-field { flex: 1; min-width: 0; }
.sort-field { width: 160px; flex: none; }
.sort-caption { display: flex; justify-content: space-between; gap: 8px; }
.sort-current { color: var(--gold-hi); }
.sort-buttons { display: grid; grid-template-columns: repeat(3, 48px); gap: 8px; }
.input-shell { height: 46px; border: 1px solid var(--line); color: var(--ink); }
.input-shell { display: flex; align-items: center; gap: 11px; padding: 0 14px; }
.input-shell svg { flex: none; width: 18px; fill: none; stroke: var(--gold); stroke-width: 1.8; }
.input-shell input { width: 100%; height: 100%; border: 0; outline: 0; background: none; color: var(--ink); font-family: var(--font-ui); font-size: .96rem; }
.input-shell input::placeholder { color: #b9a98f; }
.input-shell:focus-within { border-color: var(--gold-hi); outline: 2px solid rgba(245, 216, 148, .22); outline-offset: 0; }
.sort-button { position: relative; display: grid; place-items: center; width: 48px; height: 46px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background-image: linear-gradient(rgba(22, 12, 13, .75), rgba(22, 12, 13, .83)), var(--brocade); background-size: auto, 320px 320px; color: #e6c891; transition: border-color .18s, color .18s, transform .18s, box-shadow .18s; }
.sort-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sort-button:hover { border-color: var(--gold-hi); color: #fff0c5; transform: translateY(-1px); }
.sort-button[aria-pressed="true"] { border-color: var(--gold-hi); background-image: linear-gradient(rgba(95, 48, 27, .32), rgba(49, 23, 18, .48)), var(--gold-brocade); background-size: auto, 280px 280px; color: #fff0c5; box-shadow: inset 0 0 0 1px rgba(255, 222, 148, .55); }
.sort-button:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.sort-button::after { content: attr(data-tooltip); position: absolute; z-index: 5; top: calc(100% + 8px); left: 50%; padding: 6px 9px; border: 1px solid var(--gold); border-radius: 4px; background: #211719; color: var(--ink); box-shadow: 0 8px 18px rgba(0, 0, 0, .5); font: 600 .78rem/1 var(--font-ui); letter-spacing: 0; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate(-50%, -4px); transition: opacity .16s, transform .16s; }
.sort-button:hover::after, .sort-button:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.sort-buttons:has(.sort-button:focus-visible) .sort-button:hover:not(:focus-visible)::after { opacity: 0; }

.table-frame { overflow: hidden; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
thead { background: rgba(89, 41, 36, .78); }
th { height: 43px; padding: 0 14px; color: var(--gold-hi); font: 700 .83rem var(--font-display); letter-spacing: .06em; text-transform: uppercase; }
th:nth-child(n+3), td:nth-child(n+3) { text-align: center; }
tbody tr { border-top: 1px solid rgba(225, 181, 114, .19); transition: background .2s; }
tbody tr:hover { background: rgba(125, 50, 45, .22); }
td { height: 55px; padding: 5px 14px; font-size: .95rem; }
td:first-child { color: var(--gold-hi); font: 800 1.05rem var(--font-display); }
td:nth-child(3) { color: var(--gold-hi); font-weight: 700; }
td:last-child { font-weight: 700; }
.player-button { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font: 700 1rem var(--font-display); text-align: left; }
.player-button:hover { color: var(--gold-hi); }
.player-button .player-name-with-medal { justify-content: flex-start; }
.player-button .player-medal { width: 28px; height: 28px; }
.avatar { position: relative; display: grid; place-items: center; flex: none; width: 29px; height: 29px; overflow: hidden; border: 1px solid var(--gold); border-radius: 50%; background: #53242a; }
.avatar .player-silhouette { width: 27px; height: 27px; object-fit: contain; object-position: center bottom; }
.avatar .player-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.avatar.has-image .player-photo { opacity: 1; }
.avatar.has-image .player-silhouette { opacity: 0; }
.mobile-rank-list { display: none; }
.empty-state { padding: 28px; color: var(--muted); text-align: center; }
.ranking-count { margin: 10px 2px 0; color: var(--muted); font-size: .86rem; text-align: right; }

.lineup-section { scroll-margin-top: 18px; margin-top: 33px; padding: 26px 28px 29px; }
.lineup-head { position: relative; z-index: 1; display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.lineup-head p { margin: 6px 0 0; color: var(--muted); font-size: .94rem; }
.lineup-controls { display: flex; align-items: center; gap: 9px; }
.lineup-controls button { width: 44px; height: 44px; border: 1px solid var(--line); background: #2a1b1b; color: var(--gold-hi); font-size: 1.15rem; }
.lineup-controls button:disabled { opacity: .45; cursor: not-allowed; }
.lineup-controls span { min-width: 43px; color: var(--muted); font: 700 .87rem var(--font-display); text-align: center; }
.lineup-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.lineup-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 342px;
  aspect-ratio: 4 / 5;
  padding: 10px;
  overflow: hidden;
  border: 2px solid #b58a4b;
  border-radius: 13px;
  background-image: linear-gradient(145deg, rgba(63, 32, 21, .11), rgba(24, 11, 10, .30)), var(--gold-brocade);
  background-size: auto, 520px 520px;
  background-position: center;
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 222, 148, .67), inset 0 0 0 4px rgba(40, 20, 15, .85), 0 12px 25px rgba(0, 0, 0, .22);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.lineup-card::before { content: ''; position: absolute; inset: 5px; border: 1px solid rgba(255, 216, 139, .52); border-radius: 8px; pointer-events: none; }
.lineup-card:hover, .lineup-card:focus-visible { border-color: #f0ce87; box-shadow: inset 0 0 0 1px #f5db9f, inset 0 0 0 4px rgba(40, 20, 15, .85), 0 16px 32px rgba(0, 0, 0, .39); }
.lineup-card-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; flex: none; height: 46px; padding: 3px 9px; border: 1px solid rgba(238, 190, 111, .63); border-radius: 7px 7px 0 0; background: rgba(25, 14, 13, .84); }
.lineup-card-top img { width: 65px; height: 24px; object-fit: contain; }
.lineup-rank { position: relative; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; align-self: center; min-width: 62px; min-height: 38px; padding: 4px 8px 3px; overflow: hidden; border: 1px solid #aa794d; border-radius: 2px; background-image: linear-gradient(135deg, rgba(248, 196, 133, .13), transparent 42%), repeating-linear-gradient(90deg, transparent 0 2px, rgba(238, 179, 123, .045) 2px 3px), linear-gradient(150deg, #51282a, #2b171b 78%); box-shadow: inset 0 0 0 1px rgba(255, 215, 159, .22), inset 0 0 0 3px rgba(28, 12, 15, .66), 0 4px 9px rgba(0, 0, 0, .46); text-align: right; white-space: nowrap; }
.lineup-rank::after { content: ''; position: absolute; inset: 5px; border: 1px dashed rgba(224, 164, 104, .39); border-radius: 1px; pointer-events: none; }
.lineup-rank small { position: relative; z-index: 1; color: #dfbd94; font: 800 .59rem/1 var(--font-display); letter-spacing: .12em; }
.lineup-rank b { position: relative; z-index: 1; color: #ffebc7; font: 800 1.75rem/.92 var(--font-display); letter-spacing: .02em; text-shadow: 0 2px 3px rgba(0, 0, 0, .7); }
.lineup-portrait { position: relative; display: grid; place-items: center; flex: 1; min-height: 168px; margin: 0 3px; overflow: hidden; border-right: 1px solid rgba(224, 170, 88, .58); border-left: 1px solid rgba(224, 170, 88, .58); background: radial-gradient(circle at 50% 43%, #642c32 0, #351b20 45%, #170f13 90%); }
.lineup-portrait::before { content: ''; position: absolute; inset: 0; background: var(--gold-brocade) center / 400px 400px; mix-blend-mode: screen; opacity: .12; }
.lineup-portrait .player-silhouette { position: absolute; z-index: 1; bottom: -2px; left: 50%; width: min(78%, 185px); height: 91%; object-fit: contain; object-position: center bottom; opacity: .8; transform: translateX(-50%); filter: drop-shadow(0 7px 11px rgba(0, 0, 0, .48)); }
.lineup-portrait .player-photo { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 24%; opacity: 0; filter: saturate(.86) contrast(1.04); transition: opacity .25s; }
.lineup-portrait.has-image .player-photo { opacity: 1; }
.lineup-portrait.has-image .player-silhouette { opacity: 0; }
.lineup-nameplate { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; align-items: center; flex: none; min-height: 55px; margin-top: -18px; padding: 7px 5px 6px; border: 1px solid #c8a05e; border-radius: 5px; background-image: linear-gradient(rgba(19, 13, 14, .80), rgba(14, 10, 12, .89)), var(--brocade); background-size: auto, 500px 500px; box-shadow: 0 5px 10px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(202, 144, 72, .15); text-align: center; }
.lineup-nameplate strong, .lineup-nameplate h2 { margin: 0; color: #fff1d5; font: 800 1.47rem/1 var(--font-display); letter-spacing: .015em; overflow-wrap: anywhere; }
.lineup-nameplate .player-name-with-medal { padding-inline: 4px; }
.lineup-bottom { display: grid; grid-template-columns: 1.18fr .78fr 1fr; align-items: center; flex: none; min-height: 55px; margin: 7px 2px 1px; padding: 5px 3px; border: 1px solid rgba(238, 190, 111, .58); border-radius: 0 0 7px 7px; background: rgba(24, 13, 13, .89); }
.lineup-bottom span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 37px; padding: 0 2px; border-right: 1px solid rgba(226, 178, 108, .24); }
.lineup-bottom span:last-child { border-right: 0; }
.lineup-bottom b { color: #f7daa1; font: 800 1.13rem/1 var(--font-display); white-space: nowrap; }
.lineup-bottom span:first-child b { font-size: 1.45rem; }
.lineup-bottom small { margin-top: 4px; color: #cbb898; font: 700 .65rem/1 var(--font-display); letter-spacing: .08em; }

.site-footer { border-top: 1px solid var(--line); background-image: linear-gradient(rgba(13, 8, 9, .82), rgba(13, 8, 9, .82)), var(--brocade); background-size: auto, 700px 700px; }
.footer-inner { max-width: 1260px; margin: auto; padding: 27px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; color: var(--muted); }
.footer-brand { color: var(--ink); font: 800 1.26rem var(--font-display); }
.footer-inner p { margin: 0; font-size: .84rem; }
.footer-inner p a { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }
.footer-inner small { margin-left: auto; font-size: .77rem; }

.player-dialog { width: min(440px, calc(100vw - 26px)); max-height: calc(100dvh - 26px); padding: 52px 0 0; overflow: visible; border: 0; background: transparent; color: var(--ink); }
.player-dialog::backdrop { background: rgba(6, 3, 4, .83); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; z-index: 5; top: 0; right: 4px; width: 44px; height: 44px; border: 1px solid rgba(245, 209, 138, .75); border-radius: 50%; background: #211517; color: var(--ink); font-size: 1.5rem; line-height: 1; box-shadow: 0 8px 20px rgba(0, 0, 0, .5); }
#dialog-content { display: flex; flex-direction: column; max-height: calc(100dvh - 78px); padding: 10px; overflow-x: hidden; overflow-y: auto; border: 2px solid #b58a4b; border-radius: 13px; background-image: linear-gradient(145deg, rgba(63, 32, 21, .11), rgba(24, 11, 10, .30)), var(--gold-brocade); background-size: auto, 520px 520px; background-position: center; box-shadow: inset 0 0 0 1px rgba(255, 222, 148, .67), inset 0 0 0 4px rgba(40, 20, 15, .85), 0 25px 80px #000; scrollbar-width: thin; }
.player-dialog .dialog-card-top { height: 52px; padding: 4px 9px; }
.dialog-card-top .lineup-rank b { font-size: 2.05rem; }
.dialog-portrait { flex: none; height: clamp(145px, 32vh, 250px); min-height: 0; }
.dialog-portrait .player-silhouette { width: min(70%, 230px); }
.dialog-nameplate { min-height: 62px; margin-top: -19px; }
.dialog-nameplate h2 { font-size: clamp(1.55rem, 5vw, 2rem); }
.dialog-nameplate .player-medal { width: 38px; height: 38px; }
.dialog-score-strip { min-height: 67px; margin-top: 7px; }
.dialog-score-strip b { font-size: 1.27rem; }
.dialog-score-strip span:first-child b { font-size: 1.75rem; }
.dialog-score-strip small { font-size: .72rem; }
.dialog-details { margin: 7px 2px 1px; padding: 11px 8px; border: 1px solid rgba(238, 190, 111, .58); border-radius: 0 0 7px 7px; background-image: linear-gradient(rgba(24, 13, 13, .88), rgba(24, 13, 13, .91)), var(--brocade); background-size: auto, 500px 500px; text-align: center; }
.dialog-role { margin-bottom: 7px; padding-bottom: 7px; border-bottom: 1px solid rgba(226, 178, 108, .24); color: var(--muted); font: 700 .88rem var(--font-display); }
.dialog-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dialog-stats div { min-width: 0; padding: 6px 4px; border-right: 1px solid rgba(226, 178, 108, .24); }
.dialog-stats div:last-child { border-right: 0; }
.dialog-stats strong { display: block; color: #f0d3a0; font: 800 1.31rem/1 var(--font-display); }
.dialog-stats span { display: block; margin-top: 4px; color: #cbb898; font: 700 .72rem/1.1 var(--font-display); text-transform: uppercase; overflow-wrap: anywhere; }

@media (max-width: 950px) {
  .intro-section { grid-template-columns: minmax(0, 1fr) minmax(300px, 38%); gap: 14px; min-height: 340px; }
  .intro-banner { width: 260px; height: 260px; margin-inline: -38px -30px; }
  .intro-copy { min-height: 340px; gap: 16px; }
  .intro-copy h1 { font-size: 2.55rem; }
  .intro-lead { font-size: .92rem; }
  .intro-data { padding: 14px 15px; }
  .lineup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner small { margin-left: 0; }
}

@media (max-width: 760px) {
  .intro-section { grid-template-columns: 1fr; }
  .intro-copy { min-height: 340px; }
  .intro-data { width: min(100%, 430px); justify-self: end; }
}

@media (max-width: 700px) {
  body::before { animation: none; opacity: .36; transform: none; }
  .header-inner { min-height: 64px; padding: 0 14px; gap: 12px; }
  .wordmark img { width: 106px; }
  .site-header nav { gap: 2px; }
  .site-header nav a { justify-content: center; min-width: 44px; font-size: .83rem; letter-spacing: 0; }
  .page-shell { padding: 15px 14px 52px; }
  .intro-section { grid-template-columns: 1fr; gap: 8px; min-height: 0; }
  .intro-copy { min-height: 285px; gap: 13px; padding: 0 5px; }
  .intro-banner { width: 218px; height: 218px; margin-inline: -34px -25px; }
  .intro-title { padding: 4px 0; }
  .intro-copy h1 { margin: 10px 0 9px; font-size: clamp(2.1rem, 8vw, 2.7rem); }
  .intro-lead { max-width: 26ch; margin-bottom: 17px; font-size: .82rem; line-height: 1.32; }
  .hero-create-room { min-height: 44px; padding: 8px 14px; }
  .intro-data { width: 100%; gap: 9px; padding: 13px 17px 12px; }
  .intro-metrics { gap: 8px; }
  .intro-metrics dd { font-size: 1.54rem; }
  .scoring { gap: 3px 12px; padding-top: 7px; }
  .scoring strong { font-size: .96rem; }
  #ranking-source { font-size: .72rem; }
  .podium-section { margin-top: 10px; }
  .section-heading { align-items: end; margin-bottom: 9px; }
  .section-heading h2, .lineup-head h2 { font-size: 1.62rem; }
  .section-heading p { font-size: .76rem; text-align: right; }
  .podium-grid { gap: 5px; padding: 187px 1px 8px; }
  .podium-place { height: 100px; padding: 5px; }
  .podium-place.place-first { height: 116px; }
  .podium-place.place-third { height: 94px; }
  .place-figure { height: 116px; }
  .place-first .place-figure { height: 184px; }
  .place-third .place-figure { height: 102px; }
  .place-figure { overflow: hidden; }
  .place-plaque, .place-first .place-plaque { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 5px 2px; text-align: center; }
  .place-number, .place-first .place-number { font-size: 2.2rem; }
  .place-identity { align-items: center; gap: 1px; padding: 0; border: 0; }
  .place-identity strong, .place-first .place-identity strong { font-size: clamp(.83rem, 2.7vw, 1.1rem); }
  .place-identity .player-name-with-medal { gap: 3px; }
  .place-identity .player-medal { width: 25px; height: 25px; }
  .place-score { flex-direction: column; align-items: center; gap: 0; }
  .place-score b, .place-first .place-score b { font-size: 1.24rem; }
  .place-score small { font-size: .59rem; }
  .ranking-section { margin-top: 42px; }
  .rank-toolbar { gap: 9px; }
  .sort-field { width: 160px; }
  .table-frame { border: 0; background: none; }
  table { display: none; }
  .mobile-rank-list { display: grid; gap: 7px; }
  .mobile-rank-card { display: grid; grid-template-columns: 30px 32px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 68px; padding: 9px 12px; border: 1px solid var(--line); color: var(--ink); text-align: left; }
  .mobile-rank-card .avatar { width: 32px; height: 32px; }
  .mobile-rank-card .rank { color: var(--gold-hi); font: 800 1.05rem var(--font-display); }
  .mobile-rank-card strong { display: block; font: 800 1.12rem var(--font-display); overflow-wrap: anywhere; }
  .mobile-rank-card .player-name-with-medal { justify-content: flex-start; }
  .mobile-rank-card .player-medal { width: 27px; height: 27px; }
  .mobile-rank-card small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.25; }
  .mobile-rank-card b { color: var(--gold-hi); font: 800 1.2rem var(--font-display); white-space: nowrap; }
  .mobile-rank-card b span { display: block; color: var(--muted); font: 600 .7rem var(--font-display); text-align: right; text-transform: uppercase; }
  .ranking-count { text-align: left; }
  .lineup-section { margin-top: 19px; padding: 20px 15px; }
  .lineup-head { align-items: start; }
  .lineup-head p { font-size: .84rem; }
  .lineup-grid { gap: 10px; }
  .lineup-card { min-height: 288px; padding: 7px; }
  .lineup-card-top { height: 43px; padding: 2px 6px; }
  .lineup-card-top img { width: 55px; height: 20px; }
  .lineup-rank b { font-size: 1.65rem; }
  .lineup-rank small { font-size: .56rem; }
  .lineup-portrait { min-height: 135px; margin: 0 2px; }
  .lineup-nameplate { min-height: 50px; margin-top: -15px; }
  .lineup-nameplate strong { font-size: 1.2rem; }
  .lineup-bottom { grid-template-columns: 1.14fr .7fr 1fr; min-height: 49px; margin-top: 5px; padding: 4px 1px; }
  .lineup-bottom b { font-size: .95rem; }
  .lineup-bottom span:first-child b { font-size: 1.16rem; }
  .lineup-bottom small { font-size: .53rem; letter-spacing: .02em; }
  .footer-inner { display: block; padding: 23px 16px; }
  .footer-inner > * { display: block; margin: 0 0 9px !important; }
  .footer-inner small { line-height: 1.4; }
}

@media (max-width: 520px) {
  .rank-toolbar { flex-direction: column; align-items: stretch; }
  .sort-field { width: 100%; }
  .sort-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sort-button { width: 100%; }
  .lineup-head { flex-direction: column; gap: 12px; }
  .lineup-grid { grid-template-columns: minmax(0, 340px); justify-content: center; }
  .lineup-card { min-height: 322px; }
  .lineup-nameplate strong { font-size: 1.4rem; }
  .lineup-rank b { font-size: 1.75rem; }
  .lineup-rank small { font-size: .58rem; }
  .lineup-bottom b { font-size: 1.12rem; }
  .lineup-bottom span:first-child b { font-size: 1.4rem; }
  .lineup-bottom small { font-size: .64rem; letter-spacing: .05em; }
}

@media (max-width: 380px) {
  .header-inner { padding: 0 10px; gap: 7px; }
  .wordmark img { width: 91px; }
  .site-header nav { gap: 2px; }
  .site-header nav a { font-size: .76rem; }
  .section-heading p { font-size: .7rem; }
  .intro-banner { width: 158px; height: 158px; margin-inline: -25px -17px; }
  .intro-copy { min-height: 225px; gap: 8px; }
  .intro-copy h1 { font-size: 2rem; }
  .eyebrow { font-size: .63rem; letter-spacing: .09em; }
  .eyebrow span { padding: 0 .2em; }
  .intro-lead { margin-bottom: 13px; font-size: .77rem; }
  .hero-create-room { gap: 6px; min-height: 44px; padding: 7px 10px; font-size: .85rem; }
  .hero-create-room svg { width: 15px; height: 15px; }
  .intro-data { gap: 8px; padding: 12px; }
  .intro-metrics { gap: 5px; }
  .intro-metrics > div { grid-template-columns: 22px auto; column-gap: 6px; }
  .intro-metrics svg { width: 20px; height: 20px; }
  .intro-metrics dd { font-size: 1.38rem; }
  .intro-metrics dt { font-size: .7rem; }
  .scoring { gap: 3px 5px; }
  .scoring svg { width: 15px; height: 15px; margin-right: 1px; }
  .scoring > div span { font-size: .72rem; }
  .scoring strong { font-size: .87rem; }
  .mobile-rank-card { gap: 5px; padding: 9px; }
  .mobile-rank-card small { font-size: .73rem; }
  .lineup-grid { grid-template-columns: 1fr; }
  .lineup-card { min-height: 322px; padding: 8px; }
  .lineup-card-top { height: 43px; }
  .lineup-portrait { min-height: 170px; }
  .lineup-nameplate strong { font-size: 1.4rem; }
  .lineup-bottom b { font-size: 1.1rem; }
  .lineup-bottom span:first-child b { font-size: 1.4rem; }
  .lineup-bottom small { font-size: .64rem; }
}

@media (max-height: 460px) {
  .dialog-portrait { min-height: 0; }
  .dialog-portrait::after { width: min(50%, 130px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  body::before { animation: none !important; opacity: .36; transform: none; }
  .intro-banner__base { clip-path: none; }
  .intro-banner__side, .intro-banner__fabric { display: none; }
}
