/*
  Dumb Game Palace styles.
  Tweak theme colors in the data-theme blocks near the top.
  Tweak animation intensity in the keyframes section below.
*/

:root {
  --bg: #140f2a;
  --bg-soft: #25164c;
  --panel: rgba(24, 17, 45, 0.84);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #fff9ee;
  --muted: #d8c9ff;
  --accent: #ffbf46;
  --accent-2: #ff5c7c;
  --accent-3: #64f4d7;
  --shadow: rgba(0, 0, 0, 0.35);
  --success: #89ff8d;
  --danger: #ff6c91;
  --scanline: rgba(255, 255, 255, 0.06);
  --button-text: #1b1039;
  --card-glow: rgba(255, 191, 70, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition: 180ms ease;
  --title-font: "Impact", "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  --body-font: "Trebuchet MS", "Verdana", sans-serif;
  --mono-font: "Courier New", monospace;
}

body[data-theme="slime"] {
  --bg: #091b14;
  --bg-soft: #1e4538;
  --panel: rgba(9, 35, 26, 0.84);
  --muted: #d4ffe8;
  --accent: #ffd447;
  --accent-2: #69ff92;
  --accent-3: #53d8ff;
  --button-text: #092015;
  --card-glow: rgba(105, 255, 146, 0.25);
}

body[data-theme="disco"] {
  --bg: #251018;
  --bg-soft: #4f1633;
  --panel: rgba(50, 16, 34, 0.83);
  --muted: #ffe5ef;
  --accent: #7eff4f;
  --accent-2: #ff7adf;
  --accent-3: #ffd24d;
  --button-text: #240f17;
  --card-glow: rgba(255, 122, 223, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 32%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
  color: var(--text);
  font-family: var(--body-font);
}

body.crt-enabled .page-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(transparent 0%, transparent 48%, var(--scanline) 49%, transparent 51%, transparent 100%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 255, 0.02));
  background-size: 100% 4px, 8px 100%;
  mix-blend-mode: screen;
  opacity: 0.55;
  z-index: 30;
}

body.nonsense-mode .hero-title {
  animation-duration: 1.05s;
}

body.nonsense-mode .panel {
  animation: sillyTilt 5s ease-in-out infinite;
}

body.nonsense-mode #stage-panel {
  animation: none;
  transform: none;
}

body.extreme-mode .page-shell {
  filter: saturate(1.25) contrast(1.08);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.layout {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.bg-layer,
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-layer-a {
  background:
    radial-gradient(circle at 15% 25%, rgba(255, 92, 124, 0.2), transparent 22%),
    radial-gradient(circle at 78% 18%, rgba(100, 244, 215, 0.18), transparent 24%),
    radial-gradient(circle at 70% 72%, rgba(255, 191, 70, 0.18), transparent 18%);
  animation: floatBg 18s linear infinite;
  z-index: 0;
}

.bg-layer-b {
  background:
    radial-gradient(circle at 25% 85%, rgba(255, 255, 255, 0.06), transparent 18%),
    radial-gradient(circle at 90% 45%, rgba(255, 255, 255, 0.08), transparent 15%);
  animation: pulseBg 9s ease-in-out infinite;
  z-index: 0;
}

.bg-grid {
  z-index: 1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.18;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 92%);
}

.panel {
  position: relative;
  margin-bottom: 20px;
  padding: 22px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 24%), var(--panel);
  box-shadow:
    0 22px 55px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: auto -10% -55% auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--card-glow), transparent 70%);
  pointer-events: none;
  animation: pulseBg 8s ease-in-out infinite;
}

.hero {
  padding-top: 26px;
}

.hero-topline,
.hero-actions,
.section-heading,
.stage-actions,
.stage-meta,
.stage-hud,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-topline,
.section-heading,
.stage-actions {
  justify-content: space-between;
  align-items: flex-start;
}

.badge,
.control-chip,
.tiny-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.88rem;
}

.badge-hot {
  background: rgba(255, 92, 124, 0.2);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero-title,
.loading-title,
.section-heading h2,
.meta-title,
.empty-stage-title,
.game-card-title {
  margin: 0;
  font-family: var(--title-font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.92;
  text-shadow:
    0 4px 0 rgba(0, 0, 0, 0.18),
    0 0 18px rgba(255, 191, 70, 0.25);
  animation: titleBounce 1.6s ease-in-out infinite;
  transform-origin: center bottom;
  cursor: pointer;
}

.hero-copy,
.section-copy,
.meta-card,
.footer p,
.empty-stage p,
.loading-copy,
.announcer-text {
  color: var(--muted);
  line-height: 1.55;
}

.hero-copy,
.section-copy {
  max-width: 56ch;
  margin: 0;
}

.hero-actions {
  margin-top: 18px;
}

.account-layout,
.account-form,
.leaderboard-list {
  display: grid;
  gap: 12px;
}

.account-layout {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 18px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.account-actions .arcade-button {
  flex: 1 1 170px;
  justify-content: center;
}

.arcade-button {
  position: relative;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  background: linear-gradient(180deg, #fff7ca, var(--accent));
  color: var(--button-text);
  font-weight: 800;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    filter var(--transition);
}

.arcade-button:hover,
.arcade-button:focus-visible {
  transform: translateY(-3px) rotate(-1.5deg) scale(1.03);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.28),
    inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  animation: wiggle 0.38s ease-in-out 1;
}

.arcade-button:active {
  transform: translateY(0) scale(0.98);
}

.arcade-button-hot {
  background: linear-gradient(180deg, #fff3f6, var(--accent-2));
}

.arcade-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.arcade-input:focus {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 0 3px rgba(100, 244, 215, 0.12);
  transform: translateY(-1px);
}

.arcade-input::placeholder {
  color: rgba(255, 249, 238, 0.5);
}

.field-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.announcer {
  display: grid;
  gap: 8px;
}

.announcer-label {
  font-family: var(--mono-font);
  color: var(--accent-3);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}

.announcer-text {
  margin: 0;
  font-size: 1.04rem;
  animation: announcerWobble 6s ease-in-out infinite;
}

.games .game-grid,
.achievement-grid {
  display: grid;
  gap: 16px;
}

.game-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 18px;
}

.game-card,
.achievement-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 25%),
    rgba(255, 255, 255, 0.05);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.18);
}

.game-card {
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
  animation: cardFloat 5.5s ease-in-out infinite;
  will-change: transform;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-7px) rotate(-1.6deg) scale(1.02);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 24px 38px rgba(0, 0, 0, 0.25);
}

.game-card.is-active {
  outline: 2px solid var(--accent);
  transform: translateY(-4px) rotate(1deg);
}

.game-card-kicker {
  color: var(--accent-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
}

.game-card-title {
  margin-top: 8px;
  font-size: 1.5rem;
}

.game-card-copy {
  margin: 10px 0 14px;
  color: var(--muted);
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stage-hud {
  margin-bottom: 16px;
}

.stat-pill {
  min-width: 140px;
  flex: 1 1 160px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-pill span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-pill strong {
  display: block;
  font-size: 1.18rem;
}

.stat-pill-wide {
  flex-basis: 260px;
}

.stage-meta {
  margin-bottom: 18px;
}

.meta-card {
  flex: 1 1 280px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-title {
  margin-bottom: 12px;
  font-size: 1.15rem;
}

.account-card,
.leaderboard-card {
  align-self: start;
}

.signed-in-copy,
.leaderboard-copy,
.leaderboard-footnote,
.policy-list {
  margin: 0;
  color: var(--muted);
}

.policy-list {
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard-row.is-self {
  background: rgba(100, 244, 215, 0.12);
  border-color: rgba(100, 244, 215, 0.3);
}

.leaderboard-rank {
  font-family: var(--title-font);
  font-size: 1.05rem;
  color: var(--accent);
  min-width: 2ch;
}

.leaderboard-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.leaderboard-value {
  font-family: var(--mono-font);
  font-weight: 700;
  color: var(--accent-3);
}

.leaderboard-footnote {
  margin-top: 12px;
  font-size: 0.92rem;
}

.control-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.control-chip {
  background: rgba(255, 255, 255, 0.08);
}

.game-shell {
  position: relative;
  min-height: 460px;
  border-radius: var(--radius-lg);
  padding: 18px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 24%),
    rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.embedded-frame-stage {
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 26%),
    rgba(6, 8, 16, 0.88);
}

.embedded-game-frame {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 16px;
  background: #faf8ef;
}

.embedded-2048-frame {
  height: 720px;
}

.embedded-sm64-frame {
  height: min(980px, 82vh);
  background: #05070f;
}

.embedded-fsm-frame {
  height: min(980px, 84vh);
  background: #05070f;
}

.embedded-spacecadet-stage {
  max-width: 1260px;
  margin-inline: auto;
}

.embedded-spacecadet-frame {
  height: 520px;
  background: transparent;
}

.embedded-orct2-stage {
  max-width: 1380px;
  margin-inline: auto;
}

.embedded-orct2-frame {
  height: min(980px, 84vh);
  background: #04070d;
}

.sm64-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.cabinet-note-card p:last-child {
  margin-bottom: 0;
}

.stage-actions {
  margin-top: 16px;
  justify-content: center;
}

.empty-stage {
  height: 100%;
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
}

.game-root {
  display: grid;
  gap: 18px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.game-subcopy {
  margin: 0;
  color: var(--muted);
}

.game-stage {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 25%),
    rgba(5, 7, 15, 0.84);
}

.game-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  touch-action: none;
  background: transparent;
}

.game-overlay {
  position: absolute;
  inset: 18px;
  z-index: 4;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  border-radius: 20px;
  background: rgba(9, 8, 19, 0.76);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  transition:
    opacity var(--transition),
    transform var(--transition);
}

.game-overlay.is-visible {
  opacity: 1;
  transform: scale(1);
}

.game-overlay strong {
  display: block;
  font-family: var(--title-font);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.game-overlay p {
  margin: 0;
  color: var(--muted);
  max-width: 28ch;
}

.game-overlay.dramatic-shake {
  animation: dramaticShake 0.52s linear 2;
}

.touch-panel,
.info-strip,
.memory-stats,
.ttt-board,
.whack-grid,
.pong-toolbar,
.pong-net-panel,
.mode-toolbar,
.multiplayer-panel,
.tank-controls,
.cup-controls,
.pool-controls {
  display: grid;
  gap: 12px;
}

.touch-panel {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.touch-button,
.board-button,
.hole-button,
.memory-card,
.launch-button {
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent 32%),
    rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition:
    transform var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.touch-button,
.launch-button {
  min-height: 56px;
}

.touch-button:hover,
.board-button:hover,
.hole-button:hover,
.memory-card:hover,
.launch-button:hover {
  transform: translateY(-2px) rotate(-1deg);
}

.touch-button.is-held {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 32%),
    rgba(255, 191, 70, 0.2);
}

.info-strip {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.pong-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.pong-mode-button.is-active,
.mode-button.is-active {
  filter: saturate(1.15) brightness(1.06);
  transform: translateY(-2px) scale(1.01);
}

.pong-net-panel,
.multiplayer-panel {
  padding: 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pong-net-status,
.multiplayer-status {
  font-family: var(--title-font);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pong-net-copy,
.match-copy {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.pong-code-display,
.match-code-display {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 16px;
  border-radius: 16px;
  background: rgba(7, 10, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pong-code-display span,
.match-code-display span {
  color: var(--muted);
  font-size: 0.9rem;
}

.pong-code-value,
.match-code-value {
  font-family: var(--title-font);
  font-size: clamp(2.1rem, 6vw, 3rem);
  letter-spacing: 0.16em;
}

.pong-code-input,
.match-code-input {
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 10, 20, 0.8);
  color: var(--text);
  font-family: var(--title-font);
  font-size: 1.5rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pong-code-input::placeholder,
.match-code-input::placeholder {
  color: rgba(255, 249, 238, 0.4);
}

.pong-net-section,
.multiplayer-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.emote-button-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.emote-button {
  min-height: 46px;
}

.emote-button:disabled {
  opacity: 0.46;
  cursor: default;
  transform: none !important;
}

.emote-feed {
  display: grid;
  gap: 8px;
  min-height: 88px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(7, 10, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.emote-feed-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.emote-line {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.emote-line strong {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.emote-line span {
  line-height: 1.35;
}

.emote-line-local {
  border-color: rgba(122, 244, 255, 0.2);
}

.emote-line-remote {
  border-color: rgba(245, 213, 71, 0.2);
}

.pong-code {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 10, 20, 0.8);
  color: var(--text);
  font-family: var(--mono-font);
  font-size: 0.86rem;
  line-height: 1.45;
}

.pong-code::placeholder {
  color: rgba(255, 249, 238, 0.45);
}

.pong-mini-button,
.mini-button {
  min-height: 48px;
  padding: 10px 14px;
}

.mode-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.mini-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-card-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.mini-card-value {
  font-size: 1.18rem;
  font-weight: 800;
}

.ttt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 12px;
}

.board-button {
  aspect-ratio: 1;
  font-family: var(--title-font);
  font-size: clamp(2rem, 8vw, 3rem);
}

.board-button:disabled {
  cursor: default;
  opacity: 0.9;
}

.ttt-banner,
.memory-banner,
.whack-banner {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 12px;
}

.memory-card {
  aspect-ratio: 1;
  padding: 10px;
  text-transform: uppercase;
}

.memory-card-face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.memory-card.is-flipped .memory-card-face,
.memory-card.is-matched .memory-card-face {
  background: rgba(100, 244, 215, 0.18);
}

.memory-card.is-matched {
  transform: rotate(-2deg) scale(0.98);
}

.memory-stats {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.tank-controls {
  padding: 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tank-banner {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.tank-control-label {
  font-family: var(--title-font);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tank-readout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.tank-readout-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tank-readout-label {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tank-readout-value {
  font-family: var(--title-font);
  color: var(--accent);
  letter-spacing: 0.04em;
  font-size: 1.6rem;
}

.tank-power-meter {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tank-power-meter.is-live {
  box-shadow: 0 0 0 1px rgba(255, 191, 70, 0.22), 0 0 24px rgba(255, 191, 70, 0.12);
}

.tank-power-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 800;
}

.tank-power-head strong {
  font-family: var(--title-font);
  color: var(--accent);
  letter-spacing: 0.04em;
}

.tank-power-bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tank-power-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-3), var(--accent), var(--accent-2));
  box-shadow: 0 0 16px rgba(255, 191, 70, 0.3);
  transition: width 80ms linear;
}

.tank-control-tip {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.cup-controls {
  padding: 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cup-banner {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.cup-control-label {
  font-family: var(--title-font);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cup-readout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.cup-readout-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cup-readout-label {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cup-readout-value {
  font-family: var(--title-font);
  color: var(--accent);
  letter-spacing: 0.04em;
  font-size: 1.6rem;
}

.cup-power-meter {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cup-power-meter.is-live {
  box-shadow: 0 0 0 1px rgba(100, 244, 215, 0.22), 0 0 24px rgba(100, 244, 215, 0.12);
}

.cup-power-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 800;
}

.cup-power-head strong {
  font-family: var(--title-font);
  color: var(--accent-3);
  letter-spacing: 0.04em;
}

.cup-power-bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cup-power-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7af4ff, #f5d547, #ff7f59);
  box-shadow: 0 0 16px rgba(122, 244, 255, 0.28);
  transition: width 80ms linear;
}

.cup-control-tip {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.pool-controls {
  padding: 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pool-banner {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.pool-control-label {
  font-family: var(--title-font);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pool-readout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.pool-readout-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pool-readout-label {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pool-readout-value {
  font-family: var(--title-font);
  color: var(--accent);
  letter-spacing: 0.04em;
  font-size: 1.6rem;
}

.pool-power-meter {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pool-power-meter.is-live {
  box-shadow: 0 0 0 1px rgba(100, 244, 215, 0.22), 0 0 24px rgba(100, 244, 215, 0.12);
}

.pool-power-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 800;
}

.pool-power-head strong {
  font-family: var(--title-font);
  color: var(--accent-3);
  letter-spacing: 0.04em;
}

.pool-power-bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pool-power-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7af4ff, #f5d547, #ff7f59);
  box-shadow: 0 0 16px rgba(122, 244, 255, 0.28);
  transition: width 80ms linear;
}

.pool-control-tip {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.pool-stage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 16px;
  align-items: start;
}

.pool-stage-layout .game-stage {
  min-width: 0;
}

.pool-spin-panel {
  position: relative;
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(7, 8, 17, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
}

.pool-spin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pool-spin-title {
  font-family: var(--title-font);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.pool-spin-reset {
  border: 0;
  min-height: 0;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform var(--transition), background var(--transition), opacity var(--transition);
}

.pool-spin-reset:hover:not(:disabled) {
  transform: translateY(-1px) rotate(-2deg);
  background: rgba(255, 255, 255, 0.14);
}

.pool-spin-reset:disabled {
  opacity: 0.45;
  cursor: default;
}

.pool-spin-picker {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  touch-action: none;
  background:
    radial-gradient(circle at 36% 32%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.82) 28%, rgba(225, 236, 255, 0.58) 65%, rgba(137, 172, 255, 0.12) 100%),
    rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 -10px 18px rgba(81, 111, 168, 0.16);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.pool-spin-picker:hover,
.pool-spin-picker.is-active {
  transform: scale(1.03) rotate(-1deg);
  box-shadow:
    inset 0 -10px 18px rgba(81, 111, 168, 0.16),
    0 0 0 1px rgba(122, 244, 255, 0.18),
    0 0 22px rgba(122, 244, 255, 0.12);
}

.pool-spin-axis {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  background: rgba(26, 35, 69, 0.26);
  transform: translate(-50%, -50%);
}

.pool-spin-axis-horizontal {
  width: 74%;
  height: 2px;
}

.pool-spin-axis-vertical {
  width: 2px;
  height: 74%;
}

.pool-spin-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 35%, #fff6cf, #ffb347 68%, #ff7f59);
  border: 2px solid rgba(24, 17, 8, 0.38);
  box-shadow: 0 0 14px rgba(255, 168, 80, 0.38);
}

.pool-spin-copy {
  margin: 0;
  min-height: 2.6em;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.whack-grid {
  grid-template-columns: repeat(3, minmax(86px, 1fr));
}

.hole-button {
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 70%, rgba(0, 0, 0, 0.7), transparent 35%),
    rgba(255, 255, 255, 0.07);
}

.hole-button span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  transform: translateY(30%);
  opacity: 0;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
  font-family: var(--title-font);
  font-size: clamp(1rem, 4vw, 1.45rem);
}

.hole-button.is-up span {
  transform: translateY(0);
  opacity: 1;
}

.achievement-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 18px;
}

.is-hidden {
  display: none !important;
}

.achievement-card.is-locked {
  opacity: 0.55;
  filter: grayscale(0.35);
}

.achievement-card-title {
  margin: 0 0 6px;
  font-family: var(--title-font);
  text-transform: uppercase;
  font-size: 1.2rem;
}

.achievement-card-copy {
  margin: 0 0 10px;
  color: var(--muted);
}

.achievement-state {
  color: var(--accent-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.footer {
  text-align: center;
}

.toast-layer,
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

.toast-layer {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  padding-top: 18px;
}

.toast {
  max-width: min(88vw, 420px);
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 9, 21, 0.88);
  color: var(--text);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.25);
  animation: toastIn 2.5s ease forwards;
}

.toast.toast-win {
  background: rgba(8, 30, 16, 0.9);
}

.toast.toast-danger {
  background: rgba(42, 10, 24, 0.9);
}

.score-pop {
  position: fixed;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 191, 70, 0.92);
  color: #1e113d;
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.25);
  animation: scoreFloat 1.1s ease forwards;
  z-index: 45;
}

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 16px;
  top: -20px;
  border-radius: 3px;
  animation: confettiDrop 1.8s ease-out forwards;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #120c29, #070611);
  transition:
    opacity 420ms ease,
    visibility 420ms ease;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-panel {
  width: min(520px, calc(100% - 32px));
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 12, 30, 0.88);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.loading-title {
  font-size: clamp(2.6rem, 9vw, 4.5rem);
  margin-bottom: 10px;
  animation: titleBounce 1.2s ease-in-out infinite;
}

.loading-copy,
.loading-percent {
  margin: 0;
}

.loading-meter {
  margin: 18px 0 10px;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.loading-meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  box-shadow: 0 0 20px rgba(255, 191, 70, 0.35);
}

@keyframes floatBg {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, 12px, 0) scale(1.04); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes pulseBg {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 0.78; transform: scale(1.05); }
}

@keyframes titleBounce {
  0%, 100% { transform: translateY(0) rotate(-1deg) scale(1); }
  25% { transform: translateY(-6px) rotate(1deg) scale(1.01); }
  50% { transform: translateY(2px) rotate(-2deg) scale(0.99); }
  75% { transform: translateY(-10px) rotate(2deg) scale(1.02); }
}

@keyframes wiggle {
  0%, 100% { transform: translateY(-3px) rotate(-1.5deg) scale(1.03); }
  25% { transform: translateY(-4px) rotate(2deg) scale(1.03); }
  50% { transform: translateY(-3px) rotate(-2deg) scale(1.04); }
  75% { transform: translateY(-4px) rotate(1deg) scale(1.03); }
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0) rotate(0.4deg); }
  50% { transform: translateY(-5px) rotate(-0.6deg); }
}

@keyframes sillyTilt {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(0.35deg); }
  75% { transform: rotate(-0.35deg); }
}

@keyframes announcerWobble {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(0.4deg); }
  60% { transform: rotate(-0.4deg); }
}

@keyframes dramaticShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-8px, 4px, 0) rotate(-1deg); }
  40% { transform: translate3d(8px, -4px, 0) rotate(1deg); }
  60% { transform: translate3d(-6px, -3px, 0) rotate(-1deg); }
  80% { transform: translate3d(6px, 3px, 0) rotate(1deg); }
}

@keyframes toastIn {
  0% { opacity: 0; transform: translateY(-10px) scale(0.94); }
  10%, 85% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

@keyframes scoreFloat {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.8) rotate(-8deg); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1) rotate(4deg); }
  100% { opacity: 0; transform: translate(-50%, -52px) scale(1.08) rotate(-4deg); }
}

@keyframes confettiDrop {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate3d(var(--drift, 0px), 110vh, 0) rotate(540deg); }
}

@media (max-width: 760px) {
  .layout {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .panel {
    padding: 18px;
    border-radius: 24px;
  }

  .hero-topline,
  .section-heading,
  .stage-actions {
    flex-direction: column;
  }

  .game-shell {
    min-height: 380px;
    padding: 14px;
  }

  .embedded-2048-frame {
    height: 690px;
  }

  .embedded-sm64-frame {
    height: min(820px, 78vh);
  }

  .embedded-fsm-frame {
    height: min(760px, 76vh);
  }

  .embedded-spacecadet-frame {
    height: 420px;
  }

  .ttt-grid,
  .memory-board,
  .whack-grid {
    gap: 10px;
  }

  .pool-stage-layout {
    grid-template-columns: 1fr;
  }

  .pool-spin-panel {
    width: 122px;
    padding: 10px;
    justify-self: end;
    order: -1;
  }

  .pool-spin-copy {
    min-height: 2.2em;
    font-size: 0.78rem;
  }
}
