:root {
  color-scheme: dark;
  --ink: #07100f;
  --panel: rgba(10, 24, 22, 0.92);
  --panel-2: rgba(18, 37, 31, 0.9);
  --cream: #fff3cf;
  --muted: #bdd0c5;
  --acid: #c8ff36;
  --mint: #54f3c2;
  --pink: #ff4fa3;
  --gold: #ffc856;
  --danger: #ff675f;
  --line: rgba(255, 243, 207, 0.18);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.44);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--cream);
  background:
    radial-gradient(circle at 12% -10%, rgba(255, 79, 163, 0.19), transparent 34rem),
    radial-gradient(circle at 92% 12%, rgba(84, 243, 194, 0.16), transparent 28rem),
    linear-gradient(145deg, #07100f, #0b1714 55%, #120b19);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 3px;
}

.game-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(14px, 2.4vw, 30px);
  display: grid;
  align-content: start;
  gap: 16px;
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 200, 86, 0.5);
  border-radius: 13px;
  background: rgba(255, 200, 86, 0.09);
  box-shadow: inset 0 0 22px rgba(255, 200, 86, 0.09);
  font-size: 23px;
}

.brand-kicker,
.eyebrow {
  margin: 0;
  color: var(--mint);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.brand-title {
  margin: 2px 0 0;
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  letter-spacing: 0.04em;
}

.exit-link {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cream);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.04);
}

.exit-link:hover {
  border-color: var(--mint);
  color: var(--mint);
}

.game-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(16px, 2.8vw, 28px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(110deg, rgba(255, 79, 163, 0.08), transparent 44%),
    var(--panel);
  box-shadow: var(--shadow);
}

.game-heading h1 {
  margin: 4px 0 6px;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.1rem, 7vw, 5.4rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.game-heading p {
  max-width: 64ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.xp-pill {
  flex: 0 0 auto;
  min-width: 125px;
  padding: 11px 14px;
  border: 1px solid rgba(200, 255, 54, 0.35);
  border-radius: 16px;
  background: rgba(200, 255, 54, 0.08);
  text-align: right;
}

.xp-pill small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.xp-pill strong {
  color: var(--acid);
  font-size: 1.05rem;
}

.hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 9px;
}

.stat {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel-2);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--cream);
  font-size: clamp(1rem, 3vw, 1.35rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card {
  position: relative;
  padding: clamp(12px, 2vw, 22px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.btn {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--mint);
  background: rgba(84, 243, 194, 0.1);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.btn-primary {
  border-color: rgba(200, 255, 54, 0.56);
  color: #0b150f;
  background: var(--acid);
}

.btn-primary:hover:not(:disabled) {
  border-color: white;
  background: #e3ff91;
}

.btn-danger {
  border-color: rgba(255, 103, 95, 0.45);
  color: #ffd5d2;
  background: rgba(255, 103, 95, 0.11);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 15px;
  border: 1px solid rgba(200, 255, 54, 0.55);
  border-radius: 14px;
  color: #0b150f;
  background: var(--acid);
  box-shadow: var(--shadow);
  font-weight: 900;
  transform: translateY(140%);
  transition: transform 220ms ease;
}

.toast.show {
  transform: translateY(0);
}

.arcade-disclosure {
  margin: 0;
  padding: 10px 13px;
  border: 1px solid rgba(255, 200, 86, 0.22);
  border-radius: 13px;
  color: #c7c1ae;
  background: rgba(255, 200, 86, 0.045);
  font-size: 0.72rem;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 7, 0.82);
  backdrop-filter: blur(9px);
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  width: min(520px, 100%);
  padding: clamp(22px, 5vw, 38px);
  border: 1px solid rgba(255, 243, 207, 0.23);
  border-radius: 25px;
  background:
    radial-gradient(circle at 80% 0, rgba(255, 79, 163, 0.18), transparent 48%),
    #0b1a17;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
  text-align: center;
}

.modal-panel h2 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 7vw, 3.3rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.modal-panel p {
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 650px) {
  .game-shell {
    padding: 10px;
    gap: 11px;
  }

  .game-heading {
    align-items: start;
    border-radius: 19px;
  }

  .xp-pill {
    min-width: 104px;
    padding: 9px;
  }

  .game-card {
    border-radius: 18px;
  }

  .brand-kicker {
    display: none;
  }
}

@media (max-width: 470px) {
  .game-heading {
    display: block;
  }

  .xp-pill {
    margin-top: 13px;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
