:root {
  color-scheme: dark;
  --bg: #090d15;
  --ink: #f4f7ff;
  --muted: #aeb9cb;
  --dim: #8f9bb0;
  --line: #253043;
  --blue: #67b4ff;
  --orange: #ff9b63;
  --body: Barlow, "Segoe UI", sans-serif;
  --display: "Barlow Condensed", Impact, "Arial Narrow", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px var(--body); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #e3edff; outline-offset: 5px; }

.top { background: #0b1019; border-bottom: 1px solid #20293a; }
.top-inner {
  width: min(100% - 72px, 1376px);
  min-height: 69px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  font: italic 800 23px/.9 var(--display);
  letter-spacing: .025em;
  text-transform: uppercase;
}
.brand b { color: #7abfff; font-weight: inherit; }
.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  flex: none;
  transform: skew(-9deg);
  background: linear-gradient(145deg, #223c5c, #101a2a 57%, #3b261f);
  border: 1px solid #365171;
}
.brand-mark::before, .brand-mark::after {
  position: absolute;
  content: "";
  top: 5px;
  left: 12px;
  height: 16px;
  width: 2px;
  background: #8fcaff;
  transform: rotate(42deg);
}
.brand-mark::after { background: #ffae80; transform: rotate(-42deg); }
.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid #2a374d;
  border-radius: 5px;
  color: #cbd5e6;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.panel-link:hover { border-color: #6587b1; color: #fff; }
.panel-link span { color: #8bbcff; }

.arena {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: 32px 36px 25px;
  background:
    radial-gradient(ellipse at 18% 46%, #16325b 0%, transparent 46%),
    radial-gradient(ellipse at 83% 54%, #39221d 0%, transparent 46%),
    radial-gradient(ellipse at 50% -20%, #1e2b3d 0%, transparent 56%),
    #090d15;
}
.arena::before {
  position: absolute;
  content: "";
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(128deg, transparent 0 40px, #8da6ca09 41px 42px, transparent 43px 84px);
  mask-image: radial-gradient(ellipse, #000, transparent 83%);
}
.ambient { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient i {
  position: absolute;
  height: 1px;
  width: 38vw;
  opacity: .55;
  transform: rotate(-36deg);
  background: linear-gradient(90deg, transparent, #548fff, transparent);
  box-shadow: 0 0 16px #3789ff;
}
.ambient i:nth-child(1) { left: -14%; top: 42%; }
.ambient i:nth-child(2) { left: -6%; top: 74%; opacity: .24; }
.ambient i:nth-child(3), .ambient i:nth-child(4) {
  right: -12%;
  top: 33%;
  background: linear-gradient(90deg, transparent, #f3895c, transparent);
  box-shadow: 0 0 16px #ff7046;
}
.ambient i:nth-child(4) { right: -5%; top: 71%; opacity: .29; }
.intro { text-align: center; margin: 0 auto 28px; }
.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #2e405a;
  border-radius: 50px;
  padding: 6px 11px;
  background: #111b2c;
  color: #c4dbff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
}
.live span[aria-hidden] {
  background: #69bcff;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 0 9px #5ea8ff;
}
.live.closed { color: #ccd4e0; border-color: #404959; background: #171f2c; }
.live.closed span[aria-hidden] { background: #aab5c7; box-shadow: none; }
.intro h1 {
  margin: 7px 0 3px;
  font: italic 900 clamp(63px, 8.5vw, 112px)/.91 var(--display);
  letter-spacing: -.035em;
  text-transform: uppercase;
  text-shadow: 0 8px 38px #0008;
}
.intro h1 em {
  display: inline-block;
  padding: 0 .18em .055em 0;
  margin-inline-end: -.12em;
  font-style: inherit;
  color: #82c4ff;
  background: linear-gradient(180deg, #bfecff 12%, #7bc4ff 62%, #5f9fe9);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.intro p { margin: 12px 0 0; color: #bcc7da; font-weight: 500; font-size: 15px; }

.match {
  --gap: clamp(104px, 15vw, 176px);
  --portrait-ratio: .94;
  --mark-size: 82px;
  width: min(100%, 1040px);
  max-width: 1040px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--gap) minmax(0, 1fr);
  align-items: stretch;
  container-type: inline-size;
}
.match::before {
  content: "";
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  align-self: start;
  width: var(--mark-size);
  aspect-ratio: 1;
  margin-block-start: calc((100cqw - var(--gap)) / 4 / var(--portrait-ratio) - var(--mark-size) / 2);
  background:
    linear-gradient(45deg, transparent 45%, #eff3ff 47% 53%, transparent 55%) center / 39% 39% no-repeat,
    linear-gradient(-45deg, transparent 45%, #eff3ff 47% 53%, transparent 55%) center / 39% 39% no-repeat,
    radial-gradient(ellipse, #729ef54d, #7a9cfa18 37%, transparent 69%);
  pointer-events: none;
}
.match .blue { grid-column: 1; grid-row: 1; }
.match .orange { grid-column: 3; grid-row: 1; }
.match-center-anchor { grid-column: 2; grid-row: 1; justify-self: center; align-self: start; width: var(--mark-size); aspect-ratio: 1; margin-block-start: calc((100cqw - var(--gap)) / 4 / var(--portrait-ratio) - var(--mark-size) / 2); opacity: 0; pointer-events: none; }
.blue { --accent: #77bcff; --edge: #426b9d; --tint: #142339; --glow: #4b9eff; }
.orange { --accent: #ffac82; --edge: #965d43; --tint: #2c201f; --glow: #fa8351; }
.card {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  appearance: none;
  border: 1px solid var(--edge);
  background: #101723;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 14px 38px #02040b94, 0 0 25px color-mix(in srgb, var(--glow) 10%, transparent);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:not(:disabled):hover, .card.selected {
  border-color: var(--accent);
  box-shadow: 0 12px 39px #000a, 0 0 27px color-mix(in srgb, var(--glow) 36%, transparent);
}
.card:not(:disabled):hover { transform: translateY(-4px); }
.portrait {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--portrait-ratio);
  overflow: hidden;
}
.photo-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: radial-gradient(ellipse, var(--tint), #0a101a);
}
.photo-frame img {
  position: absolute;
  display: block;
  inset: 0 auto auto 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 44%;
}
.portrait::after {
  position: absolute;
  content: "";
  inset: 0;
  background: linear-gradient(180deg, #0207123b, transparent 22%, transparent 73%, #090d16ae);
  pointer-events: none;
}
.corner { position: absolute; z-index: 1; width: 21px; height: 21px; opacity: .82; }
.corner-top { inset: 12px auto auto 12px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.corner-bottom { inset: auto 12px 12px auto; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.pick {
  position: absolute;
  z-index: 1;
  top: 16px;
  right: 16px;
  background: var(--accent);
  color: #101624;
  border-radius: 4px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
}
.pick span { margin-right: 2px; }
.card-info {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  min-height: 72px;
  border-top: 1px solid var(--edge);
  padding: 13px 17px;
  background: linear-gradient(115deg, var(--tint), #111723 80%);
}
.option-name {
  font: 800 clamp(23px, 3vw, 35px)/.98 var(--display);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.vote-label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 9px;
  color: var(--accent);
  border: 1px solid var(--edge);
  border-radius: 4px;
  font: 700 13px var(--body);
}
.card:hover .vote-label { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.percent { color: var(--accent); font: 800 32px/1 var(--display); }
progress {
  grid-column: 1 / -1;
  appearance: none;
  display: block;
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 8px;
  background: #ffffff22;
  overflow: hidden;
  accent-color: var(--accent);
}
progress::-webkit-progress-bar { background: #ffffff22; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 8px; transition: width .3s; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 8px; }

.arena-status {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  margin-top: 17px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.arena-status:has(.confirmed) { color: #dae8ff; }
.suggestion-footer { margin: auto -36px 0; padding: 6px 12px 7px; border-top: 1px solid #253043; background: #090d15; text-align: center; }
.suggestion-footer a { color: #aeb9cb; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.suggestion-footer a:hover { color: #82c4ff; }
.champion-entry-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: center; margin: 0 auto; min-height: 0; }
.champion-entry-wrap:has(.champion-entry:not([hidden])) { margin-top: 88px; min-height: 62px; }
.champion-entry { padding: 11px 27px; border: 1px solid #ffe18a; border-radius: 6px; background: linear-gradient(120deg, #fff0a8 0%, #e5b93d 45%, #b98116 100%); color: #4a2d0b; -webkit-text-stroke: .2px #2875b9; paint-order: stroke fill; font: 900 20px/.91 var(--display); letter-spacing: .025em; text-transform: uppercase; box-shadow: 0 7px 24px #e5b93d44; }
.champion-entry:hover { filter: brightness(1.08); transform: translateY(-1px); }
.champion-entry-deadline { color: #d8dfeb; font-size: 12px; font-weight: 700; text-align: center; text-shadow: 0 1px 4px #000; }
.champion-history { position: fixed; z-index: 5; top: 50%; right: 20px; transform: translateY(-50%); width: min(245px, 18vw); padding: 15px; display: grid; gap: 8px; border: 1px solid #a86843; border-radius: 8px; background: linear-gradient(150deg, #211813, #0d1118 80%); box-shadow: 0 16px 42px #0008; cursor: pointer; }
.champion-history-open { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: inherit; background: transparent; }
.champion-history-open:focus-visible { outline: 2px solid #ffd1ae; outline-offset: 3px; }
.champion-history-kicker, .champion-dialog-kicker { color: #ffb17d; font-size: 10px; font-weight: 850; letter-spacing: .15em; }
.champion-history h2 { margin: 0; font: 800 19px/1.1 var(--display); }
.champion-history img { display: block; width: 100%; max-height: 190px; aspect-ratio: 1.15; object-fit: contain; border-radius: 5px; background: radial-gradient(ellipse, #38251d, #0a1018); }
.champion-history strong { color: #ffb17d; overflow-wrap: anywhere; font: 800 20px/1.05 var(--display); text-transform: uppercase; }
.champion-history > span:last-child { color: var(--muted); font-size: 11px; }
.champion-history-toggle { display: none; }
body.compact-champion-hall .champion-history { visibility: hidden !important; transform: translateY(-50%); }
body.compact-champion-hall .champion-history-toggle:not([hidden]) {
  position: fixed;
  z-index: 9;
  right: 0;
  width: 42px;
  min-height: 132px;
  padding: 12px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 1px solid #a86843;
  border-right: 0;
  border-radius: 7px 0 0 7px;
  background: linear-gradient(150deg, #211813, #0d1118 80%);
  color: #ffb17d;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .12em;
  text-orientation: mixed;
  writing-mode: vertical-rl;
  text-transform: uppercase;
  box-shadow: -8px 10px 28px #0008;
}
.confirmed::before { content: "✓"; color: #8cd0ff; margin-right: 7px; }
.text-button { border: 0; background: none; color: #a9d3ff; padding: 2px; text-decoration: underline; text-underline-offset: 3px; }
.admin { width: min(100% - 48px, 1000px); margin: 50px auto; }
.admin-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.admin-heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.admin h1 { font: italic 900 64px/.95 var(--display); text-transform: uppercase; margin: 0; }
.admin-status { min-height: 24px; color: var(--muted); }
.admin-status.error { color: #ffb796; }
.champion-admin { margin: 24px 0; padding: 18px; border: 1px solid #80583f; border-radius: 8px; background: linear-gradient(135deg, #211a17, #101722 75%); }
.champion-admin > .history-heading { align-items: center; }
.champion-admin h2 { margin: 0; font-size: 21px; }
.champion-admin .history-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.champion-admin-toggle { background: linear-gradient(135deg, #ffb16f, #f07836); border-color: #ffb574; color: #21130e; }
.champion-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 18px; }
.champion-form-grid label { display: grid; gap: 6px; font-weight: 650; }
.champion-form-grid input:not([type=checkbox]), .champion-form-grid select { width: 100%; min-height: 40px; padding: 8px; border: 1px solid #604737; border-radius: 5px; color: var(--ink); background: #0c121c; }
.champion-form-grid select { min-width: 0; }
.champion-start-now { align-items: center; grid-template-columns: auto 1fr; align-self: end; min-height: 40px; }
.champion-form-actions { display: flex; align-items: center; gap: 15px; margin-top: 16px; }
.champion-admin-list { display: grid; gap: 8px; margin-top: 12px; }
.champion-admin-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px; border: 1px solid #553e33; border-radius: 5px; background: #121820; }
.champion-admin-item > div { min-width: 0; }
.champion-admin-item strong { overflow-wrap: anywhere; }
.champion-admin-item small { display: block; margin-top: 4px; color: var(--muted); }
.champion-admin-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.champion-admin-result { margin-top: 13px; padding-top: 12px; border-top: 1px solid #4d382e; color: #ffc49d; font-size: 13px; }
.champion-admin > p[role=status] { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.current-battle { margin: 14px 0 24px; padding: 20px; border: 1px solid #344b68; border-radius: 9px; background: linear-gradient(130deg, #121d2b, #0e1520 76%); box-shadow: 0 14px 36px #0004; }
.current-battle-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.current-battle-kicker { color: #81c5ff; font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.current-battle-heading h2 { margin: 5px 0 3px; font: 800 29px/1.05 var(--display); overflow-wrap: anywhere; }
.current-battle-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.current-battle-state { flex: none; margin-top: 4px; }
.current-battle-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.current-option { min-width: 0; padding: 13px 14px; border: 1px solid var(--edge); border-radius: 6px; background: #0d1520; }
.current-option > span { display: block; margin-bottom: 5px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.current-option strong { display: block; overflow-wrap: anywhere; font-size: 17px; }
.current-battle-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 17px; }
#editor > label[for="round-name"] { display: block; margin-bottom: 7px; font-weight: 600; }
#editor > #round-name { margin-bottom: 18px; }
.login {
  display: grid;
  gap: 12px;
  width: min(100%, 390px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111925;
}
.login label, .editor-option label { font-weight: 600; }
.login .action { justify-self: start; }
.editor-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.editor-option {
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 9px;
  padding: 17px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: #111925;
}
.editor-option legend { padding-inline: 6px; color: var(--accent); font: 700 22px var(--display); }
.restore { justify-self: start; font-size: 13px; }
.previews { display: grid; grid-template-columns: 1.5fr 1fr; gap: 11px; margin: 0 0 9px; align-items: start; }
.previews figure { min-width: 0; margin: 0; }
.previews .photo-frame { aspect-ratio: .94; border: 1px solid var(--line); border-radius: 5px; }
.previews .mobile-frame { aspect-ratio: .71; }
.previews figcaption { margin-top: 4px; color: var(--muted); font-size: 12px; }
.framing-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.framing-controls .device-framing { min-width: 0; margin: 0; padding: 9px; display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 6px; }
.framing-controls .device-framing legend { padding-inline: 5px; color: var(--accent); font-weight: 700; }
.framing-controls label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.framing-controls .fit-control { display: grid; }
.framing-controls output { color: var(--accent); font-variant-numeric: tabular-nums; }
.framing-controls input[type=range] { width: 100%; margin: 0; accent-color: var(--accent); }
.center-button { justify-self: start; margin-block: 4px; font-size: 13px; }
input:is([type=password], [type=text], [type=file]), select {
  width: 100%;
  min-width: 0;
  background: #0b111c;
  color: var(--ink);
  border: 1px solid #384863;
  border-radius: 5px;
  padding: 8px 10px;
}
input::file-selector-button {
  background: #23344a;
  border: 0;
  border-radius: 3px;
  color: var(--ink);
  padding: 5px 7px;
  margin-right: 7px;
  font: inherit;
  cursor: pointer;
}
input[type=checkbox] { accent-color: #82c4ff; width: 17px; height: 17px; }
.check { display: flex; gap: 7px; align-items: center; font-weight: 600; }
.editor-actions { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-top: 18px; }
.editor-actions p { margin: 7px 0; font-size: 13px; color: var(--muted); }
.save-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.action { border: 0; border-radius: 5px; padding: 10px 15px; background: #8acaff; color: #0c1828; font-weight: 800; white-space: nowrap; }
.action:hover { background: #a9d9ff; }
.action:disabled { opacity: .65; }
.action.danger { border: 1px solid #975b4b; background: #291c21; color: #ffc1aa; }
.action.danger:hover { background: #3c252a; }
.history { border-top: 1px solid var(--line); margin-top: 33px; padding-top: 18px; }
.history-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.history-heading h2 { margin: 0; font-size: 23px; }
.history-heading a { font-size: 14px; }
.history p { color: var(--muted); font-size: 14px; }
.history-scroll { overflow-x: auto; }
.history table { width: 100%; min-width: 700px; border-collapse: collapse; }
.history :is(th, td) { padding: 10px 9px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.history tbody td:last-child { vertical-align: middle; }
.history thead th { background: #151e2d; }
.champion-history-row { background: linear-gradient(100deg, #2b2116, #121821 44%); }
.champion-history-row td:first-child { border-left: 3px solid #d4a33b; }
.champion-history-type { display: table; margin-bottom: 5px; padding: 3px 6px; border: 1px solid #9c762e; border-radius: 3px; color: #f1c75c; background: #2a2112; font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.history small { display: block; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.history td { overflow-wrap: anywhere; }
.history-delete { color: #ffc1aa; padding: 4px 8px; }
.history-actions { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 8px; }
.history-reopen { padding: 6px 9px; font-size: 13px; }
.scheduled-section .history-heading > span { color: var(--muted); font-size: 13px; }
.scheduled-list { display: grid; gap: 9px; }
.scheduled-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px; background: #111a28; border: 1px solid var(--line); border-radius: 6px; }
.scheduled-item > div:first-child { flex: 1 1 auto; min-width: 0; }
.scheduled-item small { display: block; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
.scheduled-actions { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: 8px; white-space: nowrap; }
.queue-move { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.queue-move:disabled { opacity: .35; }
.intro .round-name { margin: 12px 0 0; color: var(--text); font-size: 22px; font-weight: 700; }
.intro .live { margin-top: 10px; }

.winners-drawer {
  --drawer-width: min(330px, calc(100vw - 18px));
  position: fixed;
  z-index: 8;
  top: 50%;
  left: 0;
  width: var(--drawer-width);
  height: min(850px, calc(100svh - 40px));
  transform: translate(-100%, -50%);
  transition: transform .28s ease;
  border: 1px solid #31435c;
  border-left: 0;
  border-radius: 0 9px 9px 0;
  background: linear-gradient(150deg, #111d2d 0%, #0b121d 70%);
  box-shadow: 10px 18px 55px #0009;
}
@media (min-width: 741px) {
  .winners-drawer:not(.is-open) .winners-toggle { top: -34px; }
}
@media (min-width: 461px) and (max-height: 917px) {
  .winners-drawer:not(.is-open) .winners-toggle {
    top: max(-34px, min(-12px, calc(433px - 50svh)));
  }
}
.winners-drawer.is-open { transform: translate(0, -50%); }
.winners-toggle {
  position: absolute;
  top: 16px;
  right: -42px;
  width: 42px;
  min-height: 104px;
  padding: 10px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #416087;
  border-left: 0;
  border-radius: 0 7px 7px 0;
  background: #101b2a;
  color: #a9d3ff;
  box-shadow: 8px 8px 25px #0006;
}
.winners-toggle .toggle-icon { width: 16px; height: 16px; display: grid; place-items: center; }
.winners-toggle .toggle-icon svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.winners-drawer.is-open .icon-open, .winners-drawer:not(.is-open) .icon-close { display: none !important; }
.toggle-label { writing-mode: vertical-rl; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.winners-drawer.is-open .winners-toggle {
  top: 12px;
  right: 12px;
  width: 34px;
  min-height: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #34465d;
  border-radius: 5px;
  box-shadow: none;
}
.winners-drawer.is-open .toggle-label { display: none; }
.winners-content { height: 100%; padding: 18px 16px 14px; display: flex; flex-direction: column; overflow: hidden; }
.winners-heading { flex: none; padding: 0 42px 13px 1px; border-bottom: 1px solid #29374b; }
.winners-heading > span { color: #80bfff; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.winners-heading h2 { margin: 4px 0 2px; font: 800 22px/1.08 "Segoe UI", Arial, sans-serif; letter-spacing: -.035em; }
.winners-heading h2 em { color: #82c4ff; font-style: inherit; }
.winners-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.winners-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 12px 3px 4px 0; scrollbar-color: #405978 #0d1521; scrollbar-width: thin; }
.winner-featured { margin: 0 0 8px; }
.winner-entry { appearance: none; display: grid; width: 100%; padding: 0; border: 0; color: inherit; text-align: left; background: transparent; }
.winner-entry:hover { background-color: #ffffff08; }
.winner-entry:focus-visible { outline-offset: 2px; }
.winner-featured .winner-entry { grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 108px; padding: 7px; border: 1px solid #426b9d; border-radius: 6px; background: linear-gradient(110deg, #17283e, #111a28); }
.winner-featured img { width: 92px; height: 100px; object-fit: cover; border-radius: 4px; background: #0a111b; }
.winner-details { min-width: 0; display: grid; gap: 4px; }
.winner-details strong { overflow-wrap: anywhere; font: 750 18px/1.12 "Segoe UI", Arial, sans-serif; letter-spacing: -.025em; text-transform: uppercase; }
.winner-details small { color: #bdc8d8; font: 500 10px/1.4 "Segoe UI", Arial, sans-serif; }
.winner-compact { border-bottom: 1px solid #253145; }
.winner-compact .winner-entry { grid-template-columns: minmax(0, 1fr); align-items: center; min-height: 49px; padding: 6px 8px; }
.winner-compact .winner-details { gap: 2px; }
.winner-compact .winner-details strong { font: 650 14px/1.2 "Segoe UI", Arial, sans-serif; letter-spacing: -.01em; }
.winner-compact .winner-details small { font: 500 9px/1.25 "Segoe UI", Arial, sans-serif; }
.winners-loading { padding: 16px 5px; color: var(--muted); font-size: 12px; }

.battle-detail { width: min(760px, calc(100vw - 32px)); max-width: none; max-height: calc(100svh - 32px); overflow-y: auto; padding: 0; border: 1px solid #3b5272; border-radius: 10px; color: var(--ink); background: linear-gradient(145deg, #142033, #0b111b 72%); box-shadow: 0 24px 80px #000b; }
.battle-detail::backdrop { background: #050912d9; backdrop-filter: blur(4px); }
.battle-detail-content { position: relative; padding: 24px; }
.battle-detail-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid #344b68; border-radius: 5px; background: #111d2c; color: #b8d8fb; }
.battle-detail-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.battle-detail-kicker { color: #80bfff; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.battle-detail h2 { margin: 5px 48px 3px 0; font: 800 28px/1.1 "Segoe UI", Arial, sans-serif; overflow-wrap: anywhere; }
.battle-detail-meta { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.battle-detail-candidates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.battle-detail-candidate { min-width: 0; overflow: hidden; border: 1px solid var(--edge); border-radius: 7px; background: #0c1420; }
.battle-detail-candidate > img { display: block; width: 100%; height: clamp(160px, 28vh, 260px); object-fit: contain; background: radial-gradient(ellipse, var(--tint), #0a101a); }
.battle-detail-candidate-info { display: grid; gap: 5px; padding: 12px 14px; border-top: 1px solid var(--edge); }
.battle-detail-candidate-info strong { color: var(--accent); font-size: 17px; overflow-wrap: anywhere; }
.battle-detail-candidate-info span { color: var(--muted); font-size: 13px; }
.battle-detail-winner { margin: 15px 0 0; color: #d6eaff; font-weight: 650; }
.battle-detail-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #2b3d55; color: var(--muted); }
.battle-detail-total strong { color: #fff; font-size: 20px; }
.result-candidate-loser > img,
.result-candidate-loser .photo-frame img { filter: grayscale(1) contrast(.96) brightness(.82); }
.result-candidate-winner > img,
.result-candidate-winner .photo-frame { border: 0; box-shadow: none; }
.result-candidate-winner { border: 3px solid #f4c64e; box-shadow: 0 0 18px #f4c64e55; }
.result-candidate-winner::before { position: absolute; z-index: 2; top: 9px; left: 9px; padding: 5px 8px; border: 1px solid #f4c64e; border-radius: 3px; background: #211b0eeF; color: #ffdb78; content: "VENCEDOR"; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.battle-detail-candidate, .champion-result-candidate { position: relative; }
.result-candidate-winner .battle-detail-candidate-info,
.champion-result-candidate.result-candidate-winner .champion-result-info {
  border-top: 1px solid var(--edge);
  background: #101723;
  color: var(--ink);
}
.result-candidate-winner .battle-detail-candidate-info strong,
.champion-result-candidate.result-candidate-winner .champion-result-info strong { color: #ffcb60; }
.result-candidate-winner .battle-detail-candidate-info span,
.champion-result-candidate.result-candidate-winner .champion-result-info .champion-candidate-vote { color: var(--muted); }
.champion-result-info { display: grid; gap: 5px; padding: 12px 14px; border-top: 1px solid var(--edge); }
.champion-result-info > strong { padding: 0; }
.champion-result-info .champion-candidate-vote { padding: 0; }
.champion-dialog { width: min(780px, calc(100vw - 28px)); max-width: none; max-height: calc(100svh - 28px); overflow-y: auto; padding: 0; border: 1px solid #a86843; border-radius: 11px; color: var(--ink); background: radial-gradient(ellipse at 50% 0, #482a1e, #17131a 58%, #0b111b); box-shadow: 0 24px 80px #000d; }
.champion-dialog::backdrop { background: #050912dc; backdrop-filter: blur(5px); }
.champion-dialog-content { position: relative; padding: 25px; }
.champion-dialog h2 { margin: 6px 48px 4px 0; font: italic 900 34px/.98 var(--display); text-transform: uppercase; }
.champion-dialog-content > p:not(.champion-dialog-status) { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.champion-candidates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.champion-candidate { min-width: 0; padding: 0; overflow: hidden; display: grid; text-align: left; border: 1px solid #9a6042; border-radius: 8px; background: #131821; }
.champion-result-candidate.result-candidate-winner { border: 3px solid #f4c64e; box-shadow: 0 0 18px #f4c64e55; }
.champion-candidate:hover:not(:disabled) { border-color: #ffb17d; box-shadow: 0 0 24px #ef833c33; }
.champion-candidate:disabled { cursor: default; }
.champion-candidate .champion-portrait { width: 100%; height: clamp(180px, 35vh, 330px); aspect-ratio: auto; background: radial-gradient(ellipse, #3a291f, #0c1118); }
.champion-candidate strong { padding: 12px 14px 3px; color: #ffb17d; font: 850 24px/1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.champion-candidate-vote { padding: 6px 14px 13px; color: #d0d7e3; font-size: 13px; }
.champion-dialog-status { min-height: 20px; margin: 15px 0 0; color: #ffcfaa; text-align: center; font-size: 13px; }

@media (max-width: 740px) {
  .top-inner { width: calc(100% - 36px); }
  .top-inner { min-height: 56px; }
  .admin { width: calc(100% - 32px); margin: 32px auto; }
  .admin-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .admin-heading-actions { width: 100%; justify-content: flex-start; }
  .champion-form-grid { grid-template-columns: minmax(0, 1fr); }
  .champion-admin > .history-heading { align-items: flex-start; flex-direction: column; }
  .champion-admin-item { align-items: flex-start; flex-direction: column; }
  .champion-admin-actions { justify-content: flex-start; }
  #create-battle { white-space: normal; }
  .scheduled-actions { flex-wrap: wrap; white-space: normal; }
  .arena { min-height: 100svh; padding: 36px 15px 20px; }
  .suggestion-footer { margin-inline: -15px; }
  .intro { margin-bottom: 26px; }
  .intro h1 { font-size: clamp(50px, 11.4vw, 82px); }
  .intro p { font-size: 14px; }
  .champion-entry-wrap:has(.champion-entry:not([hidden])) { margin-top: 18px; }
  .match { --gap: clamp(48px, 11vw, 64px); --portrait-ratio: .71; --mark-size: 50px; }
  .champion-history { top: 12px; right: 10px; transform: none; width: min(150px, 34vw); padding: 9px; }
  .champion-history img { max-height: 95px; }
  .champion-history h2 { font-size: 15px; }
  .champion-history strong { font-size: 16px; }
  .champion-history-kicker { font-size: 8px; }
  .champion-candidate .champion-portrait { height: min(30svh, 220px); }
  .card { border-radius: 7px; }
  .card-info { padding: 9px; min-height: 64px; }
  .option-name { font-size: clamp(20px, 4.8vw, 30px); }
  .vote-label { padding: 4px 6px; font-size: 11px; gap: 4px; }
  .percent { font-size: 25px; }
  .corner { width: 12px; height: 12px; }
  .corner-top { inset: 7px auto auto 7px; }
  .corner-bottom { inset: auto 7px 7px auto; }
  .pick { top: 8px; right: 7px; padding: 4px 5px; font-size: 10px; }
  .current-battle { padding: 16px; }
  .current-battle-heading { flex-direction: column; }
}
@media (max-width: 460px) {
  .intro h1 { font-size: clamp(43px, 12.3vw, 55px); }
  .card-info { grid-template-columns: minmax(0, 1fr); gap: 6px; min-height: 80px; }
  .option-name { font-size: clamp(19px, 5vw, 23px); }
  .vote-label { justify-self: start; }
  .percent { font-size: 21px; }
  .editor-options { grid-template-columns: minmax(0, 1fr); }
  .framing-controls { grid-template-columns: minmax(0, 1fr); }
  .editor-actions { flex-direction: column; }
  .scheduled-item { align-items: flex-start; flex-direction: column; }
  .current-battle-options { grid-template-columns: minmax(0, 1fr); }
  .current-battle-actions { justify-content: stretch; }
  .current-battle-actions .action { flex: 1; }
  .battle-detail-content { padding: 22px 14px 16px; }
  .champion-dialog-content { padding: 22px 14px 16px; }
  .champion-dialog h2 { font-size: 28px; }
  .champion-candidates { grid-template-columns: minmax(0, 1fr); }
  .battle-detail-candidates { grid-template-columns: minmax(0, 1fr); }
  .battle-detail-candidate > img { height: min(34svh, 230px); }
  .winners-drawer {
    top: auto;
    bottom: 0;
    left: 50%;
    width: min(390px, calc(100vw - 24px));
    height: min(68svh, 560px);
    transform: translate(-50%, 100%);
    border: 1px solid #31435c;
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
  }
  .winners-drawer.is-open { transform: translate(-50%, 0); }
  .winners-toggle {
    top: -42px;
    right: auto;
    left: calc(50% - 8px);
    width: auto;
    min-width: 132px;
    min-height: 42px;
    height: 42px;
    padding: 8px 14px;
    flex-direction: row;
    transform: translateX(-100%);
    gap: 9px;
    border: 1px solid #416087;
    border-radius: 7px 7px 0 0;
  }
  .toggle-label { writing-mode: initial; }
  .winners-drawer.is-open .winners-toggle {
    top: 12px;
    left: auto;
    right: 12px;
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    height: 34px;
    padding: 0;
    transform: none;
    flex-direction: row;
    border-radius: 5px;
  }
  .champion-history { display: none !important; }
  .champion-history-toggle:not([hidden]) {
    position: fixed;
    z-index: 9;
    left: calc(50% + 8px);
    bottom: 0;
    width: min(168px, calc(50vw - 22px));
    min-height: 42px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #a86843;
    border-radius: 7px 7px 0 0;
    background: linear-gradient(145deg, #2a1e19, #111720);
    color: #ffb17d;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
    box-shadow: 0 -6px 22px #0006;
  }
  body.mobile-history-open .champion-history-toggle { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
