/* Brawlaris web app — chunky Brawl-style UI in the SolarisClub purple/gold */
:root {
  --bg-1: #160838;
  --bg-2: #2A1060;
  --panel: #3A1A80;
  --panel-2: #4B25A0;
  --panel-3: #5C33BC;
  --ink: #12062B;
  --gold: #FFC21A;
  --gold-2: #FFE06B;
  --gold-dark: #C77700;
  --orange: #FF8A00;
  --text: #FFFFFF;
  --muted: #CBBBF2;
  --green: #36D67E;
  --green-dark: #17884A;
  --red: #FF4D6A;
  --discord: #5865F2;
  --discord-dark: #3B45B8;
  --yt: #FF1F3D;
  --yt-dark: #B0001A;
  --radius: 18px;
  --shadow: 0 6px 0 var(--ink);
  --font: 'Rubik', system-ui, 'Segoe UI', Arial, sans-serif;
  --font-display: 'Lilita One', 'Rubik', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(255, 194, 26, .18), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1) 70%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: inherit; }
img { max-width: 100%; }

/* ─── Top bar ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 20px 10px;
  background: rgba(22, 8, 56, .88);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--ink);
}
/* Logo lockup like the club logo: sun sitting on top of the name */
.brand { display: flex; flex-direction: column; align-items: center; text-decoration: none; }
.brand-sun { width: 48px; height: auto; margin-bottom: -5px; position: relative; z-index: 1; }
.wordmark { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: .5px; direction: ltr; line-height: 1; }
.w-white, .w-gold {
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}
.w-white { color: #fff; }
.w-gold { color: var(--gold); }

.nav { display: flex; gap: 6px; margin-inline-start: 12px; }
.nav a {
  text-decoration: none; font-weight: 700;
  padding: 8px 14px; border-radius: 12px;
  color: var(--muted);
  border: 2px solid transparent;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav a.active { color: var(--ink); background: var(--gold); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }

.topbar .me { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.topbar .me img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--gold); }
.topbar .me .name { font-weight: 700; }

/* ─── Layout ──────────────────────────────────────────── */
.view { max-width: 980px; margin: 0 auto; padding: 24px 16px 110px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.stack { display: grid; gap: 18px; }

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card h2 {
  margin: 0 0 14px; font-size: 1.25rem; font-weight: 800;
  display: flex; align-items: center; gap: 8px;
}
.card.gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink); }
.muted { color: var(--muted); }
.card.gold .muted { color: #5b3a00; }

.page-title {
  font-weight: 800; font-size: 1.9rem; margin: 4px 0 18px;
  text-shadow: 0 3px 0 var(--ink);
}

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  --b: var(--gold); --b-dark: var(--gold-dark); --c: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 800 1.05rem var(--font);
  color: var(--c); background: var(--b);
  border: 3px solid var(--ink); border-radius: 14px;
  padding: 12px 22px; cursor: pointer; text-decoration: none;
  box-shadow: 0 5px 0 var(--ink), inset 0 -4px 0 var(--b-dark);
  transition: transform .06s, box-shadow .06s, filter .15s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink), inset 0 -2px 0 var(--b-dark); }
.btn:disabled { filter: grayscale(.7) brightness(.8); cursor: not-allowed; transform: none; }
.btn.discord { --b: var(--discord); --b-dark: var(--discord-dark); --c: #fff; }
.btn.youtube { --b: var(--yt); --b-dark: var(--yt-dark); --c: #fff; }
.btn.green { --b: var(--green); --b-dark: var(--green-dark); --c: var(--ink); }
.btn.ghost { --b: var(--panel-3); --b-dark: var(--panel); --c: #fff; }
.btn.small { font-size: .9rem; padding: 7px 14px; border-radius: 11px; box-shadow: 0 3px 0 var(--ink), inset 0 -3px 0 var(--b-dark); }
.btn.block { width: 100%; }
.btn svg { width: 24px; height: 24px; }

/* ─── Forms ───────────────────────────────────────────── */
.field { display: flex; gap: 10px; flex-wrap: wrap; }
.input {
  flex: 1 1 180px; min-width: 0;
  font: 700 1.1rem var(--font); letter-spacing: 1px;
  color: var(--ink); background: #fff;
  border: 3px solid var(--ink); border-radius: 12px;
  padding: 11px 14px; direction: ltr; text-align: left; text-transform: uppercase;
}
.input:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.hint { font-size: .9rem; margin-top: 8px; }
.error-text { color: var(--red); font-weight: 700; margin-top: 10px; }

/* ─── Badges ──────────────────────────────────────────── */
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: .9rem;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 2px solid var(--ink);
}
.badge.on { background: var(--gold); color: var(--ink); }
.badge.green { background: var(--green); color: var(--ink); }
.badge.red { background: var(--red); color: #fff; }

/* ─── Profile ─────────────────────────────────────────── */
.hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero img { width: 88px; height: 88px; border-radius: 50%; border: 4px solid var(--gold); box-shadow: 0 4px 0 var(--ink); }
.hero h1 { margin: 0 0 8px; font-size: 1.7rem; font-weight: 800; text-shadow: 0 3px 0 var(--ink); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 800; }
.tag { direction: ltr; unicode-bidi: isolate; font-family: ui-monospace, Consolas, monospace; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.stat {
  text-align: center; padding: 14px 8px;
  background: rgba(0, 0, 0, .18); border: 2px solid var(--ink); border-radius: 14px;
}
.stat .v { font-family: var(--font-display); font-size: 2rem; color: var(--gold); text-shadow: 0 3px 0 var(--ink); line-height: 1.1; }
.stat .l { color: var(--muted); font-weight: 700; font-size: .9rem; }

/* ─── Login ───────────────────────────────────────────── */
.login { min-height: 80vh; display: grid; place-items: center; text-align: center; }
.login-card { max-width: 440px; width: 100%; padding: 34px 26px 30px; }
.logo-big { display: grid; justify-items: center; gap: 2px; margin-bottom: 10px; }
.logo-big img { width: 170px; margin-bottom: -14px; position: relative; z-index: 1; }
.logo-big .wordmark { font-size: 3rem; }
.login h1 { font-size: 1.5rem; margin: 10px 0 6px; font-weight: 800; }
.login p { margin: 0 0 22px; }
.login .small-print { font-size: .85rem; margin-top: 16px; }

.soon { border-style: dashed; opacity: .85; }

/* ─── Toast ───────────────────────────────────────────── */
.toast {
  position: fixed; inset-inline: 16px; bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  margin: 0 auto; max-width: 420px; z-index: 50;
  padding: 14px 18px; border-radius: 14px; font-weight: 700; text-align: center;
  background: var(--gold); color: var(--ink); border: 3px solid var(--ink); box-shadow: var(--shadow);
}
.toast.error { background: var(--red); color: #fff; }

.loading { text-align: center; padding: 60px 0; color: var(--muted); font-weight: 700; }
.spinner {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, .15); border-top-color: var(--gold);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Mobile: bottom tab bar like an app ─────────────── */
@media (max-width: 700px) {
  /* no backdrop-filter here: it would make the fixed bottom nav position relative to the top bar */
  .topbar { padding-inline: 14px; backdrop-filter: none; background: var(--bg-1); }
  .wordmark { font-size: 1.35rem; }
  .brand-sun { width: 40px; margin-bottom: -4px; }
  .topbar .me .name { display: none; }
  .nav {
    position: fixed; inset-inline: 0; bottom: 0; margin: 0; z-index: 20;
    justify-content: space-around;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-1); border-top: 3px solid var(--ink);
  }
  .nav a { display: grid; justify-items: center; font-size: 1.3rem; padding: 6px 18px; }
  .nav a span { font-size: .8rem; }
  .page-title { font-size: 1.5rem; }
  .logo-big .wordmark { font-size: 2.4rem; }
}

/* ─── Shared components (stage 2–4) ───────────────────── */
.center { text-align: center; }
.big-title { justify-content: center; font-size: 1.5rem; }
.big-number { font-family: var(--font-display); font-size: 4.2rem; color: var(--gold); text-shadow: 0 4px 0 var(--ink); line-height: 1; margin: 6px 0; }
.big-emoji { font-size: 3rem; }
.room-code {
  display: inline-block; margin-top: 8px; direction: ltr;
  font-family: var(--font-display); font-size: 2.6rem; letter-spacing: 4px;
  background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; padding: 6px 22px;
  box-shadow: 0 5px 0 var(--ink); user-select: all;
}
.count { margin-inline-start: auto; font-size: .95rem; color: var(--muted); font-weight: 700; }
.plain { text-decoration: none; }
.ltr { direction: ltr; text-align: left; text-transform: uppercase; }
.input:not(.ltr) { direction: rtl; text-align: right; text-transform: none; letter-spacing: 0; }
.hint { margin-bottom: 0; }
.out { margin-top: 12px; font-weight: 700; }

.live-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 16px; font-weight: 700; color: var(--muted); }
.live { background: var(--red); color: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; animation: pulse 1.6s ease-in-out infinite; }
.live.paused { background: var(--gold); color: var(--ink); animation: none; }
@keyframes pulse { 50% { filter: brightness(1.25); } }

.btn.big { font-size: 1.2rem; padding: 14px 28px; }
.btn.danger { --b: var(--red); --b-dark: #B8203A; --c: #fff; }
.btn-row { display: flex; gap: 10px; align-items: center; }
.btn-row.wrap { flex-wrap: wrap; }

/* list rows */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rows li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .18); border: 2px solid transparent;
}
.rows li.me { border-color: var(--gold); background: rgba(255, 194, 26, .12); }
.rows .grow, .grow { flex: 1 1 auto; min-width: 0; }
.pos { min-width: 30px; text-align: center; font-family: var(--font-display); font-size: 1.2rem; color: var(--gold); }
.av { border-radius: 50%; border: 2px solid var(--ink); object-fit: cover; flex: none; }
.av-letter { display: inline-grid; place-items: center; background: var(--panel-3); font-weight: 800; }
.dots { display: inline-flex; gap: 4px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .15); border: 2px solid var(--ink); }
.dot.x { background: var(--red); }

/* tabs & chips */
.tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.tabs.scroll { overflow-x: auto; padding-bottom: 6px; }
.tab {
  flex: none; text-decoration: none; font-weight: 800; padding: 9px 16px; border-radius: 12px;
  background: var(--panel); border: 3px solid var(--ink); color: var(--muted); box-shadow: 0 3px 0 var(--ink);
}
.tab.active { background: var(--gold); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700;
  padding: 5px 12px 5px 8px; border-radius: 999px; background: rgba(0, 0, 0, .2); border: 2px solid var(--ink);
}
.chip.active, .chip.me { background: var(--gold); color: var(--ink); }
.chip.out { opacity: .45; text-decoration: line-through; }

/* tournaments */
.t-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.t-title { margin: 0 0 8px !important; font-size: 1.45rem !important; }
h3.sub { margin: 18px 0 10px; font-size: 1.05rem; color: var(--gold); }
.card.inner { margin-top: 14px; box-shadow: 0 4px 0 var(--ink); }
/* Knockout bracket wall chart (views/bracket.js) */
.bracket-scroll { overflow-x: auto; padding: 14px 2px 10px; }
.bk { --h: calc(var(--r1) * 124px + 20px); position: relative; display: flex; gap: 34px; min-width: min-content; padding: 6px 4px; }
.bk.two-sided { --h: calc(var(--r1) * 62px + 170px); gap: 22px; margin: 0 auto; }
.view.wide { max-width: 1280px; }
.bk-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.bk-lines path { fill: none; stroke: rgba(203, 187, 242, .35); stroke-width: 3; stroke-linejoin: round; }
.bk-lines path.done { stroke: var(--gold); }
.bk-col { display: flex; flex-direction: column; gap: 14px; width: var(--colw, 196px); flex: none; position: relative; z-index: 1; }
.bk-round {
  text-align: center; font-weight: 800; font-size: .95rem; color: var(--ink);
  background: var(--gold); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 10px; box-shadow: 0 3px 0 var(--ink);
}
.bk-champ-col .bk-round { visibility: hidden; }
.bk-matches { height: var(--h); display: flex; flex-direction: column; justify-content: space-around; gap: 16px; }
.bk-match {
  position: relative; direction: rtl;
  background: linear-gradient(180deg, var(--panel-3), var(--panel));
  border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
}
.bk-match.st-awaiting_report { border-color: var(--gold); }
.bk-label {
  position: absolute; top: -11px; inset-inline-start: 10px; font-size: .72rem; font-weight: 800;
  color: var(--muted); background: var(--bg-2); border: 2px solid var(--ink); padding: 0 6px; border-radius: 6px;
}
.bk-slot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; min-height: 44px; font-weight: 700; }
.bk-slot .av { width: 28px; height: 28px; }
.bk-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-slot.won { background: linear-gradient(90deg, rgba(54, 214, 126, .08), rgba(54, 214, 126, .32)); }
.bk-slot.lost { opacity: .45; }
.bk-slot.lost .bk-name { text-decoration: line-through; }
.bk-slot.tbd { color: var(--muted); font-weight: 500; font-style: italic; }
.bk-slot.me { box-shadow: inset 0 0 0 2px var(--gold); }
.bk-slot[data-slot="0"] { border-radius: 11px 11px 0 0; }
.bk-slot[data-slot="1"] { border-radius: 0 0 11px 11px; }
.bk-q { background: rgba(255, 255, 255, .08); color: var(--muted); }
.bk-mark { color: var(--green); font-size: 1.1rem; }
.bk-score {
  min-width: 24px; text-align: center; font: 1rem var(--font-display);
  background: rgba(0, 0, 0, .3); border: 2px solid var(--ink); border-radius: 7px; padding: 0 5px;
}
.bk-slot.won .bk-score { background: var(--green); color: var(--ink); }
.series-score { font-family: var(--font-display); font-size: 2.4rem; letter-spacing: 2px; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.how-to { margin: 10px 0 0; padding: 0 18px 0 0; }
.how-to li { margin: 3px 0; }
details.manual { margin-top: 12px; }
details.manual summary { cursor: pointer; font-weight: 700; }
.bk-mark.small { font-size: .9rem; }
.bk-vs { height: 0; border-top: 2px dashed rgba(255, 255, 255, .16); position: relative; display: flex; justify-content: center; }
.bk-vs::after {
  content: 'VS'; position: absolute; top: -11px; font: .72rem var(--font-display); letter-spacing: 1px;
  color: var(--ink); background: var(--orange); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 8px;
}
.bk-vs { font-size: 0; }
.bk-win { border: 2px solid var(--ink); background: var(--gold); border-radius: 8px; cursor: pointer; font-size: .9rem; padding: 2px 6px; box-shadow: 0 2px 0 var(--ink); }
.bk-win:active { transform: translateY(2px); box-shadow: none; }
.bk-bye { direction: rtl; font-weight: 700; padding: 8px 12px; border: 2px dashed var(--muted); border-radius: 12px; color: var(--muted); background: rgba(0, 0, 0, .15); }
.bk-bye small { display: block; font-weight: 500; }
.bk-champion {
  direction: rtl; display: grid; justify-items: center; gap: 4px; text-align: center;
  padding: 14px 10px; border-radius: 18px; border: 3px dashed var(--gold); background: rgba(255, 194, 26, .06);
}
.bk-champion.has { border: 3px solid var(--ink); background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink); box-shadow: 0 5px 0 var(--ink); }
.bk-trophy { font-size: 2.6rem; line-height: 1; filter: drop-shadow(0 3px 0 var(--ink)); }
.bk-champion .av { width: 56px; height: 56px; border-width: 3px; }
.bk-champ-name { font-family: var(--font-display); font-size: 1.35rem; }
.bk-champ-sub { font-weight: 800; font-size: .9rem; }
.bk-center { width: calc(var(--colw, 196px) + 24px); }
.bk-center .bk-matches { justify-content: center; gap: 30px; }

/* forms */
.select, select.input { font: 700 .95rem var(--font); padding: 7px 10px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; color: var(--ink); }
textarea.input { font-size: 1rem; resize: vertical; }
.small-input { width: 80px; flex: none; padding: 6px 10px; font-size: 1rem; }
.settings { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 16px; font-weight: 700; color: var(--muted); }
.settings label { display: flex; align-items: center; gap: 8px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid label, .dialog-body label { display: grid; gap: 6px; font-weight: 700; color: var(--muted); }
.form-grid .span2 { grid-column: 1 / -1; }
label.check { display: flex !important; align-items: center; gap: 8px; color: var(--text) !important; cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.danger-zone { border-color: var(--red); background: linear-gradient(180deg, #4a1a4f, #3a1540); }

/* roles */
.member-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.role-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.role-chip {
  --rc: #99aab5;
  font: 700 .92rem var(--font); cursor: pointer; color: #fff;
  padding: 7px 12px; border-radius: 999px; border: 2px solid var(--rc); background: rgba(0, 0, 0, .2);
}
.role-chip.has { background: var(--rc); color: var(--ink); border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.role-chip small { opacity: .75; font-weight: 500; }
.role-chip:disabled { cursor: not-allowed; opacity: .55; }

/* dialog */
.dialog-wrap {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 3, 30, .72);
}
.dialog { width: 100%; max-width: 440px; }
.dialog-body { display: grid; gap: 12px; margin-bottom: 18px; }
.dialog-body p { margin: 0; }
.dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.club-head { display: grid; gap: 16px; }

@media (max-width: 700px) {
  .nav a { padding: 6px 8px; font-size: 1.2rem; }
  .nav a span { font-size: .72rem; }
  .big-number { font-size: 3.4rem; }
  .room-code { font-size: 2rem; }
}
.row-actions { display: flex; gap: 6px; align-items: center; margin-inline-start: auto; flex: none; }
.rows li .grow { flex: 1 1 110px; overflow-wrap: anywhere; }
/* grid/stack children may shrink below their content (bracket scrolls instead of widening the page) */
.stack > *, .grid > * { min-width: 0; }

/* ─── Test mode ───────────────────────────────────────── */
.test-toggle {
  font: 800 .9rem var(--font); cursor: pointer; color: var(--muted);
  background: transparent; border: 2px dashed var(--muted); border-radius: 12px; padding: 7px 12px;
}
.test-toggle.on { color: var(--ink); background: var(--gold); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.test-banner {
  position: sticky; top: 70px; z-index: 9;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 8px 20px; color: var(--ink); font-weight: 700;
  background: repeating-linear-gradient(-45deg, var(--gold) 0 18px, var(--gold-2) 18px 36px);
  border-bottom: 3px solid var(--ink);
}
.test-banner .tb-text { font-weight: 500; }
.test-banner .tb-view { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.test-panel-wrap { max-width: 980px; margin: 0 auto; padding: 18px 16px 0; }
.test-panel { border: 3px dashed var(--gold); background: linear-gradient(180deg, #3d2a10, #2e1d52); display: grid; gap: 10px; }
.test-panel h2 { margin: 0; }
.tk-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tk-head .btn { margin-inline-start: auto; }
.tk-line { margin: 0; }
.tk-group { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
body.test-mode .view { padding-top: 16px; }

@media (max-width: 700px) {
  .test-toggle span { display: none; }
  .test-banner { top: 64px; padding: 8px 14px; font-size: .9rem; }
  .test-banner .tb-text { display: none; }
}

/* ─── Verification prompt ─────────────────────────────── */
.benefits { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.benefits li { display: flex; gap: 12px; align-items: center; }
.benefits li > span { font-size: 1.5rem; width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: rgba(0, 0, 0, .18); border: 2px solid var(--ink); border-radius: 12px; }
.benefits strong { display: block; }
.benefits small { opacity: .8; }
.card.gold .benefits li > span { background: rgba(255, 255, 255, .45); }
.verify-dialog { max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; }
.verify-dialog .big-title { margin-top: 6px; }

/* ─── Queue points & "skip ahead" ─────────────────────── */
.pts { font-weight: 800; font-size: .9rem; white-space: nowrap; color: var(--gold); }
.upgrades { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.upgrade { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .35); border: 2px solid var(--ink); }
.up-jump { display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 2px 6px; font-family: var(--font-display); flex: none; }
.up-jump small { grid-column: 1 / -1; text-align: center; font-family: var(--font); font-weight: 800; }
.up-from { font-size: 1.3rem; opacity: .6; text-decoration: line-through; }
.up-arrow { font-size: 1.2rem; }
.up-to { font-size: 2.1rem; color: var(--green-dark); }
.up-how { flex: 1 1 220px; min-width: 0; }
.up-title { font-weight: 800; margin-bottom: 8px; }
.how-points summary { cursor: pointer; }
.how-points ol { margin: 12px 0 0; padding-inline-start: 22px; display: grid; gap: 8px; }
.settings-sep { font-weight: 800; color: var(--gold); }

/* Supercell Fan Content Policy notice */
.legal { max-width: 980px; margin: 0 auto; padding: 0 16px 110px; text-align: center; font-size: .75rem; color: var(--muted); opacity: .75; }
.legal a { color: inherit; }
body.test-mode .legal, .view + .legal { margin-top: -80px; }

/* Tag ownership challenge */
.challenge { display: grid; gap: 12px; }
.icon-swap { display: flex; align-items: center; gap: 14px; }
.icon-slot { width: 84px; height: 84px; border-radius: 16px; border: 3px solid var(--ink); background: rgba(0, 0, 0, .2); object-fit: cover; }
.icon-slot.from { opacity: .6; }
div.icon-slot.any { display: grid; place-items: center; text-align: center; font-weight: 800; font-size: .85rem; line-height: 1.1; }
.swap-arrow { font-size: 1.8rem; font-weight: 800; }
details.card > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
.season-head { display: grid; gap: 8px; }
.season-me { margin-top: 6px; padding: 12px 16px; border-radius: 12px; background: rgba(255, 194, 26, .14); border: 2px solid var(--gold); font-size: 1.1rem; }

/* ─── Icons (js/icons.js swaps emoji for these) ─────────── */
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; display: inline-block; }
.ic-gold { color: var(--gold); }
.ic-green { color: var(--green); }
.ic-red { color: var(--red); }
.ic-silver { color: #D7DCE8; }
.ic-bronze { color: #E08A4B; }
.card h2 > .ic, .page-title > .ic, h3.sub > .ic { color: var(--gold); filter: drop-shadow(0 2px 0 var(--ink)); }
.nav a > .ic { width: 1.25em; height: 1.25em; }
.btn .ic { color: inherit; }
.big-emoji .ic { width: 3.2rem; height: 3.2rem; color: var(--gold); filter: drop-shadow(0 4px 0 var(--ink)); }
.nav a.active .ic, .badge.on .ic, .badge.green .ic, .chip.me .ic { color: inherit; filter: none; }
.card.gold .ic:not(.ic-green):not(.ic-red), .card.gold h2 > .ic { color: var(--ink); filter: none; }

/* ─── Arena: "Esports Pro" look (design direction B) for tournaments — same language as the OBS overlay ─── */
.view.arena {
  --a-panel: #121826; --a-panel-2: #1A2233; --a-line: rgba(255, 255, 255, .10);
  --a-cyan: #22D3EE; --a-text: #F0F6FC; --a-muted: #9AA4B2;
}
.view.arena .page-title { font-family: var(--font-display); font-weight: 400; letter-spacing: .5px; text-transform: uppercase; }
.view.arena .page-title::after {
  content: ""; display: block; height: 4px; width: 90px; margin-top: 8px; border-radius: 2px;
  background: linear-gradient(90deg, var(--a-cyan), var(--gold));
}
.view.arena .card:not(.gold) {
  background: linear-gradient(180deg, var(--a-panel-2), var(--a-panel));
  border: 1px solid var(--a-line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45), inset 0 3px 0 var(--a-cyan);
  color: var(--a-text);
}
.view.arena .card:not(.gold) .muted { color: var(--a-muted); }
.view.arena .card.inner:not(.gold) { background: rgba(255, 255, 255, .03); box-shadow: inset 3px 0 0 var(--a-cyan); }
.view.arena .card.gold { border-radius: 14px; border-width: 2px; }
.view.arena .t-title { font-family: var(--font-display); font-weight: 400 !important; letter-spacing: .4px; }
.view.arena h3.sub { font-family: var(--font-display); font-weight: 400; letter-spacing: .4px; color: var(--a-cyan); }
.view.arena h3.sub > .ic { color: var(--a-cyan); filter: none; }
.view.arena .kv dt { color: var(--a-muted); }
.view.arena .badge { border-radius: 6px; }
.view.arena .chip { background: rgba(255, 255, 255, .06); border: 1px solid var(--a-line); }
.view.arena .chip.me { background: var(--gold); color: var(--ink); }
.view.arena .rows li { border-color: var(--a-line); }
/* Bracket in arena colors */
.view.arena .bk-match { background: var(--a-panel-2); border: 1px solid var(--a-line); border-radius: 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
.view.arena .bk-match.st-awaiting_report { border-color: var(--gold); }
.view.arena .bk-slot[data-slot="0"] { border-radius: 9px 9px 0 0; border-bottom: 1px solid var(--a-line); }
.view.arena .bk-slot[data-slot="1"] { border-radius: 0 0 9px 9px; }
.view.arena .bk-slot.won { background: linear-gradient(90deg, rgba(34, 211, 238, .04), rgba(34, 211, 238, .22)); }
.view.arena .bk-slot.me { box-shadow: inset 3px 0 0 var(--gold); }
.view.arena .bk-round { background: transparent; color: var(--a-cyan); border: 1px solid rgba(34, 211, 238, .5); box-shadow: none; font-family: var(--font-display); font-weight: 400; letter-spacing: .5px; }
.view.arena .bk-label { background: var(--a-panel); border: 1px solid var(--a-line); color: var(--a-muted); }
.view.arena .bk-lines path { stroke: rgba(154, 164, 178, .35); stroke-width: 2; }
.view.arena .bk-lines path.done { stroke: var(--a-cyan); }
.view.arena .bk-score { background: rgba(0, 0, 0, .35); border: 1px solid var(--a-line); }
.view.arena .series-score { font-family: var(--font-display); letter-spacing: 2px; }
.chip.me .muted { color: #5b3a00; }

/* Logo image (web/img/logo.png — rendered from sun.svg + the Lilita One wordmark) */
.brand-logo { height: 52px; width: auto; display: block; }
.logo-big .logo-img { width: 300px; max-width: 80%; height: auto; margin: 0 auto 6px; z-index: auto; }
@media (max-width: 700px) { .brand-logo { height: 44px; } }

/* Login: our channels */
.social { margin-top: 22px; padding-top: 16px; border-top: 2px dashed rgba(255, 255, 255, .15); }
.social p { margin: 0 0 10px !important; font-weight: 700; }
.social-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.social-row .btn { flex: 1 1 140px; justify-content: center; }
.social-row .btn svg { width: 1.2em; height: 1.2em; }
.btn.tiktok { --b: #161616; --b-dark: #000; --c: #fff; }
.btn.tiktok svg { filter: drop-shadow(-1.5px -1px 0 #25F4EE) drop-shadow(1.5px 1px 0 #FE2C55); }
