/* Bundled fonts from Winter Moon Dashboard.html */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/dashboard/fonts/inter.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url('/dashboard/fonts/jetbrains-mono.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/dashboard/fonts/space-grotesk.woff2') format('woff2');
}

body {
  margin: 0;
}

.wm {
  --bg: #080913;
  --surf: #111324;
  --surf2: #1A1D36;
  --line: #2C3057;
  --text: #F5F3FC;
  --mute: #C4C0DC;
  --faint: #8D88B0;
  --ice: #F2CE74;
  --moon: #FAE29C;
  --lunar-glow: #C8BFFF;
  --win: #F2CE74;
  --loss: #F07A67;
  --van: #8F9BFF;
  --due: #F7839D;
  --str: #7FE3C3;
  --on: #090A14;
  --onrole: #090A14;
  background:
    radial-gradient(ellipse 920px 460px at 80% -10%, rgba(242, 206, 116, 0.12), rgba(200, 191, 255, 0.05) 45%, transparent 72%),
    radial-gradient(ellipse 640px 380px at 10% 105%, rgba(200, 191, 255, 0.06), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}

.wm.light {
  --bg: #F4F2EA;
  --surf: #FFFFFF;
  --surf2: #EAE6D9;
  --line: #D6D0BE;
  --text: #141326;
  --mute: #4A4766;
  --faint: #6D698A;
  --ice: #9E7312;
  --moon: #B88614;
  --lunar-glow: #5B4FC8;
  --win: #9E7312;
  --loss: #C4493A;
  --van: #4956C8;
  --due: #C4365C;
  --str: #1C7D60;
  --on: #FFFFFF;
  --onrole: #FFFFFF;
  background:
    radial-gradient(ellipse 900px 420px at 80% -10%, rgba(212, 168, 67, 0.14), transparent 70%),
    var(--bg);
}

a {
  color: var(--ice);
}
a:hover {
  color: var(--text);
}

.shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Fixed-width column. The explicit width, min-width: 0 and horizontal clipping stop Safari from widening it to fit
   wide children (an AdSense iframe) and pushing into the main column. */
.side {
  flex: 0 0 260px;
  width: 260px;
  min-width: 0;
  max-width: 260px;
  box-sizing: border-box;
  padding: 20px 14px;
  background: var(--surf);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* Stays in view while the page scrolls; scrolls on its own when the window is short. */
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 820px) {
  /* Top bar, then content, stacked; the sidebar is a fixed full-screen menu (see the phones section below). */
  .shell {
    flex-direction: column;
  }
  .main {
    flex: 1 1 auto;
  }
  .side {
    max-width: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    position: static;
    height: auto;
    overflow: visible;
  }
}

.main {
  flex: 1 1 0%;
  min-width: 0;
  box-sizing: border-box;
  padding: 28px 32px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.view-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.view-panel[hidden] {
  display: none !important;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  min-height: 44px;
  border-radius: 8px;
  color: var(--mute);
  text-decoration: none;
  font-weight: 500;
  border: 0;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
}
.nav:hover {
  background: var(--surf2);
  color: var(--text);
}
.nav.on {
  background: linear-gradient(90deg, rgba(242, 206, 116, 0.14) 0%, var(--surf2) 100%);
  color: var(--ice);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--ice);
}
.nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.card {
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  box-sizing: border-box;
  min-width: 0;
}

.h {
  font-family: 'Space Grotesk', Inter, sans-serif;
  letter-spacing: -0.01em;
}

.lbl {
  font-size: 12px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--mute);
}
.faint {
  color: var(--faint);
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.mvp {
  background: var(--moon);
  color: var(--on);
}

.svp {
  border: 1px solid var(--moon);
  color: var(--moon);
}

.flag {
  border: 1px solid var(--line);
  color: var(--mute);
}

.av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--onrole);
  flex: none;
  overflow: hidden;
  box-sizing: border-box;
}

.av img.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.av.has-img {
  padding: 2px;
}

.rank-ico {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: none;
  display: inline-block;
  vertical-align: middle;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.rank-ico-lg {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex: none;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.map-thumb {
  width: 46px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--line);
  flex: none;
  display: block;
}

.map-thumb-lg {
  width: 58px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--line);
  flex: none;
  display: block;
}

.ban img.ban-ico {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  opacity: 0.85;
}

.r-van {
  background: var(--van);
}
.r-due {
  background: var(--due);
}
.r-str {
  background: var(--str);
}

.t-van {
  color: var(--van);
}
.t-due {
  color: var(--due);
}
.t-str {
  color: var(--str);
}

.crest {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 14px 'Space Grotesk', sans-serif;
  background: var(--surf2);
  border: 1px solid var(--line);
  color: var(--text);
  flex: none;
}

.bar {
  height: 6px;
  background: var(--surf2);
  border-radius: 99px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--ice);
  border-radius: 99px;
}
.bar.bar-loss {
  height: 8px;
}
.bar.bar-loss i {
  background: var(--loss);
}

.res {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--on);
  flex: none;
}
.res.W {
  background: var(--win);
}
.res.L {
  background: var(--loss);
}

.up {
  color: var(--win);
}
.down {
  color: var(--loss);
}

/* Overview: enemy matchups (strong against / struggle against) */
.mu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.mu-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.mu-head {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mu-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surf2);
}
.mu-name {
  min-width: 0;
  flex: 1;
}
.mu-name > div:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mu-rate {
  text-align: right;
  flex: none;
}
.mu-empty {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--line);
}
.mu-note {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
}
.mu-note a {
  color: var(--ice);
}
/* Map banners from the game, cropped to a strip */
.map-card {
  flex: none;
  display: block;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surf);
  border: 1px solid var(--line);
}
.map-card.md {
  width: 96px;
  height: 40px;
}
.map-card.sm {
  width: 64px;
  height: 27px;
}
.map-card.none {
  background: repeating-linear-gradient(135deg, var(--surf), var(--surf) 6px, var(--surf2) 6px, var(--surf2) 12px);
}
.mu-more {
  font-size: 12px;
  color: var(--ice);
  text-decoration: none;
}
.mu-more:hover {
  text-decoration: underline;
}

/* Matchups view: every map and every enemy hero */
#view-matchups .view-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mu-switch {
  align-self: flex-start;
}
.mu-switch button {
  min-height: 40px;
  padding: 0 18px;
  font-weight: 600;
}
.mu-card[hidden] {
  display: none;
}
.mu-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.mu-card-head h2 {
  margin: 0;
  font-size: 18px;
}
.mu-card-sub {
  font-size: 12px;
  margin-top: 4px;
}
.mu-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.mu-hide[aria-pressed="true"] {
  border-color: var(--van);
  color: var(--van);
}
.mu-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mu-line {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(150px, 1fr) minmax(90px, 1.2fr) 90px 92px;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surf2);
}
.mu-line.few > :not(.mu-wr) {
  opacity: 0.72;
}
.mu-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.mu-who-text {
  min-width: 0;
}
.mu-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.mu-small {
  font-size: 11px;
}
.mu-rec {
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
}
/* Confidence label under a win rate, with the range explained in a tooltip (hover, tap or keyboard focus) */
.has-tip {
  position: relative;
  outline: none;
}
.has-tip:focus-visible {
  box-shadow: 0 0 0 2px var(--ice);
  border-radius: 3px;
}
.mu-conf {
  position: relative;
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  cursor: help;
  border-bottom: 1px dotted currentColor;
  outline: none;
}
.mu-conf.solid {
  color: var(--win);
}
.mu-conf.unsure {
  color: var(--mute);
}
.mu-conf.few {
  color: var(--faint);
}
.mu-conf:focus-visible {
  box-shadow: 0 0 0 2px var(--ice);
  border-radius: 3px;
}
.mu-tip {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: 240px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s;
  pointer-events: none;
}
.has-tip:hover .mu-tip,
.has-tip:focus .mu-tip {
  opacity: 1;
  visibility: visible;
}
.mu-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--line);
}
.mu-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 4px;
  background: var(--ice);
}
.mu-bar b {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  margin-left: -1px;
  background: var(--text);
  opacity: 0.7;
}
.mu-wr {
  text-align: right;
}
.mu-big {
  font-weight: 700;
  font-size: 16px;
}
.mu-diff {
  text-align: right;
  white-space: nowrap;
}
.mu-gap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  cursor: help;
}
.mu-gap-num {
  font-weight: 700;
  font-size: 15px;
}
.mu-gap-lbl {
  border-bottom: 1px dotted currentColor;
}
@media (max-width: 760px) {
  .mu-line {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "who who who"
      "rec wr diff"
      "bar bar bar";
    gap: 6px 12px;
  }
  .mu-who {
    grid-area: who;
  }
  .mu-wr {
    grid-area: wr;
  }
  .mu-diff {
    grid-area: diff;
  }
  .mu-rec {
    grid-area: rec;
  }
  .mu-bar {
    grid-area: bar;
  }
}

.scroll {
  overflow-x: auto;
}

table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.t th {
  text-align: left;
  font-size: 11px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.t td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
.t tr:last-child td {
  border-bottom: 0;
}
.t tr.me td {
  background: var(--surf2);
}

.btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surf2);
  color: var(--text);
  font: 600 13px Inter, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-sizing: border-box;
}
.btn:hover {
  border-color: var(--ice);
}
.btn.pri {
  background: var(--ice);
  border-color: var(--ice);
  color: var(--on);
}
.btn.pri-moon {
  background: var(--moon);
  border-color: var(--moon);
  color: var(--on);
}
.btn.ghost {
  background: transparent;
}
.btn.sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--mute);
  font: 600 13px Inter, sans-serif;
  cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--surf2);
  color: var(--text);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: var(--surf2);
  font-size: 13px;
  font-weight: 500;
}
.chip .av {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.ban {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px dashed var(--loss);
  font-size: 13px;
  color: var(--mute);
  text-decoration: line-through;
}

.sev {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.sev.hi {
  background: var(--loss);
  color: var(--on);
}
.sev.md {
  border: 1px solid var(--loss);
  color: var(--loss);
}
.sev.lo {
  border: 1px solid var(--ice);
  color: var(--ice);
}

.tg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 500 14px Inter, sans-serif;
  text-align: left;
  cursor: pointer;
}
.tg:hover {
  background: var(--surf2);
}
.tg .sw {
  width: 40px;
  height: 24px;
  border-radius: 99px;
  background: var(--line);
  position: relative;
  flex: none;
}
.tg .sw::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--mute);
  transition: left 0.15s ease;
}
.tg[aria-pressed="true"] .sw {
  background: var(--ice);
}
.tg[aria-pressed="true"] .sw::after {
  left: 19px;
  background: var(--on);
}

input.in,
select.in {
  min-height: 44px;
  box-sizing: border-box;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: 14px Inter, sans-serif;
  flex: 1 1 200px;
  min-width: 0;
}
input.in::placeholder {
  color: var(--faint);
}

.date {
  width: 52px;
  flex: none;
  text-align: center;
  border-radius: 10px;
  background: var(--surf2);
  padding: 6px 0;
}

/* Ad slots: shown only for Free users, hidden completely for Paid (Pro / Guild Pro / Unlimited) users */
.ad-slot {
  background: var(--surf);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  box-sizing: border-box;
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
/* Keep AdSense units inside their box. */
.ad-slot ins.adsbygoogle {
  max-width: 100%;
  overflow: hidden;
  background: transparent;
}
/* Ad iframes are light-scheme documents. On a dark color-scheme page (phones in dark mode) the browser paints an
   opaque white backdrop behind an iframe whose scheme doesn't match; matching it keeps the iframe transparent. */
.ad-slot ins.adsbygoogle iframe {
  color-scheme: light;
  max-width: 100%;
}
/* Collapse units AdSense couldn't fill instead of leaving an empty box; the Lunar promo copy still shows. */
.ad-slot ins.adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}
.wm.ad-free .ad-slot,
.ad-slot[hidden] {
  display: none !important;
}
.ad-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(90deg, var(--surf) 0%, var(--surf2) 100%);
}
.ad-side {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surf2);
}
.ad-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg);
  color: var(--faint);
  border: 1px solid var(--line);
}

/* Tier & Settings modal / drawer */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 22, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-backdrop[hidden] {
  display: none !important;
}
.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surf2);
  color: var(--text);
  border: 1px solid var(--ice);
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 13px;
  z-index: 200;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}
.toast[hidden] {
  display: none !important;
}

.dd-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}
.dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 190px;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  box-sizing: border-box;
  z-index: 60;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dd-menu.dd-up {
  top: auto;
  bottom: calc(100% + 4px);
}
.dd-menu[hidden] {
  display: none !important;
}
.dd-item {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: 500 13px Inter, sans-serif;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dd-item:hover {
  background: var(--surf2);
}
.dd-item.on {
  background: var(--surf2);
  color: var(--ice);
  font-weight: 600;
}

/* Public site (lunartracker.app): LAN-only tools are hidden. */
.is-public [data-lan-only] {
  display: none !important;
}

.sample-note {
  border: 1px dashed var(--moon);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  background: var(--surf2);
}

.session-empty {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#view-session:not(.is-empty) .session-empty,
#view-session.is-empty > section {
  display: none !important;
}

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

/* Live views */
.view-empty {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.view-empty[hidden],
.view-body[hidden] {
  display: none !important;
}

.view-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover td,
tr.clickable:focus-visible td {
  background: var(--surf2);
}

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 13px;
}

.kv dd {
  margin: 0;
}

img[hidden] {
  display: none !important;
}

/* `hidden` always hides, whatever display a class or inline style sets. */
[hidden] {
  display: none !important;
}

/* Form fields stacked under a label: natural height, full width. */
label > .in {
  flex: none;
  width: 100%;
}

/* Stat cards: one grid, equal heights per row, and room for a two-line caption so a card doesn't grow
   when its caption wraps (or shrink when it doesn't). */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.stats > .card {
  display: flex;
  flex-direction: column;
}

.stats > .card.wide {
  grid-column: span 2;
}

@media (max-width: 520px) {
  /* Two narrow columns on a phone: the rank card takes the whole row. */
  .stats > .card.wide {
    grid-column: 1 / -1;
  }
}

.stats .muted {
  min-height: calc(2 * 1.45em);
  line-height: 1.45;
}

/* ---------------------------------------------------------------- phones */
.topbar {
  display: none;
}

.menu-close {
  display: none;
}

@media (max-width: 820px) {
  /* A slim top bar; the sidebar becomes a full-screen menu behind the menu button. */
  .topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    position: sticky;
    top: 0;
    z-index: 80;
    background: var(--surf);
    border-bottom: 1px solid var(--line);
  }

  .menu-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }

  .menu-btn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 17px;
  }

  .side {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 90;
    width: 100%;
    max-width: none;
    height: 100%;
    overflow-y: auto;
    border: 0;
    padding: 16px 16px max(16px, env(safe-area-inset-bottom));
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.28s;
  }

  .wm.menu-open .side {
    transform: none;
    visibility: visible;
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
  }

  /* The links follow the panel in, one after another. */
  .wm.menu-open .side .nav {
    animation: rise-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .wm.menu-open .side .nav:nth-of-type(2) { animation-delay: 0.03s; }
  .wm.menu-open .side .nav:nth-of-type(3) { animation-delay: 0.06s; }
  .wm.menu-open .side .nav:nth-of-type(4) { animation-delay: 0.09s; }
  .wm.menu-open .side .nav:nth-of-type(5) { animation-delay: 0.12s; }

  .wm.menu-open .menu-close {
    display: inline-flex;
  }

  .wm.menu-open .side .nav {
    min-height: 48px;
    font-size: 16px;
  }

  .main {
    padding: 20px 16px 40px;
  }

  /* Ads stay out of the way: one in the menu (below the links), and one after the page's content instead of a
     banner above it plus a footer ad. */
  #ad-footer {
    display: none !important;
  }

  #ad-banner {
    order: 1;
    padding: 10px 12px;
    gap: 10px;
  }

  #ad-banner .faint {
    display: none;
  }

  .main > .view-panel {
    order: 0;
  }
}

/* No page scrolling behind the open menu. */
body.menu-locked {
  overflow: hidden;
}

/* Long unbroken names (a server id, a player name) wrap instead of widening the page. */
.h,
.view-panel header > div {
  overflow-wrap: anywhere;
  min-width: 0;
}

.clip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* An empty segmented control (no map stages) draws nothing. */
.seg:empty {
  display: none;
}

@media (max-width: 520px) {
  /* An odd last stat card takes the whole row instead of sitting alone in half of it (in grids whose cards
     are all one column wide: with a full-row rank card the count is already even). */
  .stats:not(:has(> .wide)) > .card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  /* Tilt reasons: the text gets the full width, the bar goes under it, the points stay at the right. */
  .reason-row {
    grid-template-columns: minmax(0, 1fr) 44px !important;
    row-gap: 6px !important;
  }

  .reason-row > .bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  /* The per-match chart keeps readable labels and scrolls sideways. */
  .chart-scroll > svg {
    min-width: 560px;
  }

  /* Roster rows: the name keeps its room; "Linked" is implied by being on the roster. */
  .roster-src {
    display: none;
  }
}

@media (max-width: 520px) {
  /* Two stat cards per row on any phone, rather than one tall column below 360 px. */
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .stats > .card {
    padding: 14px;
  }

  /* Settings lists: the label above its value. */
  .kv {
    grid-template-columns: 1fr;
    row-gap: 2px;
  }

  .kv dd {
    margin-bottom: 8px;
  }
}

/* ---------------------------------------------------------------- motion */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes slide-down {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(12px); }
}

@keyframes busy-sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

/* A view eases in each time it's shown. */
.view-panel:not([hidden]) {
  animation: rise-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Data arriving in a view fades in rather than popping. */
.view-body:not([hidden]),
.view-empty:not([hidden]) {
  animation: fade-in 0.2s ease both;
}

.dd-menu:not([hidden]) {
  animation: pop-in 0.14s ease-out both;
  transform-origin: top center;
}

.modal-backdrop:not([hidden]) {
  animation: fade-in 0.18s ease both;
}

.modal-backdrop:not([hidden]) .modal-card {
  animation: pop-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.toast:not([hidden]) {
  animation: slide-up 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.toast.leaving {
  animation: slide-down 0.2s ease-in both;
}

.nav,
.btn,
.seg button,
.dd-item,
tr.clickable td {
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Loading: a thin moonlight sweep along the top while anything is fetching. */
.busy-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 300;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.busy-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--moon), transparent);
  animation: busy-sweep 1s ease-in-out infinite;
}

.busy-bar.on {
  opacity: 1;
}

/* People who ask their system for less motion get none of it. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Heatmap legend swatch, matching the canvas palette. */
.heat-scale {
  display: inline-block;
  width: 90px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(59, 76, 192, 0.55), rgba(79, 195, 247, 0.75), rgba(242, 206, 116, 0.85),
    rgba(240, 122, 103, 0.92), rgba(255, 250, 240, 0.96));
}

.finding.mine {
  box-shadow: inset 3px 0 0 var(--moon);
}

/* Analysed matches. */
.pill.an {
  background: transparent;
  color: var(--lunar-glow);
  border: 1px solid var(--lunar-glow);
  white-space: nowrap;
}

.finding-clip {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  border-radius: 8px;
  margin-top: 6px;
  background: var(--bg);
}

/* Finding clip player: map-only video with the HUD drawn from hud.json above it. */
.fclip-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  margin-top: 8px;
}
.fclip-main {
  flex: 1 1 420px;
  min-width: 0;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  outline: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  box-sizing: border-box;
}
/* Scrubber, transport, Jump to and layers share one padded panel under the map. */
.fclip-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surf);
}
/* Times sit either side of the scrubber instead of on a row of their own. */
.fclip-panel .fclip-scrub {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
}
.fclip-panel .fclip-scrub .fclip-track {
  grid-column: 2;
  grid-row: 1;
}
.fclip-panel .fclip-scrub .fclip-times {
  display: contents;
}
.fclip-panel .fclip-scrub .fclip-times > :first-child {
  grid-column: 1;
  grid-row: 1;
  color: var(--mute);
}
.fclip-panel .fclip-scrub .fclip-times > :last-child {
  grid-column: 3;
  grid-row: 1;
}
.fclip-main:focus-visible {
  box-shadow: 0 0 0 2px var(--ice);
}
.fclip-main:fullscreen {
  max-width: none;
  padding: 24px;
  justify-content: center;
}
.fclip-main:fullscreen .fclip-video {
  max-height: 70vh;
  width: auto;
  margin: 0 auto;
}
.fclip-hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surf2);
}
.fclip-team {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}
.fclip-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  transition: opacity 0.15s;
}
.fclip-tile img,
.fclip-ini {
  width: 100%;
  max-width: 28px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid var(--van);
  background: var(--surf);
}
.fclip-tile.enemy img,
.fclip-tile.enemy .fclip-ini {
  border-color: var(--loss);
}
.fclip-ini {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  box-sizing: border-box;
}
.fclip-tile.down {
  opacity: 0.35;
}
.fclip-hp,
.fclip-ult {
  display: block;
  width: 100%;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.fclip-hp {
  height: 4px;
}
.fclip-ult {
  height: 3px;
}
.fclip-hp > span,
.fclip-ult > span {
  display: block;
  height: 100%;
  background: var(--str);
  transition: width 0.12s linear;
}
.fclip-hp > span.low {
  background: var(--loss);
}
.fclip-ult > span {
  background: var(--faint);
}
.fclip-ult.ready > span {
  background: var(--ice);
}
.fclip-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.fclip-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
}
.fclip-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--mute);
}
.fclip-bars {
  display: flex;
  gap: 10px;
}
.fclip-bars:empty {
  display: none;
}
.fclip-obj {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
}
.fclip-obj.enemy {
  text-align: right;
}
.fclip-obj-track {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.fclip-obj-track > span {
  display: block;
  height: 100%;
  background: var(--mute);
}
.fclip-obj.own {
  color: var(--van);
}
.fclip-obj.own .fclip-obj-track > span {
  background: var(--van);
}
.fclip-obj.enemy {
  color: var(--loss);
}
.fclip-obj.enemy .fclip-obj-track {
  transform: scaleX(-1);
}
.fclip-obj.enemy .fclip-obj-track > span {
  background: var(--loss);
}
.fclip-status {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--mute);
}
.fclip-status:empty {
  display: none;
}
.fclip-status.own {
  color: var(--van);
}
.fclip-status.enemy {
  color: var(--loss);
}
.fclip-status.contested {
  color: var(--ice);
}
.fclip-stage {
  position: relative;
}
.fclip-stage.interactive {
  aspect-ratio: 576 / 543;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
  user-select: none;
}
.fclip-stage.interactive .fclip-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  touch-action: none;
}
.fclip-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--bg);
}
.fclip-full {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(17, 19, 36, 0.88);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.fclip-full:hover {
  background: var(--surf2);
  border-color: var(--ice);
}
.fclip-zoom {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(17, 19, 36, 0.88);
  backdrop-filter: blur(4px);
  z-index: 10;
}
.fclip-zoom-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: 600 13px Inter, sans-serif;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.fclip-zoom-btn:hover {
  background: var(--surf2);
  color: var(--ice);
}
.fclip-zoom-btn.reset {
  width: auto;
  padding: 0 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--faint);
}
.fclip-zoom-btn.reset.active {
  color: var(--van);
  font-weight: 700;
}
.fclip-main:fullscreen {
  background: #090a0f;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
  gap: 8px;
}
.fclip-main:fullscreen .fclip-stage {
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100vh - 250px);
  width: auto;
  aspect-ratio: 576 / 543;
  margin: 0 auto;
}
.fclip-main:fullscreen .fclip-hud,
.fclip-main:fullscreen .fclip-bars,
.fclip-main:fullscreen .fclip-status,
.fclip-main:fullscreen .fclip-scrub,
.fclip-main:fullscreen .fclip-controls,
.fclip-main:fullscreen .fclip-layers,
.fclip-main:fullscreen .fclip-panel,
.fclip-main:fullscreen .fclip-jumps-slot,
.fclip-main:fullscreen > .fclip-jumps {
  width: 100%;
  max-width: 720px;
}
.fclip-track {
  position: relative;
  height: 22px;
}
.fclip-track input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  accent-color: var(--ice);
  cursor: pointer;
}
.fclip-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.fclip-mark {
  position: absolute;
  top: 1px;
  width: 3px;
  height: 20px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--loss);
  opacity: 0.85;
}
.fclip-mark.own.ko {
  background: var(--van);
}
.fclip-mark.ult {
  background: var(--lunar-glow);
}
.fclip-times {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--faint);
}
.fclip-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.fclip-controls .btn {
  min-width: 40px;
  min-height: 40px;
  justify-content: center;
}
.fclip-controls .fclip-play {
  min-width: 48px;
}
.fclip-speed {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-left: 12px;                 /* 6 px inside a group, 12 px between groups */
}
.fclip-layers-toggle {
  margin-left: auto;
}
.fclip-layers-toggle[aria-expanded="true"] {
  border-color: var(--van);
  color: var(--van);
}
.fclip-speed button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  background: var(--surf);
  color: var(--mute);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.fclip-speed button[aria-pressed="true"] {
  background: var(--line);
  color: var(--text);
  font-weight: 600;
}
.fclip-controls .btn[aria-pressed="false"] {
  color: var(--faint);
}
.fclip-jumps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.fclip-jumps-lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-right: 2px;
}
.fclip-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surf2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.fclip-jump:hover,
.fclip-jump:focus-visible {
  border-color: var(--ice);
}
.fclip-jump-text {
  min-width: 0;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fclip-jump-t {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--faint);
}
.fclip-jumps-slot:empty {
  display: none;
}
.fclip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--loss);
}
.fclip-dot.own.ko {
  background: var(--van);
}
.fclip-dot.ult {
  background: var(--lunar-glow);
}
.fclip-tile {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.fclip-tile.hovered {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--lunar-glow);
  border-radius: 6px;
}
.fclip-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  touch-action: manipulation;
}
.fclip-popover {
  position: absolute;
  z-index: 15;
  width: 240px;
  max-width: calc(100% - 16px);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--lunar-glow);
  background: rgba(13, 15, 22, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}
.fclip-pop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.fclip-pop-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--lunar-glow);
  background: var(--bg);
}
.fclip-pop-titles {
  min-width: 0;
  flex: 1;
}
.fclip-pop-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fclip-pop-name.subject {
  color: var(--lunar-glow);
}
.fclip-pop-name.own {
  color: var(--van);
}
.fclip-pop-name.enemy {
  color: var(--loss);
}
.fclip-pop-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--mute);
}
.fclip-pop-ultcast {
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(242, 206, 116, 0.16);
  border: 1px solid rgba(242, 206, 116, 0.45);
  color: var(--lunar-glow);
  font-size: 10px;
  font-weight: 700;
}
.fclip-pop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.fclip-pop-lbl {
  color: var(--mute);
  font-weight: 600;
}
.fclip-pop-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text);
}
.fclip-pop-val.ready {
  color: var(--lunar-glow);
}
.fclip-pop-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.fclip-pop-fill {
  display: block;
  height: 100%;
}
.fclip-pop-fill.hp.own {
  background: var(--van);
}
.fclip-pop-fill.hp.enemy {
  background: var(--loss);
}
.fclip-pop-fill.hp.low {
  background: var(--loss);
}
.fclip-pop-fill.sh {
  background: #7ee2b8;
}
.fclip-pop-fill.ult {
  background: var(--ice);
}
.fclip-pop-fill.ult.ready {
  background: var(--lunar-glow);
}
.fclip-pop-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  color: var(--mute);
}
.fclip-pop-prox.danger {
  color: var(--loss);
  font-weight: 700;
}
.fclip-layers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.fclip-layers[hidden],
.fclip-jumps-slot:empty,
.fclip-jumps-host:empty {
  display: none;
}
.fclip-layers-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  margin-right: 2px;
}
.fclip-layer-btn {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--faint);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.fclip-layer-btn[aria-pressed="false"] {
  background: transparent;
}
.fclip-layer-btn[aria-pressed="true"] {
  border-color: var(--van);
  background: rgba(79, 195, 247, 0.14);
  color: var(--van);
}
.fclip-layers-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--faint);
}

/* Findings theater, layout C: the player on the left; on the right the open finding's note and a playlist of
   every finding. Below 860 px of room the note goes first, then the player, then the list. */
#m-findings {
  container-type: inline-size;
}
.findings-theater {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas:
    "player head"
    "player note"
    "player list";
  gap: 12px 16px;
  align-items: start;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.findings-player {
  grid-area: player;
  min-width: 0;
}
.findings-player .fclip-layout {
  margin-top: 0;
}
.findings-player .fclip-main {
  max-width: none;
}
.findings-rail-head {
  grid-area: head;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.findings-rail-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.findings-rail-nav {
  display: flex;
  gap: 6px;
}
.findings-nav {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surf2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.findings-nav:hover:not(:disabled) {
  border-color: var(--van);
}
.findings-nav:disabled {
  opacity: 0.4;
  cursor: default;
}
.findings-note {
  grid-area: note;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--van);
  background: var(--surf2);
}
.findings-note-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
}
.findings-note .h-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.findings-note-who {
  font-size: 12px;
}
.findings-note-summary {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.findings-note-reasons {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.findings-note-chance {
  font-size: 12px;
  font-weight: 500;
}
.fclip-jumps-host {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.findings-list-cell {
  grid-area: list;
  align-self: stretch;
  position: relative;
  min-height: 220px;
}
.findings-list {
  position: absolute;      /* sized by the player's height, scrolls inside it */
  inset: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}
.findings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.findings-row:hover:not(:disabled) {
  border-color: var(--ice);
}
.findings-row.active {
  border-color: var(--van);
  background: var(--surf2);
}
.findings-row:disabled {
  opacity: 0.6;
  cursor: default;
}
.findings-row .f-tab-num {
  flex: none;
}
.findings-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.findings-row-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.findings-row-who {
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@container (max-width: 860px) {
  .findings-theater {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "head" "note" "player" "list";
    padding: 12px;
  }
  .findings-list-cell {
    min-height: 0;
  }
  .findings-list {
    position: static;
    max-height: 360px;
  }
}
.f-tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.f-tab-dot.hi { background: var(--loss); }
.f-tab-dot.md { background: var(--lunar-glow); }
.f-tab-dot.lo { background: var(--mute); }

.f-tab-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--faint);
}
.f-tab.active .f-tab-num {
  color: var(--van);
}

.fclip-loading-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 15, 22, 0.9);
  border: 1px solid var(--van);
  color: var(--van);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  z-index: 20;
  pointer-events: none;
}

/* Links to the public site pages (Privacy, Terms, guides) under the dashboard. */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 18px 0 8px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.site-foot a {
  color: var(--faint);
  text-decoration: none;
}
.site-foot a:hover {
  color: var(--text);
}
