:root {
  color-scheme: dark;
  --black: #090a08;
  --surface: #11130f;
  --panel: #161914;
  --white: #eeefe7;
  --muted: #a4aa9b;
  --line: #30352b;
  --acid: #dfff52;
  --front-edge: clamp(16px, 3vw, 52px);
  --front-head: 72px;
  --mono: "Cascadia Mono", Consolas, monospace;
}

html, body, #shell { background: var(--black); }
body:not(.playing) #shell { min-height: 0; }
body:not(.playing) :is(#game, .vignette, #shell > footer, #creator-credit) { visibility: hidden; }
#shell > header {
  padding-inline: var(--front-edge);
  background: #090a08;
  border-bottom: 1px solid var(--line);
  color: var(--white);
}
body:not(.playing) #shell > header { height: var(--front-head); }
.playing #shell > header { background: linear-gradient(#090a08e8, #090a0822); }
#shell .brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
#shell .brand img { width: 38px; height: 38px; display: block; }
.brand-name { font: 900 18px/1 Arial, sans-serif; letter-spacing: -.045em; white-space: nowrap; }
.brand-name small { display: block; margin-top: 5px; color: var(--muted); font: 700 9px/1 var(--mono); letter-spacing: .15em; }
/* Match the embedded document so the browser leaves its canvas transparent. */
#xcount-widget { flex: 0 0 88px; border: 0; overflow: hidden; background: transparent; vertical-align: middle; color-scheme: only light; }
.playing :is(.brand-name small, #tops, #xcount-widget) { display: none; }
#shell .head-tools { gap: 8px; }
#shell .head-tools .icon {
  min-height: 40px;
  padding: 0 13px;
  color: var(--white);
  background: #171a14;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: 700 12px/1.2 Arial, sans-serif;
  letter-spacing: .01em;
}
#shell .head-tools .icon:hover { border-color: #748044; }
#shell .head-tools .icon b { color: var(--acid); }
#shell .head-tools #tops { border-color: #6e773d; }
#shell :is(a, button, input, select):focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }

#home {
  position: absolute;
  inset: var(--front-head) 0 0;
  display: block;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 var(--front-edge);
  background: var(--black);
  color: var(--white);
}
.front { display: grid; grid-template-rows: auto 1fr auto; gap: 16px; min-height: 100%; }
.front-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(322px, 26vw, 430px); gap: 16px; min-width: 0; align-items: stretch; }
.feature { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; min-width: 0; min-height: 530px; border: 1px solid #333a2b; border-radius: 7px; background: #0d110f; }
.arena-art { position: absolute; z-index: -2; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }
.feature::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, #090a08 0%, #090a08eb 9%, #090a08b8 26%, transparent 53%, transparent 73%, #090a08f2 100%),
    linear-gradient(90deg, #090a0870, transparent 65%);
}
.feature-corners { position: absolute; top: clamp(19px, 3vw, 44px); right: clamp(17px, 3vw, 44px); width: clamp(40px, 5vw, 76px); color: #a5bb65; opacity: .55; pointer-events: none; }
.feature-title { padding: clamp(24px, 4vw, 61px); padding-bottom: 0; }
.feature-index { margin: 0; display: flex; align-items: center; gap: 11px; color: #d4d8c7; font: 700 11px/1.35 var(--mono); letter-spacing: .15em; }
.feature-index span { padding: 4px 6px; color: var(--acid); border: 1px solid #8a974d; white-space: nowrap; }
.feature h1 { margin: 17px 0 12px; }
.feature h1 img { display: block; width: min(100%, clamp(280px, 34vw, 605px)); height: auto; margin-left: -.9%; }
.feature-title > p:last-child { margin: 0; color: #d5d9ca; font-size: clamp(15px, 1.4vw, 22px); line-height: 1.45; }
.feature-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 18px clamp(17px, 3vw, 44px); }
.arena-caption { display: flex; align-items: center; gap: 9px; color: var(--white); font: 700 14px/1.15 Arial, sans-serif; }
.arena-caption b { display: grid; min-width: 38px; min-height: 38px; place-items: center; border: 1px solid #7d8853; color: var(--acid); background: #10140c; font: 700 16px/1 var(--mono); }
.arena-caption small { display: block; margin-bottom: 4px; color: #bcc5a8; font: 700 8px/1 var(--mono); letter-spacing: .11em; white-space: nowrap; }
.feature-facts { display: flex; gap: 14px; align-items: center; white-space: nowrap; }
.feature-facts span { color: #c6cbb9; font-size: 12px; }
.feature-facts b { margin-right: 3px; color: var(--white); font: 700 16px/1 var(--mono); }
.arena-motion { display: grid; min-width: 38px; min-height: 38px; place-items: center; padding: 3px; border: 1px solid #7d8853; border-radius: 4px; color: var(--acid); background: #10140c; font: 700 12px/1 var(--mono); }
.arena-motion:hover { border-color: var(--acid); }

#home .selection {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: clamp(17px, 1.7vw, 29px);
  color: var(--white);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(150deg, #181c14, #10120e 57%);
  box-shadow: none;
}
#home .panel-label { display: flex; justify-content: space-between; gap: 6px; color: var(--acid); font: 700 10px/1.25 var(--mono); letter-spacing: .085em; }
#home .panel-label span { color: inherit; }
#home .panel-label span + span { color: var(--muted); }
.selection h2 { margin: 10px 0 15px; color: var(--white); font: 900 clamp(26px, 2.55vw, 42px)/1 Arial, sans-serif; letter-spacing: -.065em; }
#home .fighters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
#home .fighter { display: flex; flex-direction: column; width: 100%; height: auto; min-width: 0; padding: 0; color: var(--white); background: #1d211a; border: 1px solid #373f2f; border-radius: 4px; box-shadow: none; }
#home .fighter.selected { border-color: #a3b14d; background: #262d1b; }
#home .fighter:hover { border-color: var(--acid); }
.fighter-art { display: grid; position: relative; place-items: center; width: 100%; height: clamp(68px, 6vw, 99px); overflow: hidden; border-bottom: 1px solid #383e31; background: repeating-linear-gradient(0deg, #0c100800 0 11px, #717d4e22 11px 12px), radial-gradient(ellipse at center, #39422c, #141813 74%); }
.fighter-art::after { content: ""; position: absolute; right: 8px; top: 8px; width: 7px; height: 7px; border: 1px solid #798360; transform: rotate(45deg); }
.selected .fighter-art::after { border-color: var(--acid); background: var(--acid); }
#home .fighter img { position: static; display: block; width: auto; max-width: 75%; height: 75%; max-height: 75px; object-fit: contain; image-rendering: pixelated; }
.fighter-info { display: block; padding: 8px 9px 10px; }
#home .fighter strong { font: 900 20px/1 Arial, sans-serif; letter-spacing: -.045em; }
#home .fighter small { margin-top: 4px; color: var(--muted); font: 700 10px/1.2 Arial, sans-serif; letter-spacing: .01em; }
#home #style-description { display: block; min-height: 0; margin: 9px 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
#orientation-tip { display: none; padding-left: 8px; border-left: 2px solid var(--acid); color: var(--acid); font-size: 12px; }
body:not(.playing) #rotate { display: none !important; }
#home .primary, #home .secondary, #home .bonus-link {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  min-height: 41px; margin: 0; padding: 8px 11px; clip-path: none; box-shadow: none;
  color: var(--white); background: #1a1e16; border: 1px solid var(--line); border-radius: 4px;
  font: 700 13px/1.2 Arial, sans-serif; letter-spacing: 0; text-align: left;
}
#home #solo { min-height: 50px; color: #101506; background: var(--acid); border-color: var(--acid); font-size: 15px; }
#home #solo:hover:not(:disabled) { background: #efff96; }
#home #solo b, #home .secondary span, #home .bonus-link span { font-size: 16px; }
#home .secondary:hover:not(:disabled), #home .bonus-link:hover:not(:disabled) { border-color: #848f55; color: var(--acid); }
#home .zone-picker { padding: 11px 0; margin: 0; border: 0; border-bottom: 1px solid var(--line); }
#home .zone-picker label { margin-bottom: 5px; color: var(--muted); font: 700 11px/1.2 Arial, sans-serif; letter-spacing: 0; }
#home #zone-select, #home #zone-select option { background: var(--surface); color: var(--white); }
#home #zone-select { min-height: 39px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 4px; font-size: 16px; }
#home #zone-start { min-height: 34px; margin-top: 5px; }
.coop-panel { padding: 10px 0; }
#home .join-row { display: flex; min-height: 38px; margin: 6px 0 0; border: 1px solid var(--line); border-radius: 4px; background: #0f120e; }
#home .join-row input { padding: 6px 8px; color: var(--white); font-size: 16px; letter-spacing: 0; }
#home .join-row input::placeholder { color: var(--muted); }
#home .join-row button { padding: 0 9px; color: var(--acid); font-size: 11px; border-left: 1px solid var(--line); }
#home .bonus-link { min-height: 36px; background: transparent; }
#home #status { margin: 8px 0; min-height: 0; color: var(--muted); font-size: 11px; }
#home .progress-line { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; padding-top: 8px; border-color: var(--line); color: var(--muted); font: 700 9px/1.3 var(--mono); }
#home #build-label { color: var(--acid); }
#home #save-status { display: block; color: var(--muted); font-size: 10px; }

.front-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px 16px; min-height: 50px; padding: 9px 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
.front-footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 15px; }
.front-footer a { color: inherit; text-decoration: none; }
.front-footer a:hover { color: var(--acid); text-decoration: underline; }
.front-footer strong { color: var(--white); }

.ad-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 55px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.ad-strip a { text-decoration: none; }
.ad-source { align-self: stretch; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 1px; color: var(--white); font: 700 11px/1 var(--mono); white-space: nowrap; }
.ad-source strong { color: var(--acid); }
.ad-stage { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; min-width: 0; }
.ad-status { margin: 0; padding: 5px 7px; color: var(--muted); font-size: 12px; line-height: 1.2; }
.ad-slides { min-width: 0; margin: 0; padding: 0; list-style: none; }
.ad-slide:not([hidden]) { animation: ad-in .28s ease-out both; }
@keyframes ad-in { from { transform: translateX(8px); opacity: .15; } to { transform: none; opacity: 1; } }
.ad-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; min-height: 40px; padding: 4px 8px; color: var(--white); background: #191d16; border: 1px solid var(--line); border-radius: 4px; }
.ad-item:hover { border-color: #a4ab79; }
.ad-tier { white-space: nowrap; color: #e1e7ce; font: 700 10px/1 var(--mono); }
.ad-copy, .ad-copy strong, .ad-copy small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-copy strong { font-size: 13px; }
.ad-copy small { margin-top: 2px; color: #cbd0bf; font-size: 10px; }
.ad-controls, .ad-plans { display: flex; gap: 4px; }
.ad-controls button, .ad-plan { min-height: 36px; border: 1px solid var(--line); border-radius: 4px; color: var(--white); }
.ad-controls button { min-width: 32px; padding: 0 4px; background: #151813; font-size: 18px; line-height: 1; }
.ad-controls button:last-child { font-size: 12px; }
.ad-controls button:hover, .ad-controls button[aria-pressed="true"] { border-color: #81914a; color: var(--acid); }
.ad-plan { display: flex; align-items: center; gap: 5px; padding: 4px 8px; font-size: 11px; white-space: nowrap; }
.ad-plan b { font: 700 11px/1 var(--mono); }
.ad-plan:hover { border-color: #b8bd9c; }
.ad-boost { background: linear-gradient(113deg, #3b2d16 8%, #3b2d16 37%, #725322 50%, #3b2d16 66%, #3b2d16 90%); background-size: 240% 100%; animation: ad-shine 5s ease-in-out infinite; border-color: #8d703d; }
.ad-fire { background: linear-gradient(110deg, #58251b, #762e20 50%, #58251b); border-color: #b35d46; }
.ad-item.ad-fire .ad-tier::before, .ad-plan.ad-fire b::before { content: ""; display: inline-block; width: 8px; height: 11px; margin-right: 4px; vertical-align: -.08em; background: #ffb26e; clip-path: polygon(52% 0, 69% 37%, 81% 21%, 100% 65%, 86% 89%, 57% 100%, 25% 94%, 0 70%, 12% 47%, 30% 65%); animation: ad-ember 1.8s ease-in-out infinite alternate; }
@keyframes ad-shine { 0%, 44% { background-position: 100%; } 78%, 100% { background-position: 0%; } }
@keyframes ad-ember { to { transform: translateY(-1px) scaleY(.82); opacity: .72; } }
.ad-strip.is-paused .ad-boost, .ad-strip.is-paused .ad-fire ::before { animation-play-state: paused; }

#leaderboard-dialog { width: min(680px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 24px); height: fit-content; margin: auto; padding: 0; border: 1px solid #444b34; border-radius: 8px; color: var(--white); background: #141711; overflow: auto; }
#leaderboard-dialog:not([open]) { display: none; }
#leaderboard-dialog::backdrop { background: #030403d9; backdrop-filter: blur(6px); }
#leaderboard-dialog .modal { width: 100%; max-height: none; margin: 0; background: transparent; border: 0; color: var(--white); box-shadow: none; }
#leaderboard-dialog .top-title h2 { margin: 0; font: 900 clamp(24px, 4vw, 38px)/1 Arial, sans-serif; letter-spacing: -.055em; }
#leaderboard-dialog :is(.top-tabs button, #close-tops) { min-height: 38px; background: #20251a; border: 1px solid var(--line); border-radius: 4px; color: var(--white); }
#leaderboard-dialog #close-tops { min-width: 38px; padding: 0; font-size: 19px; }
#leaderboard-dialog #tops-status { color: var(--muted); }
#leaderboard-dialog .top-tabs button[aria-pressed="true"] { color: var(--acid); border-color: #8c9c4c; }
#leaderboard-dialog #refresh-top { width: auto; height: auto; margin-left: auto; font-size: 15px; }
#leaderboard-dialog .top-table :is(td, th) { color: var(--white); border-color: var(--line); }
#leaderboard-dialog .top-table tr:first-child td:first-child { color: var(--acid); }
#boot-loader { --hot: var(--acid); }
.boot-logo { height: auto; }
.boot-noscript { width: min(440px, 88vw); padding: 15px; color: var(--white); background: var(--surface); border: 1px solid var(--line); }

#touch-controls .combat-button {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  color: #fff8e8;
}
#touch-controls .combat-icon {
  display: block;
  width: clamp(23px, 6.5vh, 30px);
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 1px #0008);
}
#touch-controls .button-a .combat-icon { width: clamp(29px, 8vh, 38px); }
#touch-controls .combat-key {
  font: 800 10px/1 var(--mono);
  text-shadow: 0 1px 2px #000b;
}
#touch-controls .combat-button > * { pointer-events: none; }
#touch-controls .combat-button:active { box-shadow: inset 0 2px 7px #0006; }

@media (max-width: 900px) {
  .front-grid { grid-template-columns: minmax(0, 1fr) 310px; gap: 11px; }
  .feature-title { padding: 26px 22px 0; }
  .feature-facts { gap: 7px; }
  .feature-facts span { font-size: 10px; }
  .feature-facts b { font-size: 13px; }
  .feature-foot { flex-wrap: wrap; }
}
@media (max-width: 720px) {
  :root { --front-head: 58px; }
  #shell .brand { gap: 7px; }
  #shell .brand img { width: 30px; height: 30px; }
  .brand-name { font-size: 15px; }
  #shell .head-tools { gap: 5px; }
  #shell .head-tools .icon { min-height: 36px; padding: 0 7px; font-size: 11px; }
  #shell .head-tools #fullscreen span { display: none; }
  .front, .front-grid { gap: 10px; }
  .front-grid { grid-template-columns: minmax(0, 1fr); }
  .feature { min-height: clamp(285px, 64vw, 435px); }
  .feature-title { padding: 16px 15px 0; }
  .feature-index { gap: 7px; font-size: 9px; }
  .feature-corners { top: 17px; right: 13px; }
  .feature h1 { margin: 10px 0 6px; }
  .feature h1 img { width: min(80%, 370px); }
  .feature-title > p:last-child { font-size: 13px; }
  .feature-foot { gap: 7px; padding: 9px; }
  .arena-caption { gap: 6px; font-size: 11px; }
  .arena-caption b { min-width: 26px; min-height: 29px; font-size: 12px; }
  .arena-caption small { font-size: 7px; }
  .feature-facts { gap: 6px; }
  .feature-facts b { margin-right: 1px; font-size: 11px; }
  .ad-strip { grid-template-columns: auto minmax(0, 1fr); gap: 4px; padding: 5px 0; }
  .ad-source { gap: 4px; padding: 0 3px; font-size: 9px; }
  .ad-plans { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ad-plan { justify-content: center; min-height: 27px; }
  .arena-motion { min-width: 28px; min-height: 31px; }
}
@media (max-width: 480px) {
  :root { --front-head: 94px; }
  body:not(.playing) #shell > header { display: grid; grid-template-columns: 1fr; grid-template-rows: 46px 43px; padding-block: 0; }
  body:not(.playing) #shell .head-tools { grid-row: 2; justify-self: start; }
}
@media (max-width: 395px) {
  .ad-controls button { min-width: 25px; }
  .ad-item { grid-template-columns: minmax(0, 1fr) auto; gap: 4px; padding-inline: 4px; }
  .ad-tier { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .feature-facts span { font-size: 9px; }
}
@media (max-width: 355px) {
  .feature-facts { display: none; }
  .brand-name { font-size: 13px; }
  #shell .brand img { width: 25px; height: 25px; }
  #shell .head-tools .icon { padding-inline: 5px; }
}
@media (pointer: coarse) and (orientation: portrait) { #orientation-tip { display: block; } }
@media (pointer: coarse) { .playing #shell .head-tools .icon { min-height: 32px; } }
@media (prefers-reduced-motion: reduce) { .ad-strip *, .ad-strip *::before { animation: none !important; } }
