:root {
  --bg: #0c1020;
  --panel: rgba(8, 12, 25, 0.86);
  --panel-line: rgba(255, 255, 255, 0.12);
  --paper: #f6eed5;
  --ink: #0d1321;
  --accent: #ef476f;
  --accent-2: #ffd166;
  --accent-3: #06d6a0;
  --electric: #66c7ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(255, 209, 102, 0.14), transparent 28%),
    linear-gradient(180deg, #171d33 0%, #0a0d17 65%, #05060c 100%);
  color: var(--paper);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

body {
  display: flex;
  justify-content: center;
}

.game-shell {
  width: min(1180px, 100%);
  padding: 24px 24px 40px;
}

.title-strip {
  margin: 0 auto 18px;
  max-width: 840px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
}

h1,
h2,
.arcade-button,
.selection-label {
  font-family: "Courier New", "Lucida Console", monospace;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.1;
  color: #fff1bf;
  text-shadow: 0 0 24px rgba(255, 209, 102, 0.26);
}

.subtitle {
  margin: 16px auto 0;
  max-width: 760px;
  line-height: 1.45;
  font-size: 1.05rem;
  color: rgba(246, 238, 213, 0.88);
}

.stage-shell {
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(3, 6, 14, 0.72);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #111;
  image-rendering: pixelated;
}

.menu-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(4, 7, 15, 0.22), rgba(4, 7, 15, 0.88)),
    radial-gradient(circle at top, rgba(102, 199, 255, 0.08), transparent 40%);
  backdrop-filter: blur(4px);
}

.menu-overlay.hidden {
  display: none;
}

.menu-panel {
  width: min(100%, 980px);
  max-height: 100%;
  overflow: auto;
  padding: 24px;
  border: 2px solid var(--panel-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 22%),
    var(--panel);
}

.panel-copy h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1.35;
}

.panel-copy p {
  margin: 0 0 18px;
  max-width: 760px;
  line-height: 1.5;
}

.panel-kicker {
  margin: 0;
  color: var(--electric);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.character-button {
  padding: 14px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.16));
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.character-button:hover,
.character-button.selected {
  transform: translateY(-3px);
  border-color: rgba(255, 209, 102, 0.8);
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.22), rgba(0, 0, 0, 0.18));
}

.character-portrait {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 2px,
      transparent 2px,
      transparent 4px
    ),
    #10172a;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 700% 100%;
  transform: scale(1.16);
  transform-origin: center;
}

.character-button strong {
  display: block;
  margin-top: 12px;
  font-size: 1.05rem;
}

.character-button span {
  display: block;
  margin-top: 6px;
  font-size: 0.92rem;
  color: rgba(246, 238, 213, 0.74);
}

.selection-row {
  display: grid;
  grid-template-columns: 1.45fr 0.9fr;
  gap: 18px;
  margin-top: 20px;
}

.selection-card,
.mode-card {
  min-height: 100%;
  padding: 18px;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, 0.04);
}

.selection-label {
  display: block;
  margin-bottom: 14px;
  font-size: 10px;
  color: var(--accent-2);
}

#selectedName {
  display: block;
  margin-bottom: 8px;
  font-size: 1.35rem;
}

#selectedBio {
  margin: 0 0 16px;
  line-height: 1.45;
}

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

.move-chip {
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  background: rgba(255, 255, 255, 0.06);
}

.move-chip strong {
  display: block;
  margin-bottom: 4px;
}

.button-stack {
  display: grid;
  gap: 12px;
}

.arcade-button {
  padding: 14px 16px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--paper);
  cursor: pointer;
  line-height: 1.35;
  font-size: 12px;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.arcade-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 209, 102, 0.8);
}

.arcade-button.primary {
  background: linear-gradient(180deg, rgba(239, 71, 111, 0.3), rgba(239, 71, 111, 0.15));
}

.control-note {
  margin: 14px 0 0;
  line-height: 1.6;
  color: rgba(246, 238, 213, 0.74);
}

.hud-notes {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.86rem;
  color: rgba(246, 238, 213, 0.72);
}

@media (max-width: 900px) {
  .character-grid,
  .selection-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .game-shell {
    padding: 14px 14px 26px;
  }

  .character-grid,
  .selection-row {
    grid-template-columns: 1fr;
  }

  .menu-overlay {
    position: static;
    inset: auto;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .menu-panel {
    border-width: 0 0 1px;
  }

  .hud-notes {
    flex-direction: column;
  }
}
