:root {
  --bg-top: #071524;
  --bg-bottom: #15314a;
  --panel: rgba(11, 24, 40, 0.78);
  --panel-strong: rgba(10, 22, 36, 0.94);
  --panel-border: rgba(189, 221, 255, 0.16);
  --text: #eff6ff;
  --muted: #b8c9db;
  --accent: #ffd166;
  --accent-strong: #ffb347;
  --accent-mint: #58d7b0;
  --danger: #ff8b73;
  --shadow: 0 28px 64px rgba(1, 8, 18, 0.36);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --app-height: 100dvh;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Outfit", "Segoe UI", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 15%, rgba(255, 209, 102, 0.16), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(88, 215, 176, 0.15), transparent 22%),
    radial-gradient(circle at 50% 120%, rgba(55, 122, 255, 0.18), transparent 42%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.03), transparent 22%),
    linear-gradient(300deg, rgba(255, 255, 255, 0.02), transparent 28%);
}

body::after {
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.12), transparent 2px),
    radial-gradient(circle at 80% 22%, rgba(255, 255, 255, 0.12), transparent 1px),
    radial-gradient(circle at 34% 80%, rgba(255, 255, 255, 0.08), transparent 1px);
  opacity: 0.25;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 14px;
  padding: 0.95rem 1rem;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(8, 18, 31, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.mobile-topbar-copy {
  display: grid;
  gap: 0.24rem;
}

.mobile-topbar-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a8c6e0;
}

.mobile-topbar-copy strong {
  font-family: "Space Grotesk", "Outfit", sans-serif;
  font-size: 1.08rem;
  line-height: 1.05;
}

.mobile-topbar-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #172131;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 22px rgba(255, 179, 71, 0.2);
}

.game-header {
  text-align: center;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: #c6dbef;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}

.game-header h1 {
  margin: 0;
  font-family: "Space Grotesk", "Outfit", sans-serif;
  font-size: clamp(2.6rem, 6vw, 4.9rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.game-subtitle {
  margin: 0.55rem 0 0.45rem;
  font-size: 1.12rem;
  color: #ffe2af;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-intro {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.02rem;
}

main {
  position: relative;
}

.panel {
  display: none;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  padding: clamp(18px, 2vw, 30px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  pointer-events: none;
}

.panel.active {
  display: block;
}

.panel h2 {
  margin: 0 0 0.45rem;
  font-family: "Space Grotesk", "Outfit", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.panel h3 {
  margin: 1.2rem 0 0.55rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.panel p {
  margin: 0.35rem 0;
  color: #e8f1fb;
}

.level-biome {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #dcebf9;
  font-size: 0.84rem;
  font-weight: 600;
  text-transform: capitalize;
}

button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1.15rem;
  font-family: "Space Grotesk", "Outfit", sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(135deg, #31507b, #213450);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.26);
  filter: brightness(1.05);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

.primary {
  color: #172131;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.character-screen-note,
.overlay-name-hint,
.pc-controls-summary {
  color: var(--muted);
}

.character-grid,
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.25rem;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(7, 16, 28, 0.58);
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.card.selected {
  border-color: rgba(255, 209, 102, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 18px 36px rgba(0, 0, 0, 0.22);
}

.card h3 {
  margin: 0;
}

.card p {
  font-size: 0.94rem;
  color: #e6eef9;
}

.character-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, var(--card-color, #31507b), var(--card-accent, #ffd166));
  opacity: 0.1;
  pointer-events: none;
}

.character-card > * {
  position: relative;
  z-index: 1;
}

.character-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--card-color, rgba(255, 255, 255, 0.12));
}

.level-card {
  cursor: pointer;
}

.level-card.locked {
  cursor: default;
  opacity: 0.62;
  filter: saturate(0.72);
}

.level-lock-note {
  color: #ffd8a8;
}

.level-unlock-copy {
  color: #bfe9d7;
}

.level-stars {
  display: flex;
  gap: 0.18rem;
  margin: 0.75rem 0 0.35rem;
}

.star {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.24);
}

.star.fill {
  color: #ffd166;
}

.level-goals,
.overlay-goals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.goal-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #dcebf9;
  font-size: 0.76rem;
  font-weight: 700;
}

.goal-pill.complete {
  background: rgba(88, 215, 176, 0.14);
  border-color: rgba(88, 215, 176, 0.28);
  color: #d8fff3;
}

.level-progress-copy {
  color: var(--muted);
}

.level-card-top h3 {
  font-size: 1.08rem;
}

.store-card button {
  width: 100%;
  margin-top: 0.7rem;
}

.character-card-top,
.level-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.difficulty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.difficulty-badge[data-tone="starter"] {
  background: #8be5ba;
  color: #133023;
}

.difficulty-badge[data-tone="easy"] {
  background: #b8e486;
  color: #173019;
}

.difficulty-badge[data-tone="medium"] {
  background: #ffd166;
  color: #37290b;
}

.difficulty-badge[data-tone="hard"] {
  background: #ffb274;
  color: #4a220d;
}

.difficulty-badge[data-tone="expert"] {
  background: #ff7f8a;
  color: #3a0912;
}

.character-portrait-frame {
  padding: 0.5rem;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.24), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(5, 11, 19, 0.26));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.character-portrait {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
  border-radius: 18px;
  background: transparent;
}

.character-copy {
  display: grid;
  gap: 0.36rem;
}

.character-copy h3 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.character-role {
  color: var(--card-accent, var(--accent));
  font-weight: 700;
}

.character-difficulty {
  color: #fff0c3;
}

.character-flavor {
  color: #d9e6f4;
}

.character-stat-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.mission-summary {
  margin-top: 0.2rem;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mission-summary.complete {
  background: rgba(88, 215, 176, 0.12);
  border-color: rgba(88, 215, 176, 0.28);
}

.mission-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}

.mission-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.26rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.16);
  color: #fff0c3;
  font-size: 0.76rem;
  font-weight: 800;
}

.character-stat {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.6rem;
  align-items: center;
}

.character-stat-label {
  font-size: 0.82rem;
  color: #d3e0ee;
  font-weight: 600;
}

.character-stat-meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.22rem;
}

.stat-segment {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.stat-segment.fill {
  background: linear-gradient(90deg, var(--card-accent, var(--accent)), #ffffff);
}

.game-panel {
  gap: 1rem;
}

.game-layout {
  display: grid;
  gap: 1rem;
  grid-template-areas:
    "status"
    "stage"
    "hud"
    "support"
    "controls";
}

.game-stage {
  grid-area: stage;
  position: relative;
  padding: 0.65rem;
  border-radius: 26px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 35%),
    linear-gradient(180deg, rgba(9, 18, 30, 0.96), rgba(8, 17, 28, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 420;
  border-radius: 22px;
  background: linear-gradient(180deg, #8fd7ff, #f4e2ba);
  image-rendering: auto;
}

.hud {
  grid-area: hud;
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.55rem;
}

.hud-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border-radius: 18px;
  background: rgba(9, 18, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-card span {
  font-size: 0.74rem;
  color: #aac4db;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud-card strong {
  font-size: 1.06rem;
  line-height: 1.1;
}

.hud-card-primary {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.18), rgba(88, 215, 176, 0.18));
}

.hud-card-accent {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.16), rgba(255, 179, 71, 0.18));
}

.hud-subtext {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.hud-runner {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0.72rem;
  align-items: center;
}

.hud-runner-portrait-frame {
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(7, 16, 28, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-runner-portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 16px;
  background: transparent;
}

.hud-runner-copy {
  display: grid;
  gap: 0.12rem;
}

.hud-runner-copy span {
  font-size: 0.74rem;
  color: #aac4db;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud-runner-copy strong {
  font-size: 1.06rem;
  line-height: 1.1;
}

.game-support {
  grid-area: support;
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 0.75rem;
  align-items: stretch;
}

.pc-controls,
.soundtrack-banner,
.overlay-name-prompt {
  border-radius: 20px;
  background: rgba(9, 18, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.95rem 1rem;
}

.pc-controls h3,
.soundtrack-banner strong {
  margin: 0 0 0.55rem;
  display: block;
}

.control-row {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  padding: 0.22rem 0.5rem;
  border-radius: 10px;
  background: #0c1726;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: "Space Grotesk", "Outfit", sans-serif;
  font-size: 0.8rem;
}

.soundtrack-banner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.soundtrack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.soundtrack-controls {
  display: flex;
  gap: 0.45rem;
}

.soundtrack-controls button {
  min-width: 74px;
  padding: 0.55rem 0.8rem;
  font-size: 0.84rem;
}

.mobile-status-strip {
  grid-area: status;
  display: none;
}

.mobile-status-chip {
  min-width: 0;
  padding: 0.72rem 0.85rem;
  border-radius: 18px;
  background: rgba(9, 18, 30, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.mobile-status-chip span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aac4db;
}

.mobile-status-chip strong {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.95rem;
  line-height: 1.15;
  color: #f8fbff;
}

.mobile-stage-hud,
.mobile-stage-hint {
  display: none;
}

.mobile-stage-hud {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-width: calc(100% - 1.5rem);
  pointer-events: none;
}

.mobile-stage-chip {
  min-width: 74px;
  padding: 0.42rem 0.55rem;
  border-radius: 14px;
  background: rgba(7, 16, 28, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
}

.mobile-stage-chip span {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a8c6e0;
}

.mobile-stage-chip strong {
  display: block;
  margin-top: 0.16rem;
  font-size: 0.88rem;
  line-height: 1.1;
  color: #f8fbff;
}

.mobile-stage-hint {
  position: absolute;
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
}

.mobile-stage-hint span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(7, 16, 28, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e9f4ff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(10px);
}

.mobile-controls {
  display: none;
  grid-area: controls;
  gap: 0.65rem;
}

.mobile-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.3rem;
  min-height: 74px;
  padding: 0.95rem 1rem;
  border-radius: 22px;
  text-align: left;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.mobile-action-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-action strong {
  font-size: 1.08rem;
  line-height: 1.05;
}

.mobile-action-jump {
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #172131;
}

.mobile-action-jump .mobile-action-hint {
  background: rgba(23, 33, 49, 0.12);
  color: rgba(23, 33, 49, 0.82);
}

.mobile-action-slide {
  background: linear-gradient(145deg, rgba(88, 215, 176, 0.96), rgba(42, 162, 139, 0.96));
  color: #0a2c28;
}

.mobile-action-slide .mobile-action-hint {
  background: rgba(10, 44, 40, 0.12);
  color: rgba(10, 44, 40, 0.78);
}

.mobile-action-pause {
  background: linear-gradient(145deg, rgba(58, 84, 122, 0.98), rgba(27, 42, 68, 0.98));
  color: #f2f7ff;
}

.overlay-panel {
  max-width: 720px;
  margin: 0 auto;
}

.overlay-details {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0;
}

.overlay-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
}

.overlay-stat-card,
.overlay-detail-block {
  border-radius: 18px;
  background: rgba(9, 18, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.85rem 0.95rem;
}

.overlay-stat-card span {
  display: block;
  font-size: 0.74rem;
  color: #aac4db;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overlay-stat-card strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.12rem;
}

.overlay-detail-block strong {
  display: block;
  margin-bottom: 0.35rem;
}

.overlay-name-prompt {
  margin: 1rem 0;
}

.overlay-name-prompt label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.overlay-name-prompt input {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: #112033;
  font-family: inherit;
  font-size: 0.96rem;
}

.overlay-name-prompt input:focus {
  outline: 2px solid rgba(255, 209, 102, 0.8);
  outline-offset: 2px;
}

.score-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  border-radius: 20px;
  background: rgba(9, 18, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  min-height: 120px;
}

.score-list li {
  padding: 0.8rem 0.95rem;
  font-size: 0.9rem;
  color: #e4eef8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.score-list li:last-child {
  border-bottom: 0;
}

@media (max-width: 960px) {
  .game-support {
    grid-template-columns: 1fr;
  }

  .control-row {
    grid-template-columns: auto auto auto 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 18px 14px 28px;
  }

  .panel {
    padding: 18px;
  }

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

  .pc-controls {
    display: none;
  }

  .actions {
    gap: 0.55rem;
  }

  .actions button {
    width: 100%;
  }

  .soundtrack-row {
    align-items: stretch;
    flex-direction: column;
  }

  .soundtrack-controls {
    width: 100%;
  }

  .soundtrack-controls button {
    width: 100%;
  }

  .control-row {
    grid-template-columns: auto auto auto;
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.is-mobile {
  min-height: var(--app-height);
}

body.is-mobile .app-shell {
  max-width: none;
  padding:
    max(14px, calc(var(--safe-area-top) + 10px))
    max(12px, calc(var(--safe-area-right) + 12px))
    max(24px, calc(var(--safe-area-bottom) + 18px))
    max(12px, calc(var(--safe-area-left) + 12px));
}

body.is-mobile .mobile-topbar {
  position: sticky;
  top: max(8px, var(--safe-area-top));
  z-index: 12;
  display: flex;
}

body.is-mobile .game-header {
  padding: 1.15rem 1rem;
  margin-bottom: 14px;
  text-align: left;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.16), transparent 35%),
    linear-gradient(180deg, rgba(8, 18, 31, 0.88), rgba(8, 18, 31, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

body.is-mobile .eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
}

body.is-mobile .game-header h1 {
  font-size: clamp(2.2rem, 11vw, 3.2rem);
}

body.is-mobile .game-subtitle {
  margin-top: 0.4rem;
  font-size: 0.92rem;
}

body.is-mobile .game-intro {
  margin-top: 0.55rem;
  font-size: 0.94rem;
  line-height: 1.45;
}

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

body.is-mobile .panel p {
  line-height: 1.45;
}

body.is-mobile .start-panel.active {
  display: grid;
  gap: 0.95rem;
}

body.is-mobile #startBtn {
  width: 100%;
  min-height: 58px;
  font-size: 1.08rem;
}

body.is-mobile .score-list li {
  padding: 0.9rem 1rem;
}

body.is-mobile .character-grid,
body.is-mobile .level-grid {
  gap: 0.85rem;
}

body.is-mobile .card {
  border-radius: 22px;
  padding: 1.05rem;
}

body.is-mobile .character-copy h3 {
  font-size: 1.28rem;
}

body.is-mobile .menu-panel .actions,
body.is-mobile .overlay-panel .actions {
  position: sticky;
  bottom: calc(10px + var(--safe-area-bottom));
  z-index: 8;
  padding: 0.75rem;
  border-radius: 20px;
  background: rgba(6, 14, 25, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

body.is-mobile .menu-panel .actions,
body.is-mobile .overlay-panel .actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 0.6rem;
}

body.is-mobile .menu-panel .actions button,
body.is-mobile .overlay-panel .actions button {
  width: 100%;
  min-height: 54px;
}

body.is-mobile .hud {
  display: none;
}

body.is-mobile .mobile-status-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(108px, 1fr);
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: thin;
}

body.is-mobile .game-panel {
  padding: 14px;
}

body.is-mobile .game-stage {
  margin: 0;
  padding: 0.45rem;
  border-radius: 24px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body.is-mobile .game-support {
  margin-top: 0;
  gap: 0.65rem;
}

body.is-mobile .pc-controls {
  display: none;
}

body.is-mobile .soundtrack-banner {
  padding: 0.8rem 0.9rem;
  border-radius: 18px;
}

body.is-mobile .soundtrack-row {
  gap: 0.65rem;
}

body.is-mobile .soundtrack-controls {
  width: 100%;
}

body.is-mobile .soundtrack-controls button {
  min-width: 0;
  width: 100%;
}

body.is-mobile .mobile-controls {
  display: grid;
  padding: 0.72rem;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(6, 14, 25, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

body.is-mobile.game-screen-active {
  overflow: hidden;
}

body.is-mobile.game-screen-active .game-header {
  display: none;
}

body.is-mobile.game-screen-active main {
  min-height: calc(var(--app-height) - 88px);
}

body.is-mobile.game-screen-active .game-panel.active {
  min-height: calc(var(--app-height) - 88px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

body.is-mobile.mobile-portrait .game-layout {
  grid-template-areas:
    "status"
    "stage"
    "support"
    "controls";
}

body.is-mobile.mobile-portrait .mobile-controls {
  position: sticky;
  bottom: calc(8px + var(--safe-area-bottom));
  z-index: 9;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.is-mobile.mobile-portrait .mobile-action-jump {
  grid-column: 1 / -1;
  min-height: 88px;
}

body.is-mobile.mobile-portrait .soundtrack-row {
  align-items: stretch;
  flex-direction: column;
}

body.is-mobile.mobile-landscape .game-panel.active {
  min-height: calc(var(--app-height) - 88px);
  overflow: hidden;
}

body.is-mobile.mobile-landscape.game-screen-active .mobile-topbar {
  margin-bottom: 8px;
  padding: 0.55rem 0.75rem;
  border-radius: 18px;
}

body.is-mobile.mobile-landscape.game-screen-active .mobile-topbar-brand {
  display: none;
}

body.is-mobile.mobile-landscape .game-layout {
  grid-template-columns: minmax(0, 1fr) clamp(116px, 17vw, 148px);
  grid-template-areas:
    "stage controls";
  gap: 0.75rem;
  align-items: stretch;
  height: 100%;
}

body.is-mobile.mobile-landscape .mobile-status-strip {
  display: none;
}

body.is-mobile.mobile-landscape .mobile-stage-hud {
  display: flex;
}

body.is-mobile.mobile-landscape .mobile-stage-hint {
  display: block;
}

body.is-mobile.mobile-landscape .game-support {
  display: none;
}

body.is-mobile.mobile-landscape .mobile-controls {
  position: sticky;
  top: calc(var(--safe-area-top) + 58px);
  bottom: auto;
  align-self: stretch;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 100%;
  padding: 0.55rem;
  gap: 0.55rem;
}

body.is-mobile.mobile-landscape .mobile-action-jump {
  display: none;
}

body.is-mobile.mobile-landscape .mobile-action {
  min-height: 0;
  height: 100%;
  border-radius: 18px;
  padding: 0.8rem 0.82rem;
}

body.is-mobile.mobile-landscape .mobile-action strong {
  font-size: 0.95rem;
}

body.is-mobile.mobile-landscape .mobile-action-slide {
  justify-content: flex-end;
}

body.is-mobile.mobile-landscape .mobile-action-pause {
  height: auto;
  min-height: 76px;
}

body.is-mobile.mobile-landscape .game-stage {
  align-self: stretch;
  min-width: 0;
  min-height: 100%;
}

body.is-mobile.mobile-landscape .soundtrack-row {
  align-items: center;
  flex-direction: row;
}

body.is-mobile.mobile-landscape .soundtrack-controls {
  width: auto;
}

body.is-mobile.mobile-landscape .soundtrack-controls button {
  width: auto;
  min-width: 72px;
}

.pause-soundtrack-panel {
  display: grid;
  gap: 0.75rem;
}

.pause-soundtrack-name {
  font-size: 0.96rem;
  font-weight: 700;
  color: #eff6ff;
}

.pause-soundtrack-controls {
  display: flex;
  gap: 0.55rem;
}

.pause-soundtrack-controls button {
  min-width: 86px;
}
