/* MULTIROI CLICKER v0.04
   Phase 4 retro clicker styles with slower levels, next-level counter and click-origin ROI floats.
   Safe to place in /games/assets/multiroi-clicker.css
*/

:root {
  --roi-bg: #070019;
  --roi-bg-2: #160037;
  --roi-panel: #10002b;
  --roi-panel-2: #23005a;
  --roi-hot: #ff51a2;
  --roi-acid: #6dff00;
  --roi-cyan: #00f0ff;
  --roi-yellow: #fff100;
  --roi-white: #fff;
  --roi-dim: #c7b6ff;
  --roi-black: #000;
  --roi-border: #8d4dff;
  --roi-danger: #ff3131;
  --roi-good: #66ff99;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body.multiroi-clicker-page {
  margin: 0;
  color: var(--roi-white);
  font-family: "Courier New", Courier, monospace;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 81, 162, .28), transparent 26%),
    radial-gradient(circle at 80% 25%, rgba(0, 240, 255, .18), transparent 28%),
    linear-gradient(135deg, var(--roi-bg), var(--roi-bg-2) 60%, #02000a);
  overflow-x: hidden;
}

body.multiroi-clicker-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, .045),
      rgba(255, 255, 255, .045) 1px,
      transparent 1px,
      transparent 4px
    );
  mix-blend-mode: screen;
  opacity: .48;
}

body.multiroi-clicker-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(109, 255, 0, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 255, 0, .08) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .25;
}

button,
a,
input { font-family: inherit; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }

.roi-page-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.roi-topbar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.roi-back-link {
  display: inline-block;
  color: var(--roi-yellow);
  background: var(--roi-black);
  border: 2px outset var(--roi-hot);
  padding: 8px 10px;
  text-decoration: none;
  font-weight: 700;
  text-shadow: 1px 1px 0 var(--roi-hot);
}

.roi-back-link:hover,
.roi-back-link:focus {
  color: var(--roi-black);
  background: var(--roi-yellow);
  outline: 2px dotted var(--roi-white);
}

.roi-marquee {
  overflow: hidden;
  border: 2px inset var(--roi-cyan);
  background: #000;
  color: var(--roi-acid);
  white-space: nowrap;
  padding: 8px 0;
  box-shadow: 0 0 18px rgba(0, 240, 255, .35);
}

.roi-marquee span {
  display: inline-block;
  min-width: 100%;
  padding-left: 100%;
  animation: roiMarquee 22s linear infinite;
}

@keyframes roiMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.roi-window {
  border: 3px outset var(--roi-border);
  background: linear-gradient(180deg, rgba(35, 0, 90, .95), rgba(5, 0, 16, .96));
  box-shadow:
    0 0 0 3px #000,
    0 0 30px rgba(255, 81, 162, .38),
    10px 10px 0 rgba(0, 0, 0, .58);
}

.roi-window-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 7px 10px;
  color: #000;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--roi-acid), var(--roi-yellow) 45%, var(--roi-hot));
  border-bottom: 3px ridge #000;
  text-shadow: 1px 1px 0 rgba(255,255,255,.5);
}

.roi-window-buttons { display: inline-flex; gap: 5px; }
.roi-window-buttons i {
  width: 14px;
  height: 14px;
  display: block;
  background: #fff;
  border: 2px outset #000;
}

.roi-game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(280px, .82fr);
  grid-template-areas:
    "core shop"
    "noise leaderboard";
  gap: 14px;
  padding: 14px;
}

.roi-core-panel,
.roi-shop-panel,
.roi-noise-panel,
.roi-leaderboard-panel {
  border: 2px ridge var(--roi-cyan);
  background: linear-gradient(180deg, rgba(16, 0, 43, .97), rgba(0, 0, 0, .92));
  box-shadow: inset 0 0 25px rgba(109, 255, 0, .08);
  padding: 14px;
}

.roi-core-panel {
  grid-area: core;
  position: relative;
  overflow: hidden;
  min-height: 590px;
}
.roi-shop-panel { grid-area: shop; }
.roi-noise-panel { grid-area: noise; }
.roi-leaderboard-panel { grid-area: leaderboard; }

.roi-kicker {
  margin: 0 0 12px;
  color: var(--roi-yellow);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.roi-setup-panel {
  margin: 0 0 14px;
  padding: 14px;
  color: #000;
  background: linear-gradient(135deg, var(--roi-yellow), #fff 58%, var(--roi-cyan));
  border: 3px outset var(--roi-hot);
  box-shadow: 6px 6px 0 #000;
}

.roi-setup-panel[hidden],
.roi-player-panel[hidden] { display: none !important; }

.roi-setup-panel h2,
.roi-shop-panel h2,
.roi-noise-panel h2,
.roi-leaderboard-panel h2,
.roi-noise-panel h3 {
  margin: 0 0 10px;
  color: var(--roi-yellow);
  font-size: 18px;
  line-height: 1.1;
  text-shadow: 2px 2px 0 #000, 0 0 8px rgba(255, 241, 0, .4);
}

.roi-setup-panel h2 {
  color: #000;
  text-shadow: none;
  font-size: 21px;
}

.roi-setup-panel p { margin: 0 0 12px; font-weight: 700; }
.roi-form { margin: 10px 0 0; }
.roi-form label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.roi-inline-form {
  display: flex;
  gap: 8px;
}

.roi-inline-form input {
  flex: 1;
  min-width: 0;
  border: 2px inset #000;
  background: #fff;
  color: #000;
  padding: 9px;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.roi-inline-form button,
.roi-actions button,
.roi-player-actions button,
.roi-panel-heading-row button {
  color: #000;
  background: var(--roi-acid);
  border: 3px outset #fff;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 #000;
}

.roi-inline-form button:active,
.roi-actions button:active,
.roi-player-actions button:active,
.roi-panel-heading-row button:active {
  border-style: inset;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #000;
}

.roi-restore-form input { text-transform: uppercase; }

.roi-player-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  background: #000;
  border: 2px inset var(--roi-cyan);
}

.roi-player-panel strong,
.roi-player-panel code {
  display: block;
  margin-top: 3px;
  color: var(--roi-acid);
  font-size: 16px;
  word-break: break-word;
}

.roi-mini-label {
  display: block;
  color: var(--roi-cyan);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.roi-player-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roi-player-actions button { background: var(--roi-yellow); }
.roi-player-actions button[aria-pressed="false"] { background: #ddd; color: #111; }

.roi-score-card {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  background: #000;
  border: 3px inset var(--roi-hot);
  padding: 12px;
  text-align: center;
  box-shadow: 0 0 18px rgba(255, 81, 162, .28);
  overflow: hidden;
}

.roi-score-card.roi-score-pop {
  animation: roiScorePop .18s steps(2, end) both;
}

@keyframes roiScorePop {
  0% { filter: brightness(1); }
  45% { filter: brightness(1.9) saturate(1.6); transform: scale(1.006); }
  100% { filter: brightness(1); transform: scale(1); }
}

.roi-score-card.roi-level-pop {
  animation: roiLevelCardPop .75s ease-out both;
}

@keyframes roiLevelCardPop {
  0% { box-shadow: 0 0 18px rgba(255, 81, 162, .28); }
  22% { box-shadow: 0 0 0 5px var(--roi-yellow), 0 0 34px rgba(255, 241, 0, .95); }
  100% { box-shadow: 0 0 18px rgba(255, 81, 162, .28); }
}

.roi-level-portrait {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  min-width: 0;
  background:
    linear-gradient(45deg, rgba(109,255,0,.18), transparent 38%),
    linear-gradient(135deg, #160037, #000);
  border: 3px ridge var(--roi-cyan);
  box-shadow: inset 0 0 18px rgba(0,240,255,.18), 4px 4px 0 rgba(0,0,0,.8);
  padding: 7px;
}

.roi-level-strip {
  color: #000;
  background: var(--roi-yellow);
  border: 2px outset #fff;
  padding: 3px 5px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 #000;
}

.roi-level-portrait img {
  display: block;
  width: min(120px, 100%);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin: 7px auto;
  image-rendering: pixelated;
  border: 3px outset #fff;
  background: #111;
  box-shadow: 0 0 18px rgba(255, 81, 162, .42);
}

.roi-level-portrait img.is-changing {
  animation: roiFaceChange .65s steps(4, end) both;
}

@keyframes roiFaceChange {
  0% { opacity: .45; transform: scale(.85) rotate(-7deg); filter: hue-rotate(120deg) contrast(1.5); }
  25% { opacity: 1; transform: scale(1.14) rotate(4deg); filter: invert(1); }
  55% { transform: scale(.96) rotate(-2deg); filter: hue-rotate(-90deg) saturate(2); }
  100% { opacity: 1; transform: scale(1) rotate(0); filter: none; }
}

.roi-level-name {
  color: var(--roi-cyan);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000;
}

.roi-score-main {
  display: grid;
  align-content: center;
  min-width: 0;
}

.roi-score-label {
  color: var(--roi-cyan);
  font-size: 14px;
  font-weight: 700;
}

.roi-score {
  display: block;
  color: var(--roi-acid);
  font-size: clamp(44px, 8vw, 82px);
  font-weight: 900;
  line-height: 1;
  margin-top: 8px;
  text-shadow: 2px 2px 0 #003600, 0 0 18px rgba(109, 255, 0, .85);
  word-break: break-word;
}

.roi-stat-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.roi-stat-row span {
  color: var(--roi-white);
  background: var(--roi-panel-2);
  border: 1px solid var(--roi-border);
  padding: 5px 8px;
  font-size: 13px;
}

.roi-big-button {
  position: relative;
  display: block;
  width: min(390px, 100%);
  min-height: 150px;
  margin: 20px auto 12px;
  color: #000;
  background:
    radial-gradient(circle at 35% 20%, #fff, transparent 20%),
    linear-gradient(135deg, var(--roi-yellow), var(--roi-hot) 52%, var(--roi-cyan));
  border: 6px outset #fff;
  border-radius: 999px;
  box-shadow: 0 10px 0 #000, 0 0 30px rgba(255, 81, 162, .7);
  text-align: center;
  text-transform: uppercase;
  transform: translateY(0);
  transition: transform .06s ease, box-shadow .06s ease, filter .08s ease;
  user-select: none;
  touch-action: manipulation;
}

.roi-big-button:hover { filter: saturate(1.35) contrast(1.08); }
.roi-big-button:active,
.roi-big-button.roi-button-pulse {
  transform: translateY(7px) scale(.985);
  border-style: inset;
  box-shadow: 0 3px 0 #000, 0 0 38px rgba(109, 255, 0, .8);
}

.roi-big-button.roi-click-spark::after {
  content: "CLICK!!!";
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%) rotate(-5deg);
  color: #000;
  background: var(--roi-acid);
  border: 2px outset #fff;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 2px 2px 0 #000;
  animation: roiClickSpark .28s ease-out both;
}

@keyframes roiClickSpark {
  0% { opacity: 0; transform: translateX(-50%) scale(.35) rotate(-9deg); }
  45% { opacity: 1; transform: translateX(-50%) scale(1.14) rotate(6deg); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-18px) scale(.95) rotate(-3deg); }
}

.roi-button-main {
  display: block;
  font-size: clamp(28px, 5.4vw, 48px);
  font-weight: 900;
  letter-spacing: -.03em;
  text-shadow: 2px 2px 0 rgba(255,255,255,.6);
}

.roi-button-sub {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 900;
}

.roi-floating-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.roi-float {
  position: absolute;
  z-index: 12;
  color: var(--roi-yellow);
  font-size: 22px;
  font-weight: 900;
  text-shadow: 2px 2px 0 #000, 0 0 10px var(--roi-hot);
  will-change: transform, opacity;
  animation: roiFloatUp .82s cubic-bezier(.17,.67,.27,1.05) forwards;
}

.roi-float.is-mega {
  color: var(--roi-acid);
  font-size: 28px;
  text-shadow: 2px 2px 0 #000, 0 0 16px var(--roi-cyan);
}

.roi-particle {
  position: absolute;
  z-index: 11;
  color: var(--roi-cyan);
  font-size: 16px;
  font-weight: 900;
  text-shadow: 2px 2px 0 #000;
  animation: roiParticle .62s ease-out forwards;
}

@keyframes roiFloatUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.72) rotate(-5deg); }
  13% { opacity: 1; }
  38% { transform: translate(-50%, -34px) scale(1.18) rotate(4deg); }
  100% { opacity: 0; transform: translate(-50%, -96px) scale(1.33) rotate(10deg); }
}

@keyframes roiParticle {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(0deg); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, -44px))) scale(1.25) rotate(140deg); }
}

.roi-progress-wrap { margin-top: 12px; }
.roi-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--roi-cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.roi-next-distance {
  margin-top: 5px;
  color: var(--roi-yellow);
  font-size: 18px;
  font-weight: 900;
  text-align: right;
  text-shadow: 2px 2px 0 #000, 0 0 10px rgba(255, 241, 0, .45);
}
.roi-progress-bar {
  height: 18px;
  margin-top: 6px;
  background: #000;
  border: 2px inset var(--roi-cyan);
  overflow: hidden;
}
.roi-progress-fill {
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--roi-acid), var(--roi-acid) 9px, var(--roi-yellow) 9px, var(--roi-yellow) 18px);
  box-shadow: 0 0 12px rgba(109,255,0,.8);
  transition: width .2s ease;
}

.roi-status,
.roi-server-status {
  min-height: 42px;
  margin: 12px 0 0;
  color: var(--roi-acid);
  background: #000;
  border: 2px inset var(--roi-border);
  padding: 9px;
  font-size: 13px;
  line-height: 1.35;
}

.roi-server-status { min-height: auto; color: var(--roi-dim); }
.roi-server-status.is-ok { color: var(--roi-good); }
.roi-server-status.is-error { color: var(--roi-danger); }

.roi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.roi-actions button:nth-child(1) { background: var(--roi-cyan); }
.roi-actions button:nth-child(2) { background: var(--roi-acid); }
.roi-actions button:nth-child(3) { background: var(--roi-hot); color: #fff; }

.roi-upgrade-list {
  display: grid;
  gap: 10px;
}

.roi-upgrade {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px;
  color: var(--roi-white);
  text-align: left;
  background: linear-gradient(135deg, rgba(35, 0, 90, .98), rgba(0, 0, 0, .95));
  border: 2px outset var(--roi-border);
  box-shadow: 4px 4px 0 rgba(0,0,0,.7);
}

.roi-upgrade:hover:not(:disabled) {
  border-color: var(--roi-yellow);
  box-shadow: 0 0 16px rgba(255, 241, 0, .3), 4px 4px 0 rgba(0,0,0,.7);
}
.roi-upgrade:active:not(:disabled) { border-style: inset; transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(0,0,0,.7); }

.roi-upgrade-name {
  display: block;
  color: var(--roi-yellow);
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}
.roi-upgrade-desc {
  display: block;
  margin-top: 4px;
  color: var(--roi-dim);
  font-size: 12px;
  line-height: 1.3;
}
.roi-upgrade-meta {
  display: block;
  margin-top: 5px;
  color: var(--roi-cyan);
  font-size: 11px;
}
.roi-upgrade-cost {
  color: #000;
  background: var(--roi-acid);
  border: 2px outset #fff;
  padding: 7px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.roi-meter {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin-bottom: 12px;
  padding: 8px;
  background: #000;
  border: 2px inset var(--roi-hot);
}
.roi-meter i {
  display: block;
  height: 20px;
  background: var(--roi-acid);
  transform-origin: bottom;
  animation: roiMeter 1s steps(2, end) infinite alternate;
}
.roi-meter i:nth-child(2n) { animation-delay: .15s; background: var(--roi-cyan); }
.roi-meter i:nth-child(3n) { animation-delay: .35s; background: var(--roi-hot); }

@keyframes roiMeter {
  0% { transform: scaleY(.2); }
  25% { transform: scaleY(.72); }
  50% { transform: scaleY(.38); }
  100% { transform: scaleY(1); }
}

.roi-level-help {
  display: grid;
  gap: 6px;
  min-height: 42px;
  margin-bottom: 12px;
  padding: 8px;
  color: var(--roi-cyan);
  background: #000;
  border: 2px inset var(--roi-cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}


.roi-badge-item,
.roi-badge-empty {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #000;
  background: var(--roi-yellow);
  border: 2px outset #fff;
  padding: 6px 7px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 #000;
}

.roi-badge-empty { background: #ddd; color: #333; }
.roi-badge-item.is-new { animation: roiBadgePop .75s ease-out both; }

@keyframes roiBadgePop {
  0% { transform: scale(.25) rotate(-12deg); opacity: 0; }
  55% { transform: scale(1.18) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

.roi-log {
  list-style: square;
  margin: 0;
  padding: 10px 10px 10px 28px;
  background: #000;
  border: 2px inset var(--roi-border);
  color: var(--roi-dim);
  font-size: 12px;
  line-height: 1.45;
  min-height: 116px;
}

.roi-log li:first-child { color: var(--roi-acid); }

.roi-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.roi-badges span {
  display: inline-block;
  color: #000;
  background: var(--roi-yellow);
  border: 2px outset #fff;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 900;
  transform: rotate(-2deg);
}
.roi-badges span:nth-child(2n) { background: var(--roi-cyan); transform: rotate(2deg); }
.roi-badges span:nth-child(3n) { background: var(--roi-hot); color: #fff; }

.roi-panel-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.roi-panel-heading-row button { background: var(--roi-yellow); }

.roi-leaderboard {
  counter-reset: roiRank;
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.roi-leaderboard li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px;
  background: #000;
  border: 2px inset var(--roi-border);
  font-size: 12px;
}

.roi-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: #000;
  background: var(--roi-acid);
  border: 2px outset #fff;
  font-weight: 900;
}

.roi-board-name {
  color: var(--roi-yellow);
  font-weight: 900;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.roi-board-score {
  color: var(--roi-acid);
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.roi-footer {
  margin-top: 12px;
  color: var(--roi-dim);
  text-align: center;
  font-size: 12px;
}

.roi-shake { animation: roiShake .3s linear both; }
@keyframes roiShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(5px, -2px); }
  60% { transform: translate(-2px, -3px); }
  80% { transform: translate(3px, 2px); }
}

.roi-win-flash { animation: roiWinFlash 1.8s steps(2, end) both; }
@keyframes roiWinFlash {
  0%, 100% { filter: none; }
  12%, 36%, 62% { filter: hue-rotate(80deg) brightness(1.7) saturate(2); }
  24%, 50%, 76% { filter: hue-rotate(-90deg) brightness(1.2) saturate(1.8); }
}

.roi-unlock-burst::after {
  content: "*** NEW INTERNET POWER UNLOCKED ***";
  position: fixed;
  z-index: 20;
  left: 50%;
  top: 18%;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  color: #000;
  background: var(--roi-yellow);
  border: 5px outset #fff;
  padding: 18px;
  text-align: center;
  font-size: clamp(20px, 5vw, 38px);
  font-weight: 900;
  line-height: 1.05;
  box-shadow: 8px 8px 0 #000, 0 0 40px rgba(255, 81, 162, .7);
  animation: roiUnlockBanner 1.55s ease-out both;
  pointer-events: none;
}

@keyframes roiUnlockBanner {
  0% { opacity: 0; transform: translateX(-50%) scale(.4) rotate(-8deg); }
  16% { opacity: 1; transform: translateX(-50%) scale(1.08) rotate(3deg); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) scale(.92) rotate(0deg); }
}

@media (max-width: 900px) {
  .roi-topbar { grid-template-columns: 1fr; }
  .roi-game-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "core"
      "shop"
      "leaderboard"
      "noise";
  }
  .roi-core-panel { min-height: 0; }
}

@media (max-width: 620px) {
  .roi-page-shell { width: min(100% - 12px, 1240px); padding-top: 8px; }
  .roi-game-grid { padding: 8px; gap: 8px; }
  .roi-core-panel,
  .roi-shop-panel,
  .roi-noise-panel,
  .roi-leaderboard-panel { padding: 10px; }
  .roi-window { box-shadow: 0 0 0 2px #000, 0 0 22px rgba(255, 81, 162, .35); }
  .roi-inline-form { flex-direction: column; }
  .roi-inline-form button { width: 100%; }
  .roi-player-panel { grid-template-columns: 1fr; }
  .roi-score-card { grid-template-columns: 112px minmax(0, 1fr); gap: 8px; padding: 8px; }
  .roi-level-portrait { padding: 5px; }
  .roi-level-portrait img { width: 86px; }
  .roi-level-strip { font-size: 10px; }
  .roi-level-name { font-size: 9px; }
  .roi-big-button { min-height: 132px; margin-top: 14px; }
  .roi-upgrade { grid-template-columns: 1fr; }
  .roi-upgrade-cost { justify-self: start; }
  .roi-leaderboard li { grid-template-columns: auto 1fr; }
  .roi-board-score { grid-column: 2; text-align: left; }
}


@media (max-width: 420px) {
  .roi-score-card { grid-template-columns: 92px minmax(0, 1fr); }
  .roi-level-portrait { padding: 4px; }
  .roi-level-portrait img { width: 70px; margin: 4px auto; }
  .roi-level-strip { font-size: 9px; padding: 2px 3px; }
  .roi-level-name { font-size: 8px; }
  .roi-score { font-size: clamp(34px, 16vw, 54px); }
  .roi-stat-row span { font-size: 11px; padding: 4px 5px; }
  .roi-next-distance { text-align: left; font-size: 15px; }
}

.roi-unlock-burst strong,
.roi-unlock-burst span {
  display: block;
}
.roi-unlock-burst span {
  margin-top: 3px;
  font-size: .62em;
}

/* v0.04 level-up banner uses a real element instead of body::after. */
.roi-unlock-burst::after {
  content: none !important;
  display: none !important;
}
.roi-unlock-burst {
  position: fixed;
  z-index: 20;
  left: 50%;
  top: 18%;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  color: #000;
  background: var(--roi-yellow);
  border: 5px outset #fff;
  padding: 18px;
  text-align: center;
  font-size: clamp(20px, 5vw, 38px);
  font-weight: 900;
  line-height: 1.05;
  box-shadow: 8px 8px 0 #000, 0 0 40px rgba(255, 81, 162, .7);
  animation: roiUnlockBanner 1.55s ease-out both;
  pointer-events: none;
}
