html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #070918;
  font-family: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
  cursor: crosshair;
}

.tuning {
  position: fixed;
  top: 70px;
  right: 12px;
  width: min(320px, calc(100vw - 24px));
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(35, 67, 90, 0.92);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.tuning[hidden] { display: none; }

.tp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 16px;
}
.tp-close {
  background: none;
  border: 0;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.tp-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  margin: 8px 0;
}
.tp-val { font-variant-numeric: tabular-nums; color: #ffd2c9; }
.tp-row input { grid-column: 1 / -1; width: 100%; accent-color: #ff6f59; }

.tp-stats {
  margin: 10px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 13px;
  line-height: 1.4;
}

.tp-btns { display: flex; gap: 8px; }
.tp-btns button {
  flex: 1;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: #ff6f59;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.tp-btns button + button { background: rgba(255, 255, 255, 0.18); }

.tp-note { margin: 10px 0 0; font-size: 12px; opacity: 0.75; line-height: 1.4; }

/* ---- screens: mode menu, upgrade shop, game over (js/main.js) ---- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  overflow-y: auto;
  box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at center, rgba(7, 9, 24, 0.3), rgba(7, 9, 24, 0.78));
  color: #23435a;
}
.screen[hidden] { display: none; }
.screen button { font: inherit; color: inherit; cursor: pointer; }

.panel {
  margin: auto;   /* centred, but scrolls from the top when taller than the screen */
  width: min(560px, 100%);
  box-sizing: border-box;
  padding: 22px 22px 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.key {
  position: absolute;
  top: 10px;
  right: 12px;
  min-width: 22px;
  box-sizing: border-box;
  padding: 1px 6px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.25);
  font-size: 13px;
  font-weight: 600;
}
.hint { margin: 12px 0 0; font-size: 13px; opacity: 0.6; }

/* menu */
.logo {
  margin: 0;
  font-size: clamp(40px, 10vw, 58px);
  font-weight: 700;
  line-height: 1.05;
  background: linear-gradient(90deg, #ff6f59, #8f5cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { margin: 4px 0 18px; font-weight: 500; opacity: 0.7; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 16px 14px;
  border: 0;
  border-radius: 18px;
  text-align: left;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.16);
  transition: transform 0.12s;
}
.screen .mode-card { color: #fff; }
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-3px); }
.mode-card:active { transform: translateY(1px); }
.mode-card.endless { background: linear-gradient(135deg, #ff6f59, #ff9a5a); }
.mode-card.waves { background: linear-gradient(135deg, #8f5cff, #5c7cff); }
.mode-card.last { outline: 3px solid rgba(35, 67, 90, 0.3); outline-offset: 3px; }
/* menu pages (D53): Singleplayer / Multiplayer, then their modes */
.modes.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* columns never grow past half */
.mode-card.single { background: linear-gradient(135deg, #ff7a59, #b35cff); }
.mode-card.multi { background: linear-gradient(135deg, #1fb57a, #3a6cff); }
.mode-card.royale { background: linear-gradient(135deg, #ffb238, #ff4f6d); }
.mode-card.soon { opacity: 0.75; }
.mode-card.single .mode-title, .mode-card.multi .mode-title { font-size: 24px; }
/* phones held upright: the two cards one above the other (D53) */
@media (max-width: 520px) and (orientation: portrait) {
  .modes.two { grid-template-columns: 1fr; }
}
.menu-sub { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.menu-sub h2 { margin: 0; font-size: 22px; }
.back-btn { border: 0; border-radius: 12px; padding: 7px 12px; background: rgba(35, 67, 90, 0.08); font-weight: 700; color: inherit; }
.back-btn .key { position: static; display: inline-block; margin-right: 6px; background: rgba(35, 67, 90, 0.12); }
.mode-title { font-size: 26px; font-weight: 700; }
.mode-desc { font-size: 15px; font-weight: 500; line-height: 1.35; }
.mode-best {
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 14px;
  font-weight: 600;
}

/* shop */
.shop-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.cleared { font-size: 22px; font-weight: 700; color: #1f9e69; }
.wallet { padding: 4px 14px; border-radius: 999px; background: #ffe27a; font-size: 24px; font-weight: 700; }
.ship-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 4px 14px 4px 4px;
  border-radius: 16px;
  background: #0d1030;
  color: #fff;
  text-align: left;
}
.ship-preview { flex: none; }
.ship-stats { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.ship-stats b { font-size: 19px; }
.ship-stats span { opacity: 0.85; }
.upgrades { display: grid; gap: 8px; }
.upg {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 44px 9px 10px;
  border: 2px solid rgba(35, 67, 90, 0.12);
  border-radius: 14px;
  background: #fff;
  text-align: left;
}
.upg:hover:not(:disabled) { border-color: #ff6f59; }
.upg.poor .upg-cost { color: #b0584c; opacity: 0.6; }
.upg:disabled { opacity: 0.55; cursor: default; }
.upg .key { top: 50%; transform: translateY(-50%); background: rgba(35, 67, 90, 0.1); }
.upg-icon { font-size: 26px; text-align: center; }
.upg-main { display: flex; flex-direction: column; gap: 1px; }
.upg-name { font-size: 17px; font-weight: 700; }
.upg-desc { font-size: 13px; opacity: 0.7; }
.pips { display: flex; gap: 4px; margin-top: 4px; }
.pips i { width: 16px; height: 6px; border-radius: 3px; background: rgba(35, 67, 90, 0.15); }
.pips i.on { background: #ff6f59; }
.upg-cost { font-size: 17px; font-weight: 700; white-space: nowrap; }
.shop-msg { min-height: 1.2em; margin: 10px 0 0; font-weight: 600; color: #8f5cff; }

.screen .primary {
  width: 100%;
  margin-top: 12px;
  padding: 13px;
  border: 0;
  border-radius: 999px;
  background: #ff6f59;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 5px 0 #d4513d;
}
.screen .primary:active { transform: translateY(2px); box-shadow: 0 3px 0 #d4513d; }

/* game over */
.over-mode { margin: 0; font-weight: 600; opacity: 0.6; }
.over h2 { margin: 2px 0 0; font-size: 40px; }
.cause { margin: 2px 0 6px; opacity: 0.75; }
.score { font-size: 58px; font-weight: 700; line-height: 1.1; color: #ff6f59; font-variant-numeric: tabular-nums; }
.best { display: inline-block; margin-top: 4px; padding: 3px 12px; border-radius: 999px; background: rgba(35, 67, 90, 0.08); font-weight: 600; }
.best.new { background: #ffe27a; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 4px; }
.stats div { display: flex; flex-direction: column; padding: 8px 4px; border-radius: 12px; background: rgba(35, 67, 90, 0.06); }
.stats b { font-size: 20px; }
.stats span { font-size: 12px; opacity: 0.65; }
.btns { display: flex; gap: 10px; }
.btns .primary { flex: 2; }
.screen .secondary {
  flex: 1;
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(35, 67, 90, 0.1);
  font-size: 18px;
  font-weight: 600;
}

/* menu with three modes */
.panel.menu { width: min(760px, 100%); }
.mode-card.versus { background: linear-gradient(135deg, #1fb57a, #1d8fb8); }

/* versus lobby / waiting / result (js/versus-ui.js) */
.vs h2 { margin: 0; font-size: 32px; }
.ship-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; margin: 4px 0 12px; }
.ship-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px 8px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #0d1030;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.screen .ship-pick { color: #fff; }
.ship-pick span { max-width: 100%; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ship-pick.on { border-color: #1fb57a; box-shadow: 0 0 0 3px rgba(31, 181, 122, 0.3); }
.join-row { display: flex; gap: 8px; margin-top: 10px; }
.join-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 2px solid rgba(35, 67, 90, 0.2);
  border-radius: 999px;
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-align: center;
  text-transform: uppercase;
  color: #23435a;
  -webkit-user-select: text;
  user-select: text;
}
.join-row input:focus { outline: none; border-color: #1d8fb8; }
.join-row .join { padding: 0 22px; border: 0; border-radius: 999px; background: #1d8fb8; font-size: 18px; font-weight: 700; }
.screen .join-row .join { color: #fff; }
.screen .secondary.wide { display: block; width: 100%; padding: 11px; }
.vs-msg { min-height: 1.2em; margin: 10px 0 0; font-weight: 600; color: #c8412c; }
.screen .link { margin-top: 6px; border: 0; background: none; font-weight: 600; opacity: 0.6; }
.room-code {
  margin: 10px 0;
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #1d8fb8;
  -webkit-user-select: all;
  user-select: all;
}
.wait { font-weight: 600; opacity: 0.75; }
.wait .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  background: #1fb57a;
  animation: vs-pulse 1s ease-in-out infinite;
}
@keyframes vs-pulse { 50% { opacity: 0.25; } }
.screen button:disabled { cursor: default; opacity: 0.7; }

/* settings (js/main.js showSettings) */
.settings-btn {
  margin-top: 14px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(35, 67, 90, 0.08);
  font-size: 16px;
  font-weight: 700;
}
.settings-state { margin-left: 6px; font-weight: 500; opacity: 0.7; }
.settings h2 { margin: 0 0 8px; font-size: 32px; }
.set-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(35, 67, 90, 0.1);
  text-align: left;
}
.set-row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.set-row.dim { opacity: 0.45; }
.set-label { flex: 1; font-size: 17px; font-weight: 700; }
.set-row input[type=range] { flex: 2; min-width: 0; accent-color: #ff6f59; }
.set-val { width: 3.2em; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.set-hint { font-size: 13px; opacity: 0.65; }
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 84px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(35, 67, 90, 0.18);
  font-size: 15px;
  font-weight: 700;
  justify-content: flex-end;
  transition: background 0.15s;
}
.toggle .knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: left 0.15s;
}
.toggle.on { justify-content: flex-start; background: #1fb57a; }
.screen .toggle.on { color: #fff; }
.toggle.on .knob { left: 52px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn {
  flex: 1;
  min-width: 100px;
  padding: 9px 8px;
  border: 2px solid rgba(35, 67, 90, 0.15);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
}
.seg-btn.on { border-color: #ff6f59; background: rgba(255, 111, 89, 0.12); }

.set-label small { display: block; margin-top: 1px; font-size: 12px; font-weight: 500; opacity: 0.6; }
.seg-btn.small { flex: none; min-width: 0; padding: 7px 14px; font-size: 14px; }
a.seg-btn { display: inline-block; color: inherit; text-decoration: none; text-align: center; }

/* on a touchscreen, keyboard badges mean nothing (js/settings.js toggles body.touch) */
.touch .key { display: none; }
.touch .upg { padding-right: 12px; }

/* how-to-play cards */
.howto h2 { margin: 0 0 6px; font-size: 34px; }
.howto-list { margin: 8px 0 4px; padding: 0; list-style: none; text-align: left; }
.howto-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 4px;
  border-bottom: 1px solid rgba(35, 67, 90, 0.08);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}
.howto-icon { flex: none; width: 30px; font-size: 22px; line-height: 1.1; text-align: center; }

@media (max-width: 440px) {
  .panel { padding: 18px 14px 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .mode-desc { font-size: 14px; }
}

/* menu: shop + settings row (js/main.js showMenu) */
.menu-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.menu-row .settings-btn { margin-top: 0; }
.store-btn {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: #ffe27a;
  font-size: 16px;
  font-weight: 700;
}
.store-btn .key { position: static; background: rgba(35, 67, 90, 0.12); }
.coins { font-variant-numeric: tabular-nums; }
.menu-ship { font-weight: 500; opacity: 0.75; }
.mode-card .mode-title { font-size: 28px; }

/* general shop (js/main.js showStore) */
.store .shop-head h2 { margin: 0; font-size: 30px; }
.tabs { margin: 4px 0 10px; flex-wrap: nowrap; }
.tabs .seg-btn { min-width: 0; padding: 6px 2px; font-size: 13px; line-height: 1.15;
  display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tabs .tab-i { font-size: 18px; }
.tabs .tab-t { white-space: nowrap; }
.ship-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ship-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 6px 8px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #0d1030;
  font-size: 13px;
}
.screen .ship-card { color: #fff; }
.ship-card b { font-size: 15px; }
.ship-card .stat { font-size: 11px; opacity: 0.75; }
.ship-card .gad { font-size: 15px; }
.ship-card .price { margin-top: 2px; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); font-weight: 700; }
.ship-card.locked .price { background: #ffe27a; color: #23435a; }
.reward { display: block; width: 100%; margin: 10px 0 4px; padding: 10px 14px; border: 0; border-radius: 14px;
  background: linear-gradient(135deg, #ffe066, #ffb35c); color: #23435a; font: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; box-shadow: 0 3px 0 #d99a12; }
.reward:active { transform: translateY(2px); box-shadow: 0 1px 0 #d99a12; }
.reward small { font-size: 12px; font-weight: 600; opacity: 0.75; margin-left: 6px; }
.ship-card .legend { font-size: 11px; font-weight: 700; color: #ffd84d; letter-spacing: 0.03em; }
.ship-card .legend.epic { color: #c9a8ff; }
.trail-preview { flex: none; width: 100% !important; max-width: 104px; height: auto !important; aspect-ratio: 104 / 64; }
.ship-grid > .ship-card { min-width: 0; }
.ship-stats b small { font-size: 12px; font-weight: 600; opacity: 0.7; }
.ship-card.on { border-color: #1fb57a; box-shadow: 0 0 0 3px rgba(31, 181, 122, 0.3); }
.ask { border-color: #ff6f59 !important; box-shadow: 0 0 0 3px rgba(255, 111, 89, 0.35); }
.upg-name small { font-size: 12px; font-weight: 600; opacity: 0.6; }
.pips i.lock { background: repeating-linear-gradient(45deg, rgba(35, 67, 90, 0.1) 0 3px, transparent 3px 6px); }
.upg.maxed .upg-cost { color: #1f9e69; }
.store-note { margin: 8px 0 0; font-size: 13px; opacity: 0.65; }
.gadget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.gadget-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  border: 2px solid rgba(35, 67, 90, 0.12);
  border-radius: 14px;
  background: #fff;
  text-align: left;
}
.gadget-card.on { border-color: #1fb57a; }
.g-icon { font-size: 28px; }
.gadget-card b { font-size: 17px; }
.g-desc { font-size: 14px; opacity: 0.8; }
.g-cd { font-size: 12px; opacity: 0.6; }
.gadget-card .price { align-self: flex-end; padding: 2px 12px; border-radius: 999px; background: rgba(35, 67, 90, 0.08); font-weight: 700; }
.coin-line { margin: 8px 0 0; font-weight: 600; color: #b8860b; }
.vs-gadget { margin: 0 0 10px; font-size: 14px; }
.wave-ups { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* phones held sideways (and other short screens): tighter panels, side-by-side lists */
@media (max-height: 520px) {
  .screen { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .panel { padding: 12px 16px 10px; border-radius: 18px; }
  .panel.menu, .panel.store, .panel.shop, .panel.vs { width: min(860px, 100%); }
  .logo { font-size: 34px; }
  .tagline { margin: 2px 0 8px; font-size: 14px; }
  .modes { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mode-card { padding: 10px 12px; }
  .mode-card .mode-title { font-size: 22px; }
  .menu-row { margin-top: 8px; }
  .hint { margin-top: 6px; font-size: 12px; }
  .ship-row { margin: 6px 0; }
  .ship-row .ship-preview { width: 60px !important; height: 60px !important; }
  .upgrades, .wave-ups { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
  .shop-head .cleared { font-size: 18px; }
  .wallet { font-size: 18px; }
  .upg { padding: 6px 40px 6px 8px; }
  .upg-desc { font-size: 12px; }
  .screen .primary { margin-top: 8px; padding: 9px; font-size: 18px; }
  .shop-msg { margin-top: 6px; }
  .ship-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .howto h2 { font-size: 26px; }
  .howto-list { columns: 2; column-gap: 16px; }
  .howto-list li { break-inside: avoid; padding: 6px 4px; font-size: 14px; }
  .over h2 { font-size: 30px; }
  .score { font-size: 42px; }
  .stats { margin: 8px 0 2px; }
  .ship-picks { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); margin-bottom: 6px; }
  .room-code { margin: 4px 0; font-size: 44px; }
  .settings .set-row { padding: 7px 4px; }
  /* landscape phones (D52): the shops keep their header, tabs and button in view; only the list scrolls */
  .panel.store, .panel.shop { display: flex; flex-direction: column; max-height: 100%; }
  .panel.store > *, .panel.shop > * { flex: none; }
  .panel.store > .store-body, .panel.shop > .wave-ups { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px; }
  .panel.store .hint, .panel.shop .hint { display: none; }
  .panel.store .ship-row, .panel.shop .ship-row { margin: 4px 0; padding-top: 4px; padding-bottom: 4px; }
  .panel.store .ship-row .ship-preview, .panel.shop .ship-row .ship-preview { width: 44px !important; height: 44px !important; }
  .panel.store .shop-msg:empty, .panel.store .shop-msg { margin: 2px 0; min-height: 0; }
}
@media (max-width: 440px) {
  .tabs .seg-btn { font-size: 12px; }
  .ship-grid { grid-template-columns: repeat(3, 1fr); }
  .store-btn { font-size: 15px; }
}

/* battle royale (D54): the seats filling while pilots are found, and the champion's screen */
.royale-find .seats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-width: 260px; margin: 16px auto; }
.royale-find .seat { aspect-ratio: 1; border-radius: 50%; background: rgba(35, 67, 90, 0.12); transition: transform 0.3s, background 0.3s, box-shadow 0.3s; }
.royale-find .seat.on { background: linear-gradient(135deg, #ffb238, #ff4f6d); transform: scale(1.1); box-shadow: 0 0 14px rgba(255, 110, 90, 0.6); }
.panel.royale-win {
  position: relative; overflow: hidden; text-align: center;
  background: radial-gradient(circle at 50% 0%, #fffbe8 0%, #ffe38f 45%, #ffb238 100%);
  box-shadow: 0 0 60px rgba(255, 200, 60, 0.55), 0 10px 0 rgba(0, 0, 0, 0.18);
  animation: champ-pop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.panel.royale-win::before {   /* a sweep of light across the panel */
  content: ''; position: absolute; top: -20%; bottom: -20%; width: 40%; left: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: champ-shine 2.4s ease-in-out 0.5s infinite; pointer-events: none;
}
.royale-win .crown { font-size: 72px; line-height: 1; margin-top: -4px; filter: drop-shadow(0 6px 8px rgba(150, 80, 0, 0.35)); animation: champ-crown 1.6s ease-in-out infinite; }
.royale-win .over-mode { color: #8a4b00; }
.royale-win .champ { margin: 2px 0 6px; font-size: 34px; letter-spacing: 1px; color: #7a3300; }
.royale-win .champ span {
  display: inline-block; margin-right: 8px; font-size: 58px; vertical-align: -6px;
  background: linear-gradient(180deg, #ffffff, #ffd84d 55%, #ff9a3c); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #b85c00); animation: champ-num 1.2s ease-in-out infinite;
}
.royale-win .cause { color: #7a3300; font-weight: 600; }
.royale-win .stats > div { background: rgba(255, 255, 255, 0.55); }
@keyframes champ-pop { from { transform: scale(0.35) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes champ-crown { 0%, 100% { transform: translateY(0) rotate(-7deg); } 50% { transform: translateY(-10px) rotate(7deg); } }
@keyframes champ-num { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes champ-shine { from { transform: translateX(-150%) skewX(-20deg); } to { transform: translateX(320%) skewX(-20deg); } }
@media (prefers-reduced-motion: reduce) {
  .panel.royale-win, .panel.royale-win::before, .royale-win .crown, .royale-win .champ span { animation: none; }
}
.stats.three { grid-template-columns: repeat(3, 1fr); }   /* battle royale results: three boxes in a row (D59) */
