:root {
  --bg: #050814;
  --bg-elev: #0b1224;
  --bg-card: rgba(14, 22, 44, 0.86);
  --line: rgba(146, 176, 255, 0.16);
  --cyan: #2ee6ff;
  --cyan-dim: rgba(46, 230, 255, 0.14);
  --violet: #8b6cff;
  --violet-dim: rgba(139, 108, 255, 0.18);
  --text: #eef4ff;
  --muted: #93a0c2;
  --up: #3dffb0;
  --down: #ff6b8a;
  --same: #7f8db3;
  --radius: 20px;
  --tap: 48px;
  --shadow: 0 18px 50px rgba(2, 6, 20, 0.45);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, "Segoe UI", system-ui, sans-serif;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(46, 230, 255, 0.16), transparent 55%),
    radial-gradient(700px 380px at 100% 8%, rgba(139, 108, 255, 0.2), transparent 50%),
    linear-gradient(180deg, #081022 0%, #050814 42%, #07061a 100%);
  z-index: -1;
}

.bg-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(146, 176, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(146, 176, 255, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--cyan);
  color: #041018;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 10;
}

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

.site-header,
main,
.site-footer {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 22px 0 8px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 18px;
}

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

.brand-name {
  margin: 0;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 0.9;
  text-transform: uppercase;
}

.brand-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.page-title {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 7vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

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

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 20, 42, 0.8);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.meta-chip.source {
  color: var(--cyan);
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 12px 0 10px;
  background: linear-gradient(180deg, rgba(5, 8, 20, 0.96), rgba(5, 8, 20, 0.72) 70%, transparent);
  backdrop-filter: blur(10px);
}

.toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0a1226;
}

.toggle-btn {
  min-height: var(--tap);
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.toggle-btn.is-active {
  background: linear-gradient(180deg, rgba(46, 230, 255, 0.2), rgba(139, 108, 255, 0.16));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(46, 230, 255, 0.28);
}

.toolbar-note {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.board {
  display: grid;
  gap: 12px;
  padding-bottom: 28px;
}

.conf-block {
  display: grid;
  gap: 10px;
}

.conf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 2px 0;
}

.conf-head h2 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.conf-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.row {
  display: grid;
  grid-template-columns: 42px 4px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.row-1 {
  border-color: rgba(46, 230, 255, 0.38);
  background:
    linear-gradient(180deg, rgba(46, 230, 255, 0.08), transparent 48%),
    var(--bg-card);
}

.rank {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: var(--cyan);
}

.mark {
  width: 56px;
  height: 56px;
}

.mark svg,
.mark-img {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.row-main {
  min-width: 0;
}

.row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.team-name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.record {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.row-mid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.move {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.move.up {
  color: var(--up);
}

.move.down {
  color: var(--down);
}

.move.same {
  color: var(--same);
}

.next {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.next-label {
  display: block;
  margin-bottom: 2px;
  color: var(--violet);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.state {
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

.state-error {
  border-color: rgba(255, 107, 138, 0.4);
}

.retry {
  min-height: var(--tap);
  margin-top: 12px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--cyan);
  color: #041018;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pulse {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--cyan-dim);
  box-shadow: 0 0 0 0 rgba(46, 230, 255, 0.45);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 16px transparent;
  }
}

.site-footer {
  padding: 8px 0 36px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.site-footer p + p {
  margin-top: 10px;
}

.footer-meta {
  color: #6f7c9e;
}

@media (min-width: 720px) {
  .site-header {
    padding-top: 36px;
  }

  .row {
    grid-template-columns: 52px 5px minmax(0, 1fr);
    padding: 16px 18px;
  }

  .team-name {
    font-size: 24px;
  }

  .rank {
    font-size: 40px;
  }

  .mark,
  .mark svg {
    width: 64px;
    height: 64px;
  }

  .team-name {
    font-size: 22px;
  }

  .next {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }

  .next-label {
    margin: 0;
  }
}


.color-pip {
  width: 4px;
  align-self: stretch;
  min-height: 100%;
  border-radius: 99px;
  background: var(--pip, var(--cyan));
  flex: 0 0 auto;
}

.row {
  grid-template-columns: 42px 4px minmax(0, 1fr);
}

.team-name {
  font-family: "Barlow Condensed", Manrope, sans-serif;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* Compact phone: denser one-screen Top 12 */
@media (max-width: 719px) {
  :root {
    --radius: 8px;
    --tap: 32px;
    --shadow: none;
  }

  .site-header,
  main,
  .site-footer {
    width: min(760px, calc(100% - 16px));
  }

  .site-header {
    padding: 6px 0 2px;
  }

  .kicker {
    font-size: 9px;
    gap: 5px;
    letter-spacing: 0.06em;
  }

  .kicker-dot {
    width: 5px;
    height: 5px;
  }

  .brand-row {
    margin: 4px 0 2px;
  }

  .wordmark {
    gap: 8px;
  }

  .wordmark-mark svg {
    width: 22px;
    height: 22px;
  }

  .brand-name {
    font-size: 14px;
    line-height: 1.05;
  }

  .brand-sub {
    font-size: 9px;
    margin-top: 0;
  }

  .page-title {
    margin: 0 0 2px;
    font-size: 1.05rem;
    line-height: 1.05;
  }

  .lede {
    display: none;
  }

  .meta-row {
    gap: 4px;
    margin-top: 4px;
  }

  .meta-chip {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 10px;
    border-radius: 999px;
  }

  .toolbar {
    margin: 6px 0 4px;
  }

  .toggle {
    padding: 2px;
    border-radius: 8px;
    gap: 0;
  }

  .toggle-btn {
    min-height: 26px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
  }

  .toolbar-note {
    display: none;
  }

  .board {
    gap: 2px;
    padding-bottom: 4px;
    min-height: calc(100dvh - 118px);
    display: flex;
    flex-direction: column;
  }

  .conf-block {
    gap: 2px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
  }

  .conf-head {
    margin: 2px 2px 0;
  }

  .conf-head h2 {
    font-size: 11px;
  }

  .conf-head span {
    font-size: 10px;
  }

  .row {
    flex: 1 1 0;
    min-height: 0;
    grid-template-columns: 20px 3px minmax(0, 1fr);
    gap: 4px;
    align-items: center;
    padding: 0 6px 0 4px;
    border-radius: 7px;
  }

  .rank {
    min-height: 0;
    font-size: 15px;
  }

  .mark { display: none; }

  .color-pip {
    width: 3px;
    border-radius: 99px;
  }

  .team-name {
    font-family: "Barlow Condensed", Manrope, sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .row-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    min-width: 0;
  }

  .row-top {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
  }

  .team-name {
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
  }

  .record {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 0;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 800;
    border-radius: 999px;
    white-space: nowrap;
  }

  .row-mid {
    display: flex;
    margin: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    font-size: 9.5px;
    color: var(--muted);
    min-width: 0;
  }

  .row-mid > span {
    white-space: nowrap;
  }

  .row-mid > span:not(.move) {
    display: inline;
  }

  .move {
    font-size: 10px;
  }

  .next {
    display: none;
  }

  .row-next-compact {
    display: block;
    font-size: 9px;
    font-weight: 600;
    color: #7f8db3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
  }

  .site-footer {
    display: none;
  }
}

@media (max-width: 719px) and (max-height: 740px) {
  .page-title {
    display: none;
  }

  .kicker {
    display: none;
  }

  .board {
    min-height: calc(100dvh - 88px);
  }

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

  .team-name {
    font-size: 11px;
  }

  .rank {
    font-size: 14px;
  }

  .toggle-btn {
    min-height: 24px;
    font-size: 10px;
  }
}

/* Rows are tappable buttons */
button.row {
  width: 100%;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button.row:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

body.sheet-open {
  overflow: hidden;
}

.team-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.team-sheet[hidden] {
  display: none;
}

.team-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 20, 0.72);
  backdrop-filter: blur(4px);
}

.team-sheet-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(78dvh, 640px);
  overflow: auto;
  padding: 12px 14px 22px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: #0b1224;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.45);
}

.team-sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.team-sheet-title {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.team-sheet-close {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.sheet-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.sheet-mark { display: none; }

.sheet-name {
  font-family: "Barlow Condensed", Manrope, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.sheet-rank {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-name {
  margin: 2px 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.sheet-loc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.sheet-grid > div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.sheet-grid .sheet-span {
  grid-column: 1 / -1;
}

.sheet-grid dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-grid dd {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.sheet-note {
  margin: 12px 2px 0;
  color: #6f7c9e;
  font-size: 11px;
  line-height: 1.4;
}

@media (min-width: 720px) {
  .team-sheet {
    align-items: center;
    padding: 24px;
  }

  .team-sheet-panel {
    border-radius: 22px;
    border-bottom: 1px solid var(--line);
    max-height: min(80vh, 680px);
  }
}

@media (min-width: 720px) {
  .row-next-compact { display: none; }
}

.sheet-map-wrap {
  margin: 12px 0 4px;
}

.sheet-map-label {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-map-frame {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #07101f;
  aspect-ratio: 959 / 593;
}

.sheet-map-base,
.sheet-map-pins {
  display: block;
  width: 100%;
  height: auto;
}

.sheet-map-pins {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}


.sheet-map-frame svg {
  display: block;
  width: 100%;
  height: 100%;
}
