/* Wing Fighter: a 1000 by 640 stage, scaled to fit the window. The arena is a small pixel canvas
   scaled up four times along the top; every screen is markup over it. */

:root {
  color-scheme: dark;
  --bg: #0a0618;
  --panel: #1b1240;
  --panel2: #281a5e;
  --line: #5a43c0;
  --gold: #ffd23f;
  --cyan: #5ce1ff;
  --pink: #ff6bd6;
  --text: #f6f0ff;
  --muted: #a89bdc;
  --good: #5af08a;
  --bad: #ff5a6b;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #05030d;
}
#viewport {
  position: fixed;
  inset: 0;
}
#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1000px;
  height: 640px;
  margin: -320px 0 0 -500px;
  transform: scale(var(--s, 1));
  transform-origin: center;
  overflow: hidden;
  background: linear-gradient(#150c36, var(--bg));
  color: var(--text);
  font: 800 18px/1.3 var(--mono);
  letter-spacing: 0.04em;
  user-select: none;
  -webkit-user-select: none;
}
#arena {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 400px;
  image-rendering: pixelated;
  border-bottom: 4px solid #3a2c8a;
}
#floor {
  position: absolute;
  left: 0;
  right: 0;
  top: 400px;
  bottom: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 96px, #0003 96px 100px),
    repeating-linear-gradient(0deg, transparent 0 36px, #0003 36px 40px),
    linear-gradient(var(--f0, #2a1a5e), var(--f1, #0a0618));
}
#ui {
  position: absolute;
  inset: 0;
}
h1,
h2,
h3,
p,
ul {
  margin: 0;
}
canvas.pic {
  display: block;
  image-rendering: pixelated;
}
small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

/* ---- Buttons and panels ---- */
.btn {
  display: block;
  padding: 11px 20px;
  font: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--panel2);
  border: 3px solid var(--line);
  box-shadow: 0 5px 0 #05030d;
  cursor: pointer;
  text-align: center;
}
.btn:hover,
.btn.sel,
.btn:focus-visible {
  color: var(--gold);
  border-color: var(--gold);
  outline: none;
}
.btn.primary {
  color: #1a1030;
  background: var(--gold);
  border-color: #fff3b0;
}
.btn.primary:hover,
.btn.primary.sel {
  background: #fff3b0;
  color: #1a1030;
}
.btn.ghost {
  background: transparent;
}
/* In a row of choices the lit one is filled, so it is plain which Enter will press. */
.row .btn.sel,
.bottom .btn.sel,
.chips .btn.sel {
  color: #1a1030;
  background: var(--gold);
  border-color: #fff3b0;
}
.btn.small {
  padding: 6px 12px;
  font-size: 14px;
}
.btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.panel {
  background: var(--panel);
  border: 4px solid var(--line);
  box-shadow:
    0 0 0 4px var(--bg),
    0 10px 0 4px var(--bg),
    0 20px 40px #000a;
  padding: 22px 26px;
  display: grid;
  /* A grid column is as wide as its widest child unless told it may shrink: that let a row of
     buttons push the text past the border. minmax(0, 1fr) makes the column the panel's width. */
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.panel.wide {
  width: 760px;
}
.panel.narrow {
  width: 480px;
}
.panel h2 {
  font-size: 30px;
  color: var(--gold);
  text-align: center;
  letter-spacing: 0.1em;
}
.stack {
  display: grid;
  gap: 10px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}
.label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.12em;
}
.note {
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 15px;
  text-align: center;
}
.hint {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}
.chip {
  display: inline-block;
  padding: 1px 8px;
  margin-left: 6px;
  font-style: normal;
  font-size: 14px;
  color: #06223a;
  background: var(--cyan);
  border-bottom: 3px solid #1b8fb0;
}
.line {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
}
em.new,
em.tag {
  font-style: normal;
  font-size: 12px;
  padding: 1px 6px;
  margin-right: 6px;
  color: #1a1030;
  background: var(--muted);
}
em.tag {
  background: var(--bad);
  color: #fff;
}
.starrow {
  display: inline-flex;
  gap: 3px;
}
.star {
  font-style: normal;
  color: #3a2c80;
  font-size: 22px;
}
.star.on {
  color: var(--gold);
  text-shadow: 0 2px 0 #b8741a;
}
.screen {
  position: absolute;
  inset: 0;
}
.screen.dim {
  background: #07041a;
  background: linear-gradient(#07041ad8, #07041af2);
}
.screen-title {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--gold);
  font-size: 34px;
  letter-spacing: 0.12em;
  text-shadow: 0 4px 0 #6b2d1a;
}

/* ---- Title ---- */
.title .logo {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 92px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.logo span {
  display: inline-block;
  margin: 0 12px;
  color: transparent;
  background: linear-gradient(#fffbd0, #ffd23f 42%, #ff7a2e);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 4px 0 #b3361a) drop-shadow(0 8px 0 #4a1a6e) drop-shadow(0 12px 0 #12072e);
}
.logo span + span {
  background-image: linear-gradient(#e8fcff, #5ce1ff 45%, #3a6bff);
  filter: drop-shadow(0 4px 0 #1b4f9e) drop-shadow(0 8px 0 #4a1a6e) drop-shadow(0 12px 0 #12072e);
}
.tagline {
  position: absolute;
  top: 132px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 24px;
  font-size: 20px;
  letter-spacing: 0.18em;
  color: var(--gold);
  background: #1b1240e6;
  border: 3px solid var(--pink);
  white-space: nowrap;
}
.playerline {
  position: absolute;
  bottom: 52px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  text-shadow: 0 2px 0 #000;
}
.title .menu {
  position: absolute;
  top: 226px;
  left: 330px;
  width: 340px;
}
.credits-btn {
  position: absolute;
  right: 20px;
  bottom: 20px;
}
.title .hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
}

/* ---- Story, settings, credits, leaderboard, initials ---- */
.story,
.settings,
.credits,
.leaderboard,
.initials-screen,
.result {
  display: grid;
  place-items: center;
}
.story-lines {
  display: grid;
  gap: 14px;
  min-height: 250px;
  align-content: start;
}
.story-lines p,
.credits p {
  font-weight: 600;
  font-size: 19px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  text-transform: none;
}
.story-lines p.new {
  animation: rise 0.5s ease-out;
}
.story .row,
.story .row small {
  justify-content: flex-end;
}
.story .row small {
  margin-right: auto;
}
.setrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.setrow .val {
  color: var(--cyan);
}
.lb {
  display: grid;
  gap: 6px;
}
.lb-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: -8px;
}
.lb-row {
  display: grid;
  grid-template-columns: 40px 90px 1fr 160px 130px;
  padding: 7px 12px;
  background: var(--panel2);
  border-left: 5px solid var(--line);
}
.lb-row.me {
  border-left-color: var(--gold);
  color: var(--gold);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 20px;
}
input.initials {
  width: 100%;
  padding: 10px;
  font: 900 52px var(--mono);
  letter-spacing: 0.4em;
  text-align: center;
  text-transform: uppercase;
  color: var(--gold);
  background: #0e0828;
  border: 3px solid var(--line);
  outline: none;
}
input.initials:focus {
  border-color: var(--gold);
}
input.initials::selection {
  background: #5a43c0;
  color: #fff;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---- Fighter select ---- */
.select .left {
  position: absolute;
  left: 24px;
  top: 74px;
  width: 400px;
  display: grid;
  gap: 16px;
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 92px);
  gap: 8px;
}
.tile-btn {
  position: relative;
  width: 92px;
  height: 88px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 4px solid #3a2c8a;
  cursor: pointer;
  overflow: hidden;
}
.tile-btn.mine::after {
  content: '1P';
  position: absolute;
  top: 2px;
  left: 3px;
  font: 900 11px var(--mono);
  color: #1a1030;
  background: var(--gold);
  padding: 0 3px;
}
.tile-btn.sel {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px #ffd23f55;
}
.tile-btn .qmark {
  position: absolute;
  font-size: 34px;
  color: var(--muted);
  text-shadow: 0 3px 0 #000;
}
.stats-panel {
  padding: 14px 18px;
  gap: 8px;
}
.stats-panel .cls {
  color: var(--cyan);
  font-size: 22px;
}
.rowline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}
.rowline span:first-child {
  color: var(--muted);
}
.rowline b {
  color: var(--gold);
}
.seg {
  display: inline-flex;
  gap: 5px;
}
.seg i {
  width: 34px;
  height: 12px;
  background: #2a1f6a;
}
.seg i.on {
  background: var(--gold);
  box-shadow: inset 0 -3px 0 #c98a1a;
}
.select .right {
  position: absolute;
  left: 452px;
  top: 74px;
  width: 524px;
  height: 440px;
  align-content: start;
}
.detail {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.detail .name {
  font-size: 40px;
  text-align: left;
  color: var(--cyan);
  text-shadow: 0 4px 0 #0a2a4a;
}
.detail .style {
  color: var(--muted);
  font-size: 16px;
}
.detail .big {
  align-self: center;
  justify-self: center;
  padding: 6px 0;
}
.blurb {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-transform: none;
}
.select .bottom {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.select .bottom .hint {
  flex: 1;
  text-align: left;
}

/* ---- Leagues map ---- */
.leagues .head {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 14px;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.leagues .head .portrait {
  border: 3px solid var(--line);
  background: var(--panel);
}
.leagues .who b {
  font-size: 20px;
  color: var(--cyan);
}
.leagues .rank {
  color: var(--gold);
  font-size: 18px;
}
.leagues .screen-title.right {
  position: static;
  margin-left: auto;
  font-size: 28px;
}
.cards {
  position: absolute;
  left: 24px;
  top: 100px;
  width: 300px;
  display: grid;
  gap: 8px;
}
.league-card {
  position: relative;
  display: grid;
  gap: 1px;
  height: 76px;
  padding: 8px 12px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: linear-gradient(90deg, #0a0618e0, #0a061866), linear-gradient(135deg, var(--a), var(--b));
  border: 3px solid #3a2c8a;
  cursor: pointer;
}
.league-card b {
  font-size: 17px;
  text-shadow: 0 2px 0 #000;
}
.league-card small {
  color: #ddd2ff;
  font-size: 12px;
  text-transform: none;
  font-weight: 600;
}
.league-card .lstars {
  position: absolute;
  right: 10px;
  bottom: 6px;
  font-size: 13px;
  color: var(--gold);
  text-shadow: 0 2px 0 #000;
}
.league-card.locked {
  filter: grayscale(1) brightness(0.65);
}
.league-card.sel {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px #ffd23f55;
}
.right-col {
  position: absolute;
  left: 346px;
  right: 24px;
  top: 100px;
  display: grid;
  gap: 10px;
}
.league-blurb {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #ddd2ff;
  min-height: 38px;
}
.stages {
  display: grid;
  gap: 5px;
}
.stage-row {
  display: grid;
  grid-template-columns: 48px 62px 1fr 176px;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 4px 12px 4px 10px;
  font: inherit;
  color: var(--text);
  text-align: left;
  background: #1b1240d8;
  border: 3px solid #3a2c8a;
  cursor: pointer;
}
.stage-row .portrait {
  background: #0e0828;
  border: 2px solid #3a2c8a;
}
.stage-row .num {
  font-size: 20px;
  color: var(--muted);
}
.stage-row .info {
  display: grid;
  gap: 0;
}
.stage-row .info b {
  font-size: 17px;
}
.stage-row.boss {
  border-color: #8a2a4a;
}
.stage-row.sel {
  border-color: var(--gold);
  background: #2c1d6ae6;
}
.stage-row.locked {
  opacity: 0.5;
}
.stage-row .side {
  display: grid;
  justify-items: end;
  gap: 0;
}
.stage-row .side small {
  font-size: 11px;
}
.stage-row .lock {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.stage-row .starrow .star {
  font-size: 20px;
}
.leagues > .hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 62px;
}
.leagues .bottom {
  position: absolute;
  right: 24px;
  bottom: 14px;
  display: flex;
  gap: 10px;
}

/* ---- Coach ---- */
.coach-panel {
  position: absolute;
  left: 28px;
  top: 18px;
  width: 640px;
  gap: 6px;
  padding: 14px 22px 16px;
}
.coach-panel .btn {
  white-space: nowrap;
}
.coach-panel h2 {
  text-align: left;
  font-size: 26px;
  line-height: 1.15;
}
.coach-panel h3 {
  font-size: 15px;
  color: var(--cyan);
  letter-spacing: 0.2em;
}
.coach-panel ul {
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
}
.coach-panel li {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-transform: none;
  padding-left: 20px;
  position: relative;
}
.coach-panel li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 7px;
  width: 8px;
  height: 8px;
  background: var(--gold);
}
.coach-deck,
.deck {
  position: absolute;
  left: 0;
  right: 0;
  top: 404px;
  bottom: 0;
  background: #0a0620ee;
  display: grid;
  grid-template-columns: 215px 1fr 215px;
  align-items: center;
  justify-items: center;
}

/* ---- Keyboard and hands ---- */
.kb {
  display: grid;
  gap: 3px;
}
.kb-row {
  display: flex;
  gap: 3px;
}
.kb-space {
  justify-content: center;
  padding-left: 0;
}
.key {
  position: relative;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  color: #8f84c8;
  background: #1d1546;
  border-bottom: 4px solid var(--finger);
}
.key b {
  font-weight: 900;
}
.key i {
  position: absolute;
  top: 1px;
  left: 4px;
  font-size: 9px;
  font-style: normal;
  color: #6e63a8;
}
.key.lit {
  z-index: 2;
  color: #120a2e;
  background: var(--finger);
  outline: 3px solid #fff;
  box-shadow: 0 0 16px var(--finger);
}
.key.lit i {
  color: #120a2e;
}
.key.bad {
  background: var(--bad);
  color: #fff;
}
.hand {
  width: 136px;
  height: 126px;
}
.hand .palm {
  fill: #241a58;
  stroke: #4a3aa0;
  stroke-width: 3;
}
.hand .finger {
  fill: #2f2370;
  stroke: var(--finger);
  stroke-width: 3;
  opacity: 0.75;
}
.hand .finger.on {
  fill: var(--finger);
  opacity: 1;
  filter: drop-shadow(0 0 7px var(--finger));
}
.hand-wrap {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding-bottom: 34px;
}
.stats {
  display: flex;
  gap: 22px;
  text-align: center;
}
.stats div {
  display: grid;
}
.stats b {
  font-size: 28px;
  color: var(--text);
}

/* ---- The fight ---- */
.hud {
  position: absolute;
  top: 8px;
  left: 16px;
  right: 16px;
  display: grid;
  grid-template-columns: 1fr 190px 1fr;
  align-items: start;
  gap: 8px;
}
.hud .side {
  display: grid;
  gap: 4px;
}
.hud .who {
  font-size: 19px;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #000;
}
.hud .me .who {
  color: var(--cyan);
}
.hud .foe .who {
  color: var(--pink);
  text-align: right;
}
.hud .foe .who em {
  margin-left: 6px;
  font-style: normal;
  font-size: 13px;
  background: var(--bad);
  color: #fff;
  padding: 1px 5px;
}
.bar {
  position: relative;
  height: 22px;
  background: #1a0a22;
  border: 3px solid #fff;
  box-shadow:
    0 0 0 2px #000,
    inset 0 0 0 2px #000;
}
.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(#ffe46b, #ff9a2e);
  transition: width 0.18s;
}
.foe .bar i {
  margin-left: auto;
  background: linear-gradient(#ff8aa0, #e0405a);
}
.hud .meters {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 18px;
}
.hud .foe .meters {
  justify-content: flex-end;
}
.hud .lab {
  font-size: 12px;
  color: #d8ccff;
  text-shadow: 0 1px 0 #000;
}
.bar.rush,
.bar.attack {
  height: 12px;
  width: 140px;
  border-width: 2px;
}
.bar.rush i {
  background: linear-gradient(#9af0ff, #2a9bff);
}
.bar.rush.full {
  animation: blink 0.4s steps(2) infinite;
}
.bar.attack i {
  background: linear-gradient(#ffb36b, #ff3a3a);
  transition: none;
}
.pips {
  display: flex;
  gap: 4px;
}
.pips span {
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  background: #1a0a22;
}
.pips span.on {
  background: var(--gold);
}
.pips.full span {
  animation: blink 0.4s steps(2) infinite;
}
.hud .score {
  font-size: 15px;
  color: #d8ccff;
  text-shadow: 0 1px 0 #000;
}
.hud .score b {
  color: var(--gold);
}
.vs {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0;
}
.vs b {
  font-size: 40px;
  color: var(--gold);
  text-shadow: 0 4px 0 #b3361a;
  line-height: 1;
}
.vs small {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: #d8ccff;
  text-shadow: 0 1px 0 #000;
}
.partlabel {
  margin-top: 4px;
  padding: 2px 10px;
  font-size: 14px;
  color: #1a1030;
  background: var(--cyan);
}
.hud-warm {
  display: block;
  text-align: center;
}
.hud-warm .who {
  color: #fff;
  font-size: 16px;
}
.prompt {
  position: absolute;
  top: 116px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 300px;
  max-width: 430px;
  padding: 8px 20px 10px;
  display: grid;
  justify-items: center;
  gap: 4px;
  background: #0b0630eb;
  border: 4px solid var(--cyan);
  box-shadow:
    0 0 0 3px #000,
    0 0 26px #5ce1ff55;
}
.move {
  font-size: 15px;
  letter-spacing: 0.22em;
  color: var(--cyan);
}
.move.rush {
  color: #9af0ff;
}
.move.perfect {
  color: var(--gold);
}
.prompt:has(.tiles.perfect) {
  border-color: var(--gold);
  box-shadow:
    0 0 0 3px #000,
    0 0 30px #ffd23faa;
}
.prompt:has(.tiles.rush) {
  box-shadow:
    0 0 0 3px #000,
    0 0 30px #5ce1ffcc;
}
.tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  text-transform: none;
}
.tile {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 54px;
  padding: 0 4px;
  font: 900 42px/1 var(--mono);
  letter-spacing: 0;
  text-transform: none;
  color: #fff;
  background: #1c1450;
  border-bottom: 5px solid #3a2c8a;
}
.tile.done {
  color: #5af08a;
  opacity: 0.55;
}
.tile.cur {
  color: #120a2e;
  background: var(--gold);
  border-bottom-color: #c98a1a;
  animation: nudge 0.5s steps(2) infinite;
}
.tile.sp {
  min-width: 36px;
}
.tile.sp::after {
  content: '';
  width: 20px;
  height: 10px;
  border: 4px solid currentColor;
  border-top: 0;
}
.next {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.next b {
  color: var(--text);
  text-transform: none;
  font-size: 16px;
  letter-spacing: 0.05em;
}
.next em {
  font-style: normal;
  color: var(--gold);
}
.coachline {
  font-size: 14px;
  color: #d8ccff;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
}
.pause-btn {
  position: absolute;
  left: 14px;
  bottom: 12px;
}
.skip-btn {
  position: absolute;
  right: 14px;
  bottom: 12px;
}
.is-warmup .deck .stats {
  visibility: hidden;
}
.fight.over .prompt {
  opacity: 0.25;
  transition: opacity 0.4s;
}
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #05030dc8;
  z-index: 20;
}
.popup {
  position: absolute;
  top: 250px;
  font: 900 40px var(--mono);
  color: #fff;
  text-shadow:
    0 3px 0 #000,
    0 0 12px #ff9a2e;
  animation: float 0.9s ease-out forwards;
  pointer-events: none;
}
.popup.foe {
  right: 160px;
}
.popup.me {
  left: 150px;
  color: #ff8a8a;
}
.popup.big {
  font-size: 66px;
  color: var(--gold);
}
.shake {
  animation: shake 0.25s;
}

.banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 250px;
  text-align: center;
  font: 900 76px/1 var(--mono);
  letter-spacing: 0.05em;
  color: var(--gold);
  text-shadow:
    0 6px 0 #b3361a,
    0 0 30px #ff9a2e;
  pointer-events: none;
  z-index: 30;
}
.banner.pop {
  animation: pop 0.35s ease-out;
}
.banner.rush {
  color: #9af0ff;
  text-shadow:
    0 6px 0 #1b4f9e,
    0 0 30px #5ce1ff;
}
.banner.warn {
  color: var(--bad);
  text-shadow: 0 6px 0 #5a1020;
  font-size: 56px;
}
.banner.ko {
  font-size: 110px;
}
.banner.perfect {
  font-size: 100px;
  color: #fff3b0;
}

/* ---- Special moves: the charge, the damage number and the title card ----
   A fight's screen carries its dragon's element colours as --el-hi, --el and --el-dark (specials.js). */
.prompt.charge {
  border-color: var(--el);
  box-shadow:
    0 0 0 3px #000,
    0 0 calc(14px + var(--c, 0) * 30px) var(--el),
    0 0 calc(var(--c, 0) * 56px) var(--el-dark);
}
.prompt.charge-perfect {
  border-color: var(--gold);
}
.prompt.charge .move {
  color: var(--el-hi);
  text-shadow: 0 0 10px var(--el);
}
.prompt.charge .tile.done {
  color: var(--el-hi);
  background: var(--el-dark);
  border-bottom-color: var(--el);
  opacity: 1;
  text-shadow: 0 0 10px var(--el);
}
/* A bar along the bottom of the box that fills as the move is typed. */
.prompt.charge::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 5px;
  width: calc(var(--c, 0) * 100%);
  background: linear-gradient(90deg, var(--el-dark), var(--el));
}
.prompt.fizzle {
  animation: fizzle 0.5s ease-out;
}
/* Its right edge stays put and it grows leftwards, so even four digits keep clear of the prompt box. */
.popup.special {
  top: 150px;
  right: 36px;
  line-height: 1;
  font-size: 80px;
  color: var(--el-hi);
  text-shadow:
    0 5px 0 var(--el-dark),
    0 0 22px var(--el);
  transform-origin: 100% 50%;
  animation: slam 1.1s linear var(--delay, 0ms) both;
}
.popup.special.perfect {
  top: 130px;
  font-size: 96px;
  animation-duration: 1.3s;
  color: #fff3b0;
  text-shadow:
    0 6px 0 var(--el-dark),
    0 0 26px var(--gold),
    0 0 50px var(--el);
}
/* The title card is a band low in the arena, under the prompt box (which ends at 244) and clear of
   the deck (from 404); a dragon's feet and the floor show through it. */
.card {
  position: absolute;
  left: 0;
  right: 0;
  top: 300px;
  height: 88px;
  display: grid;
  justify-items: center;
  align-content: center;
  pointer-events: none;
  z-index: 30;
}
.card::before,
.card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  bottom: 4px;
  transform-origin: left center;
}
.card::before {
  background: linear-gradient(90deg, #0000, var(--el-dark) 14%, var(--el-dark) 86%, #0000);
  opacity: 0.7;
}
.card.perfect::after {
  top: 2px;
  bottom: 0;
  border-top: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
  opacity: 0.85;
}
.card small {
  position: relative;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--el-hi);
  text-shadow:
    0 0 3px #000,
    0 1px 0 #000;
}
.card.perfect small {
  color: var(--gold);
}
.card b {
  position: relative;
  font: 900 56px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--el-hi);
  text-shadow:
    0 4px 0 var(--el-dark),
    0 0 4px var(--el-dark),
    0 0 22px var(--el);
}
.card.perfect b {
  color: #fff3b0;
  text-shadow:
    0 6px 0 var(--el-dark),
    0 0 30px var(--gold),
    0 0 60px var(--el);
}
.card.show {
  animation: card-out 0.3s ease-in var(--out, 0ms) forwards;
}
.card.show::before,
.card.show::after {
  animation: card-bar 0.24s ease-out var(--delay, 0ms) both;
}
.card.show small {
  animation: card-tag 0.3s ease-out var(--delay, 0ms) both;
}
.card.show b {
  animation: card-in 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.25) var(--delay, 0ms) both;
}
.caps {
  position: absolute;
  top: 366px;
  pointer-events: none;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  padding: 6px 22px;
  font-size: 18px;
  color: #fff;
  background: var(--bad);
  border: 3px solid #fff;
  animation: blink 0.8s steps(2) infinite;
}
.toast {
  position: absolute;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 10px 20px;
  font-size: 15px;
  background: var(--panel2);
  border: 3px solid var(--gold);
  animation: rise 0.25s ease-out;
}

/* ---- Result ---- */
.result-panel {
  width: 600px;
  justify-items: center;
  text-align: center;
}
.result-panel h1 {
  font-size: 84px;
  line-height: 1;
  letter-spacing: 0.06em;
}
.result-panel h1.ko {
  color: var(--gold);
  text-shadow:
    0 6px 0 #b3361a,
    0 0 24px #ff9a2e;
}
.result-panel h1.lost {
  color: var(--bad);
  text-shadow: 0 6px 0 #5a1020;
  font-size: 60px;
}
.perfect-badge {
  padding: 2px 18px;
  font-size: 26px;
  color: #1a1030;
  background: linear-gradient(#fff3b0, #ffd23f);
  letter-spacing: 0.2em;
  animation: blink 0.5s steps(2) 4;
}
.bigrow {
  gap: 10px;
}
.star.big {
  font-size: 64px;
  line-height: 1;
}
.star.big.on {
  animation: pop 0.4s ease-out;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  width: 100%;
}
.result-stats div {
  display: grid;
}
.result-stats b {
  font-size: 26px;
}
.want {
  font-size: 14px;
  color: var(--cyan);
}
.notes {
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: var(--gold);
  font-size: 16px;
}

/* ---- Motion ---- */
@keyframes blink {
  50% {
    opacity: 0.35;
  }
}
@keyframes nudge {
  50% {
    transform: translateY(-3px);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes float {
  from {
    transform: translateY(0) scale(0.7);
    opacity: 1;
  }
  20% {
    transform: translateY(-16px) scale(1.15);
  }
  to {
    transform: translateY(-80px) scale(1);
    opacity: 0;
  }
}
@keyframes pop {
  from {
    transform: scale(1.6);
    opacity: 0;
  }
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
@keyframes fizzle {
  from {
    filter: grayscale(1) brightness(1.3);
  }
}
@keyframes slam {
  0% {
    transform: scale(1.25);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  10% {
    transform: scale(1.15);
  }
  22% {
    transform: scale(0.88);
  }
  34% {
    transform: scale(1.06);
  }
  46% {
    transform: scale(0.98);
  }
  58% {
    transform: scale(1);
  }
  80% {
    opacity: 1;
    transform: translateY(-10px);
  }
  100% {
    opacity: 0;
    transform: translateY(-30px);
  }
}
@keyframes card-bar {
  from {
    transform: scaleX(0);
  }
}
@keyframes card-tag {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}
@keyframes card-in {
  0% {
    opacity: 0;
    transform: translateX(-140px) scale(1.7);
  }
  55% {
    opacity: 1;
    transform: translateX(0) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes card-out {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes fade-out {
  to {
    opacity: 0;
  }
}
@keyframes show-hold {
  0% {
    opacity: 0;
  }
  8%,
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  /* A special's card and number just appear and fade: nothing slides, zooms or bounces. */
  .card.show {
    animation: fade-out 0.3s ease-in var(--out, 0ms) forwards;
  }
  .card.show::before,
  .card.show::after,
  .card.show small,
  .card.show b {
    animation: fade-in 0.2s ease-out var(--delay, 0ms) both;
  }
  .popup.special {
    animation: show-hold 1.1s linear var(--delay, 0ms) both;
  }
  .popup.special.perfect {
    animation-duration: 1.3s;
  }
  .prompt.fizzle {
    animation: none;
  }
  .tile.cur,
  .caps,
  .pips.full span,
  .bar.rush.full,
  .perfect-badge {
    animation: none;
  }
}
