﻿
:root {
  --bg: #060816;
  --panel: #102040;
  --line: #63ecff;
  --line2: #ffca7d;
  --text: #ecf7ff;
  --sub: #a8dcff;
  --danger: #ff7b95;
  --ok: #8eff9a;
}

* { box-sizing: border-box; image-rendering: pixelated; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, #02050d, #0c1530 56%, #0d1224);
  color: var(--text);
  font-family: "DotGothic16", monospace;
  overflow: hidden;
  touch-action: auto;
}

#app { position: relative; width: 100%; height: 100%; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active {
  display: flex;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.screen.input-lock { pointer-events: none; }
.hidden { display: none !important; }

#game-screen,
#game-canvas {
  touch-action: none;
}

#splash-screen, #title-screen { align-items: center; justify-content: center; }
#menu-screen, .panel-screen { align-items: flex-start; justify-content: center; padding: 10px 0; }

.splash-wrap, .title-wrap, .panel-wrap, .menu-wrap {
  width: min(97vw, 720px);
  max-height: 96vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  border: 3px solid var(--line);
  background: #0f1e3c;
  box-shadow: 0 0 0 3px #1f3568 inset;
  padding: 14px;
}

.world-list,
#events-list,
#league-ranking-list,
#lobby-ranking-list,
#record-list,
#consumable-list,
#weapon-list {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.splash-wrap { text-align: center; }
.splash-sub, .subtitle, .menu-subtitle, .menu-section-title, .label, .gacha-rarity, .gacha-badge { font-family: "Press Start 2P", monospace; }
.splash-logo, .logo, .menu-title, .gacha-event-title { font-family: "Press Start 2P", monospace; line-height: 1.45; }
.splash-logo { font-size: clamp(18px, 5vw, 42px); }
.logo { font-size: clamp(24px, 7vw, 48px); margin: 0; }
.subtitle { font-size: 10px; line-height: 1.6; }
.title-mobile {
  display: grid;
  gap: 12px;
  background:
    radial-gradient(circle at 85% 10%, rgba(108, 245, 255, 0.24), transparent 42%),
    radial-gradient(circle at 8% 88%, rgba(255, 200, 108, 0.18), transparent 36%),
    #0f1e3c;
}

.title-top-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.title-pill {
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #08252d;
  background: #7beeff;
  border: 2px solid #b8f7ff;
  padding: 6px 8px;
}

.title-pill.gold {
  color: #3b2700;
  background: #ffd583;
  border-color: #ffe3ad;
}

.title-hero {
  border: 2px solid #64ebff;
  background: rgba(12, 27, 56, 0.82);
  padding: 12px;
}

.title-catch {
  margin: 6px 0 0;
  color: #b5e4ff;
  font-size: 13px;
}

.title-news-card {
  border: 2px solid #ffcf7f;
  background: rgba(55, 34, 11, 0.84);
  padding: 10px;
}

.title-news-label {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #ffe8b6;
}

.title-news-main {
  margin: 6px 0 4px;
  font-size: 14px;
  color: #fff0c9;
}

.title-news-sub {
  margin: 0;
  font-size: 12px;
  color: #ffe1a0;
}

.title-start-zone {
  display: grid;
  gap: 8px;
}

.title-start-btn {
  min-height: 56px;
  font-size: 12px;
  border-color: #7deaff;
  background: linear-gradient(180deg, #205997, #183e6d);
}

.title-start-note {
  margin: 0;
  font-size: 11px;
  color: #9dd9ff;
  text-align: center;
}

.splash-line {
  margin: 18px auto 0;
  width: 82%;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--line), var(--line) 12px, transparent 12px, transparent 20px);
  animation: pulse 1s steps(2, end) infinite;
}

@keyframes pulse { 0%,100%{opacity:.4}50%{opacity:1} }

.primary-btn, .menu-btn, .shop-btn, .stage-btn, .item-btn, .weapon-card, .gacha-roll-btn, .gacha-banner-btn, .sub-link-btn, .floating-btn {
  border: 3px solid var(--line);
  background: #173468;
  color: var(--text);
  font-family: "Press Start 2P", monospace;
  cursor: pointer;
  padding: 10px;
  touch-action: manipulation;
}

.primary-btn:active, .menu-btn:active, .shop-btn:active, .stage-btn:active, .item-btn:active, .weapon-card:active, .gacha-roll-btn:active, .gacha-banner-btn:active, .sub-link-btn:active, .floating-btn:active { transform: translateY(1px); }

.menu-wrap { padding: 16px; }
.menu-title { text-align: center; font-size: clamp(20px, 5vw, 34px); margin: 0; }
.menu-subtitle { text-align: center; font-size: 10px; }
.menu-section-title { text-align: center; margin: 12px 0 8px; font-size: 10px; color: #93ddff; }

.mode-grid-main, .mode-grid-sub, .menu-list, .stage-select-grid, .protocol-grid, .world-tabs, .gacha-banner-select, .gacha-action-row, .gacha-stats, .record-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.menu-list, .record-list { grid-template-columns: 1fr; }
.menu-btn { text-align: left; min-height: 78px; display: grid; align-content: center; gap: 3px; }
.menu-btn strong { font-size: 12px; line-height: 1.4; }
.menu-btn span { font-size: 10px; color: var(--sub); }
.mode-main { min-height: 120px; }
.mode-main strong { font-size: 15px; }

.btn-stage { border-color: #68e7ff; }
.btn-endless { border-color: #ff73ff; }
.btn-boss { border-color: #9de9ff; }
.btn-cosmo { border-color: #abff86; }
.btn-ancient-knight { border-color: #f5d88b; background: linear-gradient(180deg, #4b3a12, #2b1f08); }
.btn-shop { border-color: #ffc779; }
.btn-gacha { border-color: #84e8ff; }
.btn-hangar { border-color: #8eff9a; }
.btn-record { border-color: #acd5ff; }
.btn-world { border-color: #ffd989; }
.btn-options { border-color: #c0b6ff; }

.menu-footer-stats { text-align: right; margin-top: 10px; font-family: "Press Start 2P", monospace; font-size: 11px; color: #ffd89d; }

.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.panel-head h2 { font-family: "Press Start 2P", monospace; font-size: 13px; line-height: 1.5; margin: 0; }
.panel-note, .shop-item-meta, .record-line, .profile-label, .weapon-card-meta { font-size: 13px; line-height: 1.4; }

.stage-item, .shop-item, .record-card, .weapon-card, .protocol-detail, .gacha-progress-card, .gacha-stat, .gacha-result, .world-entry {
  border: 2px solid #62e9ff;
  background: #172d58;
  padding: 9px;
}

.stage-item { aspect-ratio: 1 / 1; display: grid; align-content: space-between; }
.weapon-card { aspect-ratio: 1.35 / 1; display: grid; align-content: space-between; }
.shop-grid { display: grid; gap: 8px; }
.weapon-card.selected { border-color: var(--line2); }
.weapon-card-name { font-family: "Press Start 2P", monospace; font-size: 10px; line-height: 1.5; }

.option-row { display: grid; gap: 5px; margin: 10px 0; }
.profile-wrap, .gacha-event-wrap, .gacha-open-wrap, .reduced-wrap { display: grid; gap: 10px; }
.forge-stat-item { display: grid; gap: 6px; }
.forge-range { width: 100%; accent-color: #7deaff; }
.reduced-note { text-align: left; line-height: 1.85; }
.reduced-warn { color: #ffd89a; text-align: left; line-height: 1.7; }
.reduced-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-input {
  width: 100%;
  height: 42px;
  border: 3px solid var(--line);
  background: #14274f;
  color: var(--text);
  font-size: 16px;
  padding: 0 8px;
}

/* Gacha 8bit premium */
.gacha-event-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.gacha-event-label { margin: 0; font-size: 9px; color: #89dfff; }
.gacha-event-title { margin: 4px 0; font-size: 16px; }
.gacha-event-sub, .gacha-event-period { margin: 0; font-size: 12px; color: #c7e7ff; }
.gacha-badge { background: #ffd28a; color: #2f2108; padding: 6px 8px; font-size: 9px; }

.gacha-main-visual {
  position: relative;
  min-height: 150px;
  border: 2px solid #62e9ff;
  background: linear-gradient(135deg, #132f5f, #351a56);
  overflow: hidden;
}

.gacha-main-visual::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: repeating-linear-gradient(45deg, transparent 0 18px, rgba(114, 236, 255, .2) 18px 24px);
  animation: flow 5s linear infinite;
}

@keyframes flow { to { transform: translateX(60px); } }

.gacha-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 228, 150, 0.5), rgba(111, 233, 255, 0.2), transparent 70%);
}

.gacha-feature-card {
  position: absolute;
  inset: 12px;
  border: 2px solid #ffd48a;
  background: rgba(16, 27, 55, 0.82);
  padding: 10px;
  display: grid;
  align-content: end;
  z-index: 2;
}

.gacha-feature-card { min-width: 0; }

.gacha-rarity { margin: 0; font-size: 9px; color: #ffd794; }
#gacha-feature-name { margin: 0; font-size: 17px; }
#gacha-feature-desc { margin: 2px 0 0; font-size: 12px; }

.gacha-progress-head { display: flex; justify-content: space-between; font-family: "Press Start 2P", monospace; font-size: 9px; }
.gacha-progress-bar { margin-top: 6px; height: 12px; border: 2px solid #67eaff; background: #10254a; }
.gacha-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #67eaff, #ffd38f); transition: width .2s linear; }
.gacha-progress-note { font-size: 12px; margin: 8px 0 0; }

.gacha-stat, .gacha-result { font-family: "Press Start 2P", monospace; font-size: 9px; line-height: 1.6; }
.gacha-banner-btn { min-height: 46px; font-size: 10px; }
.gacha-banner-btn.active { border-color: #ffd28a; }
.gacha-roll-btn { min-height: 56px; font-size: 11px; }
.gacha-roll-btn.ten { border-color: #ffd28a; background: #4f3513; }

.gacha-sub-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.sub-link-btn { font-size: 9px; min-height: 34px; }
.gacha-result.success { border-color: var(--ok); }
.gacha-result.duplicate { border-color: #ffd38a; }
.gacha-result.fail { border-color: var(--danger); }

.gacha-machine {
  position: relative;
  height: 220px;
  border: 2px solid #62e9ff;
  background:
    radial-gradient(circle at 20% 18%, rgba(166, 237, 255, 0.28), transparent 34%),
    radial-gradient(circle at 78% 24%, rgba(255, 214, 156, 0.24), transparent 36%),
    linear-gradient(180deg, #11264b, #1f123e 62%, #120a2b);
  overflow: hidden;
}

.gacha-machine::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
    radial-gradient(circle, rgba(136, 225, 255, 0.4) 1px, transparent 1px);
  background-size: 32px 32px, 44px 44px;
  background-position: 0 0, 10px 16px;
  opacity: 0.34;
}

.gacha-machine-large { height: 270px; }
.gacha-reel { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-family: "Press Start 2P", monospace; font-size: 10px; }
.gacha-chest { position: absolute; left: 50%; top: 22px; width: 136px; height: 124px; transform: translateX(-50%); }
.chest-lid, .chest-body {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 3px solid #80ecff;
  background: linear-gradient(180deg, #2f4c86, #21386a 58%, #1a2e56);
  box-shadow: 0 0 16px rgba(125, 230, 255, 0.22);
}
.chest-lid {
  top: 8px;
  width: 108px;
  height: 38px;
  transform-origin: 50% 96%;
  transition: transform .2s steps(2, end);
}
.chest-body { top: 46px; width: 124px; height: 68px; }
.chest-lid::before, .chest-body::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  background: linear-gradient(180deg, #ffe2a5, #d19032);
}
.chest-lid::before { top: 0; bottom: 0; }
.chest-body::before { top: 0; bottom: 0; }
.chest-core {
  position: absolute;
  left: 50%;
  top: 69px;
  width: 54px;
  height: 20px;
  transform: translateX(-50%);
  border: 2px solid rgba(230, 248, 255, 0.95);
  background: linear-gradient(180deg, #f8fdff, #c7f5ff);
  opacity: 0;
}
.gacha-flash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(circle, rgba(255,255,255,.75), transparent 56%); }
.gacha-machine.opening .chest-lid { transform: translateX(-50%) rotate(-30deg) translateY(-12px); }
.gacha-machine.reveal .gacha-flash { animation: flash .35s steps(2,end); }
.gacha-machine.reveal .chest-core { animation: core .45s steps(2,end); }
.gacha-machine.rarity-pickup .chest-lid,.gacha-machine.rarity-pickup .chest-body { border-color: #ffd28a; }
.gacha-machine.rarity-standard .chest-lid,.gacha-machine.rarity-standard .chest-body { border-color: #7deaff; }
.gacha-machine.rarity-item .chest-lid,.gacha-machine.rarity-item .chest-body { border-color: #a6b9dc; }
.gacha-machine.closing.glow-normal .gacha-flash { opacity: 0.75; background: radial-gradient(circle, rgba(210,220,245,0.85), rgba(111,131,182,0.25), transparent 62%); }
.gacha-machine.closing.glow-standard .gacha-flash { opacity: 0.85; background: radial-gradient(circle, rgba(132,255,174,0.92), rgba(54,170,94,0.32), transparent 62%); }
.gacha-machine.closing.glow-pickup .gacha-flash { opacity: 0.9; background: radial-gradient(circle, rgba(255,132,132,0.95), rgba(210,55,75,0.38), transparent 62%); }
.gacha-machine.closing.glow-standard .chest-lid,.gacha-machine.closing.glow-standard .chest-body { border-color: #7dff9f; }
.gacha-machine.closing.glow-pickup .chest-lid,.gacha-machine.closing.glow-pickup .chest-body { border-color: #ff8f98; }
@keyframes flash { 0%{opacity:0}40%{opacity:1}100%{opacity:0} }
@keyframes core { 0%{opacity:0}30%{opacity:1}100%{opacity:0} }

.gacha-cinematic-screen {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(126, 244, 255, 0.18), transparent 28%),
    radial-gradient(circle at 50% 75%, rgba(255, 216, 122, 0.1), transparent 30%),
    linear-gradient(180deg, #030611, #09132a 46%, #120b23 100%);
}

.gacha-cinematic-bg,
.gacha-cinematic-wrap {
  position: absolute;
  inset: 0;
}

.gacha-cinematic-bg {
  overflow: hidden;
  pointer-events: none;
}

.gacha-cinematic-wrap {
  width: 100%;
  max-height: none;
  max-width: none;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto auto;
  gap: 14px;
  align-content: start;
  overflow: hidden;
}

.gacha-cinematic-ring,
.gacha-cinematic-rays,
.gacha-cinematic-grid,
.gacha-cinematic-noise {
  position: absolute;
  inset: 0;
}

.gacha-cinematic-ring {
  left: 50%;
  top: 46%;
  inset: auto;
  border-radius: 50%;
  border: 1px solid rgba(126, 237, 255, 0.28);
  transform: translate(-50%, -50%);
}

.gacha-cinematic-ring.ring-a { width: min(72vw, 520px); height: min(72vw, 520px); animation: gachaSpinA 16s linear infinite; }
.gacha-cinematic-ring.ring-b { width: min(56vw, 400px); height: min(56vw, 400px); border-color: rgba(183, 137, 255, 0.26); animation: gachaSpinB 12s linear infinite; }
.gacha-cinematic-ring.ring-c { width: min(86vw, 640px); height: min(86vw, 640px); border-color: rgba(255, 216, 122, 0.18); animation: gachaSpinA 22s linear infinite reverse; }
.gacha-cinematic-screen {
  --swipe-progress: 0;
}
.gacha-cinematic-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .16s ease;
}
.gacha-cinematic-screen.is-normal .gacha-open-title {
  text-shadow: 0 0 12px rgba(126, 237, 255, 0.45);
}
.gacha-cinematic-screen.is-rare .gacha-open-title {
  text-shadow: 0 0 14px rgba(194, 136, 255, 0.5), 0 0 24px rgba(126, 237, 255, 0.2);
}
.gacha-cinematic-screen.is-pickup .gacha-open-title {
  text-shadow: 0 0 16px rgba(255, 229, 154, 0.72), 0 0 30px rgba(126, 237, 255, 0.32);
}
.gacha-cinematic-screen.phase-charge .gacha-open-phase {
  animation: gachaPhasePulse .55s ease-in-out infinite;
}
.gacha-cinematic-screen.phase-preburst::after {
  opacity: 0.92;
  background:
    radial-gradient(circle at 50% 58%, rgba(255, 255, 255, 0.62), rgba(255, 214, 121, 0.36) 28%, rgba(54, 22, 88, 0.2) 56%, transparent 80%);
}
.gacha-cinematic-screen.phase-burst::after {
  animation: gachaScreenFlash .42s ease-out both;
  background:
    radial-gradient(circle at 50% 56%, rgba(255, 255, 255, 0.96), rgba(255, 237, 178, 0.62) 24%, rgba(131, 236, 255, 0.38) 54%, transparent 82%);
}
.gacha-cinematic-screen.phase-burst .gacha-cinematic-ring.ring-a,
.gacha-cinematic-screen.phase-burst .gacha-cinematic-ring.ring-b {
  filter: brightness(1.35);
}
.gacha-cinematic-screen.phase-burst .gacha-open-title {
  animation: gachaBurstTitlePop .22s ease-out both;
}
.gacha-cinematic-screen.phase-lockbreak .gacha-cinematic-machine {
  animation: gachaLockbreakShake .16s steps(2, end) infinite;
}
.gacha-cinematic-screen.phase-lockbreak .gacha-cinematic-noise {
  opacity: 0.4;
}
.gacha-cinematic-screen.phase-jackpot .gacha-cinematic-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 245, 196, 0.22), transparent 42%),
    radial-gradient(circle at 50% 62%, rgba(118, 238, 255, 0.16), transparent 46%);
  animation: gachaJackpotAura .44s ease-in-out infinite;
}
.gacha-cinematic-screen .gacha-cinematic-ring.ring-a { animation-duration: calc(16s - (var(--swipe-progress) * 8s)); }
.gacha-cinematic-screen .gacha-cinematic-ring.ring-b { animation-duration: calc(12s - (var(--swipe-progress) * 6s)); }
.gacha-cinematic-screen .gacha-cinematic-ring.ring-c { animation-duration: calc(22s - (var(--swipe-progress) * 11s)); }

.gacha-cinematic-rays {
  background:
    conic-gradient(from 0deg, rgba(255,255,255,0.08), transparent 12%, rgba(111,233,255,0.1) 18%, transparent 32%, rgba(255,215,122,0.08) 38%, transparent 52%, rgba(180,124,255,0.12) 62%, transparent 78%, rgba(255,255,255,0.08) 88%, transparent 100%);
  opacity: 0.4;
  animation: gachaSpinA 18s linear infinite;
}

.gacha-cinematic-grid {
  background-image:
    linear-gradient(rgba(99, 236, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 236, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, transparent, rgba(0,0,0,0.8) 18%, rgba(0,0,0,0.92) 80%, transparent);
  opacity: 0.28;
}

.gacha-cinematic-noise {
  background-image:
    linear-gradient(transparent 0 92%, rgba(255,255,255,0.08) 92% 100%),
    linear-gradient(90deg, rgba(255,255,255,0.03), transparent 24%, rgba(255,255,255,0.02) 40%, transparent 68%, rgba(255,255,255,0.04));
  background-size: 100% 4px, 100% 100%;
  mix-blend-mode: screen;
  opacity: 0.22;
}

.gacha-cinematic-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gacha-cinematic-particles i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(126, 237, 255, 0.85);
  box-shadow: 0 0 10px rgba(126, 237, 255, 0.55);
  animation: gachaParticleFloat 1.6s linear forwards;
}

.gacha-cinematic-head {
  position: relative;
  z-index: 2;
  text-align: center;
  display: grid;
  gap: 6px;
}

.gacha-cinematic-tier {
  z-index: 3;
  justify-self: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(184, 232, 255, 0.8);
  background: rgba(8, 26, 52, 0.86);
  color: #d8f5ff;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  letter-spacing: .08em;
}

.gacha-cinematic-alert {
  z-index: 5;
  justify-self: center;
  min-width: min(92vw, 420px);
  padding: 8px 12px;
  border: 2px solid rgba(255, 226, 160, 0.95);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(20, 12, 28, 0.96), rgba(12, 22, 48, 0.96));
  color: #ffeca4;
  text-align: center;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  letter-spacing: .06em;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  box-shadow: 0 0 18px rgba(255, 213, 128, 0.3), inset 0 0 0 1px rgba(255, 245, 206, 0.25);
}

.gacha-cinematic-alert.show {
  animation: gachaAlertInOut .42s ease-out both;
}

.gacha-open-label,
.gacha-open-phase,
.gacha-pickup-tag {
  font-family: "Press Start 2P", monospace;
  letter-spacing: 1px;
}

.gacha-open-label {
  margin: 0;
  font-size: 9px;
  color: #8fe9ff;
}

.gacha-open-title {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(16px, 3vw, 26px);
  color: #effbff;
  text-shadow: 0 0 12px rgba(126, 237, 255, 0.45);
}

.gacha-open-phase {
  margin: 0;
  font-size: 10px;
  color: #ffe2a0;
}

.gacha-cinematic-machine {
  --swipe-progress: 0;
  z-index: 2;
  align-self: center;
  justify-self: center;
  width: min(92vw, 620px);
  height: min(56vh, 620px);
  border: 2px solid rgba(126, 237, 255, 0.72);
  background:
    radial-gradient(circle at 50% 28%, rgba(148, 244, 255, 0.26), transparent 20%),
    radial-gradient(circle at 50% 72%, rgba(255, 214, 136, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(11, 28, 58, 0.94), rgba(27, 15, 49, 0.96) 72%, rgba(10, 9, 28, 0.98));
  box-shadow:
    0 0 0 2px rgba(65, 124, 185, 0.45) inset,
    0 0 32px rgba(65, 176, 255, 0.22);
}
.gacha-cinematic-machine.swipe-idle {
  touch-action: none;
}
.gacha-cinematic-machine.theme-normal {
  border-color: rgba(120, 204, 255, 0.82);
}
.gacha-cinematic-machine.theme-rare {
  border-color: rgba(194, 136, 255, 0.86);
  box-shadow: 0 0 0 2px rgba(112, 74, 160, 0.45) inset, 0 0 34px rgba(170, 118, 255, 0.25);
}
.gacha-cinematic-machine.theme-pickup {
  border-color: rgba(255, 236, 176, 0.98);
  box-shadow: 0 0 0 2px rgba(146, 122, 58, 0.62) inset, 0 0 44px rgba(255, 233, 170, 0.34), 0 0 88px rgba(126, 237, 255, 0.2);
}

/* REM Gacha premium UI (scoped) */
#gacha-screen.rem-gacha {
  position: relative;
  overflow: hidden;
  align-items: stretch;
  justify-content: stretch;
}
.rem-gacha-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 15%, rgba(100, 223, 255, 0.16), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(186, 118, 255, 0.14), transparent 26%),
    radial-gradient(circle at 50% 72%, rgba(255, 214, 122, 0.08), transparent 30%),
    linear-gradient(180deg, #071024 0%, #0d1734 48%, #14122f 100%);
}
.rem-gacha-bg__nebula,
.rem-gacha-bg__grid,
.rem-gacha-bg__scanline {
  position: absolute;
  inset: 0;
}
.rem-gacha-bg__nebula {
  background:
    radial-gradient(circle at 30% 56%, rgba(126, 237, 255, 0.14), transparent 32%),
    radial-gradient(circle at 74% 44%, rgba(188, 145, 255, 0.15), transparent 30%);
}
.rem-gacha-bg__grid {
  background-image:
    linear-gradient(rgba(109, 218, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 218, 255, 0.09) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.26;
}
.rem-gacha-bg__scanline {
  background: repeating-linear-gradient(
    180deg,
    rgba(255,255,255,0.02) 0px,
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.25;
}
.rem-gacha-panel {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(12, 31, 68, 0.88), rgba(15, 24, 52, 0.92));
  box-shadow: 0 0 0 1px rgba(131, 226, 255, 0.2) inset, 0 14px 40px rgba(3, 7, 20, 0.45);
}
.rem-gacha .gacha-banner-select {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rem-gacha-machine-visual {
  min-height: 200px;
}
.rem-gacha-core-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 170px;
  height: 170px;
  pointer-events: none;
  z-index: 1;
}
.rem-gacha-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(126, 237, 255, 0.42);
  border-radius: 50%;
}
.rem-gacha-ring-a {
  animation: gachaSpinA 14s linear infinite;
}
.rem-gacha-ring-b {
  inset: 16px;
  border-color: rgba(255, 213, 138, 0.38);
  animation: gachaSpinB 9s linear infinite;
}
.rem-gacha-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(188, 245, 255, 0.86);
  background: radial-gradient(circle, rgba(238, 250, 255, 0.92), rgba(113, 233, 255, 0.72) 42%, rgba(26, 96, 152, 0.5) 70%, transparent 100%);
  box-shadow: 0 0 22px rgba(126, 237, 255, 0.42);
  animation: gachaCorePulse 1.8s ease-in-out infinite;
}
.rem-gacha .gacha-feature-card {
  z-index: 2;
  backdrop-filter: blur(1px);
}
.rem-gacha .gacha-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rem-gacha .gacha-stat {
  min-height: 44px;
  display: grid;
  align-content: center;
}
.rem-gacha-actions .gacha-roll-btn {
  min-height: 60px;
}
.rem-gacha .gacha-roll-btn.one {
  background: linear-gradient(180deg, #16406d, #132c4f);
}
.rem-gacha .gacha-roll-btn.ten {
  background: linear-gradient(180deg, #5f4313, #3d2a0f);
}
.rem-gacha .gacha-roll-btn:disabled,
.rem-gacha .gacha-roll-btn[disabled] {
  opacity: 0.42;
  filter: grayscale(0.3);
}
.rem-gacha .gacha-result {
  white-space: pre-wrap;
  word-break: break-word;
}
.rem-gacha-open .gacha-open-close-btn {
  min-height: 52px;
  font-size: 11px;
}
.rem-gacha-open .gacha-open-result-grid {
  max-height: 32vh;
  overflow: auto;
  padding-right: 2px;
}
.rem-gacha-open .gacha-result-card {
  min-height: 84px;
}

@keyframes gachaCorePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.92; }
  50% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
}

@media (max-width: 380px) {
  .rem-gacha .gacha-event-title { font-size: 14px; }
  .rem-gacha .gacha-stat, .rem-gacha .gacha-result { font-size: 8px; }
  .rem-gacha .gacha-roll-btn { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .rem-gacha-ring-a,
  .rem-gacha-ring-b,
  .rem-gacha-core,
  .rem-gacha-bg__scanline {
    animation: none !important;
  }
}

/* ===== Mobile UI system refresh: interaction safety + visual hierarchy ===== */
:root {
  --rem-ui-font: system-ui, -apple-system, BlinkMacSystemFont, "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --rem-display-font: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --rem-surface: linear-gradient(180deg, rgba(26, 56, 104, 0.96), rgba(8, 20, 45, 0.98));
  --rem-surface-strong: linear-gradient(180deg, rgba(48, 111, 178, 0.98), rgba(14, 44, 88, 0.99));
  --rem-outline: rgba(132, 226, 255, 0.72);
  --rem-outline-focus: #d7f8ff;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--rem-ui-font);
  font-synthesis: none;
}

#app button {
  -webkit-tap-highlight-color: transparent;
}

#app .primary-btn,
#app .shop-btn,
#app .stage-btn,
#app .gacha-roll-btn,
#app .gacha-banner-btn,
#app .sub-link-btn,
#app .floating-btn,
#app .menu-nav-item,
#app .abyss-upgrade-reroll-btn {
  min-height: 46px;
  border: 1px solid var(--rem-outline);
  border-radius: 12px;
  background: var(--rem-surface);
  color: #f3fbff;
  font-family: var(--rem-ui-font);
  font-weight: 800;
  letter-spacing: 0.035em;
  line-height: 1.2;
  text-shadow: 0 1px 0 rgba(1, 8, 22, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 4px 0 rgba(1, 7, 20, 0.55), 0 9px 18px rgba(0, 0, 0, 0.18);
  transition: transform 120ms ease, border-color 120ms ease, background 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

#app .primary-btn:not(.reset-btn):hover,
#app .shop-btn:hover,
#app .stage-btn:hover,
#app .gacha-roll-btn:hover,
#app .gacha-banner-btn:hover,
#app .sub-link-btn:hover,
#app .floating-btn:hover,
#app .menu-nav-item:hover,
#app .abyss-upgrade-reroll-btn:hover {
  border-color: var(--rem-outline-focus);
  background: var(--rem-surface-strong);
  filter: none;
}

#app .primary-btn:active,
#app .shop-btn:active,
#app .stage-btn:active,
#app .gacha-roll-btn:active,
#app .gacha-banner-btn:active,
#app .sub-link-btn:active,
#app .floating-btn:active,
#app .menu-nav-item:active,
#app .abyss-upgrade-reroll-btn:active {
  transform: translateY(3px) scale(0.99);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 0 rgba(1, 7, 20, 0.52);
}

#app button:focus-visible {
  outline: 3px solid rgba(217, 248, 255, 0.95);
  outline-offset: 3px;
}

#app button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: saturate(0.45);
  box-shadow: none;
}

#app .panel-wrap {
  border-color: rgba(126, 221, 255, 0.56);
  border-radius: 18px;
  background:
    linear-gradient(115deg, rgba(130, 231, 255, 0.05), transparent 28%),
    linear-gradient(180deg, rgba(14, 31, 64, 0.98), rgba(6, 16, 36, 0.99));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 30px rgba(0, 0, 0, 0.26);
}

#app .panel-head h2,
#app .menu-section-title,
#app .gacha-event-title,
#app .abyss-upgrade-floor,
#app .label {
  font-family: var(--rem-display-font);
  font-weight: 900;
  letter-spacing: 0.08em;
}

#app .menu-btn {
  border: 1px solid rgba(126, 221, 255, 0.52);
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(134, 230, 255, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(25, 55, 104, 0.96), rgba(8, 21, 48, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 5px 0 rgba(1, 7, 20, 0.48);
  transition: transform 120ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

#app .menu-btn strong {
  font-family: var(--rem-ui-font);
  font-weight: 900;
  letter-spacing: 0.025em;
}

#app .menu-btn span {
  color: #b9ddf7 !important;
  font-family: var(--rem-ui-font);
  font-weight: 700;
}

#app .menu-btn:hover,
#app .menu-btn:focus-visible {
  border-color: #d5f7ff;
  background:
    linear-gradient(135deg, rgba(134, 230, 255, 0.17), transparent 45%),
    linear-gradient(180deg, rgba(37, 84, 145, 0.98), rgba(11, 31, 68, 0.99));
}

#app .menu-btn:active {
  transform: translateY(3px) scale(0.99);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 0 rgba(1, 7, 20, 0.5);
}

#app .gacha-roll-btn.ten,
#app .primary-btn:not(.reset-btn):is(#lobby-challenge-btn, #stage-brief-start-btn, #tap-start-btn) {
  border-color: rgba(255, 222, 139, 0.9);
  background: linear-gradient(180deg, rgba(150, 106, 36, 0.97), rgba(67, 43, 16, 0.99));
  color: #fff6dc;
}

/* Battle actions stay separated from the HUD and have clear intent. */
#game-screen .floating-btn {
  right: max(8px, env(safe-area-inset-right));
  z-index: 32;
  min-width: 78px;
  min-height: 38px;
  padding: 7px 9px;
  font-family: var(--rem-display-font);
  font-size: 9px;
  letter-spacing: 0.04em;
}

#game-screen #back-to-menu-btn {
  top: calc(92px + env(safe-area-inset-top));
  border-color: rgba(151, 198, 255, 0.74);
  background: linear-gradient(180deg, rgba(28, 58, 108, 0.96), rgba(8, 24, 56, 0.99));
}

#game-screen #back-to-menu-btn::after {
  content: "0.65 SEC";
  display: block;
  margin-top: 2px;
  color: #a9dff8;
  font-size: 7px;
  letter-spacing: 0.13em;
}

#game-screen #back-to-menu-btn.armed {
  border-color: #ffcc84;
  background: linear-gradient(180deg, rgba(130, 70, 32, 0.98), rgba(66, 29, 22, 0.99));
  animation: rem-hold-confirm 650ms linear forwards;
}

#game-screen .pause-btn {
  top: calc(144px + env(safe-area-inset-top));
  border-color: rgba(132, 236, 255, 0.84);
}

#game-screen .pause-btn.paused {
  border-color: #ffdb9c;
  background: linear-gradient(180deg, rgba(111, 80, 35, 0.98), rgba(57, 37, 17, 0.99));
}

#game-screen .item-btn {
  min-height: 42px;
  border-radius: 9px;
  font-family: var(--rem-display-font);
  font-size: 8px;
  letter-spacing: 0.02em;
}

#game-screen .special-skill-btn {
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(122px + env(safe-area-inset-bottom));
  z-index: 31;
  width: 72px;
  height: 72px;
  border-width: 2px;
  font-family: var(--rem-display-font);
  line-height: 1.15;
}

@keyframes rem-hold-confirm {
  from { box-shadow: inset 0 0 0 0 rgba(255, 222, 144, 0.12), 0 4px 0 rgba(1, 7, 20, 0.55); }
  to { box-shadow: inset 0 0 0 22px rgba(255, 222, 144, 0.22), 0 2px 0 rgba(1, 7, 20, 0.55); }
}

/* The Abyss selection is a modal: it owns all touches and never overlaps combat controls. */
#game-screen .abyss-upgrade-overlay {
  z-index: 120;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: rgba(3, 5, 15, 0.9);
}

#game-screen .abyss-upgrade-card {
  width: min(94vw, 620px);
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: auto;
  border-color: rgba(255, 176, 129, 0.75);
  border-radius: 18px;
  padding: 16px;
  background:
    radial-gradient(circle at 88% 4%, rgba(255, 105, 140, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(42, 15, 37, 0.98), rgba(10, 7, 22, 0.99));
}

#game-screen .abyss-upgrade-floor,
#game-screen .abyss-upgrade-card h3,
#game-screen .abyss-upgrade-sub,
#game-screen .abyss-upgrade-reroll-row,
#game-screen .abyss-upgrade-option,
#game-screen .abyss-upgrade-option h4,
#game-screen .abyss-upgrade-option .rarity,
#game-screen .abyss-upgrade-option .desc,
#game-screen .abyss-upgrade-option .detail {
  text-align: left;
}

#game-screen .abyss-upgrade-reroll-row {
  justify-content: space-between;
  padding: 8px 0 2px;
}

#game-screen .abyss-upgrade-reroll-btn {
  min-height: 40px;
  background: linear-gradient(180deg, rgba(115, 64, 35, 0.98), rgba(55, 28, 20, 0.99));
  border-color: rgba(255, 205, 147, 0.76);
}

#game-screen .abyss-upgrade-options {
  gap: 10px;
}

#game-screen .abyss-upgrade-option {
  min-height: 156px;
  border-color: rgba(255, 171, 137, 0.62);
  border-radius: 14px;
  padding: 13px;
  background:
    linear-gradient(135deg, rgba(255, 171, 137, 0.1), transparent 40%),
    linear-gradient(180deg, rgba(56, 22, 44, 0.98), rgba(20, 9, 29, 0.99));
}

#game-screen .abyss-upgrade-option:focus-visible,
#game-screen .abyss-upgrade-option:hover {
  border-color: #ffe1b2;
  box-shadow: inset 0 0 0 1px rgba(255, 231, 190, 0.25), 0 8px 18px rgba(0, 0, 0, 0.26);
}

#game-screen .abyss-upgrade-toggle-btn,
#game-screen .abyss-upgrade-tracker {
  left: auto;
  right: max(8px, env(safe-area-inset-right));
  top: calc(194px + env(safe-area-inset-top));
  z-index: 28;
}

#game-screen .abyss-upgrade-tracker-item,
#game-screen .abyss-upgrade-tracker-item .name,
#game-screen .abyss-upgrade-tracker-item .level {
  text-align: left;
}

/* Make the cinematic skip reliably available above effects and result cards. */
#gacha-open-screen .gacha-open-close-btn {
  position: relative;
  z-index: 30;
  min-height: 52px;
  border-color: rgba(255, 223, 151, 0.82);
  background: linear-gradient(180deg, rgba(126, 82, 31, 0.98), rgba(58, 35, 16, 0.99));
  color: #fff7de;
}

#gacha-open-screen .gacha-open-close-btn:not(:disabled)::before {
  content: "TAP";
  margin-right: 0.55em;
  color: #ffe69c;
  font-family: var(--rem-display-font);
  font-size: 0.78em;
}

@media (max-width: 620px) {
  #game-screen .abyss-upgrade-options {
    grid-template-columns: 1fr;
  }

  #game-screen .abyss-upgrade-option {
    min-height: 0;
  }

  #game-screen .abyss-upgrade-toggle-btn,
  #game-screen .abyss-upgrade-tracker {
    top: calc(190px + env(safe-area-inset-top));
  }
}

@media (prefers-reduced-motion: reduce) {
  #game-screen #back-to-menu-btn.armed {
    animation: none;
  }
}

/* ===== Button height stabilization =====
   A locked card can contain extra requirements. Grid stretch must not make
   adjacent, ordinary actions inherit that card's height. */
#menu-screen .mode-grid-main,
#menu-screen .mode-grid-sub,
#menu-screen .menu-home-dock,
#menu-screen .menu-list,
#gacha-screen .gacha-banner-select,
#gacha-screen .gacha-action-row {
  align-items: start !important;
}

#menu-screen .mode-grid-main .menu-btn,
#menu-screen .mode-grid-sub .menu-btn,
#menu-screen .menu-home-dock .menu-btn,
#menu-screen .menu-list .menu-btn {
  align-self: start !important;
  height: auto !important;
}

/* Main play choices remain prominent, but no longer become tall cards. */
#menu-screen .mode-grid-main .menu-btn:not(.rem-mode-card-abyss) {
  min-height: 86px !important;
  max-height: 86px;
}

#menu-screen .mode-grid-sub .menu-btn:not(.rem-mode-card-abyss) {
  min-height: 72px !important;
  max-height: 72px;
}

/* The locked Abyss card is allowed to grow only for its unlock checklist. */
#menu-screen .rem-mode-card-abyss:not(.rem-abyss-locked) {
  min-height: 72px !important;
  max-height: 72px;
}

#menu-screen .menu-home-dock .menu-dock-btn {
  min-height: 58px !important;
  max-height: 58px;
  padding-block: 6px !important;
}

#menu-screen .menu-list .menu-btn {
  min-height: 64px !important;
  max-height: 64px;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

#menu-screen .menu-btn strong,
#menu-screen .menu-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keep small action rows compact and thumb-friendly. */
#gacha-screen .gacha-banner-btn {
  align-self: start;
  min-height: 44px !important;
  height: 44px !important;
  max-height: 44px;
  padding: 6px 8px !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

#gacha-screen .gacha-roll-btn {
  align-self: start;
  min-height: 54px !important;
  height: 54px !important;
  max-height: 54px;
}

#app .panel-back-btn,
#app #gacha-open-skip-btn,
#app #lobby-challenge-btn,
#app #stage-brief-start-btn,
#app #stage-clear-close-btn,
#app #tutorial-guide-close-btn {
  align-self: start;
  min-height: 48px;
  height: 48px;
  max-height: 48px;
}

#menu-screen .menu-bottom-nav .menu-nav-item {
  min-height: 46px !important;
  height: 46px;
  max-height: 46px;
  padding: 6px 4px;
}

@media (max-width: 390px) {
  #menu-screen .mode-grid-main .menu-btn:not(.rem-mode-card-abyss) {
    min-height: 80px !important;
    max-height: 80px;
  }

  #menu-screen .mode-grid-sub .menu-btn:not(.rem-mode-card-abyss),
  #menu-screen .rem-mode-card-abyss:not(.rem-abyss-locked) {
    min-height: 68px !important;
    max-height: 68px;
  }

  #menu-screen .menu-list .menu-btn {
    min-height: 60px !important;
    max-height: 60px;
  }
}

.gacha-machine-light,
.gacha-machine-beam,
.gacha-machine-shockwave,
.gacha-machine-pillar {
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.gacha-machine-light {
  top: 10%;
  width: 26%;
  height: 70%;
  filter: blur(14px);
}

.gacha-light-left {
  left: 8%;
  background: linear-gradient(180deg, rgba(122, 232, 255, 0.32), transparent 72%);
  transform: skewY(12deg);
}

.gacha-light-right {
  right: 8%;
  background: linear-gradient(180deg, rgba(255, 221, 146, 0.26), transparent 72%);
  transform: skewY(-12deg);
}

.gacha-machine-beam {
  left: 50%;
  top: 18%;
  width: 18%;
  height: 58%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(126,237,255,0.34), transparent 90%);
  filter: blur(9px);
}

.gacha-machine-pillar {
  left: 50%;
  bottom: 20%;
  width: 26%;
  height: 0;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(111,233,255,0.55), rgba(255,216,122,0.22), transparent 96%);
  filter: blur(6px);
}

.gacha-machine-shockwave {
  left: 50%;
  top: 58%;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.75);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.gacha-chest-advanced {
  top: 50%;
  transform: translate(-50%, -46%);
}

.chest-shadow,
.chest-impact-ring,
.chest-cracks {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.chest-shadow {
  bottom: -22px;
  width: 160px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,0.5), transparent 70%);
}

.chest-impact-ring {
  top: 90px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(126, 237, 255, 0.6);
  opacity: 0;
}

.chest-cracks {
  top: 42px;
  width: 130px;
  height: 82px;
  background:
    linear-gradient(120deg, transparent 22%, rgba(255,255,255,0.22) 24%, transparent 26%),
    linear-gradient(78deg, transparent 48%, rgba(255,255,255,0.18) 50%, transparent 52%),
    linear-gradient(138deg, transparent 60%, rgba(255,255,255,0.14) 62%, transparent 64%);
  opacity: 0;
}

.gacha-cinematic-machine.sequence-drop .gacha-chest { animation: gachaChestDrop .46s cubic-bezier(.18,.76,.24,1.16) both; }
.gacha-cinematic-machine.sequence-drop .chest-impact-ring { animation: gachaImpact .42s ease-out .16s both; }
.gacha-cinematic-machine.sequence-charge .gacha-machine-light,
.gacha-cinematic-machine.sequence-charge .gacha-machine-beam { opacity: 1; }
.gacha-cinematic-machine.sequence-charge .chest-core { animation: gachaCoreCharge .9s ease-in-out infinite alternate; opacity: 1; }
.gacha-cinematic-machine.swipe-active .gacha-machine-light,
.gacha-cinematic-machine.swipe-active .gacha-machine-beam {
  opacity: calc(0.28 + (var(--swipe-progress) * 0.9));
}
.gacha-cinematic-machine.swipe-active .gacha-machine-beam {
  filter: blur(calc(5px + (var(--swipe-progress) * 10px)));
}
.gacha-cinematic-machine.swipe-active .chest-core {
  opacity: calc(0.3 + (var(--swipe-progress) * 0.75));
  transform: translateX(-50%) scale(calc(1 + (var(--swipe-progress) * 0.22)));
}
.gacha-cinematic-machine.swipe-active .chest-cracks {
  opacity: calc(0.1 + (var(--swipe-progress) * 0.8));
}
.gacha-cinematic-machine.swipe-charged .chest-lid,
.gacha-cinematic-machine.swipe-charged .chest-body {
  box-shadow: 0 0 26px rgba(255, 255, 255, 0.34);
}
.gacha-cinematic-machine.sequence-charge.theme-normal .chest-lid,
.gacha-cinematic-machine.sequence-charge.theme-normal .chest-body { border-color: #74beff; }
.gacha-cinematic-machine.sequence-charge.theme-rare .chest-lid,
.gacha-cinematic-machine.sequence-charge.theme-rare .chest-body { border-color: #c288ff; box-shadow: 0 0 18px rgba(194, 136, 255, 0.38); }
.gacha-cinematic-machine.sequence-charge.theme-pickup .chest-lid,
.gacha-cinematic-machine.sequence-charge.theme-pickup .chest-body { border-color: #ffe59a; box-shadow: 0 0 24px rgba(255, 229, 154, 0.45); }
.gacha-cinematic-machine.theme-normal .chest-lid,
.gacha-cinematic-machine.theme-normal .chest-body { border-color: #74beff; }
.gacha-cinematic-machine.theme-rare .chest-lid,
.gacha-cinematic-machine.theme-rare .chest-body { border-color: #c288ff; }
.gacha-cinematic-machine.theme-pickup .chest-lid,
.gacha-cinematic-machine.theme-pickup .chest-body { border-color: #ffe59a; }
.gacha-cinematic-machine.sequence-charge.theme-rare .gacha-machine-beam { background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(194,136,255,0.44), transparent 90%); }
.gacha-cinematic-machine.sequence-charge.theme-pickup .gacha-machine-beam { background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(126,237,255,0.58), rgba(255,229,154,0.42), transparent 92%); }
.gacha-cinematic-machine.sequence-charge.theme-pickup .chest-cracks { opacity: 1; }
.gacha-cinematic-machine.sequence-preburst .gacha-machine-light,
.gacha-cinematic-machine.sequence-preburst .gacha-machine-beam,
.gacha-cinematic-machine.sequence-preburst .chest-core {
  opacity: 1;
}
.gacha-cinematic-machine.sequence-preburst .gacha-machine-beam {
  filter: blur(3px) brightness(1.2);
  animation: gachaPreburstBeam .12s steps(2, end) infinite;
}
.gacha-cinematic-machine.sequence-preburst .chest-core {
  animation: gachaPreburstCore .12s steps(2, end) infinite;
}
.gacha-cinematic-machine.sequence-burst .gacha-flash { animation: gachaBurstFlash .52s ease-out both; }
.gacha-cinematic-machine.sequence-burst .gacha-machine-shockwave { animation: gachaShockwave .6s ease-out both; opacity: 1; }
.gacha-cinematic-machine.sequence-burst .gacha-machine-pillar { animation: gachaPillar .74s ease-out both; opacity: 1; }
.gacha-cinematic-machine.sequence-burst .chest-lid { animation: gachaLidBlast .48s cubic-bezier(.2,.8,.16,1.18) both; }
.gacha-cinematic-machine.sequence-burst .chest-core { opacity: 1; animation: none; }
.gacha-cinematic-machine.sequence-burst {
  animation: gachaMachineKick .18s ease-out;
}

.gacha-pickup-cutin {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.08), transparent 34%),
    linear-gradient(135deg, rgba(8, 18, 44, 0.12), rgba(8, 18, 44, 0.86) 40%, rgba(28, 15, 46, 0.92) 100%);
  border: 2px solid rgba(255, 229, 154, 0.78);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
}

.gacha-pickup-cutin.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity .2s ease, transform .2s ease;
}

.gacha-pickup-lines,
.gacha-pickup-panels {
  position: absolute;
  inset: 0;
}

.gacha-pickup-lines {
  background:
    repeating-linear-gradient(110deg, transparent 0 14px, rgba(126, 237, 255, 0.28) 14px 18px, transparent 18px 40px),
    linear-gradient(90deg, rgba(255,229,154,0.2), transparent 55%);
  animation: gachaLinesSweep .7s linear infinite;
}

.gacha-pickup-panels {
  background:
    linear-gradient(120deg, transparent 0 14%, rgba(255,255,255,0.08) 14% 18%, transparent 18% 42%, rgba(126,237,255,0.12) 42% 46%, transparent 46%),
    linear-gradient(180deg, transparent 0 68%, rgba(255,255,255,0.06) 68% 70%, transparent 70%);
}

.gacha-pickup-copy {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 12%;
  display: grid;
  gap: 8px;
}

.gacha-pickup-tag {
  margin: 0;
  width: fit-content;
  padding: 7px 10px;
  font-size: 10px;
  color: #2b1d04;
  background: linear-gradient(90deg, #fff3bf, #ffd37f);
  border: 2px solid #fff2c0;
  box-shadow: 0 0 16px rgba(255, 215, 127, 0.24);
}

.gacha-pickup-name {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(18px, 4vw, 30px);
  line-height: 1.4;
  color: #f6fbff;
  text-shadow: 0 0 16px rgba(126, 237, 255, 0.6), 0 0 28px rgba(255, 229, 154, 0.3);
}

.gacha-pickup-sub {
  margin: 0;
  font-size: 12px;
  color: #b8ebff;
}

.gacha-open-summary {
  z-index: 2;
  min-height: 56px;
  font-size: 10px;
  white-space: pre-line;
}

.gacha-swipe-guide {
  margin: 4px 0 0;
  text-align: center;
  font-size: 11px;
  color: #c9f2ff;
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(126, 237, 255, 0.42);
  animation: gachaSwipeGuidePulse 1.2s ease-in-out infinite;
}
.gacha-swipe-guide.hidden {
  opacity: 0;
}

@keyframes gachaSwipeGuidePulse {
  0%, 100% { transform: translateY(0); opacity: 0.86; }
  50% { transform: translateY(-2px); opacity: 1; }
}

.gacha-open-result-grid {
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gacha-open-result-grid.single {
  grid-template-columns: 1fr;
}

.gacha-open-result-grid.hidden { display: none; }

.gacha-result-card {
  position: relative;
  border: 2px solid rgba(116, 190, 255, 0.72);
  background: linear-gradient(180deg, rgba(20, 40, 76, 0.96), rgba(14, 22, 48, 0.98));
  padding: 10px;
  min-height: 108px;
  overflow: hidden;
}
.gacha-result-card.reveal-ready {
  opacity: 0;
  transform: translateY(6px) scale(0.988);
}
.gacha-result-card.reveal-ready.show {
  animation: gachaResultReveal .26s ease-out both;
  animation-delay: var(--reveal-delay, 0s);
}

.gacha-result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 38%);
  pointer-events: none;
}

.gacha-result-card.rarity-normal { border-color: rgba(116, 190, 255, 0.72); }
.gacha-result-card.rarity-rare { border-color: rgba(194, 136, 255, 0.88); box-shadow: 0 0 18px rgba(194, 136, 255, 0.18); }
.gacha-result-card.rarity-pickup { border-color: rgba(255, 229, 154, 0.98); box-shadow: 0 0 24px rgba(255, 229, 154, 0.26); }
.gacha-result-card.jackpot-card {
  background:
    linear-gradient(180deg, rgba(46, 33, 12, 0.94), rgba(23, 34, 64, 0.96));
  box-shadow:
    0 0 0 1px rgba(255, 229, 160, 0.35) inset,
    0 0 28px rgba(255, 219, 130, 0.35);
}
.gacha-result-card.jackpot-card::after {
  content: "";
  position: absolute;
  inset: -30% -40%;
  background: linear-gradient(120deg, transparent 0 30%, rgba(255,255,255,0.28) 40%, transparent 52% 100%);
  animation: gachaJackpotSweep 1.5s linear infinite;
  pointer-events: none;
}

.gacha-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.gacha-result-kind,
.gacha-result-badge,
.gacha-result-copy {
  font-family: "Press Start 2P", monospace;
}

.gacha-result-kind {
  font-size: 8px;
  color: #9ddcff;
}

.gacha-result-badge {
  font-size: 8px;
  padding: 5px 6px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
}

.gacha-result-badge.new { color: #1d2808; background: #a9ff8f; border-color: #d8ffc8; }
.gacha-result-badge.pickup { color: #382503; background: #ffd88e; border-color: #ffecb7; }
.gacha-result-badge.dup { color: #d6e8ff; background: rgba(92, 126, 176, 0.48); }

.gacha-result-name {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #eefbff;
}

.gacha-result-illust-wrap {
  margin: 2px 0 8px;
}

.gacha-result-illust {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid rgba(169, 220, 255, 0.5);
  background: rgba(10, 21, 45, 0.9);
  object-fit: contain;
  padding: 4px;
}

.gacha-result-copy {
  margin-top: 10px;
  font-size: 8px;
  color: #ffdc98;
}

.gacha-open-close-btn {
  z-index: 2;
  min-height: 52px;
}

.gacha-cinematic-screen.lowfx .gacha-cinematic-ring.ring-c,
.gacha-cinematic-screen.lowfx .gacha-cinematic-rays,
.gacha-cinematic-screen.lowfx .gacha-machine-light,
.gacha-cinematic-screen.lowfx .gacha-machine-beam,
.gacha-cinematic-screen.lowfx .gacha-machine-pillar,
.gacha-cinematic-screen.lowfx .gacha-pickup-lines {
  display: none;
}

.gacha-cinematic-screen.lowfx .gacha-open-result-grid {
  gap: 8px;
}
.gacha-cinematic-screen.lowfx::after,
.gacha-cinematic-screen.lowfx.phase-charge .gacha-open-phase {
  animation: none !important;
  opacity: 0 !important;
}
.gacha-cinematic-screen.lowfx .gacha-cinematic-alert,
.gacha-cinematic-screen.lowfx .gacha-cinematic-tier {
  display: none;
}

@media (max-width: 640px) {
  .gacha-cinematic-wrap {
    grid-template-rows: auto minmax(260px, 1fr) auto auto;
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .gacha-open-result-grid {
    grid-template-columns: 1fr;
  }

  .gacha-result-name {
    font-size: 13px;
  }
}

@keyframes gachaSpinA { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes gachaSpinB { to { transform: translate(-50%, -50%) rotate(-360deg); } }
@keyframes gachaChestDrop {
  0% { transform: translate(-50%, -110%) scale(0.9); }
  72% { transform: translate(-50%, -40%) scale(1.03); }
  100% { transform: translate(-50%, -46%) scale(1); }
}
@keyframes gachaImpact {
  0% { opacity: 0; transform: translateX(-50%) scale(0.1); }
  30% { opacity: 0.8; }
  100% { opacity: 0; transform: translateX(-50%) scale(7); }
}
@keyframes gachaCoreCharge {
  from { opacity: 0.4; transform: translateX(-50%) scaleY(0.92); }
  to { opacity: 1; transform: translateX(-50%) scaleY(1.08); }
}
@keyframes gachaPreburstBeam {
  0%, 100% { opacity: 0.9; filter: blur(3px) brightness(1.18); }
  50% { opacity: 0.48; filter: blur(1px) brightness(1.5); }
}
@keyframes gachaPreburstCore {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
  50% { transform: translateX(-50%) scale(1.14); opacity: 0.62; }
}
@keyframes gachaBurstFlash {
  0% { opacity: 0; }
  28% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes gachaScreenFlash {
  0% { opacity: 0; }
  32% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes gachaPhasePulse {
  0%, 100% { opacity: 0.7; text-shadow: 0 0 10px rgba(255, 226, 160, 0.42); }
  50% { opacity: 1; text-shadow: 0 0 18px rgba(255, 240, 192, 0.8); }
}
@keyframes gachaResultReveal {
  from { opacity: 0; transform: translateY(6px) scale(0.988); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes gachaMachineKick {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-2px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes gachaBurstTitlePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.035); }
  100% { transform: scale(1); }
}
@keyframes gachaAlertInOut {
  0% { opacity: 0; transform: translateY(-6px) scale(0.98); }
  20% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes gachaLockbreakShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}
@keyframes gachaJackpotAura {
  0%, 100% { opacity: 0.62; }
  50% { opacity: 1; }
}
@keyframes gachaJackpotSweep {
  0% { transform: translateX(-55%); opacity: 0; }
  22% { opacity: 0.9; }
  100% { transform: translateX(58%); opacity: 0; }
}
@keyframes gachaShockwave {
  from { transform: translate(-50%, -50%) scale(0.2); opacity: 0.85; }
  to { transform: translate(-50%, -50%) scale(18); opacity: 0; }
}
@keyframes gachaPillar {
  0% { height: 0; opacity: 0; }
  22% { height: 68%; opacity: 1; }
  100% { height: 82%; opacity: 0; }
}
@keyframes gachaLidBlast {
  0% { transform: translateX(-50%) rotate(0deg) translateY(0); }
  100% { transform: translateX(-50%) rotate(-44deg) translateY(-20px); }
}
@keyframes gachaLinesSweep {
  from { transform: translateX(-22px); }
  to { transform: translateX(22px); }
}
@keyframes gachaParticleFloat {
  0% { opacity: 0; transform: translateY(16px) scale(0.3); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-42px) scale(1.15); }
}

.world-list { display: grid; gap: 8px; max-height: 52vh; overflow: auto; }
.world-entry { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; }
.world-rank { font-family: "Press Start 2P", monospace; font-size: 10px; color: #ffd28a; }
.world-name { font-size: 13px; }
.world-score { font-family: "Press Start 2P", monospace; font-size: 10px; }

.mode-info-wrap { text-align: center; }
.mode-info-wrap h2 { font-family: "Press Start 2P", monospace; font-size: 14px; line-height: 1.5; }

/* Game screen */
#game-screen { position: relative; width: 100%; height: 100%; overflow: hidden; }
.game-canvas-wrap { position: absolute; inset: 0; z-index: 1; }
#game-canvas { width: 100vw; height: 100vh; border: 0; background: #070d1a; }

.hud, .boss-hud {
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 3;
  border: 2px solid #6be9ff;
  background: rgba(10, 26, 53, 0.68);
  pointer-events: none;
}

.hud-top { top: calc(8px + env(safe-area-inset-top)); display: flex; justify-content: space-between; padding: 5px; }
.hud-bottom { bottom: calc(8px + env(safe-area-inset-bottom)); left: 10px; right: 10px; padding: 6px; display: grid; gap: 6px; }
.hud-block { min-width: 76px; display: flex; flex-direction: column; gap: 1px; }
.label { font-size: 8px; color: #9edfff; }

#score-value.score-pulse { transform: scale(1.1); color: #d9f4ff; }
#score-value.score-pulse-big { transform: scale(1.22); color: #ffe79e; }

.boss-hud { top: calc(52px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 8px; padding: 5px; }
.boss-hud.hidden { display: none; }
.boss-name { min-width: 104px; font-size: 9px; font-family: "Press Start 2P", monospace; color: #ffb1ca; }
.boss-gauge, .hp-gauge { flex: 1; height: 11px; border: 2px solid #67eaff; background: #11264d; }
.boss-fill { width: 100%; height: 100%; background: #ff749d; }
.boss-hud-sealed { border-color: rgba(102, 186, 255, 0.96) !important; box-shadow: 0 0 16px rgba(65, 144, 255, 0.42), inset 0 0 14px rgba(48, 118, 255, 0.2) !important; }
.boss-hud-sealed .boss-fill { background: linear-gradient(90deg, #2457b7, #60caff, #2f75d8) !important; }
.boss-hud-sealed .boss-name, .boss-hud-sealed .boss-phase { color: #d9f4ff; }
.boss-hud-vulnerable { border-color: rgba(255, 220, 123, 0.92) !important; box-shadow: 0 0 16px rgba(255, 187, 74, 0.38), inset 0 0 12px rgba(255, 202, 83, 0.18) !important; }
.boss-hud-vulnerable .boss-fill { background: linear-gradient(90deg, #ff8b56, #ffe27c, #ffb06b) !important; }
.hp-fill { width: 100%; height: 100%; background: #8eff9b; }
.dust-panel { display: grid; gap: 4px; }
.dust-head { display: flex; align-items: center; justify-content: space-between; font-size: 9px; }
.dust-gauge {
  width: 100%;
  height: 9px;
  border: 2px solid #79c8ff;
  background: rgba(15, 32, 66, 0.95);
  overflow: hidden;
}
.dust-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #83ecff, #7ca8ff);
  transition: width 120ms linear;
}
.hud-bottom.hud-dust-active .dust-gauge {
  border-color: #ffd27e;
  box-shadow: 0 0 10px rgba(255, 217, 137, 0.34);
}

.status-text {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  padding: 8px 10px;
  border: 2px solid #ff93b4;
  background: rgba(26, 11, 33, .86);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
  white-space: pre-line;
  max-width: min(92vw, 620px);
}

.status-text.show { opacity: 1; }
.world-record-notice {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 680px);
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  text-align: center;
  color: #ffe66e;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(14px, 2.2vw, 22px);
  line-height: 1.8;
  text-shadow: 0 0 8px rgba(255, 210, 80, 0.85), 0 0 18px rgba(255, 210, 80, 0.55);
  background: rgba(34, 26, 8, 0.84);
  border: 3px solid #ffd27e;
  padding: 16px 12px;
}

.world-record-notice.show {
  opacity: 1;
  animation: notice-blink 0.8s steps(2, end) infinite;
}

@keyframes notice-blink {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}
.item-panel { display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: 3px; pointer-events: auto; }
.item-btn { min-height: 30px; font-size: 8px; }
.item-emp { border-color: #ffc36c; background: #4a3214; }

.floating-btn { position: absolute; top: calc(96px + env(safe-area-inset-top)); right: 8px; z-index: 20; font-size: 8px; pointer-events: auto; }
.floating-btn.armed { border-color: #ff86a5; background: #502135; }
.pause-btn { top: calc(132px + env(safe-area-inset-top)); right: 8px; min-width: 64px; }
.pause-btn.paused { border-color: #ffd27e; background: #594112; color: #ffe7b1; }
.locked-item { opacity: 0.52; }

@media (max-width: 860px) {
  .title-wrap,.menu-wrap,.panel-wrap { width: 100%; max-height: 100%; }
  .menu-btn strong { font-size: 11px; }
  .menu-btn span { font-size: 9px; }
  .mode-main strong { font-size: 13px; }
  .gacha-stats, .gacha-action-row { grid-template-columns: 1fr; }
}




/* Title screen layout (mobile game style, 8bit) */
.title-portal {
  position: relative;
  min-height: min(96vh, 1280px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #5ca8ff 0%, #79c2ff 48%, #8ad9ff 62%, #2f6ea8 100%);
  overflow: hidden;
}

.title-sky-layer {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, rgba(8, 36, 75, 0.14), rgba(6, 18, 36, 0.2));
  pointer-events: none;
}

.title-cloud {
  position: absolute;
  height: 24px;
  border: 2px solid rgba(232, 249, 255, 0.95);
  background: rgba(240, 251, 255, 0.8);
  box-shadow: 0 0 0 2px rgba(126, 201, 255, 0.45);
}

.cloud-a { width: 120px; top: 84px; left: 18px; }
.cloud-b { width: 160px; top: 130px; right: 20px; }

.title-logo-zone {
  position: relative;
  z-index: 2;
  text-align: center;
  border: 3px solid #c5efff;
  background: rgba(12, 37, 78, 0.58);
  box-shadow: 0 0 0 3px rgba(74, 142, 214, 0.8) inset;
  padding: 14px 8px;
}

.title-mini {
  margin: 0 0 8px;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #e3f5ff;
}

.title-copy {
  margin: 8px 0 0;
  color: #e7f7ff;
  font-size: 12px;
}

.title-center-panel {
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: center;
  width: min(88%, 460px);
  text-align: center;
  border: 3px solid #ffd48a;
  background: rgba(59, 33, 10, 0.75);
  box-shadow: 0 0 0 3px rgba(142, 90, 21, 0.85) inset;
  padding: 10px;
}

.title-event {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
  color: #ffe7b4;
}

.title-event-sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: #fff3d0;
}

.title-bottom-ui {
  position: relative;
  z-index: 2;
  align-self: end;
  display: grid;
  gap: 8px;
}

.title-start-btn {
  min-height: 62px;
  font-size: 20px;
  border-color: #ffe2a2;
  background: linear-gradient(180deg, #a03127, #621111 55%, #3d0909);
  color: #ffe8a8;
  text-shadow: 2px 2px 0 #3a1007;
  box-shadow: 0 0 0 3px #a87a2b inset;
}

.title-start-note {
  margin: 0;
  text-align: center;
  font-size: 11px;
  color: #f2f8ff;
}

.title-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.title-version { font-size: 11px; color: #d9efff; }
.title-update-btn {
  border: 2px solid #f6f2a1;
  background: #43371f;
  color: #fff3b8;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  padding: 6px 8px;
}
.title-update-btn:active { transform: translateY(1px); }

/* Menu mobile style */
#menu-screen {
  background:
    radial-gradient(circle at 20% 10%, rgba(105, 225, 255, 0.2), transparent 35%),
    radial-gradient(circle at 80% 25%, rgba(255, 188, 120, 0.15), transparent 30%),
    linear-gradient(180deg, #0a1630, #081224 60%, #050a15);
}

.menu-wrap {
  background: rgba(12, 25, 50, 0.92);
  border-color: #72e9ff;
  box-shadow: 0 0 0 3px #24477f inset, 0 0 28px rgba(77, 190, 255, 0.25);
}

.menu-btn {
  border-width: 3px;
  min-height: 86px;
  background: linear-gradient(180deg, #1b3f76, #132d54);
  box-shadow: 0 0 0 2px rgba(109, 219, 255, 0.25) inset;
}

.mode-main {
  min-height: 132px;
}

.mode-main strong {
  font-size: 16px;
}

.mode-sub strong {
  font-size: 13px;
}

.btn-genkyo { border-color: #ffd68d; background: linear-gradient(180deg, #5c3912, #3e2508); }

.menu-section-title {
  border-top: 2px solid rgba(116, 233, 255, 0.35);
  padding-top: 10px;
}

.menu-footer-stats {
  padding: 8px;
  border: 2px solid rgba(255, 216, 157, 0.6);
  background: rgba(44, 28, 10, 0.52);
}

/* Menu readability upgrade (8bit mobile polish) */
.mode-grid-main,
.mode-grid-sub,
.menu-list {
  padding: 8px;
  border: 2px solid rgba(114, 233, 255, 0.35);
  background: rgba(8, 20, 43, 0.52);
}

.menu-btn {
  position: relative;
  overflow: hidden;
}

.menu-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.08) 48%, transparent 100%);
  transform: translateX(-120%);
  transition: transform 0.25s ease;
}

.menu-btn:active::after {
  transform: translateX(0%);
}

.menu-btn strong {
  text-shadow: 1px 1px 0 rgba(5, 17, 36, 0.95);
}

.menu-btn span {
  color: #c8ebff;
}

.menu-footer-stats {
  font-size: 12px;
  text-align: center;
}

/* Title starfield + logo glow */
.title-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.75;
}

.stars-a {
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.85) 1px, transparent 1px),
    radial-gradient(circle, rgba(180,240,255,0.9) 1px, transparent 1px);
  background-size: 24px 24px, 36px 36px;
  background-position: 0 0, 14px 10px;
  animation: star-drift-a 16s linear infinite;
}

.stars-b {
  background-image: radial-gradient(circle, rgba(255, 229, 158, 0.8) 1px, transparent 1px);
  background-size: 42px 42px;
  background-position: 8px 18px;
  opacity: 0.5;
  animation: star-drift-b 26s linear infinite;
}

@keyframes star-drift-a {
  from { transform: translateY(0); }
  to { transform: translateY(24px); }
}

@keyframes star-drift-b {
  from { transform: translateX(0); }
  to { transform: translateX(-30px); }
}

.logo {
  color: #e9f8ff;
  text-shadow:
    0 0 8px rgba(95, 221, 255, 0.85),
    0 0 18px rgba(95, 221, 255, 0.55),
    2px 2px 0 rgba(22, 48, 86, 0.95);
  animation: logo-glow 2.2s ease-in-out infinite;
}

@keyframes logo-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.17); }
}

/* Shop + gacha mobile polish */
.shop-buy-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.gacha-result {
  white-space: pre-line;
  max-height: 180px;
  overflow: auto;
  line-height: 1.5;
}

.gacha-roll-btn.one {
  background: linear-gradient(180deg, #224d87, #17345f);
}

.gacha-roll-btn.ten {
  box-shadow: 0 0 12px rgba(255, 210, 138, 0.38);
}

.daily-mission-panel {
  margin-top: 10px;
  border: 2px solid rgba(143, 232, 158, 0.75);
  background: rgba(21, 49, 29, 0.55);
  padding: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.daily-mission-panel h3 {
  margin: 0 0 6px;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: #bafdbf;
}

.daily-mission-panel p {
  margin: 4px 0;
}

#opt-vibration {
  height: 38px;
  border: 3px solid var(--line);
  background: #14274f;
  color: var(--text);
  font-family: "DotGothic16", monospace;
  font-size: 14px;
  padding: 0 8px;
}
.mode-lobby-wrap {
  display: grid;
  gap: 10px;
}

.mode-lobby-season {
  border: 3px solid var(--line);
  padding: 10px;
  background: rgba(12, 29, 59, 0.9);
}

 .mode-lobby-season .panel-note {
  margin: 6px 0 0;
  font-size: 10px;
}

#lobby-prev-rank {
  color: #cde2ff;
}

#lobby-next-reset {
  color: #ffe7a3;
}

.mode-lobby-season h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

#lobby-rank-summary {
  color: #ffe784;
  font-size: 11px;
}

.mode-lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
}

.mode-lobby-rewards,
.mode-lobby-ranking {
  border: 3px solid var(--line);
  background: rgba(8, 20, 41, 0.92);
  padding: 8px;
}

.mode-lobby-rewards h4,
.mode-lobby-ranking h4 {
  margin: 0 0 8px;
  font-size: 11px;
}

.lobby-current-league {
  margin: -2px 0 8px;
  color: #b8e9ff;
  font-size: 11px;
  letter-spacing: 0.04em;
}


.lobby-forced-weapon {
  margin: -2px 0 10px;
  color: #ffe3a3;
  font-size: 11px;
  letter-spacing: 0.03em;
}
.lobby-reward-list {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 6px;
  font-size: 10px;
}

.mode-lobby-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 8px;
}

#lobby-challenge-btn {
  border-color: #8ff5a1;
  color: #e8ffe8;
}

@media (max-width: 760px) {
  .mode-lobby-grid {
    grid-template-columns: 1fr;
  }

  .mode-lobby-actions {
    grid-template-columns: 1fr;
  }
}







.gacha-banner-select { grid-template-columns: repeat(4, 1fr); }
.gacha-sub-row { grid-template-columns: 1fr; }
.gacha-ship-preview { margin-top: 8px; height: 76px; display: grid; place-items: center; }
.gacha-ship-preview.hidden { display: none; }
.ship-a0b-sample { width: 86px; height: 62px; position: relative; filter: drop-shadow(0 0 8px rgba(122,231,255,.55)); }
.ship-a0b-sample::before { content: ""; position: absolute; left: 32px; top: 5px; width: 22px; height: 38px; background: linear-gradient(180deg,#e8fbff,#7fe8ff 45%,#2aa8da); border: 2px solid #f3fdff; box-shadow: 0 0 12px rgba(151,234,255,.72); }
.ship-a0b-sample::after { content: ""; position: absolute; left: 12px; top: 20px; width: 62px; height: 24px; background: linear-gradient(180deg,#8af0ff,#3db1df 55%,#1e6f9f); clip-path: polygon(0 50%, 14% 12%, 30% 0, 70% 0, 86% 12%, 100% 50%, 86% 88%, 70% 100%, 30% 100%, 14% 88%); border: 2px solid #d8f7ff; }


#gacha-ship-preview-canvas { width: 120px; height: 86px; image-rendering: pixelated; border: 2px solid rgba(122, 231, 255, 0.65); background: rgba(10, 27, 54, 0.72); }


.world-entry {
  grid-template-columns: 44px 1fr auto;
}

.world-entry-podium {
  grid-template-columns: 44px 52px 1fr auto;
  border-color: #ffd28a;
  background: linear-gradient(180deg, rgba(69, 42, 12, 0.82), rgba(26, 18, 9, 0.82));
}

.world-entry-podium .world-rank {
  color: #ffe6a8;
}

.world-ship-icon {
  width: 44px;
  height: 34px;
  border: 2px solid rgba(142, 237, 255, 0.72);
  image-rendering: pixelated;
}

/* Smartphone menu revamp */
#menu-screen {
  background:
    radial-gradient(circle at 10% 12%, rgba(120, 238, 255, 0.24), transparent 35%),
    radial-gradient(circle at 88% 20%, rgba(255, 191, 123, 0.2), transparent 32%),
    radial-gradient(circle at 50% 100%, rgba(103, 143, 255, 0.2), transparent 45%),
    linear-gradient(180deg, #060d1f, #08142d 45%, #060b19 100%);
}

.menu-wrap {
  position: relative;
  border: 2px solid rgba(130, 235, 255, 0.58);
  background: linear-gradient(180deg, rgba(12, 28, 56, 0.94), rgba(7, 18, 38, 0.94));
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(46, 94, 158, 0.85) inset;
  border-radius: 14px;
  overflow: auto;
}

.menu-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(138, 213, 255, 0.08) 1px, transparent 1px);
  background-size: 100% 5px;
  opacity: 0.35;
}

.menu-title {
  text-shadow: 0 0 12px rgba(111, 234, 255, 0.76), 2px 2px 0 rgba(11, 34, 64, 0.96);
}

.menu-subtitle {
  color: #d8eeff;
  margin-bottom: 14px;
}

.menu-section-title {
  position: relative;
  text-align: left;
  padding: 8px 12px 6px;
  border-radius: 8px;
  border: 1px solid rgba(115, 222, 255, 0.3);
  background: rgba(16, 39, 73, 0.62);
  color: #bde7ff;
  letter-spacing: 0.06em;
}

.mode-grid-main,
.mode-grid-sub,
.menu-list {
  border: 1px solid rgba(123, 222, 255, 0.28);
  border-radius: 12px;
  padding: 10px;
  background: rgba(10, 25, 52, 0.7);
  backdrop-filter: blur(1.5px);
}

.mode-grid-main { grid-template-columns: 1fr; }
.mode-grid-sub { grid-template-columns: 1fr 1fr; }

.menu-btn {
  position: relative;
  min-height: 82px;
  border-radius: 12px;
  border-width: 2px;
  background: linear-gradient(180deg, rgba(30, 73, 132, 0.96), rgba(17, 46, 88, 0.96));
  box-shadow: 0 0 0 2px rgba(136, 227, 255, 0.14) inset;
  transition: transform .18s ease, filter .18s ease;
}

.menu-btn::before {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-top: 2px solid rgba(229, 247, 255, 0.85);
  border-right: 2px solid rgba(229, 247, 255, 0.85);
  transform: translateY(-50%) rotate(45deg);
}

.menu-btn:hover,
.menu-btn:focus-visible {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.mode-main {
  min-height: 104px;
}

.mode-main strong {
  font-size: 17px;
}

.mode-sub strong {
  font-size: 14px;
}

.menu-btn span {
  color: #d4ecff;
  padding-right: 18px;
}

.btn-stage { background: linear-gradient(180deg, #0f5178, #12385f); }
.btn-endless { background: linear-gradient(180deg, #5f2a79, #3f1f55); }
.btn-genkyo { background: linear-gradient(180deg, #624113, #412b0a); }
.btn-cosmo { background: linear-gradient(180deg, #275a2a, #1b411f); }
.btn-abyss { background: linear-gradient(180deg, #3b1120, #220a13); }
.btn-ancient-knight { background: linear-gradient(180deg, #5a4716, #32250b); }
.btn-shop { background: linear-gradient(180deg, #6a4517, #442b0d); }
.btn-gacha { background: linear-gradient(180deg, #1c5383, #1a3768); }
.btn-hangar { background: linear-gradient(180deg, #246245, #173f2c); }
.btn-record { background: linear-gradient(180deg, #355d86, #223d61); }
.btn-world { background: linear-gradient(180deg, #6d4a18, #4b320f); }
.btn-options { background: linear-gradient(180deg, #514580, #352d56); }

.menu-footer-stats {
  margin-top: 12px;
  border: 1px solid rgba(255, 219, 156, 0.62);
  border-radius: 10px;
  background: rgba(61, 39, 10, 0.45);
  padding: 10px;
  text-align: center;
}

.daily-mission-panel {
  border-radius: 10px;
  border-color: rgba(152, 245, 174, 0.9);
  background: linear-gradient(180deg, rgba(20, 53, 36, 0.76), rgba(15, 39, 30, 0.76));
}

#gacha-feature-name {
  font-size: clamp(12px, 4.2vw, 16px);
  line-height: 1.32;
  overflow-wrap: anywhere;
  word-break: break-word;
  letter-spacing: 0.01em;
}

#gacha-feature-name { display: block; max-width: 100%; }

@media (min-width: 760px) {
  .mode-grid-main { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .menu-wrap { padding: 12px; border-radius: 12px; }
  .menu-btn { min-height: 78px; }
  .mode-main { min-height: 98px; }
  .menu-btn strong { font-size: 11px; }
}



/* A-0B text overflow hard-fix */
.gacha-main-visual {
  min-height: 198px;
}

/* compact selector list (parts / stellar books) */
.compact-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px;
}

.compact-choice-grid .shop-btn {
  min-height: 34px !important;
  padding: 6px 8px !important;
  font-size: 11px !important;
  line-height: 1.35;
  text-align: left;
}

.stellar-book-choice {
  width: 100%;
}

#stellar-book-list .stellar-book-choice {
  min-height: 52px !important;
  padding: 7px 8px !important;
  display: grid;
  align-content: center;
  gap: 3px;
}

#stellar-book-list .stellar-book-choice .stellar-book-name {
  display: block;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#stellar-book-list .stellar-book-choice .stellar-book-meta {
  display: block;
  font-size: 10px;
  line-height: 1.2;
  color: #b9ddff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* shared detail popup */
.choice-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 9800;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 10, 24, 0.68);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}

.choice-detail-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.choice-detail-card {
  width: min(520px, calc(100vw - 28px));
  border: 2px solid rgba(126, 198, 255, 0.72);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15, 32, 68, 0.96), rgba(9, 20, 44, 0.96));
  box-shadow: 0 16px 36px rgba(2, 8, 24, 0.56);
  padding: 12px;
}

.choice-detail-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.choice-detail-body {
  margin: 0;
  white-space: pre-line;
  line-height: 1.55;
  color: #deecff;
  font-size: 12px;
}

.choice-detail-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gacha-feature-card {
  inset: 10px;
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
  gap: 6px;
}

#gacha-feature-name {
  display: block;
  max-width: calc(100vw - 8px);
  padding-inline: clamp(10px, 2.8vw, 14px);
  font-size: clamp(11px, 3.9vw, 15px);
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gacha-reel {
  left: 8px;
  right: 8px;
  bottom: 8px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Special skill button + overlay */
#game-screen.special-active::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(circle, rgba(255, 238, 130, 0.45), rgba(255, 226, 80, 0.2), transparent 70%);
  mix-blend-mode: screen;
}

.special-skill-btn {
  position: absolute;
  right: 14px;
  bottom: 116px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid #ffe18f;
  background: radial-gradient(circle at 35% 30%, #fff4bf, #a87a22 70%);
  color: #251300;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  z-index: 9;
  box-shadow: 0 0 0 2px rgba(255, 207, 96, 0.38) inset;
}

.special-skill-btn.ready {
  animation: special-ready-pulse .55s ease-in-out infinite;
}

.special-skill-btn:disabled {
  opacity: 0.45;
}

.tutorial-pointer {
  position: fixed;
  z-index: 10;
  min-width: 72px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 236, 173, 0.9);
  background: linear-gradient(180deg, rgba(255, 238, 180, 0.96), rgba(255, 205, 118, 0.92));
  color: #2e1f08;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.03em;
  box-shadow: 0 0 12px rgba(255, 220, 140, 0.45);
  pointer-events: none;
  animation: tutorial-pointer-pulse 0.66s ease-in-out infinite;
}

.tutorial-pointer.hidden {
  display: none;
}

@keyframes special-ready-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(255, 222, 125, 0.6), 0 0 0 2px rgba(255, 229, 145, 0.35) inset; }
  50% { transform: scale(1.07); box-shadow: 0 0 18px rgba(255, 230, 120, 0.95), 0 0 0 2px rgba(255, 244, 168, 0.6) inset; }
}

@keyframes tutorial-pointer-pulse {
  0%, 100% { transform: translate(-50%, -100%) scale(1); }
  50% { transform: translate(-50%, -108%) scale(1.04); }
}

.menu-weekly-status {
  margin-top: 8px;
  border: 1px solid rgba(146, 231, 255, 0.65);
  border-radius: 10px;
  background: rgba(7, 43, 66, 0.55);
  padding: 8px 10px;
  text-align: center;
  font-size: 11px;
  color: #d8f4ff;
}


.stage-brief-wrap {
  display: grid;
  gap: 10px;
}
.stage-brief-boss-card, .stage-brief-reward-card {
  border: 2px solid rgba(134, 218, 255, 0.7);
  border-radius: 12px;
  padding: 10px;
  background: rgba(10, 32, 56, 0.55);
}
.stage-brief-label {
  margin: 0 0 6px;
  font-size: 10px;
  color: #9edfff;
}
.stage-speed-wrap {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}
.stage-speed-toggle-btn {
  min-height: 36px;
  font-size: 12px;
}
.stage-speed-toggle-btn.locked {
  opacity: 0.65;
}
#stage-brief-boss-canvas {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  margin: 6px auto 0;
  border: 1px solid rgba(154, 224, 255, 0.45);
  background: rgba(5, 20, 38, 0.7);
}
.reward-banner {
  position: fixed;
  left: 50%;
  top: calc(16px + env(safe-area-inset-top));
  transform: translateX(-50%) translateY(-14px);
  min-width: min(92vw, 440px);
  max-width: 92vw;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid #ffe9a6;
  background: rgba(72, 46, 8, 0.92);
  color: #fff3cb;
  text-align: center;
  font-size: 13px;
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.reward-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* Compact list layout for expandable content */
.stage-select-grid {
  gap: 6px;
}

.stage-select-grid .stage-item {
  aspect-ratio: 1.75 / 1;
  padding: 6px;
  gap: 3px;
}

.stage-select-grid .stage-item h4 {
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
}

.stage-select-grid .shop-item-meta {
  font-size: 11px;
  line-height: 1.2;
}

.stage-select-grid .stage-btn {
  padding: 6px 5px;
  font-size: 10px;
}

.protocol-grid {
  gap: 6px;
}

.protocol-grid .weapon-card {
  aspect-ratio: 1.9 / 1;
  padding: 6px;
  gap: 3px;
}

.protocol-grid .weapon-card-name {
  font-size: 9px;
  line-height: 1.25;
}

.protocol-grid .weapon-card-meta {
  font-size: 11px;
  line-height: 1.2;
}


.btn-abyss { border-color: #ff8e8e; background: linear-gradient(180deg, #3b1120, #220a13); }

#game-screen.abyss-mode {
  background:
    radial-gradient(circle at 50% -10%, rgba(214, 70, 88, 0.12), transparent 42%),
    linear-gradient(180deg, #12070d, #09050a 60%, #040306);
}

.abyss-hud {
  position: absolute;
  top: calc(178px + env(safe-area-inset-top));
  right: 10px;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 12px;
  border: 2px solid rgba(255, 146, 146, 0.8);
  background: rgba(34, 8, 16, 0.82);
  color: #ffd3d3;
  z-index: 6;
}

.abyss-hud.hidden {
  display: none;
}

.abyss-hud strong {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: #ffe6a6;
}

.abyss-hud span {
  font-size: 11px;
  color: #ffd9e5;
}

.abyss-transition {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 6, 0.75);
  pointer-events: none;
  z-index: 4;
}






/* Gacha viewport fit fix */
html, body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

#gacha-screen .panel-wrap {
  width: min(97vw, 720px);
  max-width: calc(100vw - 8px);
  padding-inline: clamp(10px, 2.8vw, 14px);
  max-height: calc(100vh - 10px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0 auto;
}

#gacha-screen .gacha-event-wrap,
#gacha-open-screen .gacha-open-wrap {
  min-width: 0;
  width: 100%;
}

#gacha-open-screen .panel-wrap {
  width: min(100vw, 980px);
  max-width: 100vw;
  min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  padding-inline: clamp(12px, 3vw, 28px);
  padding-top: max(14px, env(safe-area-inset-top));
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  border: none;
  background: transparent;
  box-shadow: none;
  overflow-x: hidden;
  overflow-y: auto;
}

#gacha-screen .gacha-banner-select,
#gacha-screen .gacha-stats,
#gacha-screen .gacha-action-row {
  min-width: 0;
}
















.league-wrap #league-current-label {
  font-weight: 700;
  letter-spacing: 0.08em;
}

#league-ranking-title {
  margin-top: 10px;
}

.league-result-wrap .record-card {
  border-left: 4px solid #66e0ff;
}

.league-result-step-title {
  font-weight: 700;
  color: #a8f0ff;
}

/* ===== Neo Cosmos Theme (title-derived) ===== */
:root {
  --bg: #02020e;
  --panel: #0e1230;
  --line: #00f5ff;
  --line2: #ff00ff;
  --text: #eef6ff;
  --sub: #9fcde8;
}

body {
  background:
    radial-gradient(circle at 22% 16%, rgba(0, 245, 255, 0.08), transparent 33%),
    radial-gradient(circle at 82% 72%, rgba(255, 0, 255, 0.08), transparent 31%),
    linear-gradient(180deg, #02020e 0%, #070b1e 100%);
}

#app::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.13) 3px,
    rgba(0, 0, 0, 0.13) 4px
  );
}

.splash-wrap,
.title-wrap,
.panel-wrap,
.menu-wrap {
  border: 2px solid var(--line);
  box-shadow: 0 0 0 1px rgba(0, 245, 255, 0.25) inset, 0 0 24px rgba(0, 245, 255, 0.16);
  background: rgba(4, 9, 28, 0.9);
}

.neo-splash-wrap {
  text-align: left;
  background: rgba(0, 0, 0, 0.86);
}

.neo-splash-line {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: #00ff88;
  margin: 8px 0 0;
  letter-spacing: 1px;
}

.neo-title-wrap {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
}

.neo-title-bg,
.neo-title-nebula,
.neo-title-stars,
.neo-title-comets,
.neo-title-planet,
.neo-title-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.neo-title-bg {
  background:
    radial-gradient(circle at 50% 10%, rgba(0, 245, 255, 0.12), transparent 45%),
    linear-gradient(180deg, #040814 0%, #040a1c 56%, #02050f 100%);
}

.neo-title-nebula {
  background:
    radial-gradient(circle at 20% 24%, rgba(0, 174, 255, 0.2), transparent 42%),
    radial-gradient(circle at 82% 26%, rgba(202, 83, 255, 0.17), transparent 40%),
    radial-gradient(circle at 50% 78%, rgba(90, 188, 255, 0.13), transparent 46%);
  filter: blur(0.4px) saturate(1.06);
  opacity: 0.92;
  animation: titleNebulaDrift 20s ease-in-out infinite alternate;
}

.neo-title-stars {
  background-image:
    radial-gradient(circle at 8% 14%, rgba(255, 255, 255, 0.95) 0 1px, transparent 1.5px),
    radial-gradient(circle at 16% 40%, rgba(155, 232, 255, 0.82) 0 1px, transparent 1.5px),
    radial-gradient(circle at 25% 72%, rgba(255, 255, 255, 0.82) 0 1px, transparent 1.6px),
    radial-gradient(circle at 33% 18%, rgba(130, 217, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle at 45% 50%, rgba(255, 255, 255, 0.92) 0 1px, transparent 1.5px),
    radial-gradient(circle at 58% 16%, rgba(143, 228, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle at 66% 75%, rgba(255, 255, 255, 0.88) 0 1px, transparent 1.6px),
    radial-gradient(circle at 77% 39%, rgba(129, 210, 255, 0.85) 0 1px, transparent 1.5px),
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.82) 0 1px, transparent 1.5px),
    radial-gradient(circle at 91% 67%, rgba(184, 238, 255, 0.8) 0 1px, transparent 1.5px),
    radial-gradient(circle at 40% 87%, rgba(255, 255, 255, 0.76) 0 1px, transparent 1.5px);
  opacity: 0.72;
  animation: titleStarsTwinkle 3.4s steps(2, end) infinite;
}

.neo-title-comets {
  opacity: 0.42;
  mix-blend-mode: screen;
}

.neo-title-comets::before,
.neo-title-comets::after {
  content: "";
  position: absolute;
  width: 220%;
  height: 2px;
  left: -60%;
  background: linear-gradient(90deg, transparent, rgba(160, 232, 255, 0.9), transparent);
  filter: drop-shadow(0 0 10px rgba(138, 226, 255, 0.5));
}

.neo-title-comets::before {
  top: 24%;
  transform: rotate(-12deg);
  animation: titleCometSweep 6.8s linear infinite;
}

.neo-title-comets::after {
  top: 58%;
  transform: rotate(-10deg);
  animation: titleCometSweep 8.6s linear infinite reverse;
  opacity: 0.7;
}

.neo-title-planet {
  background:
    radial-gradient(circle at 70% 35%, rgba(244, 250, 255, 0.82) 0 10%, rgba(156, 223, 255, 0.45) 18%, rgba(53, 122, 182, 0.24) 44%, rgba(12, 36, 67, 0) 70%),
    radial-gradient(circle at 76% 30%, rgba(180, 228, 255, 0.18), transparent 38%);
  opacity: 0.52;
  transform: translate3d(calc(var(--title-parallax-x) * 0.3), calc(var(--title-parallax-y) * 0.2), 0);
}

@keyframes titleCometSweep {
  0% { transform: translateX(-38%) rotate(-12deg); opacity: 0; }
  10% { opacity: 0.85; }
  46% { opacity: 0.75; }
  100% { transform: translateX(35%) rotate(-12deg); opacity: 0; }
}
.neo-title-grid {
  background:
    linear-gradient(rgba(0, 245, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 30%, black 40%, transparent 95%);
}

.neo-title-wrap > :not(.neo-title-bg):not(.neo-title-nebula):not(.neo-title-stars):not(.neo-title-comets):not(.neo-title-planet):not(.neo-title-grid) {
  position: relative;
  z-index: 1;
}

.neo-title-top {
  margin: 0;
  text-align: center;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 0, 255, 0.86);
}

.neo-title-main { text-align: center; }

.neo-logo {
  text-shadow: 0 0 10px var(--line), 0 0 30px rgba(0, 245, 255, 0.3), 4px 4px 0 rgba(0, 80, 120, 0.8);
  letter-spacing: 4px;
}

.neo-sub-en {
  color: #ffffa8;
  letter-spacing: 3px;
}

.neo-sub-jp {
  margin: 8px 0 0;
  font-size: 12px;
  color: rgba(224, 232, 255, 0.7);
}

.neo-divider {
  display: flex;
  align-items: center;
  gap: 10px;
}

.neo-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.56));
}

.neo-divider span:last-child {
  background: linear-gradient(90deg, rgba(0, 245, 255, 0.56), transparent);
}

.neo-divider b {
  color: var(--line);
  font-size: 12px;
}

.neo-event-card,
.neo-balance-card {
  border: 1px solid rgba(0, 245, 255, 0.35);
  background: rgba(6, 12, 34, 0.84);
  padding: 10px;
}

.neo-event-label,
.neo-balance-label {
  margin: 0 0 6px;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
}

.neo-event-label { color: #ffb14a; }
.neo-event-text { margin: 0; font-size: 12px; color: #ffe2a9; }
.neo-balance-label { color: #00ff88; }
.neo-balance-row { margin: 4px 0 0; font-size: 12px; color: #c6e6ff; }

.neo-start-btn {
  min-height: 56px;
  border-color: var(--line);
  background: linear-gradient(180deg, #0d3b63, #071d36);
  letter-spacing: 4px;
}

.neo-start-note { color: rgba(0, 245, 255, 0.6); }

.neo-footer-row {
  justify-content: center;
  gap: 16px;
}

.primary-btn,
.shop-btn,
.stage-btn,
.item-btn,
.weapon-card,
.gacha-roll-btn,
.gacha-banner-btn,
.sub-link-btn,
.floating-btn {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(0, 245, 255, 0.12), rgba(0, 245, 255, 0.05));
}

.panel-head h2,
.menu-title,
.menu-subtitle,
.menu-section-title,
.gacha-event-title {
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.35);
}

.stage-item,
.shop-item,
.record-card,
.weapon-card,
.protocol-detail,
.gacha-progress-card,
.gacha-stat,
.gacha-result,
.world-entry {
  border-color: rgba(0, 245, 255, 0.56);
  background: rgba(8, 19, 47, 0.86);
}

.menu-btn span,
.panel-note,
.record-line,
.shop-item-meta,
.weapon-card-meta {
  color: #a9c6de;
}

/* ===== Cosmos Intro Overlay ===== */
.cosmos-intro {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cosmos-intro.active { display: flex; }

#cosmos-intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cosmos-intro-core {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 16px;
}

.cosmos-intro-logo {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(28px, 7.2vw, 72px);
  letter-spacing: 8px;
  color: #00f5ff;
  text-shadow: 0 0 14px #00f5ff, 0 0 36px rgba(0, 245, 255, 0.38), 4px 4px 0 rgba(0, 80, 120, 0.72);
  opacity: 0;
  transform: scale(1.08);
  transition: all 0.65s ease;
  white-space: nowrap;
}

.cosmos-intro.show-logo .cosmos-intro-logo { opacity: 1; transform: none; }

.cosmos-intro-skip {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: rgba(0, 245, 255, 0.6);
  background: transparent;
  border: 1px solid rgba(0, 245, 255, 0.4);
  padding: 8px 12px;
}

.cosmos-intro.fadeout {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

/* Cosmos intro ornaments */
.cosmos-intro-orbits {
  position: absolute;
  width: min(66vw, 420px);
  aspect-ratio: 1 / 1;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.cosmos-intro.show-deco .cosmos-intro-orbits { opacity: 1; }

.cosmos-orbit {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(0, 245, 255, 0.18);
}

.orbit-a { width: 62%; height: 62%; animation: cosmosOrbit 9s linear infinite; }
.orbit-b { width: 78%; height: 78%; border-color: rgba(255, 0, 255, 0.18); animation: cosmosOrbitRev 14s linear infinite; }
.orbit-c { width: 94%; height: 94%; border-color: rgba(0, 245, 255, 0.11); animation: cosmosOrbit 20s linear infinite; }

.cosmos-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  top: -3px;
  left: 50%;
  margin-left: -3px;
  background: #00f5ff;
  box-shadow: 0 0 8px #00f5ff;
}

.orbit-b .cosmos-dot {
  background: #ff00ff;
  box-shadow: 0 0 8px #ff00ff;
}

.cosmos-intro-scan {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 28%;
  height: 2px;
  opacity: 0;
  background: #00f5ff;
  box-shadow: 0 0 12px #00f5ff;
  z-index: 1;
}

.cosmos-intro.show-deco .cosmos-intro-scan {
  animation: cosmosScan 1.9s ease-out;
}

.cosmos-intro-corner {
  position: absolute;
  width: 42px;
  height: 42px;
  border-color: rgba(0, 245, 255, 0.45);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.cosmos-intro-corner.tl { top: 16px; left: 16px; border-top: 1px solid; border-left: 1px solid; }
.cosmos-intro-corner.tr { top: 16px; right: 16px; border-top: 1px solid; border-right: 1px solid; }
.cosmos-intro-corner.bl { bottom: 16px; left: 16px; border-bottom: 1px solid; border-left: 1px solid; }
.cosmos-intro-corner.br { bottom: 16px; right: 16px; border-bottom: 1px solid; border-right: 1px solid; }

.cosmos-intro.show-deco .cosmos-intro-corner { opacity: 1; }

@keyframes cosmosOrbit { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes cosmosOrbitRev { to { transform: translate(-50%, -50%) rotate(-360deg); } }
@keyframes cosmosScan {
  0% { top: 26%; opacity: 1; }
  100% { top: 74%; opacity: 0; }
}

/* ===== Fix: intro logo clipping + full-screen title space ===== */
.cosmos-intro-core {
  width: min(92vw, 980px);
  padding: 12px;
}

.cosmos-intro-logo {
  font-size: clamp(16px, 4.8vw, 52px);
  letter-spacing: clamp(1px, 0.6vw, 4px);
  line-height: 1.25;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

#title-screen {
  align-items: stretch;
  justify-content: stretch;
}

#title-screen .neo-title-wrap {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: clamp(14px, 2.6vw, 34px);
  display: grid;
  align-content: center;
  gap: clamp(10px, 1.5vh, 18px);
}

#title-screen .neo-title-bg {
  background:
    radial-gradient(circle at 18% 22%, rgba(0, 245, 255, 0.16), transparent 36%),
    radial-gradient(circle at 82% 68%, rgba(255, 0, 255, 0.12), transparent 34%),
    radial-gradient(circle at 50% 90%, rgba(0, 170, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #02040e 0%, #050a1d 56%, #040713 100%);
}

#title-screen .neo-title-nebula {
  background:
    radial-gradient(circle at 12% 18%, rgba(68, 191, 255, 0.24), transparent 40%),
    radial-gradient(circle at 80% 28%, rgba(217, 93, 255, 0.2), transparent 43%),
    radial-gradient(circle at 48% 88%, rgba(100, 177, 255, 0.17), transparent 42%);
  opacity: 0.94;
}

#title-screen .neo-title-stars {
  opacity: 0.86;
}

#title-screen .neo-title-comets {
  opacity: 0.42;
  mix-blend-mode: screen;
}

.neo-title-comets::before,
.neo-title-comets::after {
  content: "";
  position: absolute;
  width: 220%;
  height: 2px;
  left: -60%;
  background: linear-gradient(90deg, transparent, rgba(160, 232, 255, 0.9), transparent);
  filter: drop-shadow(0 0 10px rgba(138, 226, 255, 0.5));
}

.neo-title-comets::before {
  top: 24%;
  transform: rotate(-12deg);
  animation: titleCometSweep 6.8s linear infinite;
}

.neo-title-comets::after {
  top: 58%;
  transform: rotate(-10deg);
  animation: titleCometSweep 8.6s linear infinite reverse;
  opacity: 0.7;
}

.neo-title-planet {
  background:
    radial-gradient(circle at 70% 35%, rgba(244, 250, 255, 0.82) 0 10%, rgba(156, 223, 255, 0.45) 18%, rgba(53, 122, 182, 0.24) 44%, rgba(12, 36, 67, 0) 70%),
    radial-gradient(circle at 76% 30%, rgba(180, 228, 255, 0.18), transparent 38%);
  opacity: 0.52;
  transform: translate3d(calc(var(--title-parallax-x) * 0.3), calc(var(--title-parallax-y) * 0.2), 0);
}

@keyframes titleCometSweep {
  0% { transform: translateX(-38%) rotate(-12deg); opacity: 0; }
  10% { opacity: 0.85; }
  46% { opacity: 0.75; }
  100% { transform: translateX(35%) rotate(-12deg); opacity: 0; }
}
.neo-title-grid {
  background-image:
    linear-gradient(rgba(0, 245, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 255, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.8;
  animation: titleGridDrift 16s linear infinite;
}

#title-screen .neo-title-main,
#title-screen .neo-divider,
#title-screen .neo-event-card,
#title-screen .neo-balance-card,
#title-screen .neo-title-actions,
#title-screen .neo-title-top {
  width: min(94vw, 980px);
  margin-left: auto;
  margin-right: auto;
}

#title-screen .neo-event-card,
#title-screen .neo-balance-card {
  background: rgba(5, 11, 32, 0.72);
  border-color: rgba(0, 245, 255, 0.38);
  backdrop-filter: blur(1px);
}

#title-screen .neo-title-actions {
  margin-top: clamp(4px, 1vh, 10px);
}

@keyframes titleGridDrift {
  0% { transform: translateY(0); }
  100% { transform: translateY(34px); }
}

@keyframes titleNebulaDrift {
  0% { transform: scale(1) translate3d(0, 0, 0); opacity: 0.78; }
  100% { transform: scale(1.06) translate3d(-1.4%, 1.2%, 0); opacity: 1; }
}

@keyframes titleStarsTwinkle {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.92; }
}










/* ===== High Quality Pass (safe additive) ===== */

/* Title / menu polish */
.neo-title-wrap {
  backdrop-filter: blur(4px);
}

.neo-logo {
  letter-spacing: 0.08em;
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.75), 0 0 18px rgba(0, 245, 255, 0.32);
  animation: logo-breath 2.8s ease-in-out infinite;
}

@keyframes logo-breath {
  0%, 100% { filter: brightness(1); transform: translateY(0); }
  50% { filter: brightness(1.18); transform: translateY(-1px); }
}

.menu-btn {
  border-radius: 12px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, filter .16s ease;
}

.menu-btn:hover,
.menu-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(116, 229, 255, 0.26);
  filter: brightness(1.08);
}

.menu-btn strong {
  display: flex;
  align-items: center;
  gap: 6px;
}

.menu-btn[data-mode="stage"] strong::before { content: "◆"; color: #7feaff; }
.menu-btn[data-mode="endless"] strong::before { content: "∞"; color: #f1a9ff; }
.menu-btn[data-mode="genkyo"] strong::before { content: "◈"; color: #ffc790; }
.menu-btn[data-mode="cosmofloor"] strong::before { content: "✹"; color: #ff9cf4; }
.menu-btn[data-mode="galactic_abyss"] strong::before { content: "⬢"; color: #ff7ab3; }
.menu-btn[data-mode="ancient_knight"] strong::before { content: "⚔"; color: #ffe2ad; }
.menu-btn[data-mode="worldrecord"] strong::before { content: "🏆"; }
.menu-btn[data-mode="league"] strong::before { content: "◉"; color: #9ce8ff; }
.menu-btn[data-mode="events"] strong::before { content: "✦"; color: #ffdd86; }
.menu-btn[data-mode="skilltree"] strong::before { content: "⬡"; color: #9fffd7; }
.menu-btn[data-mode="stellar_domain"] strong::before { content: "✶"; color: #ffe49f; }

.skill-tree-wrap #skill-tree-list {
  max-height: 48vh;
  overflow: auto;
  border: 1px solid rgba(125, 220, 255, 0.2);
  border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, rgba(65, 115, 210, 0.12), rgba(6, 14, 28, 0.55));
  padding: 12px;
}

.skill-tree-map-wrap {
  position: relative;
}

.skill-tree-map {
  position: relative;
  min-width: 1060px;
}

.skill-tree-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.skill-tree-lines path {
  stroke: rgba(232, 220, 150, 0.66);
  stroke-width: 2;
  fill: none;
}

.skill-node-dot {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 245, 190, 0.72);
  background: radial-gradient(circle at 50% 45%, rgba(255, 253, 210, 0.92), rgba(242, 215, 120, 0.68) 62%, rgba(82, 60, 24, 0.9));
  box-shadow: 0 0 10px rgba(255, 235, 158, 0.45), 0 0 20px rgba(255, 229, 130, 0.24);
  transform: translate(-50%, -50%);
  cursor: pointer;
  color: #1f1707;
  font-weight: 700;
}

.skill-node-dot::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 250, 205, 0.5);
}

.skill-node-dot.locked-item {
  filter: grayscale(0.65) brightness(0.62);
  opacity: 0.75;
  border-color: rgba(166, 172, 185, 0.6);
  background: radial-gradient(circle at 50% 45%, rgba(180, 184, 191, 0.66), rgba(80, 84, 90, 0.58) 62%, rgba(34, 38, 46, 0.9));
}

.skill-node-dot.unlockable {
  border-color: rgba(153, 255, 211, 0.95);
  background: radial-gradient(circle at 50% 45%, rgba(226, 255, 246, 0.95), rgba(123, 255, 210, 0.74) 62%, rgba(20, 92, 70, 0.95));
  box-shadow: 0 0 14px rgba(145, 255, 215, 0.58), 0 0 28px rgba(100, 239, 191, 0.46);
  animation: skill-unlockable-pulse 1.2s ease-in-out infinite;
}

.skill-node-dot.active {
  border-color: #9efeff;
  background: radial-gradient(circle at 50% 45%, rgba(235, 255, 255, 0.98), rgba(131, 246, 255, 0.82) 62%, rgba(33, 103, 127, 0.96));
  box-shadow: 0 0 14px rgba(123, 235, 255, 0.72), 0 0 30px rgba(123, 235, 255, 0.52);
}

@keyframes skill-unlockable-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}

.skill-node-no {
  position: absolute;
  right: -10px;
  bottom: -10px;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(11, 23, 45, 0.86);
  color: #d5ecff;
  font-size: 11px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(145, 191, 255, 0.55);
}

.skill-node-label {
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  text-align: center;
  font-size: 10px;
  color: #d2e6ff;
  text-shadow: 0 0 6px rgba(24, 68, 133, 0.8);
}

.skill-node-state {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(220, 232, 252, 0.65);
  background: rgba(17, 26, 43, 0.85);
  color: #d7e7ff;
}

.skill-node-state.active {
  color: #c6fff6;
  border-color: rgba(132, 255, 233, 0.88);
  background: rgba(14, 56, 72, 0.9);
}

.skill-node-state.unlockable {
  color: #0f2920;
  border-color: rgba(174, 255, 205, 0.95);
  background: rgba(182, 255, 214, 0.96);
}

.skill-node-state.locked {
  color: #b9c1ce;
  border-color: rgba(138, 144, 157, 0.8);
  background: rgba(50, 56, 68, 0.94);
}

.skill-tree-effect-list {
  margin: 8px 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--sub);
}

#stellar-domain-screen .record-list {
  grid-template-columns: 1fr;
}

.stellar-domain-pane {
  border: 1px solid rgba(120, 184, 255, 0.2);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(9, 21, 48, 0.4), rgba(5, 12, 30, 0.35));
}

.stellar-slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 8px;
}

.stellar-loadout-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.stellar-loadout-left,
.stellar-loadout-right {
  border: 1px solid rgba(126, 182, 244, 0.24);
  border-radius: 12px;
  padding: 10px;
  background: rgba(8, 18, 40, 0.34);
}

.stellar-loadout-left .stellar-slot-grid {
  grid-template-columns: 1fr;
}

.stellar-loadout-left h3,
.stellar-loadout-right h3 {
  margin-top: 0;
}

.stellar-slot-btn {
  position: relative;
  overflow: hidden;
}

.stellar-slot-btn.stellar-slot-equip-pulse {
  animation: stellarSlotEquipPulse .56s ease-out;
}

.stellar-slot-btn.stellar-slot-equip-pulse::after {
  content: "";
  position: absolute;
  left: -40%;
  top: 0;
  width: 36%;
  height: 100%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, rgba(120, 244, 255, 0), rgba(120, 244, 255, 0.88), rgba(255, 255, 255, 0));
  animation: stellarSlotSweep .5s ease-out;
  pointer-events: none;
}

.stellar-book-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

@media (max-width: 900px) {
  .stellar-loadout-layout {
    grid-template-columns: 1fr;
  }

  .stellar-loadout-left .stellar-slot-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

#stellar-gift-result .record-card {
  border-color: rgba(155, 216, 255, 0.3);
}

#stellar-gift-result.stellar-gift-cinematic .record-card {
  border-color: rgba(170, 228, 255, 0.8);
  box-shadow: 0 0 14px rgba(122, 225, 255, 0.35), inset 0 0 12px rgba(122, 225, 255, 0.15);
  animation: stellarGiftPulse .55s ease-in-out infinite;
}

#stellar-gift-result.stellar-gift-heating .record-card {
  border-color: rgba(255, 196, 118, 0.88);
  box-shadow: 0 0 22px rgba(255, 174, 78, 0.4), inset 0 0 14px rgba(255, 180, 95, 0.2);
}

#stellar-gift-result.stellar-gift-reveal .record-card {
  animation: stellarGiftReveal .22s ease-out;
}

#stellar-gift-result.tier-normal .record-card {
  border-color: rgba(128, 215, 255, 0.5);
}

#stellar-gift-result.tier-rare .record-card {
  border-color: rgba(184, 126, 255, 0.72);
  box-shadow: 0 0 16px rgba(162, 101, 255, 0.32);
}

#stellar-gift-result.tier-pickup .record-card {
  border-color: rgba(255, 225, 146, 0.88);
  box-shadow: 0 0 26px rgba(255, 220, 120, 0.45), 0 0 34px rgba(117, 255, 255, 0.22);
}

.stellar-book-result.r1 { border-left: 4px solid #78c8ff; }
.stellar-book-result.r2 { border-left: 4px solid #59e0ff; }
.stellar-book-result.r3 { border-left: 4px solid #7ef3b1; }
.stellar-book-result.r4 { border-left: 4px solid #b68aff; }
.stellar-book-result.r5 { border-left: 4px solid #ff90da; }
.stellar-book-result.r6 { border-left: 4px solid #ffe178; box-shadow: 0 0 22px rgba(255, 232, 140, 0.4); }

.stellar-book-result .shop-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stellar-book-art {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 14px;
  border: 1px solid rgba(183, 216, 255, 0.45);
  background: rgba(33, 60, 98, 0.46);
  box-shadow: inset 0 0 8px rgba(175, 220, 255, 0.18);
  flex-shrink: 0;
}

.stellar-book-art.r4,
.stellar-book-art.r5 {
  border-color: rgba(224, 187, 255, 0.7);
  background: rgba(87, 54, 125, 0.55);
  box-shadow: 0 0 10px rgba(176, 128, 255, 0.3), inset 0 0 8px rgba(216, 190, 255, 0.22);
}

.stellar-book-art.r6 {
  border-color: rgba(255, 228, 140, 0.85);
  background: linear-gradient(135deg, rgba(255, 207, 92, 0.44), rgba(109, 255, 255, 0.36));
  box-shadow: 0 0 14px rgba(255, 217, 103, 0.38), inset 0 0 10px rgba(255, 255, 220, 0.24);
}

.stellar-book-meta .stellar-book-state {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(177, 206, 237, 0.4);
}

.stellar-book-state.state-equipped {
  color: #beffe4;
  border-color: rgba(126, 255, 213, 0.75);
  background: rgba(20, 80, 67, 0.45);
}

.stellar-book-state.state-ready {
  color: #dff9ff;
  border-color: rgba(155, 225, 255, 0.75);
  background: rgba(31, 70, 102, 0.45);
}

.stellar-book-state.state-locked {
  color: #b4b7c6;
  border-color: rgba(140, 146, 166, 0.62);
  background: rgba(40, 46, 63, 0.52);
}

.stellar-book-hint {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: #9fe7ff;
}

.stellar-book-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  border: 1px solid rgba(190, 218, 255, 0.35);
}

.stellar-book-badge.r1, .stellar-book-badge.r2, .stellar-book-badge.r3 {
  background: rgba(88, 168, 245, 0.22);
  color: #bfe8ff;
}

.stellar-book-badge.r4, .stellar-book-badge.r5 {
  background: rgba(174, 112, 255, 0.24);
  color: #ecd7ff;
}

.stellar-book-badge.r6 {
  background: linear-gradient(90deg, rgba(255, 215, 106, 0.35), rgba(137, 255, 255, 0.35));
  color: #fff3c7;
  border-color: rgba(255, 231, 153, 0.7);
}

@keyframes stellarGiftPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.01); filter: brightness(1.12); }
}

@keyframes stellarSlotEquipPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(110, 236, 255, 0); }
  30% { transform: scale(1.03); box-shadow: 0 0 18px rgba(110, 236, 255, 0.42); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(110, 236, 255, 0); }
}

@keyframes stellarSlotSweep {
  from { left: -40%; opacity: 0.2; }
  to { left: 130%; opacity: 0.95; }
}

@keyframes stellarGiftReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* HUD readability */
.hud,
.boss-hud,
#abyss-hud {
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.2), inset 0 0 16px rgba(0, 245, 255, 0.08);
}

.hud-top.hud-special-ready {
  border-color: #ffe39a;
  box-shadow: 0 0 16px rgba(255, 225, 120, 0.35), inset 0 0 10px rgba(255, 225, 120, 0.22);
}

.hud-top.hud-lowhp,
.hud-bottom.hud-lowhp {
  border-color: #ff87a7;
  box-shadow: 0 0 18px rgba(255, 90, 132, 0.32), inset 0 0 12px rgba(255, 90, 132, 0.24);
  animation: hud-danger-blink .9s steps(2, end) infinite;
}

@keyframes hud-danger-blink {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

.boss-hud-critical {
  border-color: #ff9ab8;
  box-shadow: 0 0 18px rgba(255, 98, 146, 0.34), inset 0 0 16px rgba(255, 98, 146, 0.22);
}

.boss-hud-critical .boss-fill {
  animation: boss-critical-pulse .65s ease-in-out infinite;
}

@keyframes boss-critical-pulse {
  0%, 100% { filter: saturate(1) brightness(1); }
  50% { filter: saturate(1.35) brightness(1.25); }
}

/* Mode atmosphere (gameplay only) */
#game-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity .24s ease;
}

#game-screen[data-mode="endless"]::after {
  opacity: .32;
  background: radial-gradient(circle at 82% 8%, rgba(122, 206, 255, 0.26), transparent 38%);
}

#game-screen[data-mode="genkyo"]::after {
  opacity: .34;
  background: radial-gradient(circle at 50% 0%, rgba(255, 186, 130, 0.3), transparent 38%);
}

#game-screen[data-mode="cosmofloor"]::after {
  opacity: .36;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 118, 233, 0.22), transparent 34%),
    radial-gradient(circle at 78% 16%, rgba(154, 108, 255, 0.2), transparent 38%);
}

#game-screen[data-mode="galactic_abyss"]::after {
  opacity: .42;
  background: radial-gradient(circle at 50% 15%, rgba(255, 78, 138, 0.2), transparent 50%);
}

/* Ranking clarity */
.world-entry {
  border-radius: 10px;
}

.world-entry-podium {
  box-shadow: 0 0 14px rgba(255, 210, 130, 0.26);
}

.world-entry-self {
  border-color: #7de7ff;
  box-shadow: 0 0 14px rgba(125, 231, 255, 0.3), inset 0 0 8px rgba(125, 231, 255, 0.16);
  background: linear-gradient(180deg, rgba(14, 48, 78, 0.85), rgba(10, 33, 56, 0.85));
}

.world-entry-self .world-name::after {
  content: "  (YOU)";
  color: #9fefff;
  font-size: 10px;
}

/* Better touch targets */
@media (max-width: 900px) {
  .menu-btn,
  .primary-btn,
  .gacha-roll-btn,
  .stage-btn,
  .shop-btn {
    min-height: 50px;
  }

  .item-panel {
    gap: 6px;
  }

  .item-btn {
    min-height: 36px;
  }
}
/* Protocol / special cinematic boost */
.status-text.show {
  animation: status-pop .24s ease, status-breathe 1.1s ease-in-out infinite;
}

@keyframes status-pop {
  from { transform: translate(-50%, -50%) scale(0.94); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes status-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.14); }
}

#game-screen.special-active::before {
  background:
    radial-gradient(circle at 50% 56%, rgba(255, 238, 130, 0.52), rgba(255, 226, 80, 0.2), transparent 72%),
    radial-gradient(circle at 80% 18%, rgba(120, 235, 255, 0.18), transparent 42%);
  animation: special-screen-pulse .6s ease-in-out infinite;
}

@keyframes special-screen-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}
/* Title cinematic boost */
.neo-title-wrap {
  --title-parallax-x: 0px;
  --title-parallax-y: 0px;
}

#title-screen .neo-title-nebula {
  transform: translate3d(calc(var(--title-parallax-x) * 0.55), calc(var(--title-parallax-y) * 0.55), 0);
  transition: transform .22s ease;
}

#title-screen .neo-title-stars {
  transform: translate3d(calc(var(--title-parallax-x) * 0.9), calc(var(--title-parallax-y) * 0.9), 0);
  transition: transform .22s ease;
}

#title-screen .neo-title-stars::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 42%, rgba(180, 236, 255, 0.75) 49%, transparent 56%),
    linear-gradient(120deg, transparent 58%, rgba(255, 216, 160, 0.6) 63%, transparent 68%);
  animation: title-shooting 5.5s linear infinite;
  opacity: 0.28;
}

@keyframes title-shooting {
  0% { transform: translateX(-18%) translateY(-12%); }
  100% { transform: translateX(18%) translateY(12%); }
}

.neo-title-wrap.title-cine-flash .neo-title-main {
  animation: title-cine-flash .5s ease;
}

@keyframes title-cine-flash {
  0% { filter: brightness(1); }
  30% { filter: brightness(1.3) saturate(1.2); }
  100% { filter: brightness(1); }
}






/* Title start warp */
.neo-title-wrap.title-start-warp {
  animation: title-start-warp-shake .28s ease-out;
}

.neo-title-wrap.title-start-warp .neo-title-main {
  animation: title-start-warp-zoom .28s ease-out;
}

.neo-title-wrap.title-start-warp::after {
  content: "";
  position: absolute;
  inset: -8%;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(circle at 50% 52%, rgba(184, 244, 255, 0.72), rgba(160, 232, 255, 0.22), transparent 64%),
    radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.45), transparent 36%);
  mix-blend-mode: screen;
  animation: title-start-warp-flash .28s ease-out;
}

.neo-title-wrap.title-start-warp .neo-title-stars::after {
  animation-duration: .28s;
  opacity: 0.5;
}

.neo-title-wrap.title-start-warp .neo-title-comets::before,
.neo-title-wrap.title-start-warp .neo-title-comets::after {
  animation-duration: .28s;
  opacity: 0.95;
}

@keyframes title-start-warp-shake {
  0% { transform: scale(1); filter: brightness(1); }
  35% { transform: scale(1.015) translateY(-1px); filter: brightness(1.28) saturate(1.18); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes title-start-warp-zoom {
  0% { transform: scale(1); letter-spacing: 0; }
  35% { transform: scale(1.03); letter-spacing: 1px; }
  100% { transform: scale(1); letter-spacing: 0; }
}

@keyframes title-start-warp-flash {
  0% { opacity: 0; }
  22% { opacity: 1; }
  100% { opacity: 0; }
}

/* Submenu quality upgrade */
.subpanel-wrap {
  position: relative;
  overflow: auto;
  border-radius: 16px;
  background:
    radial-gradient(circle at 14% 12%, rgba(96, 230, 255, 0.12), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(255, 174, 132, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(8, 23, 47, 0.96), rgba(5, 16, 34, 0.96));
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(120, 228, 255, 0.14) inset,
    0 0 22px rgba(78, 190, 255, 0.12);
}

.subpanel-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 14%),
    repeating-linear-gradient(0deg, transparent, transparent 7px, rgba(118, 220, 255, 0.03) 7px, rgba(118, 220, 255, 0.03) 8px);
  opacity: 0.8;
}

.subpanel-wrap > * {
  position: relative;
  z-index: 1;
}

.subpanel-wrap .panel-head {
  position: relative;
  padding: 12px 14px;
  border: 1px solid rgba(118, 226, 255, 0.24);
  border-radius: 12px;
  background: rgba(12, 32, 64, 0.56);
  overflow: hidden;
}

.subpanel-wrap .panel-head::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -36%;
  width: 32%;
  background: linear-gradient(90deg, transparent, rgba(154, 235, 255, 0.26), transparent);
  animation: subpanel-head-scan 4.8s linear infinite;
}

.subpanel-wrap .panel-head h2 {
  text-shadow: 0 0 12px rgba(122, 231, 255, 0.2);
}

.subpanel-wrap .record-card,
.subpanel-wrap .shop-item,
.subpanel-wrap .protocol-detail,
.subpanel-wrap .gacha-progress-card,
.subpanel-wrap .gacha-stat,
.subpanel-wrap .world-entry,
.subpanel-wrap .mode-lobby-season,
.subpanel-wrap .mode-lobby-rewards,
.subpanel-wrap .mode-lobby-ranking {
  box-shadow: 0 0 0 1px rgba(132, 230, 255, 0.08) inset, 0 10px 18px rgba(0, 0, 0, 0.14);
}

.subpanel-wrap .primary-btn,
.subpanel-wrap .gacha-banner-btn,
.subpanel-wrap .gacha-roll-btn,
.subpanel-wrap .shop-btn,
.subpanel-wrap .weapon-card {
  box-shadow: 0 0 0 1px rgba(140, 229, 255, 0.12) inset, 0 0 14px rgba(80, 194, 255, 0.08);
}

.subpanel-wrap .primary-btn:hover,
.subpanel-wrap .primary-btn:focus-visible,
.subpanel-wrap .shop-btn:hover,
.subpanel-wrap .shop-btn:focus-visible,
.subpanel-wrap .weapon-card:hover,
.subpanel-wrap .weapon-card:focus-visible,
.subpanel-wrap .gacha-banner-btn:hover,
.subpanel-wrap .gacha-banner-btn:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.language-wrap {
  max-width: 520px;
}

.language-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.language-btn {
  min-height: 64px;
  font-size: 18px;
  letter-spacing: 0.04em;
}

@keyframes subpanel-head-scan {
  0% { left: -36%; }
  100% { left: 112%; }
}

@media (max-width: 640px) {
  .language-actions {
    grid-template-columns: 1fr;
  }
}

/* Menu cinematic boost */
#menu-screen {
  overflow: hidden;
}

.menu-wrap {
  position: relative;
  isolation: isolate;
}

.menu-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.menu-fx-nebula {
  background:
    radial-gradient(circle at 16% 12%, rgba(106, 227, 255, 0.22), transparent 36%),
    radial-gradient(circle at 86% 22%, rgba(255, 160, 232, 0.16), transparent 34%),
    radial-gradient(circle at 42% 82%, rgba(122, 159, 255, 0.16), transparent 42%);
  filter: saturate(1.08) blur(0.2px);
  animation: menu-nebula-drift 14s ease-in-out infinite alternate;
}

.menu-fx-stars {
  background-image:
    radial-gradient(circle at 8% 14%, rgba(255, 255, 255, 0.78) 0 1px, transparent 1.4px),
    radial-gradient(circle at 19% 34%, rgba(184, 236, 255, 0.72) 0 1px, transparent 1.4px),
    radial-gradient(circle at 29% 65%, rgba(255, 255, 255, 0.74) 0 1px, transparent 1.4px),
    radial-gradient(circle at 41% 22%, rgba(160, 225, 255, 0.74) 0 1px, transparent 1.4px),
    radial-gradient(circle at 56% 54%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1.4px),
    radial-gradient(circle at 71% 18%, rgba(178, 235, 255, 0.7) 0 1px, transparent 1.4px),
    radial-gradient(circle at 82% 62%, rgba(255, 255, 255, 0.75) 0 1px, transparent 1.4px),
    radial-gradient(circle at 93% 26%, rgba(190, 236, 255, 0.66) 0 1px, transparent 1.4px);
  opacity: 0.42;
  animation: menu-stars-pulse 2.9s steps(2, end) infinite;
}

.menu-fx-scan {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 6px, rgba(120, 225, 255, 0.045) 6px, rgba(120, 225, 255, 0.045) 7px);
  opacity: 0.32;
}

.menu-wrap > :not(.menu-fx-layer) {
  position: relative;
  z-index: 1;
}

.menu-title {
  animation: menu-title-breathe 2.6s ease-in-out infinite;
}

.menu-section-title {
  overflow: hidden;
}

.menu-section-title::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  left: -42%;
  background: linear-gradient(90deg, transparent, rgba(154, 235, 255, 0.35), transparent);
  animation: menu-section-scan 3.8s linear infinite;
}

.menu-btn {
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.22s ease;
}

.menu-btn:hover,
.menu-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(146, 233, 255, 0.22) inset, 0 0 18px rgba(108, 220, 255, 0.26);
}

.menu-btn:active {
  filter: brightness(1.14);
}

.mode-grid-main .menu-btn,
.mode-grid-sub .menu-btn,
.menu-list .menu-btn {
  animation: menu-card-entry .42s ease both;
}

.mode-grid-main .menu-btn:nth-child(1) { animation-delay: .02s; }
.mode-grid-main .menu-btn:nth-child(2) { animation-delay: .06s; }
.mode-grid-sub .menu-btn:nth-child(1) { animation-delay: .08s; }
.mode-grid-sub .menu-btn:nth-child(2) { animation-delay: .11s; }
.mode-grid-sub .menu-btn:nth-child(3) { animation-delay: .14s; }
.mode-grid-sub .menu-btn:nth-child(4) { animation-delay: .17s; }
.menu-list .menu-btn:nth-child(1) { animation-delay: .07s; }
.menu-list .menu-btn:nth-child(2) { animation-delay: .10s; }
.menu-list .menu-btn:nth-child(3) { animation-delay: .13s; }
.menu-list .menu-btn:nth-child(4) { animation-delay: .16s; }
.menu-list .menu-btn:nth-child(5) { animation-delay: .19s; }

.daily-mission-panel {
  border-image: linear-gradient(90deg, rgba(131, 246, 168, 0.88), rgba(138, 232, 255, 0.92)) 1;
  box-shadow: 0 0 16px rgba(138, 232, 255, 0.18);
}

@keyframes menu-nebula-drift {
  0% { transform: translate3d(-1.2%, -0.6%, 0) scale(1); }
  100% { transform: translate3d(1.4%, 1.1%, 0) scale(1.04); }
}

@keyframes menu-stars-pulse {
  0%, 100% { opacity: 0.34; }
  50% { opacity: 0.48; }
}

@keyframes menu-title-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12) saturate(1.08); }
}

@keyframes menu-section-scan {
  0% { left: -42%; }
  100% { left: 108%; }
}

@keyframes menu-card-entry {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .menu-fx-stars {
    opacity: 0.36;
  }

  .menu-section-title::after {
    width: 46%;
  }
}

/* Mobile-game-like main menu redesign */
#menu-screen .menu-wrap {
  background:
    radial-gradient(circle at 50% 22%, rgba(178, 242, 255, 0.24), transparent 35%),
    radial-gradient(circle at 50% 95%, rgba(148, 113, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #0b1b3d 0%, #122a55 44%, #183670 100%);
  border-radius: 20px;
  padding: 12px 12px 14px;
}

.menu-home-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.menu-home-resource,
.menu-home-rank {
  border: 2px solid rgba(225, 206, 158, 0.85);
  background: linear-gradient(180deg, rgba(25, 46, 86, 0.96), rgba(10, 24, 52, 0.96));
  border-radius: 14px;
  padding: 6px 8px;
  text-align: center;
  box-shadow: inset 0 0 0 2px rgba(148, 197, 255, 0.24), 0 4px 12px rgba(0, 0, 0, 0.28);
}

.menu-home-rank {
  min-width: 96px;
  border-color: rgba(248, 219, 149, 0.95);
  background:
    radial-gradient(circle at 50% 45%, rgba(116, 190, 255, 0.56), rgba(30, 58, 108, 0.98)),
    linear-gradient(180deg, rgba(20, 39, 77, 0.95), rgba(12, 27, 54, 0.96));
}

.menu-home-resource-label,
.menu-home-rank-label {
  margin: 0;
  font-size: 9px;
  color: #b8ddff;
  font-family: "Press Start 2P", monospace;
}

.menu-home-resource-value,
.menu-home-rank-value {
  margin: 4px 0 0;
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  color: #f4fbff;
}

.menu-home-rank-value {
  font-size: 18px;
  color: #fff2ca;
}

#menu-screen .menu-title {
  margin-top: 6px;
  margin-bottom: 2px;
}

#menu-screen .menu-subtitle {
  margin-top: 0;
  margin-bottom: 8px;
}

.menu-hero-card {
  position: relative;
  border: 2px solid rgba(214, 188, 255, 0.72);
  border-radius: 14px;
  min-height: 72px;
  overflow: hidden;
  display: grid;
  align-items: center;
  margin-bottom: 10px;
  background: linear-gradient(90deg, rgba(58, 41, 105, 0.92), rgba(82, 49, 126, 0.92));
}

.menu-hero-glow {
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(circle at 20% 60%, rgba(255, 182, 235, 0.55), transparent 33%),
    radial-gradient(circle at 78% 35%, rgba(166, 255, 252, 0.45), transparent 30%);
  animation: menuHeroFlow 5.6s ease-in-out infinite alternate;
}

.menu-hero-text {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  color: #fff2ff;
  text-shadow: 0 0 10px rgba(255, 190, 243, 0.5);
}

#menu-screen .mode-grid-main .menu-btn {
  min-height: 94px;
  border-radius: 14px;
}

#menu-screen .mode-grid-sub .menu-btn {
  min-height: 82px;
  border-radius: 12px;
}

#menu-screen .menu-list .menu-btn {
  min-height: 70px;
  border-radius: 12px;
}

.menu-home-dock {
  position: sticky;
  bottom: 2px;
  z-index: 5;
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 2px solid rgba(214, 198, 158, 0.82);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% -10%, rgba(173, 218, 255, 0.28), transparent 38%),
    linear-gradient(180deg, rgba(22, 45, 84, 0.95), rgba(11, 27, 53, 0.97));
  box-shadow: 0 8px 22px rgba(4, 10, 25, 0.45);
}

.menu-dock-btn {
  min-height: 62px;
  text-align: center;
  padding: 5px 4px;
  border-radius: 999px;
  border-color: rgba(198, 231, 255, 0.78);
  background: linear-gradient(180deg, rgba(53, 103, 165, 0.95), rgba(28, 67, 118, 0.95));
  box-shadow: inset 0 0 0 2px rgba(232, 246, 255, 0.2), 0 2px 10px rgba(6, 18, 42, 0.35);
}

.menu-dock-btn strong {
  font-size: 9px;
}

.menu-dock-btn span {
  font-size: 8px;
}

.menu-dock-btn strong::before {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
  line-height: 1;
}

.menu-dock-btn[data-mode="gacha"] strong::before { content: "✦"; color: #ffd787; }
.menu-dock-btn[data-mode="shop"] strong::before { content: "◍"; color: #9df7ff; }
.menu-dock-btn[data-mode="worldrecord"] strong::before { content: "🏆"; }
.menu-dock-btn[data-mode="options"] strong::before { content: "⚙"; color: #d5d5ff; }

#menu-screen .daily-mission-panel {
  border-radius: 12px;
  border: 2px solid rgba(163, 219, 255, 0.52);
  background: rgba(7, 20, 43, 0.55);
}

@keyframes menuHeroFlow {
  0% { transform: translateX(-2%) scale(1); }
  100% { transform: translateX(2%) scale(1.05); }
}

/* ===== UI Quality Refresh (Lightweight) ===== */

:root {
  --ui-bg-top: #0a1024;
  --ui-bg-mid: #111a36;
  --ui-bg-bottom: #070b17;
  --ui-card: rgba(22, 33, 66, 0.92);
  --ui-card-soft: rgba(26, 41, 80, 0.8);
  --ui-line: rgba(141, 221, 255, 0.72);
  --ui-line-strong: rgba(198, 235, 255, 0.9);
  --ui-accent: #77ddff;
  --ui-accent2: #ffd08a;
  --ui-text-main: #f4fbff;
  --ui-text-sub: #b9dfff;
}

html, body {
  font-family: "Noto Sans JP", "Rajdhani", sans-serif;
  background: linear-gradient(180deg, var(--ui-bg-top), var(--ui-bg-mid) 48%, var(--ui-bg-bottom));
}

.splash-wrap, .title-wrap, .panel-wrap, .menu-wrap {
  border: 1px solid var(--ui-line);
  border-radius: 22px;
  padding: 16px;
  background:
    radial-gradient(circle at 85% -20%, rgba(124, 216, 255, 0.16), transparent 44%),
    radial-gradient(circle at -10% 120%, rgba(255, 208, 138, 0.12), transparent 42%),
    var(--ui-card);
  box-shadow:
    0 18px 44px rgba(4, 10, 24, 0.45),
    inset 0 0 0 1px rgba(224, 242, 255, 0.12);
}

.panel-head h2,
.menu-title,
.logo,
.gacha-event-title,
.mode-info-wrap h2 {
  font-family: "Rajdhani", "Noto Sans JP", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.menu-subtitle,
.panel-note,
.record-line,
.shop-item-meta,
.weapon-card-meta {
  color: var(--ui-text-sub);
}

.primary-btn,
.menu-btn,
.shop-btn,
.stage-btn,
.item-btn,
.weapon-card,
.gacha-roll-btn,
.gacha-banner-btn,
.sub-link-btn,
.floating-btn {
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  font-family: "Noto Sans JP", "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  background:
    linear-gradient(180deg, rgba(96, 176, 240, 0.28), rgba(54, 101, 176, 0.28) 24%, rgba(27, 53, 99, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 6px 14px rgba(0, 0, 0, 0.25);
  transition: transform .08s ease, filter .16s ease, border-color .16s ease, background .2s ease;
}

.primary-btn:hover,
.menu-btn:hover,
.shop-btn:hover,
.stage-btn:hover,
.weapon-card:hover,
.gacha-roll-btn:hover,
.gacha-banner-btn:hover,
.sub-link-btn:hover,
.floating-btn:hover {
  filter: brightness(1.08);
  border-color: var(--ui-line-strong);
}

.primary-btn:active,
.menu-btn:active,
.shop-btn:active,
.stage-btn:active,
.item-btn:active,
.weapon-card:active,
.gacha-roll-btn:active,
.gacha-banner-btn:active,
.sub-link-btn:active,
.floating-btn:active {
  transform: translateY(1px) scale(0.995);
}

#menu-screen {
  background:
    radial-gradient(circle at 12% 12%, rgba(126, 224, 255, 0.18), transparent 24%),
    radial-gradient(circle at 86% 16%, rgba(255, 197, 120, 0.14), transparent 24%),
    linear-gradient(180deg, #0a1127, #091125 50%, #060b18 100%);
}

.menu-wrap {
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% -30%, rgba(150, 228, 255, 0.16), transparent 45%),
    linear-gradient(180deg, rgba(15, 29, 61, 0.97), rgba(10, 20, 44, 0.98));
}

.menu-section-title {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #d4e9ff;
  margin-top: 16px;
}

.mode-grid-main .menu-btn,
.mode-grid-sub .menu-btn,
.menu-list .menu-btn {
  border-radius: 16px;
  padding: 12px;
  min-height: 84px;
}

.mode-main {
  min-height: 110px;
}

.menu-btn strong {
  font-size: 15px;
  line-height: 1.2;
}

.menu-btn span {
  font-size: 11px;
  color: #d5ebff;
}

.menu-home-topbar,
.menu-home-dock,
.daily-mission-panel,
#weekly-coin-status {
  border-radius: 16px;
  border: 1px solid rgba(158, 223, 255, 0.4);
  background: var(--ui-card-soft);
}

.menu-home-dock {
  padding: 10px;
  gap: 10px;
}

.menu-dock-btn {
  min-height: 66px;
  border-radius: 14px;
}

.stage-item,
.shop-item,
.record-card,
.weapon-card,
.protocol-detail,
.gacha-progress-card,
.gacha-stat,
.gacha-result,
.world-entry,
.option-row,
.mode-lobby-season,
.mode-lobby-rewards,
.mode-lobby-ranking {
  border: 1px solid rgba(137, 214, 255, 0.5);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(49, 88, 156, 0.18), rgba(27, 48, 92, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.stage-select-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stage-item {
  aspect-ratio: 1.08 / 1;
  padding: 10px;
}

.protocol-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.weapon-card {
  min-height: 86px;
}

.gacha-main-visual,
.gacha-machine,
.gacha-cinematic-machine {
  border-radius: 16px;
  border-width: 1px;
}

.gacha-banner-btn.active,
.weapon-card.selected {
  border-color: rgba(255, 216, 134, 0.96);
  box-shadow: 0 0 0 1px rgba(255, 229, 175, 0.45), inset 0 0 0 1px rgba(255, 229, 175, 0.45);
}

.world-entry {
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  padding: 10px;
}

.world-rank {
  font-size: 11px;
  color: #ffe4ad;
}

.world-score {
  color: #d7efff;
}

.hud, .boss-hud {
  border: 1px solid rgba(146, 220, 255, 0.72);
  border-radius: 14px;
  background: rgba(11, 23, 44, 0.62);
  backdrop-filter: blur(4px);
}

.hud-top,
.hud-bottom,
.boss-hud {
  padding: 8px;
}

.status-text {
  border: 1px solid rgba(255, 176, 198, 0.84);
  border-radius: 14px;
  background: rgba(30, 14, 35, 0.86);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.world-record-notice {
  border-radius: 16px;
  border-width: 2px;
}

.screen {
  animation: uiFadeIn .18s ease;
}

@keyframes uiFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .menu-wrap,
  .panel-wrap,
  .title-wrap,
  .splash-wrap {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    width: 100%;
    max-height: 100%;
  }

  .mode-grid-main,
  .mode-grid-sub {
    grid-template-columns: 1fr;
  }

  .stage-select-grid,
  .protocol-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen,
  .menu-hero-glow,
  .splash-line,
  .world-record-notice.show {
    animation: none !important;
  }
}

/* ===== Renewal 2026-04: Mobile-grade UI Overhaul (non-breaking visual layer) ===== */
:root {
  --renew-bg-0: #070b17;
  --renew-bg-1: #0d1428;
  --renew-bg-2: #151f3b;
  --renew-card: rgba(20, 29, 54, 0.9);
  --renew-card-soft: rgba(26, 40, 72, 0.78);
  --renew-line: rgba(164, 214, 255, 0.4);
  --renew-line-strong: rgba(198, 233, 255, 0.72);
  --renew-text: #f2f8ff;
  --renew-sub: #b4ceeb;
  --renew-accent: #71d2ff;
  --renew-gold: #ffd38f;
  --renew-danger: #ff7b9f;
  --renew-success: #7ef0a4;
}

* {
  image-rendering: auto !important;
}

html,
body {
  font-family: "Segoe UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: var(--renew-text);
  background:
    radial-gradient(circle at 8% 10%, rgba(113, 210, 255, 0.14), transparent 26%),
    radial-gradient(circle at 90% 20%, rgba(255, 211, 143, 0.1), transparent 24%),
    linear-gradient(180deg, var(--renew-bg-2), var(--renew-bg-1) 42%, var(--renew-bg-0));
}

.screen {
  background: transparent;
}

.screen.active {
  animation: renew-screen-fade .24s ease;
}

@keyframes renew-screen-fade {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.splash-wrap,
.title-wrap,
.panel-wrap,
.menu-wrap {
  width: min(96vw, 900px);
  border: 1px solid var(--renew-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 84% -14%, rgba(133, 215, 255, 0.2), transparent 42%),
    radial-gradient(circle at -12% 120%, rgba(255, 211, 143, 0.14), transparent 40%),
    var(--renew-card);
  box-shadow:
    0 22px 56px rgba(2, 8, 21, 0.56),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.panel-wrap,
.menu-wrap {
  padding: 18px;
}

.logo,
.menu-title,
.panel-head h2,
.gacha-event-title,
#stage-brief-title,
#mode-info-title,
#lobby-title {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.subtitle,
.menu-subtitle,
.panel-note,
.shop-item-meta,
.record-line,
.weapon-card-meta {
  color: var(--renew-sub);
}

.primary-btn,
.menu-btn,
.shop-btn,
.stage-btn,
.item-btn,
.weapon-card,
.gacha-roll-btn,
.gacha-banner-btn,
.sub-link-btn,
.floating-btn {
  border: 1px solid var(--renew-line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(109, 177, 255, 0.28), rgba(58, 106, 182, 0.24) 24%, rgba(29, 53, 96, 0.9) 100%);
  color: var(--renew-text);
  font-family: "Segoe UI", "Noto Sans JP", sans-serif;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 18px rgba(2, 9, 24, 0.3);
  transition: transform .08s ease, border-color .2s ease, filter .2s ease, box-shadow .2s ease;
}

.primary-btn:hover,
.menu-btn:hover,
.shop-btn:hover,
.stage-btn:hover,
.weapon-card:hover,
.gacha-roll-btn:hover,
.gacha-banner-btn:hover,
.sub-link-btn:hover,
.floating-btn:hover {
  border-color: var(--renew-line-strong);
  filter: brightness(1.06);
}

.primary-btn:active,
.menu-btn:active,
.shop-btn:active,
.stage-btn:active,
.item-btn:active,
.weapon-card:active,
.gacha-roll-btn:active,
.gacha-banner-btn:active,
.sub-link-btn:active,
.floating-btn:active {
  transform: translateY(1px) scale(0.995);
}

/* Menu shell */
#menu-screen {
  background:
    radial-gradient(circle at 10% 10%, rgba(121, 220, 255, 0.16), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(255, 203, 129, 0.14), transparent 22%),
    linear-gradient(180deg, #0a1126, #0a1329 48%, #060b18 100%);
}

.menu-wrap {
  border-radius: 28px;
  overflow: hidden;
}

.menu-home-topbar {
  border: 1px solid rgba(163, 223, 255, 0.32);
  border-radius: 16px;
  background: var(--renew-card-soft);
  padding: 10px;
}

.menu-home-resource-label,
.menu-home-rank-label {
  color: #c9e2ff;
  font-size: 11px;
}

.menu-home-resource-value,
.menu-home-rank-value {
  font-size: 22px;
  font-weight: 800;
}

.menu-section-title {
  margin-top: 16px;
  margin-bottom: 10px;
  text-align: left;
  font-size: 12px;
  color: #dceaff;
  letter-spacing: .08em;
  border-top: 1px solid rgba(141, 211, 255, 0.24);
  padding-top: 10px;
}

.mode-grid-main,
.mode-grid-sub {
  gap: 10px;
}

.mode-grid-main .menu-btn,
.mode-grid-sub .menu-btn,
.menu-list .menu-btn {
  min-height: 84px;
  padding: 12px;
  text-align: left;
}

.mode-main {
  min-height: 108px;
}

.menu-btn strong {
  font-size: 15px;
  line-height: 1.25;
}

.menu-btn span {
  font-size: 11px;
  color: #cce5ff;
}

.menu-home-dock {
  position: sticky;
  bottom: 0;
  border: 1px solid rgba(186, 227, 255, 0.36);
  border-radius: 18px;
  background: rgba(17, 31, 60, 0.95);
  backdrop-filter: blur(6px);
  padding: 10px;
  gap: 10px;
}

.menu-dock-btn {
  min-height: 62px;
  border-radius: 12px;
}

#weekly-coin-status,
.daily-mission-panel {
  border: 1px solid rgba(157, 214, 255, 0.34);
  border-radius: 14px;
  background: rgba(19, 33, 63, 0.66);
}

/* Common cards/lists */
.stage-item,
.shop-item,
.record-card,
.weapon-card,
.protocol-detail,
.gacha-progress-card,
.gacha-stat,
.gacha-result,
.world-entry,
.mode-lobby-season,
.mode-lobby-rewards,
.mode-lobby-ranking,
.option-row,
.stage-brief-boss-card,
.stage-brief-reward-card {
  border: 1px solid rgba(150, 214, 255, 0.42);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(79, 139, 219, 0.16), rgba(33, 60, 108, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.stage-select-grid {
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stage-item {
  aspect-ratio: 1.1 / 1;
}

.protocol-grid {
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.weapon-card {
  min-height: 92px;
}

.weapon-card.selected,
.gacha-banner-btn.active {
  border-color: rgba(255, 216, 143, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(255, 228, 168, 0.42),
    0 0 0 1px rgba(255, 228, 168, 0.3);
}

/* Gacha polish */
.gacha-main-visual,
.gacha-machine,
.gacha-cinematic-machine,
.gacha-feature-card,
.gacha-open-summary,
.gacha-result-card {
  border-radius: 14px;
}

.gacha-action-row,
.gacha-banner-select,
.gacha-stats,
.gacha-sub-row {
  gap: 10px;
}

.gacha-roll-btn {
  min-height: 58px;
  font-size: 14px;
}

/* World/League style */
.world-entry {
  grid-template-columns: 56px 1fr auto;
  padding: 10px;
}

.world-rank {
  font-size: 12px;
  font-weight: 800;
  color: #ffe1a8;
}

.world-name {
  font-size: 14px;
  font-weight: 700;
}

.world-score {
  font-size: 12px;
  font-weight: 700;
  color: #d6ebff;
}

/* In-game HUD (lightweight only) */
.hud,
.boss-hud,
.abyss-hud {
  border: 1px solid rgba(151, 214, 255, 0.66);
  border-radius: 14px;
  background: rgba(8, 19, 40, 0.58);
  backdrop-filter: blur(4px);
}

.hud-top,
.hud-bottom,
.boss-hud {
  padding: 8px;
}

.label {
  font-size: 9px;
  color: #cae6ff;
}

.item-panel {
  gap: 6px;
  grid-template-columns: repeat(5, minmax(52px, 1fr));
}

.item-btn {
  min-height: 34px;
  border-radius: 10px;
}

.status-text {
  border: 1px solid rgba(255, 188, 207, 0.88);
  border-radius: 14px;
  background: rgba(34, 15, 38, 0.86);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.world-record-notice {
  border-radius: 18px;
  border: 2px solid #ffd287;
  background: rgba(44, 30, 8, 0.9);
}

/* Mobile-first layout */
@media (max-width: 860px) {
  .splash-wrap,
  .title-wrap,
  .panel-wrap,
  .menu-wrap {
    width: 100%;
    max-height: 100%;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .mode-grid-main,
  .mode-grid-sub,
  .gacha-stats,
  .gacha-action-row {
    grid-template-columns: 1fr;
  }

  .stage-select-grid,
  .protocol-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen.active,
  .splash-line,
  .world-record-notice.show,
  .menu-hero-glow {
    animation: none !important;
  }
}

/* ===== Renewal 2026-04 structural skin ===== */
.title-ops-banner {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.title-ops-badge {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(170, 229, 255, 0.7);
  background: rgba(52, 100, 165, 0.6);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}

.title-ops-text {
  font-size: 11px;
  color: #d7ebff;
  letter-spacing: .04em;
}

.menu-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.menu-chip {
  border: 1px solid rgba(167, 223, 255, 0.55);
  background: rgba(38, 68, 121, 0.7);
  color: #d9edff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
}

.menu-home-status-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.menu-btn[data-icon] {
  position: relative;
  padding-left: 44px;
}

.menu-btn[data-icon]::before {
  content: attr(data-icon);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid rgba(194, 230, 255, 0.52);
  background: rgba(87, 144, 217, 0.26);
  font-size: 13px;
  line-height: 1;
}

.menu-dock-btn[data-icon] {
  padding-left: 10px;
}

.menu-dock-btn[data-icon]::before {
  position: static;
  transform: none;
  margin: 0 auto 2px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  font-size: 11px;
}

.menu-dock-btn strong {
  display: block;
}

.menu-dock-btn strong::before {
  content: none !important;
}

@media (max-width: 860px) {
  .menu-btn[data-icon] {
    padding-left: 40px;
  }

  .menu-btn[data-icon]::before {
    left: 10px;
  }
}

/* ===== Renewal 2026-04 Phase2: Feature Screen Unification ===== */

/* shared panel layout */
.panel-wrap {
  display: grid;
  gap: 12px;
}

.panel-head {
  border: 1px solid rgba(165, 220, 255, 0.28);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(23, 38, 71, 0.66);
}

.panel-head h2 {
  font-size: clamp(18px, 2.8vw, 24px);
  margin: 0;
}

.panel-note {
  line-height: 1.6;
}

.panel-back-btn {
  margin-top: 4px;
}

/* section subtitles */
.panel-wrap h3 {
  margin: 4px 0 2px;
  font-size: 15px;
  color: #e5f2ff;
}

/* cards and list rhythm */
.shop-grid,
.protocol-grid,
.record-list,
.world-list,
.lobby-reward-list,
.stage-select-grid,
#events-list {
  gap: 10px;
}

.shop-item,
.record-card,
.weapon-card,
.stage-item,
.world-entry {
  padding: 11px;
}

.shop-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.shop-item-illust {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px solid rgba(169, 220, 255, 0.5);
  background: rgba(10, 21, 45, 0.9);
  object-fit: contain;
  flex: 0 0 auto;
  padding: 4px;
}

.shop-item-head .shop-item-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.stage-clear-wrap {
  gap: 10px;
}

#stage-clear-stars {
  font-size: 20px;
  letter-spacing: 2px;
}

.stage-brief-debuff {
  color: #ff5f72;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(255, 73, 112, 0.3);
}

.shop-item-name {
  font-size: 15px;
  font-weight: 700;
}

.shop-buy-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.shop-buy-row .shop-btn:only-child {
  grid-column: 1 / -1;
}

.shop-color-swatch {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px solid rgba(169, 220, 255, 0.58);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 10px rgba(109, 189, 255, 0.28);
  background:
    linear-gradient(140deg, rgba(255,255,255,0.32), rgba(255,255,255,0.06) 40%, rgba(0,0,0,0.16)),
    var(--ship-color, #7ae7ff);
  flex: 0 0 auto;
}

.shop-btn {
  min-height: 40px;
  font-size: 13px;
}

/* gacha */
.gacha-event-wrap {
  gap: 12px;
}

.gacha-event-head {
  border: 1px solid rgba(165, 220, 255, 0.28);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(24, 39, 74, 0.72);
}

.gacha-banner-btn {
  min-height: 42px;
  font-size: 12px;
}

.gacha-main-visual {
  min-height: 176px;
}

.gacha-feature-card {
  padding: 12px;
}

#gacha-feature-name {
  font-size: clamp(20px, 3.2vw, 28px);
}

#gacha-feature-desc {
  font-size: 13px;
}

.gacha-progress-head {
  font-size: 11px;
}

.gacha-progress-bar {
  height: 10px;
}

.gacha-stat {
  font-size: 12px;
  min-height: 44px;
  display: grid;
  align-items: center;
}

.gacha-result {
  min-height: 62px;
  font-size: 12px;
}

/* hangar/custom */
.protocol-detail {
  display: grid;
  gap: 8px;
}

.protocol-detail .primary-btn {
  min-height: 42px;
}

.weapon-card-name {
  font-size: 13px;
}

.weapon-card-meta {
  font-size: 11px;
}

/* options */
.option-row {
  padding: 10px;
  display: grid;
  gap: 6px;
}

.option-row label {
  font-weight: 700;
  color: #deedff;
}

.option-row input[type="range"],
.option-row select {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(169, 220, 255, 0.4);
  background: rgba(20, 34, 65, 0.86);
  color: #f3f8ff;
}

/* world / lobby */
.world-tabs {
  gap: 8px;
}

.mode-lobby-wrap {
  gap: 12px;
}

.mode-lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-lobby-rewards,
.mode-lobby-ranking {
  padding: 10px;
}

.mode-lobby-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lobby-reward-list {
  margin: 0;
  padding-left: 18px;
}

/* stage detail */
.stage-brief-wrap {
  gap: 10px;
}

.stage-brief-boss-card,
.stage-brief-reward-card {
  padding: 10px;
}

#stage-brief-boss-canvas {
  width: min(100%, 320px);
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(174, 223, 255, 0.5);
  background: rgba(13, 24, 48, 0.82);
}

/* responsive */
@media (max-width: 860px) {
  .mode-lobby-grid,
  .mode-lobby-actions,
  .shop-buy-row {
    grid-template-columns: 1fr;
  }

  .gacha-banner-select,
  .gacha-stats,
  .gacha-action-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Renewal 2026-04 Phase3: Title/Home Premium Flow ===== */
.title-news-ticker {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(171, 223, 255, 0.5);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(22, 39, 73, 0.72);
}

.title-news-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 216, 143, 0.72);
  color: #ffe3b1;
  background: rgba(121, 82, 22, 0.5);
}

.title-news-text {
  font-size: 12px;
  color: #d9eaff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-quick-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.menu-quick-btn {
  min-height: 68px;
  padding: 10px 10px 10px 42px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(107, 177, 255, 0.24), rgba(33, 63, 112, 0.92));
}

.menu-quick-btn strong {
  font-size: 13px;
}

.menu-quick-btn span {
  font-size: 10px;
}

@media (max-width: 860px) {
  .title-news-ticker {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .menu-quick-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Renewal 2026-04 Final: Readability + CTA Priority ===== */

/* CTA hierarchy */
#tap-start-btn,
#stage-brief-start-btn,
#gacha-roll10-btn,
#lobby-challenge-btn {
  border-color: rgba(255, 219, 150, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 204, 118, 0.38), rgba(182, 118, 35, 0.26) 26%, rgba(78, 47, 18, 0.95) 100%);
  color: #fff2d3;
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 221, 0.32),
    0 10px 20px rgba(31, 16, 6, 0.45),
    0 0 0 1px rgba(255, 225, 167, 0.25);
}

#tap-start-btn:hover,
#stage-brief-start-btn:hover,
#gacha-roll10-btn:hover,
#lobby-challenge-btn:hover {
  filter: brightness(1.09);
}

#stage-brief-start-btn,
#gacha-roll10-btn,
#lobby-challenge-btn {
  min-height: 50px;
  font-size: 15px;
  font-weight: 800;
}

/* medium CTA */
#gacha-roll-btn,
#world-refresh-btn,
#lobby-refresh-btn,
#weapon-detail-action,
#weapon-limit-break-action,
#skill-tree-unlock-btn {
  min-height: 44px;
  font-weight: 700;
}

/* text rhythm */
.menu-btn strong,
.weapon-card-name,
.shop-item-name,
.record-card h4,
.world-name,
#gacha-feature-name {
  letter-spacing: 0.01em;
}

.panel-note,
.record-line,
.shop-item-meta,
.weapon-card-meta,
#daily-play,
#daily-boss,
#daily-endless,
#daily-reward {
  line-height: 1.62;
}

/* list readability */
.record-card,
.shop-item,
.stage-item,
.weapon-card,
.world-entry {
  overflow: hidden;
}

.menu-btn span,
.weapon-card-meta,
.shop-item-meta,
.gacha-progress-note,
.gacha-event-sub,
.gacha-event-period,
.record-line {
  word-break: break-word;
}

/* spacing tune */
.panel-wrap > * + * {
  margin-top: 0;
}

/* small phones */
@media (max-width: 480px) {
  html, body {
    font-size: 14px;
  }

  .panel-wrap,
  .menu-wrap,
  .title-wrap,
  .splash-wrap {
    padding: 14px 12px;
  }

  .panel-head h2,
  .menu-title,
  .logo {
    font-size: clamp(19px, 6.2vw, 24px);
  }

  .menu-subtitle,
  .subtitle {
    font-size: 11px;
  }

  .menu-btn {
    min-height: 72px;
  }

  .menu-btn strong {
    font-size: 14px;
  }

  .menu-btn span {
    font-size: 11px;
  }

  .menu-home-resource-value,
  .menu-home-rank-value {
    font-size: 18px;
  }

  .item-panel {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    gap: 4px;
  }

  .item-btn {
    min-height: 30px;
    font-size: 10px;
    padding: 4px;
  }

  #stage-brief-start-btn,
  #gacha-roll10-btn,
  #lobby-challenge-btn {
    min-height: 46px;
    font-size: 14px;
  }
}

/* tablet */
@media (min-width: 900px) {
  .menu-wrap,
  .panel-wrap {
    width: min(92vw, 980px);
    padding: 20px;
  }

  .menu-btn {
    min-height: 92px;
  }

  .menu-btn strong {
    font-size: 16px;
  }

  .menu-btn span {
    font-size: 12px;
  }

  .stage-select-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .protocol-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .world-entry {
    grid-template-columns: 64px 1fr auto;
  }
}

/* ===== Final Polish Plus: Native-app feel ===== */

/* app chrome feel */
.menu-wrap,
.panel-wrap {
  position: relative;
}

.menu-wrap::before,
.panel-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 16%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.16), transparent 30%);
  mix-blend-mode: screen;
}

/* stronger hierarchy */
.menu-home-topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  backdrop-filter: blur(8px);
}

.menu-home-resource,
.menu-home-rank {
  border-radius: 10px;
  padding: 6px 8px;
  background: rgba(31, 51, 89, 0.42);
}

.menu-home-resource-value,
.menu-home-rank-value {
  text-shadow: 0 0 14px rgba(141, 217, 255, 0.32);
}

.menu-home-dock {
  box-shadow:
    0 -10px 22px rgba(3, 10, 26, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.menu-dock-btn {
  border-width: 1px;
  background:
    linear-gradient(180deg, rgba(132, 196, 255, 0.22), rgba(47, 89, 152, 0.18) 22%, rgba(25, 52, 96, 0.96) 100%);
}

.menu-dock-btn strong {
  font-size: 11px;
}

.menu-dock-btn span {
  opacity: 0.92;
}

/* section and cards */
.menu-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-section-title::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--renew-accent), transparent);
}

.shop-item,
.record-card,
.weapon-card,
.stage-item,
.world-entry,
.gacha-progress-card,
.gacha-stat,
.gacha-result,
.stage-brief-boss-card,
.stage-brief-reward-card,
.option-row {
  backdrop-filter: blur(2px);
}

.record-card h4,
.weapon-card-name,
.shop-item-name,
.stage-item strong,
.world-name {
  font-weight: 800;
}

/* gacha impact without heavy runtime */
.gacha-main-visual {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 24px rgba(6, 15, 39, 0.35);
}

.gacha-feature-card {
  background: linear-gradient(180deg, rgba(15, 29, 61, 0.82), rgba(14, 25, 49, 0.92));
}

.gacha-roll-btn.one {
  border-color: rgba(144, 214, 255, 0.82);
}

.gacha-roll-btn.ten {
  border-color: rgba(255, 216, 146, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 242, 215, 0.3),
    0 10px 20px rgba(46, 28, 8, 0.4);
}

/* in-game overlays */
.hud,
.boss-hud,
.abyss-hud {
  box-shadow:
    0 10px 20px rgba(4, 10, 27, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.status-text {
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* comfortable touch targets */
.primary-btn,
.menu-btn,
.shop-btn,
.gacha-roll-btn,
.gacha-banner-btn,
.sub-link-btn,
.item-btn,
.floating-btn {
  min-height: 40px;
}

/* safe area */
#menu-screen,
.panel-screen,
#title-screen {
  padding-top: max(8px, env(safe-area-inset-top));
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

@media (max-width: 480px) {
  .menu-home-topbar {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .menu-home-resource-value,
  .menu-home-rank-value {
    font-size: 17px;
  }

  .menu-quick-btn,
  .menu-btn,
  .menu-dock-btn {
    min-height: 64px;
  }
}

/* ===== Hotfix: clipping + duplicate quick buttons + menu scroll ===== */

/* 1) robust menu scroll */
#menu-screen.screen.active {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

#menu-screen .menu-wrap {
  max-height: none !important;
  overflow: visible !important;
  margin-bottom: max(12px, env(safe-area-inset-bottom));
}

/* 2) avoid text clipping */
.menu-btn,
.weapon-card,
.stage-item,
.record-card,
.shop-item,
.gacha-banner-btn,
.gacha-roll-btn,
.primary-btn {
  white-space: normal;
}

.menu-btn strong,
.menu-btn span,
.weapon-card-name,
.weapon-card-meta,
.shop-item-name,
.shop-item-meta,
.record-line,
.world-name,
.world-score,
.gacha-event-title,
#gacha-feature-name,
#stage-brief-boss-name,
#stage-brief-reward,
#daily-play,
#daily-boss,
#daily-endless,
#daily-reward {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
}

.title-news-text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* 3) remove dead spacing from removed quick row */
.menu-quick-row {
  display: none !important;
}

/* ===== Hotfix 2026-04-06: ranking wrap + pickup preview clip ===== */
.world-entry {
  grid-template-columns: 56px minmax(0, 1fr) auto !important;
  column-gap: 8px;
}

.world-entry-with-icon {
  grid-template-columns: 56px 52px minmax(0, 1fr) auto !important;
}

.world-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.world-score {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  font-size: 13px;
}

#gacha-ship-preview {
  overflow: visible;
}

#gacha-ship-preview-canvas {
  display: block;
  margin: 6px auto 0;
  max-width: 100%;
  height: auto;
}

.gacha-feature-card {
  overflow: visible;
}

/* ===== Hotfix 2026-04-06 v2: ship preview clip + dock height ===== */

/* pickup ship preview: remove legacy fixed height clip */
#gacha-ship-preview {
  height: auto !important;
  min-height: 112px;
  display: grid;
  place-items: center;
  overflow: visible !important;
}

#gacha-ship-preview-canvas {
  width: 140px !important;
  height: 100px !important;
  max-width: 100%;
  object-fit: contain;
}

.gacha-feature-card {
  min-height: 178px;
  overflow: visible !important;
}

/* pickup ship card layout stabilization */
#gacha-screen .gacha-feature-card {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  row-gap: 8px;
  padding-bottom: 12px;
}

#gacha-feature-desc {
  min-height: 36px;
  line-height: 1.45;
}

/* bottom dock buttons: prevent tall cards on mobile */
.menu-home-dock .menu-dock-btn {
  min-height: 52px !important;
  padding: 6px 6px !important;
  display: grid;
  align-content: center;
  row-gap: 2px;
}

.menu-home-dock .menu-dock-btn strong {
  font-size: 10px !important;
  line-height: 1.1;
}

.menu-home-dock .menu-dock-btn span {
  font-size: 9px !important;
  line-height: 1.1;
}

@media (max-width: 480px) {
  .menu-home-dock .menu-dock-btn {
    min-height: 48px !important;
  }
}

/* ===== Hotfix 2026-04-06 v3: menu button vanish when scrolled offscreen ===== */
#menu-screen .mode-grid-main .menu-btn,
#menu-screen .mode-grid-sub .menu-btn,
#menu-screen .menu-list .menu-btn,
#menu-screen .menu-home-dock .menu-btn {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* final clip guard for pickup ship preview */
#gacha-screen #gacha-ship-preview {
  margin-top: 2px !important;
  min-height: 120px !important;
  padding-bottom: 4px;
  overflow: visible !important;
  align-self: end;
}

#gacha-screen #gacha-ship-preview-canvas {
  width: 156px !important;
  height: 112px !important;
  max-width: min(100%, 156px) !important;
  border-width: 2px;
  display: block;
}

/* pickup ship preview: hard no-clip layout */
#gacha-screen .gacha-main-visual {
  min-height: 244px !important;
  overflow: visible !important;
}

#gacha-screen .gacha-feature-card {
  min-height: 220px !important;
  grid-template-rows: auto auto auto minmax(120px, auto) !important;
  align-content: start !important;
}

#gacha-screen #gacha-feature-name {
  font-size: clamp(17px, 4.6vw, 22px) !important;
  line-height: 1.25;
  word-break: keep-all;
}

#gacha-screen #gacha-feature-desc {
  min-height: 44px !important;
  line-height: 1.35;
}

/* gacha tab click-through fix */
#gacha-screen .gacha-banner-select,
#gacha-screen .gacha-banner-btn {
  position: relative;
  z-index: 20;
  pointer-events: auto;
}

#gacha-screen .gacha-main-visual::before,
#gacha-screen .gacha-glow,
#gacha-screen .gacha-feature-card {
  pointer-events: none !important;
}

/* ===== Gacha Cinematic Rebuild 2026-04 ===== */
#gacha-open-screen .gacha-cinematic-wrap {
  position: absolute;
  inset: 0;
}

#gacha-open-screen .gacha-cinematic-wrap::before,
#gacha-open-screen .gacha-cinematic-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.84), rgba(0,0,0,0.35));
  z-index: 6;
  pointer-events: none;
  transition: height .22s ease;
}

#gacha-open-screen .gacha-cinematic-wrap::before { top: 0; }
#gacha-open-screen .gacha-cinematic-wrap::after { bottom: 0; transform: rotate(180deg); }

#gacha-open-screen.phase-intro .gacha-cinematic-wrap::before,
#gacha-open-screen.phase-intro .gacha-cinematic-wrap::after,
#gacha-open-screen.phase-overload .gacha-cinematic-wrap::before,
#gacha-open-screen.phase-overload .gacha-cinematic-wrap::after,
#gacha-open-screen.phase-lockbreak .gacha-cinematic-wrap::before,
#gacha-open-screen.phase-lockbreak .gacha-cinematic-wrap::after,
#gacha-open-screen.phase-shatter .gacha-cinematic-wrap::before,
#gacha-open-screen.phase-shatter .gacha-cinematic-wrap::after {
  height: clamp(14px, 3.2vh, 28px);
}

#gacha-open-screen.phase-intro .gacha-cinematic-grid {
  opacity: 0.45;
  filter: brightness(1.15);
}

#gacha-open-screen.phase-overload .gacha-cinematic-ring.ring-a,
#gacha-open-screen.phase-overload .gacha-cinematic-ring.ring-b {
  filter: brightness(1.3) saturate(1.25);
}

#gacha-open-screen.phase-overload .gacha-open-phase {
  animation: gachaOverloadPulse .24s steps(2, end) infinite;
}

#gacha-open-screen.phase-shatter .gacha-cinematic-machine {
  animation: gachaShatterShake .1s steps(2, end) infinite;
}

#gacha-open-screen.phase-shatter::after {
  opacity: 1;
  animation: gachaShatterFlash .24s ease-out both;
}

#gacha-open-screen.phase-result .gacha-cinematic-alert {
  border-color: rgba(159, 232, 255, 0.9);
  color: #d8f4ff;
}

#gacha-open-screen .gacha-open-summary {
  border-width: 2px;
}

#gacha-open-screen .gacha-open-result-grid {
  perspective: 900px;
}

#gacha-open-screen .gacha-result-card.reveal-ready {
  transform: rotateX(14deg) translateY(8px) scale(0.98);
}

#gacha-open-screen .gacha-result-card.reveal-ready.show {
  animation: gachaResultRevealPro .34s cubic-bezier(.16,.85,.26,1) both;
}

@keyframes gachaOverloadPulse {
  0%, 100% { opacity: 0.7; text-shadow: 0 0 8px rgba(255, 226, 160, 0.45); }
  50% { opacity: 1; text-shadow: 0 0 20px rgba(255, 236, 188, 0.95), 0 0 28px rgba(132, 236, 255, 0.35); }
}

@keyframes gachaShatterShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

@keyframes gachaShatterFlash {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes gachaResultRevealPro {
  0% { opacity: 0; transform: rotateX(14deg) translateY(8px) scale(0.98); }
  100% { opacity: 1; transform: rotateX(0deg) translateY(0) scale(1); }
}

/* locked mode visibility (make clearly darker than unlocked) */
#menu-screen .menu-btn.locked-item {
  opacity: 0.38 !important;
  filter: saturate(0.22) brightness(0.58) contrast(0.9) !important;
  border-color: rgba(120, 144, 176, 0.45) !important;
  box-shadow: inset 0 0 0 1px rgba(68, 88, 120, 0.45) !important;
}

#menu-screen .menu-btn.locked-item strong,
#menu-screen .menu-btn.locked-item span {
  color: rgba(188, 204, 228, 0.72) !important;
}

/* scroll text vanish fix (mobile/webview compositor guard) */
#menu-screen .menu-btn,
#menu-screen .menu-dock-btn,
#gacha-screen .gacha-banner-btn,
#gacha-screen .gacha-roll-btn,
#gacha-screen .sub-link-btn {
  contain: none !important;
  isolation: isolate;
  overflow: visible !important;
}

#menu-screen .menu-btn strong,
#menu-screen .menu-btn span,
#menu-screen .menu-dock-btn strong,
#menu-screen .menu-dock-btn span {
  position: relative;
  z-index: 1;
  opacity: 1 !important;
  visibility: visible !important;
  -webkit-text-fill-color: currentColor;
  mix-blend-mode: normal !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

#menu-screen .menu-btn strong,
#menu-screen .menu-btn span {
  display: block !important;
}

#menu-screen .menu-home-dock {
  position: static !important;
  bottom: auto !important;
  backdrop-filter: none !important;
  z-index: 30;
  pointer-events: auto;
}

#menu-screen .menu-home-dock .menu-dock-btn {
  position: relative;
  z-index: 31;
  pointer-events: auto;
}

/* stability mode: lock dock layout and disable decorative layers that can cause hitbox/text glitches */
#menu-screen .menu-home-dock {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

#menu-screen .menu-home-dock .menu-dock-btn {
  flex: initial !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 52px !important;
  max-height: none !important;
  transform: none !important;
  filter: none !important;
  animation: none !important;
}

#menu-screen .menu-btn::before,
#menu-screen .menu-btn::after,
#menu-screen .menu-dock-btn::before,
#menu-screen .menu-dock-btn::after,
#menu-screen .menu-btn strong::before,
#menu-screen .menu-dock-btn strong::before {
  animation: none !important;
}

#menu-screen .menu-wrap::before,
#menu-screen .menu-wrap::after,
#menu-screen .menu-home-dock::before,
#menu-screen .menu-home-dock::after {
  display: none !important;
}

#menu-screen .menu-btn,
#menu-screen .menu-dock-btn,
#menu-screen .menu-btn strong,
#menu-screen .menu-btn span,
#menu-screen .menu-dock-btn strong,
#menu-screen .menu-dock-btn span {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  mix-blend-mode: normal !important;
  text-rendering: optimizeLegibility;
}

#gacha-screen .gacha-banner-btn,
#gacha-screen .gacha-roll-btn,
#gacha-screen .sub-link-btn {
  opacity: 1 !important;
  visibility: visible !important;
  -webkit-text-fill-color: currentColor;
  mix-blend-mode: normal !important;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

/* ultimate fallback for mobile text vanish */
#app::before {
  display: none !important;
}

#menu-screen .menu-btn,
#menu-screen .menu-dock-btn {
  filter: none !important;
}

#menu-screen .menu-btn strong,
#menu-screen .menu-btn span,
#menu-screen .menu-dock-btn strong,
#menu-screen .menu-dock-btn span {
  text-shadow: none !important;
  transform: none !important;
  -webkit-transform: none !important;
}

/* gacha cinematic: remove top rounded tier badge */
#gacha-open-screen .gacha-cinematic-tier {
  display: none !important;
}

#tutorial-intro-screen .tutorial-intro-card {
  cursor: pointer;
}

#tutorial-intro-screen .tutorial-intro-text {
  white-space: pre-line;
  min-height: 150px;
  font-size: 16px;
  line-height: 1.75;
}

#tutorial-intro-screen .tutorial-intro-hint {
  opacity: 0.95;
  margin-top: 4px;
}

.tutorial-guide-overlay {
  position: absolute;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 9, 24, 0.78);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.tutorial-guide-overlay.show {
  opacity: 1;
}

.tutorial-guide-card {
  position: relative;
  width: min(94vw, 620px);
  border-radius: 14px;
  border: 1px solid rgba(132, 214, 255, 0.56);
  background: linear-gradient(180deg, rgba(11, 34, 70, 0.98), rgba(8, 24, 48, 0.98));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(170, 231, 255, 0.14);
  padding: 16px;
  transform: translateY(12px) scale(0.96);
  opacity: 0;
}

.tutorial-guide-overlay.show .tutorial-guide-card {
  transform: translateY(0) scale(1);
  opacity: 1;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.tutorial-guide-overlay.opening .tutorial-guide-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 0%, rgba(162, 230, 255, 0.28) 42%, transparent 100%);
  transform: translateX(-120%);
  animation: tutorialGuideSweep .42s ease-out;
  pointer-events: none;
}

#tutorial-guide-title {
  margin: 0 0 8px;
  font-size: 18px;
}

.tutorial-guide-body {
  white-space: pre-line;
  line-height: 1.7;
  margin: 0 0 14px;
}

@keyframes tutorialGuideSweep {
  0% { transform: translateX(-120%); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}

/* ===== Text Safe Mode (WebView repaint stability) ===== */
html.text-safe-mode #menu-screen .menu-btn,
html.text-safe-mode #menu-screen .menu-dock-btn,
html.text-safe-mode #gacha-screen .gacha-banner-btn,
html.text-safe-mode #gacha-screen .gacha-roll-btn,
html.text-safe-mode #gacha-screen .sub-link-btn {
  transform: none !important;
  -webkit-transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  contain: layout paint !important;
}

html.text-safe-mode #menu-screen .menu-btn strong,
html.text-safe-mode #menu-screen .menu-btn span,
html.text-safe-mode #menu-screen .menu-dock-btn strong,
html.text-safe-mode #menu-screen .menu-dock-btn span,
html.text-safe-mode #gacha-screen .gacha-banner-btn strong,
html.text-safe-mode #gacha-screen .gacha-banner-btn span,
html.text-safe-mode #gacha-screen .gacha-roll-btn strong,
html.text-safe-mode #gacha-screen .gacha-roll-btn span,
html.text-safe-mode #gacha-screen .sub-link-btn strong,
html.text-safe-mode #gacha-screen .sub-link-btn span {
  color: #e3f2ff !important;
  -webkit-text-fill-color: #e3f2ff !important;
  opacity: 1 !important;
  visibility: visible !important;
  mix-blend-mode: normal !important;
  text-shadow: none !important;
  transform: none !important;
  -webkit-transform: none !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html.text-safe-mode #menu-screen .menu-btn.locked-item strong,
html.text-safe-mode #menu-screen .menu-btn.locked-item span {
  color: rgba(188, 204, 228, 0.72) !important;
  -webkit-text-fill-color: rgba(188, 204, 228, 0.72) !important;
}

@media (pointer: coarse) {
  html.text-safe-mode #menu-screen .menu-wrap,
  html.text-safe-mode #gacha-screen .subpanel-wrap,
  html.text-safe-mode #gacha-screen .gacha-feature-card,
  html.text-safe-mode #gacha-screen .gacha-main-visual {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
  }
}

.abyss-upgrade-toggle-btn {
  position: absolute;
  left: max(0px, env(safe-area-inset-left));
  top: calc(188px + env(safe-area-inset-top));
  z-index: 16;
  min-width: 58px;
  min-height: 30px;
  border: 1px solid rgba(255, 185, 126, 0.74);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(38, 14, 26, 0.95), rgba(20, 8, 15, 0.95));
  color: #ffd8ae;
  font-size: 10px;
  padding: 4px 8px;
}

.abyss-upgrade-tracker {
  position: absolute;
  left: max(0px, env(safe-area-inset-left));
  top: calc(188px + env(safe-area-inset-top));
  z-index: 15;
  width: min(50vw, 250px);
  border: 1px solid rgba(255, 180, 116, 0.55);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(22, 8, 24, 0.92), rgba(10, 4, 13, 0.92));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.36);
  padding: 8px 10px;
}

.abyss-upgrade-tracker-title {
  margin: 0 0 6px;
  font-size: 10px;
  color: #ffd8a0;
  letter-spacing: 0.08em;
}

.abyss-upgrade-tracker-list {
  display: grid;
  gap: 4px;
}

.abyss-upgrade-tracker-item {
  display: grid;
  justify-items: end;
  gap: 8px;
  font-size: 11px;
  color: #e5f4ff;
  text-align: right;
}

.abyss-upgrade-tracker-item .name,
.abyss-upgrade-tracker-item .level {
  display: block;
  width: 100%;
  text-align: right;
}

.abyss-upgrade-tracker-item b {
  color: #ffe39f;
  font-weight: 700;
}

.abyss-upgrade-overlay {
  position: absolute;
  inset: 0;
  z-index: 170;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(6, 3, 10, 0.82);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.abyss-upgrade-overlay.show {
  opacity: 1;
}

.abyss-upgrade-card {
  width: min(96vw, 680px);
  border-radius: 14px;
  border: 1px solid rgba(255, 154, 105, 0.7);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 125, 125, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(42, 13, 30, 0.95), rgba(14, 5, 16, 0.95));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 206, 149, 0.16);
  padding: 14px;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.abyss-upgrade-overlay.show .abyss-upgrade-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.abyss-upgrade-floor {
  margin: 0;
  font-size: 10px;
  color: #ffd1a1;
  letter-spacing: 0.08em;
  text-align: right;
}

.abyss-upgrade-card h3 {
  margin: 6px 0 4px;
  font-size: 19px;
  color: #fff1dc;
  text-align: right;
}

.abyss-upgrade-sub {
  margin: 0 0 10px;
  font-size: 12px;
  color: #ffd7c3;
  text-align: right;
}

.abyss-upgrade-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.abyss-upgrade-reroll-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 10px;
}

.abyss-upgrade-reroll-btn {
  border: 1px solid rgba(255, 201, 141, 0.74);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(95, 46, 27, 0.95), rgba(58, 24, 14, 0.95));
  color: #ffe7c2;
  font-size: 11px;
  padding: 7px 10px;
}

.abyss-upgrade-reroll-btn:disabled {
  opacity: 0.45;
}

.abyss-upgrade-reroll-left {
  font-size: 11px;
  color: #ffd4a3;
}

.abyss-upgrade-option {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 164, 137, 0.65);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(50, 18, 32, 0.95), rgba(28, 10, 23, 0.95));
  padding: 10px;
  text-align: right;
  align-items: end;
  color: #f0f7ff;
  cursor: pointer;
  min-height: 148px;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.22s ease, opacity 0.22s ease;
  transition-delay: var(--abyss-delay, 0s);
}

.abyss-upgrade-overlay.show .abyss-upgrade-option {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.abyss-upgrade-option:active {
  transform: translateY(1px);
}

.abyss-upgrade-option h4 {
  margin: 0 0 5px;
  font-size: 13px;
  color: #fff0be;
  text-align: right;
  width: 100%;
}

.abyss-upgrade-option h4 .name,
.abyss-upgrade-option h4 .star {
  display: block;
  width: 100%;
  text-align: right;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.abyss-upgrade-option .rarity {
  margin: 0 0 5px;
  font-size: 10px;
  color: #ffd08f;
  text-align: right;
  width: 100%;
}

.abyss-upgrade-option .desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #d7e7ff;
  text-align: right;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.abyss-upgrade-option .detail {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: #ffdba7;
  text-align: right;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 540px) {
  .abyss-upgrade-options {
    grid-template-columns: 1fr;
  }

  .abyss-upgrade-option {
    min-height: 0;
  }

  .abyss-upgrade-toggle-btn {
    left: max(0px, env(safe-area-inset-left));
    top: calc(188px + env(safe-area-inset-top));
  }

  .abyss-upgrade-tracker {
    left: max(0px, env(safe-area-inset-left));
    top: calc(188px + env(safe-area-inset-top));
    width: min(58vw, 236px);
  }
}

.profile-title-btn {
  text-align: left;
}

.profile-title-btn.star-1,
#profile-current-title.star-1 {
  border-color: rgba(145, 214, 255, 0.72);
}

.profile-title-btn.star-2,
#profile-current-title.star-2 {
  border-color: rgba(195, 151, 255, 0.82);
  box-shadow: 0 0 12px rgba(162, 101, 255, 0.22);
}

.profile-title-btn.star-3,
#profile-current-title.star-3 {
  border-color: rgba(255, 223, 142, 0.96);
  box-shadow: 0 0 14px rgba(255, 222, 132, 0.35), 0 0 24px rgba(106, 214, 255, 0.22);
}

.world-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.world-title-badge {
  display: inline-block;
  max-width: 100%;
  font-size: 10px;
  line-height: 1.25;
  color: #b8d7f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.world-title-badge.star-1 {
  color: #9fd8ff;
}

.world-title-badge.star-2 {
  color: #d7b9ff;
}

.world-title-badge.star-3 {
  color: #ffe2a0;
  text-shadow: 0 0 8px rgba(255, 226, 160, 0.26);
}

/* Ranking row anti-clipping fix */
#world-list .world-entry,
#league-ranking-list .world-entry,
#lobby-ranking-list .world-entry {
  grid-template-columns: 56px minmax(0, 1fr) max-content !important;
  align-items: center;
  column-gap: 8px;
  min-height: 50px;
  overflow: visible !important;
}

#world-list .world-entry.world-entry-with-icon,
#league-ranking-list .world-entry.world-entry-with-icon,
#lobby-ranking-list .world-entry.world-entry-with-icon {
  grid-template-columns: 56px 52px minmax(0, 1fr) max-content !important;
}

#world-list .world-main,
#league-ranking-list .world-main,
#lobby-ranking-list .world-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#world-list .world-score,
#league-ranking-list .world-score,
#lobby-ranking-list .world-score {
  justify-self: end;
  min-width: max-content;
  white-space: nowrap !important;
  padding-left: 8px;
}

/* Stage button star progress */
.stage-btn-with-stars {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
}

.stage-btn-title {
  font-size: 12px;
  line-height: 1.3;
}

.stage-btn-stars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 9px;
  line-height: 1.3;
  color: #bcdfff;
  letter-spacing: 0.02em;
}

.stage-achievement-flags {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  min-height: 13px;
}

.stage-achievement-flag {
  position: relative;
  display: inline-block;
  width: 9px;
  height: 13px;
  filter: drop-shadow(0 0 3px currentColor);
}

.stage-achievement-flag::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2px;
  height: 13px;
  background: currentColor;
}

.stage-achievement-flag::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 1px;
  width: 8px;
  height: 7px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 22%, 0 60%);
}

.stage-achievement-flag--green { color: #63f3a5; }
.stage-achievement-flag--red { color: #ff687c; }

/* League trophy (8-bit style) */
.league-trophy-card {
  --trophy-main: #c88a46;
  --trophy-accent: #ffe3a4;
  --trophy-glow: rgba(214, 146, 74, 0.32);
  --trophy-edge: rgba(255, 255, 255, 0.22);
  --trophy-plate: rgba(8, 18, 42, 0.72);
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 92px;
  border-width: 2px;
  position: relative;
  overflow: hidden;
}

.league-trophy-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 4px),
    linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.07) 44%, transparent 78%);
}
.league-trophy-card::after {
  content: "";
  position: absolute;
  inset: 2px;
  pointer-events: none;
  border-radius: 12px;
  border: 1px solid var(--trophy-edge);
  opacity: 0.5;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,0.12), transparent 38%),
    linear-gradient(100deg, transparent 15%, rgba(255,255,255,0.09) 48%, transparent 74%);
}

.league-trophy-emblem {
  width: 62px;
  height: 62px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow:
    inset 0 0 10px rgba(255,255,255,0.1),
    inset 0 -8px 10px rgba(0,0,0,0.24),
    0 0 14px var(--trophy-glow);
  background:
    linear-gradient(160deg, rgba(255,255,255,0.14), transparent 45%),
    var(--trophy-plate);
  position: relative;
}
.league-trophy-emblem::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  opacity: 0.6;
}

.pixel-trophy-sprite {
  width: 44px;
  height: 44px;
  image-rendering: pixelated;
  position: relative;
  background:
    linear-gradient(var(--trophy-main) 0 0) 14px 4px / 16px 4px no-repeat,
    linear-gradient(var(--trophy-main) 0 0) 10px 8px / 24px 4px no-repeat,
    linear-gradient(var(--trophy-main) 0 0) 12px 12px / 20px 8px no-repeat,
    linear-gradient(var(--trophy-main) 0 0) 6px 12px / 4px 8px no-repeat,
    linear-gradient(var(--trophy-main) 0 0) 34px 12px / 4px 8px no-repeat,
    linear-gradient(var(--trophy-main) 0 0) 16px 20px / 12px 8px no-repeat,
    linear-gradient(var(--trophy-main) 0 0) 18px 28px / 8px 6px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 8px 34px / 28px 4px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 6px 38px / 32px 4px no-repeat;
  filter: drop-shadow(0 0 8px var(--trophy-glow));
  animation: trophyIdleFloat 2.8s ease-in-out infinite;
}

.pixel-trophy-sprite::before,
.pixel-trophy-sprite::after {
  content: "";
  position: absolute;
  inset: 0;
}

.pixel-trophy-sprite.variant-forge::before {
  background: linear-gradient(var(--trophy-accent) 0 0) 20px 16px / 4px 4px no-repeat;
}
.pixel-trophy-sprite.variant-guard::before {
  background:
    linear-gradient(var(--trophy-accent) 0 0) 2px 18px / 4px 8px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 38px 18px / 4px 8px no-repeat;
}
.pixel-trophy-sprite.variant-core::before {
  background:
    linear-gradient(var(--trophy-accent) 0 0) 20px 14px / 4px 4px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 18px 18px / 8px 4px no-repeat;
}
.pixel-trophy-sprite.variant-wing::before {
  background:
    linear-gradient(var(--trophy-accent) 0 0) 0 16px / 6px 4px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 38px 16px / 6px 4px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 2px 22px / 4px 4px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 38px 22px / 4px 4px no-repeat;
}
.pixel-trophy-sprite.variant-circuit::before {
  background:
    linear-gradient(var(--trophy-accent) 0 0) 10px 2px / 4px 4px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 30px 2px / 4px 4px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 20px 0 / 4px 4px no-repeat;
}
.pixel-trophy-sprite.variant-halo::before {
  background:
    linear-gradient(var(--trophy-accent) 0 0) 12px 0 / 20px 2px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 10px 2px / 24px 2px no-repeat;
}
.pixel-trophy-sprite.variant-royal::before {
  background:
    linear-gradient(var(--trophy-accent) 0 0) 12px 0 / 4px 4px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 20px 0 / 4px 4px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 28px 0 / 4px 4px no-repeat;
}
.pixel-trophy-sprite.variant-ascend::before {
  background:
    linear-gradient(var(--trophy-accent) 0 0) 20px 0 / 4px 4px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 18px 4px / 8px 2px no-repeat,
    linear-gradient(var(--trophy-accent) 0 0) 16px 8px / 12px 2px no-repeat;
}

.pixel-trophy-sprite.theme-bronze { --trophy-main: #b97a46; --trophy-accent: #f0c58f; --trophy-glow: rgba(196, 133, 70, 0.3); }
.pixel-trophy-sprite.theme-silver { --trophy-main: #9bb4d4; --trophy-accent: #e4f1ff; --trophy-glow: rgba(164, 194, 235, 0.35); }
.pixel-trophy-sprite.theme-azure { --trophy-main: #5ea4df; --trophy-accent: #d1f1ff; --trophy-glow: rgba(109, 186, 255, 0.36); }
.pixel-trophy-sprite.theme-crimson { --trophy-main: #d6678a; --trophy-accent: #ffd6e3; --trophy-glow: rgba(248, 119, 164, 0.34); }
.pixel-trophy-sprite.theme-astral { --trophy-main: #9870e1; --trophy-accent: #f0dcff; --trophy-glow: rgba(186, 139, 255, 0.4); }
.pixel-trophy-sprite.theme-crown { --trophy-main: #efb85a; --trophy-accent: #fff3bf; --trophy-glow: rgba(255, 204, 93, 0.46); }

.league-trophy-meta { min-width: 0; }
.league-trophy-tier {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.9;
}
.league-trophy-name {
  margin: 3px 0 2px;
  font-size: 14px;
  line-height: 1.25;
}
.league-trophy-desc {
  margin: 0;
  font-size: 10px;
  line-height: 1.3;
  opacity: 0.88;
}
.league-trophy-style {
  margin: 4px 0 0;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #b6d6f5;
  opacity: 0.92;
}

.league-trophy-card.block-tz { border-color: #b88f66; }
.league-trophy-card.block-ns { border-color: #b9d4ff; box-shadow: 0 0 0 1px rgba(185,212,255,0.24) inset, 0 0 16px rgba(150,190,255,0.2); }
.league-trophy-card.block-hm { border-color: #7dc4ff; box-shadow: 0 0 0 1px rgba(125,196,255,0.28) inset, 0 0 18px rgba(96,168,255,0.24); }
.league-trophy-card.block-cg { border-color: #ff88a8; box-shadow: 0 0 0 1px rgba(255,136,168,0.3) inset, 0 0 20px rgba(255,96,138,0.24); }
.league-trophy-card.block-spb { border-color: #d2b0ff; box-shadow: 0 0 0 1px rgba(210,176,255,0.36) inset, 0 0 24px rgba(170,120,255,0.3); }
.league-trophy-card.block-sp { border-color: #ffe09c; box-shadow: 0 0 0 1px rgba(255,224,156,0.46) inset, 0 0 28px rgba(255,204,93,0.36); }
.league-trophy-card.block-tz {
  --trophy-edge: rgba(234, 173, 126, 0.38);
  --trophy-plate: rgba(32, 16, 8, 0.72);
  background: linear-gradient(160deg, rgba(168, 110, 66, 0.18), rgba(26, 20, 28, 0.26));
}
.league-trophy-card.block-ns {
  --trophy-edge: rgba(204, 230, 255, 0.42);
  --trophy-plate: rgba(10, 20, 40, 0.74);
  background: linear-gradient(160deg, rgba(145, 184, 228, 0.2), rgba(18, 24, 48, 0.28));
}
.league-trophy-card.block-hm {
  --trophy-edge: rgba(134, 218, 255, 0.42);
  --trophy-plate: rgba(8, 18, 42, 0.74);
  background: linear-gradient(160deg, rgba(91, 158, 232, 0.22), rgba(17, 25, 48, 0.28));
}
.league-trophy-card.block-cg {
  --trophy-edge: rgba(255, 180, 208, 0.42);
  --trophy-plate: rgba(38, 12, 28, 0.74);
  background: linear-gradient(160deg, rgba(216, 92, 133, 0.2), rgba(26, 18, 40, 0.32));
}
.league-trophy-card.block-spb {
  --trophy-edge: rgba(226, 193, 255, 0.48);
  --trophy-plate: rgba(24, 12, 40, 0.75);
  background: linear-gradient(160deg, rgba(155, 103, 224, 0.26), rgba(22, 16, 44, 0.34));
}
.league-trophy-card.block-sp {
  --trophy-edge: rgba(255, 232, 174, 0.62);
  --trophy-plate: rgba(28, 18, 10, 0.76);
}
.league-trophy-card.block-sp .league-trophy-emblem {
  box-shadow: inset 0 0 14px rgba(255,245,188,0.28), 0 0 22px rgba(255,206,104,0.48);
  background:
    linear-gradient(135deg, rgba(255, 77, 109, 0.18), rgba(255, 217, 89, 0.16), rgba(82, 255, 168, 0.16), rgba(85, 179, 255, 0.16), rgba(199, 114, 255, 0.2)),
    rgba(4, 9, 23, 0.75);
  animation: spRainbowGlow 3.6s linear infinite;
}
.league-trophy-card.block-sp .league-trophy-style {
  color: #ffe8a8;
  text-shadow: 0 0 8px rgba(255,220,138,0.35);
}
.league-trophy-card.block-sp .pixel-trophy-sprite {
  animation: spRainbowHue 3.2s linear infinite;
  filter: drop-shadow(0 0 8px rgba(255, 148, 90, 0.45)) hue-rotate(0deg) saturate(1.2);
}
.league-trophy-card.block-sp .league-trophy-tier,
.league-trophy-card.block-sp .league-trophy-name {
  animation: spRainbowText 3.2s linear infinite;
}

@keyframes spRainbowHue {
  from {
    filter: drop-shadow(0 0 8px rgba(255, 148, 90, 0.45)) hue-rotate(0deg) saturate(1.25);
  }
  to {
    filter: drop-shadow(0 0 8px rgba(255, 148, 90, 0.45)) hue-rotate(360deg) saturate(1.25);
  }
}

@keyframes spRainbowGlow {
  0% { box-shadow: inset 0 0 14px rgba(255,245,188,0.3), 0 0 22px rgba(255,88,128,0.42); }
  20% { box-shadow: inset 0 0 14px rgba(255,245,188,0.3), 0 0 22px rgba(255,186,95,0.44); }
  40% { box-shadow: inset 0 0 14px rgba(255,245,188,0.3), 0 0 22px rgba(151,255,120,0.44); }
  60% { box-shadow: inset 0 0 14px rgba(255,245,188,0.3), 0 0 22px rgba(93,197,255,0.44); }
  80% { box-shadow: inset 0 0 14px rgba(255,245,188,0.3), 0 0 22px rgba(210,134,255,0.44); }
  100% { box-shadow: inset 0 0 14px rgba(255,245,188,0.3), 0 0 22px rgba(255,88,128,0.42); }
}

@keyframes spRainbowText {
  0% { color: #ff9fb1; text-shadow: 0 0 8px rgba(255, 107, 138, 0.45); }
  25% { color: #ffd87b; text-shadow: 0 0 8px rgba(255, 208, 120, 0.45); }
  50% { color: #8dffc2; text-shadow: 0 0 8px rgba(124, 255, 190, 0.45); }
  75% { color: #8cc6ff; text-shadow: 0 0 8px rgba(124, 197, 255, 0.45); }
  100% { color: #ff9fb1; text-shadow: 0 0 8px rgba(255, 107, 138, 0.45); }
}

.league-trophy-catalog-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
}

.league-trophy-catalog-preview {
  display: grid;
  place-items: center;
}

.league-trophy-catalog-row .league-trophy-emblem {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

.league-trophy-catalog-row .pixel-trophy-sprite {
  width: 40px;
  height: 40px;
}
.league-trophy-catalog-row .league-trophy-tier {
  font-size: 9px;
}
.league-trophy-catalog-row .league-trophy-name {
  margin-top: 2px;
  font-size: 13px;
}
.league-trophy-catalog-row .league-trophy-desc {
  font-size: 9px;
}
.league-trophy-catalog-row .league-trophy-style {
  margin-top: 3px;
}
.league-trophy-catalog-row .record-line {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.35;
}

@keyframes trophyIdleFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

/* ===== Title Screen 2026 Premium Refresh ===== */
#title-screen {
  background: radial-gradient(120% 85% at 50% 8%, #1a2a52 0%, #0b1228 48%, #050914 100%);
  overflow: hidden;
  padding:
    max(10px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

#title-screen .neo-title-wrap {
  width: min(96vw, 540px);
  min-height: min(94dvh, 860px);
  max-height: min(94dvh, 860px);
  border: 1px solid rgba(123, 205, 255, 0.45);
  border-radius: 18px;
  padding: clamp(14px, 3.2vw, 24px);
  display: grid;
  grid-template-rows: auto auto auto auto auto auto auto 1fr auto;
  gap: clamp(8px, 1.8vh, 14px);
  align-content: start;
  background:
    linear-gradient(180deg, rgba(15, 28, 58, 0.88), rgba(8, 14, 34, 0.84)),
    radial-gradient(72% 44% at 50% 18%, rgba(118, 204, 255, 0.16), transparent 72%);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(163, 228, 255, 0.12),
    inset 0 -32px 60px rgba(9, 14, 38, 0.46);
  isolation: isolate;
}

#title-screen .neo-title-bg {
  background:
    radial-gradient(70% 55% at 50% 8%, rgba(107, 218, 255, 0.2), transparent 72%),
    radial-gradient(45% 33% at 88% 24%, rgba(172, 126, 255, 0.16), transparent 74%),
    radial-gradient(38% 28% at 14% 76%, rgba(103, 155, 255, 0.14), transparent 70%),
    linear-gradient(180deg, rgba(8, 16, 36, 0.68), rgba(4, 8, 20, 0.84));
}

#title-screen .neo-title-nebula {
  filter: saturate(1.08) blur(0.4px);
  opacity: 0.58;
  animation: title-nebula-shift 18s ease-in-out infinite alternate;
}

#title-screen .neo-title-stars {
  opacity: 0.74;
  background-image:
    radial-gradient(circle at 20% 24%, rgba(214, 239, 255, 0.92) 0 1px, transparent 1.2px),
    radial-gradient(circle at 78% 34%, rgba(170, 224, 255, 0.82) 0 1px, transparent 1.2px),
    radial-gradient(circle at 65% 70%, rgba(181, 153, 255, 0.8) 0 1px, transparent 1.2px),
    radial-gradient(circle at 36% 60%, rgba(200, 243, 255, 0.8) 0 1px, transparent 1.2px);
  background-size: 180px 180px, 200px 200px, 220px 220px, 160px 160px;
  animation: title-stars-drift 34s linear infinite;
}

#title-screen .neo-title-grid {
  opacity: 0.3;
  background:
    linear-gradient(rgba(125, 206, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 206, 255, 0.1) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, transparent 0, rgba(255, 255, 255, 0.2) 20%, rgba(255, 255, 255, 0.85) 48%, transparent 100%);
}

#title-screen .neo-title-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 18px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.03) 0 1px,
      rgba(255, 255, 255, 0.0) 1px 3px
    );
  mix-blend-mode: screen;
  opacity: 0.44;
}

#title-screen .neo-title-top {
  justify-self: center;
  margin: 0;
  font-size: clamp(9px, 2vw, 11px);
  letter-spacing: 0.13em;
  color: #88d8ff;
  text-shadow: 0 0 8px rgba(120, 219, 255, 0.36);
}

#title-screen .title-ops-banner {
  justify-self: center;
  width: min(100%, 380px);
  border: 1px solid rgba(148, 217, 255, 0.36);
  border-radius: 999px;
  padding: 4px 9px;
  background: linear-gradient(180deg, rgba(22, 40, 76, 0.8), rgba(12, 24, 48, 0.9));
  box-shadow: inset 0 0 0 1px rgba(182, 228, 255, 0.14);
}

#title-screen .neo-title-main {
  position: relative;
  text-align: center;
  padding: 10px 0 8px;
}

#title-screen .neo-logo {
  margin: 0;
  font-family: "Press Start 2P", "Segoe UI", "Yu Gothic UI", monospace;
  font-size: clamp(28px, 8.8vw, 48px);
  letter-spacing: 0.07em;
  line-height: 1.08;
  color: #e9f8ff;
  text-shadow:
    0 0 10px rgba(111, 227, 255, 0.65),
    0 0 24px rgba(93, 162, 255, 0.35),
    0 3px 0 rgba(4, 10, 24, 0.9),
    0 6px 16px rgba(0, 0, 0, 0.48);
  animation: title-logo-glow 4s ease-in-out infinite;
}

#title-screen .neo-logo-jp {
  margin: 10px 0 0;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  font-weight: 700;
  font-size: clamp(12px, 3.2vw, 15px);
  letter-spacing: 0.08em;
  color: #ccedff;
  text-shadow: 0 0 12px rgba(116, 208, 255, 0.24);
}

#title-screen .neo-sub-en,
#title-screen .neo-sub-jp {
  margin: 8px 0 0;
  line-height: 1.45;
  color: #b8d8f5;
}

#title-screen .neo-sub-en {
  font-size: clamp(10px, 2.5vw, 12px);
  letter-spacing: 0.08em;
}

#title-screen .neo-sub-jp {
  font-size: clamp(11px, 2.8vw, 12px);
}

#title-screen .title-hud-lines {
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

#title-screen .hud-line {
  height: 2px;
  flex: 1;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(91, 183, 255, 0), rgba(135, 224, 255, 0.82), rgba(91, 183, 255, 0));
  opacity: 0.75;
  animation: title-hud-pulse 2.4s ease-in-out infinite;
}

#title-screen .hud-line.right { animation-delay: 0.8s; }

#title-screen .title-ship {
  position: relative;
  width: min(68vw, 310px);
  aspect-ratio: 5 / 3;
  margin: 0 auto;
  opacity: 0.82;
  filter: drop-shadow(0 0 16px rgba(111, 215, 255, 0.24));
}

#title-screen .title-ship-core,
#title-screen .title-ship-wing,
#title-screen .title-ship-thruster {
  position: absolute;
  image-rendering: pixelated;
}

#title-screen .title-ship-core {
  left: 50%;
  top: 36%;
  width: 64px;
  height: 54px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(#e9f7ff 0 0) 28px 4px / 8px 8px no-repeat,
    linear-gradient(#8dd9ff 0 0) 20px 12px / 24px 26px no-repeat,
    linear-gradient(#5ba8df 0 0) 14px 38px / 36px 10px no-repeat,
    linear-gradient(#2a4e88 0 0) 16px 14px / 32px 30px no-repeat;
  box-shadow: inset 0 0 0 2px rgba(190, 236, 255, 0.22);
}

#title-screen .title-ship-wing {
  top: 44%;
  width: 64px;
  height: 36px;
  background:
    linear-gradient(#66c8ff 0 0) 0 16px / 64px 6px no-repeat,
    linear-gradient(#22497e 0 0) 6px 8px / 50px 20px no-repeat;
}

#title-screen .title-ship-wing.left {
  left: calc(50% - 84px);
  transform: skewX(-14deg);
}

#title-screen .title-ship-wing.right {
  right: calc(50% - 84px);
  transform: skewX(14deg);
}

#title-screen .title-ship-thruster {
  left: 50%;
  top: 66%;
  width: 112px;
  height: 28px;
  transform: translateX(-50%);
  background:
    radial-gradient(18px 10px at 20% 45%, rgba(126, 236, 255, 0.85), transparent 72%),
    radial-gradient(18px 10px at 50% 45%, rgba(126, 236, 255, 0.9), transparent 72%),
    radial-gradient(18px 10px at 80% 45%, rgba(126, 236, 255, 0.85), transparent 72%);
  animation: title-thruster 1.2s steps(2, end) infinite;
}

#title-screen .neo-divider,
#title-screen .neo-event-card,
#title-screen .neo-balance-card,
#title-screen .title-news-ticker {
  width: min(100%, 430px);
  margin-inline: auto;
}

#title-screen .neo-event-card,
#title-screen .neo-balance-card,
#title-screen .title-news-ticker {
  background: linear-gradient(180deg, rgba(18, 33, 64, 0.86), rgba(9, 19, 40, 0.88));
  border: 1px solid rgba(121, 205, 255, 0.3);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(149, 221, 255, 0.1);
}

#title-screen .title-news-ticker {
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

#title-screen .title-news-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#title-screen .neo-title-actions {
  align-self: end;
  width: min(100%, 430px);
  margin-inline: auto;
  display: grid;
  gap: 10px;
}

#title-screen #tap-start-btn {
  min-height: 58px;
  border-radius: 12px;
  border: 1px solid #8ce8ff;
  background: linear-gradient(180deg, #2e78c7, #1f5a9e 52%, #153f74 100%);
  box-shadow:
    0 8px 20px rgba(41, 129, 224, 0.3),
    inset 0 0 0 1px rgba(228, 247, 255, 0.28),
    inset 0 -12px 20px rgba(5, 18, 42, 0.36);
  color: #effaff;
  font-size: clamp(13px, 3.6vw, 16px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 0 rgba(7, 19, 44, 0.9), 0 0 14px rgba(140, 230, 255, 0.45);
  animation: title-start-pulse 1.9s ease-in-out infinite;
}

#title-screen #tap-start-btn:hover,
#title-screen #tap-start-btn:focus-visible {
  filter: brightness(1.12);
  box-shadow:
    0 10px 24px rgba(48, 142, 245, 0.36),
    inset 0 0 0 1px rgba(239, 252, 255, 0.34),
    inset 0 -12px 20px rgba(5, 18, 42, 0.36);
}

#title-screen #tap-start-btn:active {
  transform: translateY(2px) scale(0.988);
}

#title-screen .neo-start-note {
  margin: 0;
  text-align: center;
  font-size: clamp(10px, 2.8vw, 12px);
  color: #b6dbf8;
}

#title-screen .neo-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#title-screen .title-version {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(8px, 2.2vw, 10px);
  color: #90bedf;
}

#title-screen #title-update-btn {
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(151, 214, 255, 0.46);
  background: linear-gradient(180deg, rgba(30, 57, 98, 0.95), rgba(17, 34, 62, 0.95));
  color: #d5eeff;
  font-family: "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: clamp(11px, 2.8vw, 12px);
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgba(196, 233, 255, 0.12);
}

#title-screen #title-update-btn:active {
  transform: translateY(1px) scale(0.99);
}

@keyframes title-nebula-shift {
  0% { transform: translate3d(-1%, -1%, 0) scale(1); }
  100% { transform: translate3d(1.4%, 1.2%, 0) scale(1.03); }
}

@keyframes title-stars-drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 0 180px, 0 220px, 0 260px, 0 200px; }
}

@keyframes title-logo-glow {
  0%, 100% { text-shadow: 0 0 10px rgba(111, 227, 255, 0.65), 0 0 24px rgba(93, 162, 255, 0.35), 0 3px 0 rgba(4, 10, 24, 0.9), 0 6px 16px rgba(0, 0, 0, 0.48); }
  50% { text-shadow: 0 0 12px rgba(139, 235, 255, 0.84), 0 0 28px rgba(129, 114, 255, 0.38), 0 3px 0 rgba(4, 10, 24, 0.9), 0 8px 16px rgba(0, 0, 0, 0.52); }
}

@keyframes title-hud-pulse {
  0%, 100% { opacity: 0.46; transform: scaleX(0.95); }
  50% { opacity: 0.92; transform: scaleX(1); }
}

@keyframes title-thruster {
  0%, 100% { opacity: 0.56; filter: blur(0.5px); }
  50% { opacity: 0.92; filter: blur(0); }
}

@keyframes title-start-pulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(41, 129, 224, 0.3), inset 0 0 0 1px rgba(228, 247, 255, 0.28), inset 0 -12px 20px rgba(5, 18, 42, 0.36); }
  50% { box-shadow: 0 10px 24px rgba(67, 151, 245, 0.42), 0 0 22px rgba(125, 226, 255, 0.28), inset 0 0 0 1px rgba(237, 252, 255, 0.3), inset 0 -12px 20px rgba(5, 18, 42, 0.36); }
}

@media (max-width: 420px) {
  #title-screen .neo-title-wrap {
    width: min(97vw, 520px);
    border-radius: 14px;
    padding: 12px;
    gap: 8px;
  }
  #title-screen .title-ship {
    width: min(74vw, 286px);
  }
  #title-screen #tap-start-btn {
    min-height: 54px;
    font-size: 13px;
  }
}

@media (max-height: 720px) {
  #title-screen .neo-title-wrap {
    gap: 6px;
  }
  #title-screen .neo-balance-card {
    display: none;
  }
}

@media (max-height: 820px) {
  #title-screen.title-screen--premium {
    align-items: flex-start !important;
    padding-top: max(8px, env(safe-area-inset-top)) !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }

  #title-screen.title-screen--premium .neo-title-wrap {
    min-height: auto !important;
    max-height: none !important;
    width: min(97vw, 520px) !important;
    padding: 10px !important;
    gap: 6px !important;
    border-radius: 12px !important;
  }

  #title-screen.title-screen--premium .neo-title-main {
    padding: 6px 0 4px !important;
  }

  #title-screen.title-screen--premium .neo-logo {
    font-size: clamp(24px, 8vw, 38px) !important;
  }

  #title-screen.title-screen--premium .neo-logo-jp {
    margin-top: 6px !important;
    font-size: clamp(11px, 2.8vw, 13px) !important;
  }

  #title-screen.title-screen--premium .title-ship {
    width: min(56vw, 240px) !important;
  }

  #title-screen.title-screen--premium .neo-event-card,
  #title-screen.title-screen--premium .neo-balance-card {
    display: none !important;
  }

  #title-screen.title-screen--premium .title-news-ticker {
    min-height: 34px !important;
    padding: 6px 8px !important;
  }

  #title-screen.title-screen--premium .title-news-tag {
    font-size: 8px !important;
  }

  #title-screen.title-screen--premium .title-news-text {
    font-size: 10px !important;
  }

  #title-screen.title-screen--premium .neo-title-actions {
    gap: 8px !important;
  }

  #title-screen.title-screen--premium #tap-start-btn {
    min-height: 50px !important;
    font-size: 13px !important;
  }

  #title-screen.title-screen--premium #title-update-btn {
    min-height: 34px !important;
    font-size: 11px !important;
    padding: 4px 10px !important;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  #title-screen .neo-title-wrap {
    width: min(96vw, 860px);
    min-height: min(92dvh, 520px);
    grid-template-columns: 1.05fr 0.95fr;
    grid-template-rows: auto auto auto 1fr auto;
    column-gap: 14px;
  }
  #title-screen .neo-title-top,
  #title-screen .title-ops-banner,
  #title-screen .neo-title-main,
  #title-screen .title-hud-lines,
  #title-screen .title-ship,
  #title-screen .neo-divider {
    grid-column: 1;
  }
  #title-screen .neo-event-card,
  #title-screen .title-news-ticker,
  #title-screen .neo-balance-card,
  #title-screen .neo-title-actions {
    grid-column: 2;
  }
  #title-screen .neo-title-actions {
    align-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  #title-screen .neo-title-nebula,
  #title-screen .neo-title-stars,
  #title-screen .neo-logo,
  #title-screen .hud-line,
  #title-screen .title-ship-thruster,
  #title-screen #tap-start-btn {
    animation: none !important;
  }
}

/* ===== Global Loading Overlay ===== */
.global-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background:
    radial-gradient(72% 48% at 50% 42%, rgba(88, 170, 255, 0.16), transparent 76%),
    rgba(3, 8, 19, 0.82);
  backdrop-filter: blur(2px);
}

.global-loading-overlay.hidden {
  display: none !important;
}

.global-loading-card {
  width: min(88vw, 360px);
  border: 1px solid rgba(143, 222, 255, 0.56);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(14, 28, 56, 0.95), rgba(8, 16, 36, 0.96));
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.46),
    inset 0 0 0 1px rgba(193, 236, 255, 0.1);
  padding: 14px 14px 12px;
}

.global-loading-label {
  margin: 0;
  text-align: center;
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #d8f2ff;
  text-shadow: 0 0 10px rgba(108, 222, 255, 0.5);
}

.global-loading-bar {
  margin-top: 10px;
  height: 10px;
  border: 2px solid rgba(119, 205, 255, 0.74);
  background: rgba(11, 23, 46, 0.95);
  overflow: hidden;
}

.global-loading-fill {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, #7fd4ff, #9cf6ff, #88a9ff);
  box-shadow: 0 0 12px rgba(136, 223, 255, 0.42);
  animation: global-loading-sweep 1.1s linear infinite;
}

.global-loading-sub {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11px;
  color: #b8daf8;
}

@keyframes global-loading-sweep {
  0% { transform: translateX(-130%); }
  100% { transform: translateX(290%); }
}

@media (prefers-reduced-motion: reduce) {
  .global-loading-fill {
    animation: none;
    width: 68%;
  }
}

/* ===== Title Alignment Hotfix ===== */
#title-screen {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

#title-screen .neo-title-wrap {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

@media (orientation: landscape) and (max-height: 560px) {
  #title-screen .neo-title-wrap {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    width: min(96vw, 560px) !important;
  }
  #title-screen .neo-title-top,
  #title-screen .title-ops-banner,
  #title-screen .neo-title-main,
  #title-screen .title-hud-lines,
  #title-screen .title-ship,
  #title-screen .neo-divider,
  #title-screen .neo-event-card,
  #title-screen .title-news-ticker,
  #title-screen .neo-balance-card,
  #title-screen .neo-title-actions {
    grid-column: auto !important;
  }
}

/* ===== Premium Title Scoped Layer ===== */
#title-screen.title-screen--premium {
  --tp-bg0: #050914;
  --tp-bg1: #0b1228;
  --tp-bg2: #15284c;
  --tp-cyan: #8fe5ff;
  --tp-cyan-2: #67c8ff;
  --tp-violet: #9f85ff;
  --tp-text: #eaf7ff;
  --tp-sub: #bddcf8;
}

#title-screen.title-screen--premium .title-premium-wrap {
  contain: layout style paint;
}

#title-screen.title-screen--premium .title-premium-vignette,
#title-screen.title-screen--premium .title-premium-noise,
#title-screen.title-screen--premium .title-premium-scanline,
#title-screen.title-screen--premium .title-premium-hudframe,
#title-screen.title-screen--premium .title-premium-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#title-screen.title-screen--premium .title-premium-vignette {
  background:
    radial-gradient(130% 90% at 50% 20%, transparent 48%, rgba(2, 5, 13, 0.52) 100%),
    linear-gradient(180deg, rgba(2, 6, 16, 0.35), rgba(2, 6, 16, 0.62));
  z-index: 1;
}

#title-screen.title-screen--premium .title-premium-noise {
  opacity: 0.06;
  z-index: 2;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.3) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
}

#title-screen.title-screen--premium .title-premium-scanline {
  z-index: 3;
  background: linear-gradient(180deg, transparent 0%, rgba(122, 210, 255, 0.05) 48%, transparent 100%);
  background-size: 100% 6px;
  animation: title-premium-scanline 7.8s linear infinite;
}

#title-screen.title-screen--premium .title-premium-hudframe {
  z-index: 4;
}

#title-screen.title-screen--premium .title-premium-hudframe::before,
#title-screen.title-screen--premium .title-premium-hudframe::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(140, 218, 255, 0.15);
  border-radius: 14px;
}

#title-screen.title-screen--premium .title-premium-hudframe::after {
  inset: 18px;
  border-color: rgba(153, 132, 255, 0.12);
}

#title-screen.title-screen--premium .title-premium-stars {
  z-index: 5;
  overflow: hidden;
}

#title-screen.title-screen--premium .title-premium-stars i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 1px;
  background: rgba(208, 240, 255, 0.9);
  box-shadow: 0 0 8px rgba(120, 213, 255, 0.5);
  animation: title-premium-star-float var(--dur, 14s) linear infinite;
  animation-delay: var(--delay, 0s);
  opacity: var(--alpha, 0.75);
}

#title-screen.title-screen--premium .title-premium-wrap > :not(.title-premium-vignette):not(.title-premium-noise):not(.title-premium-scanline):not(.title-premium-hudframe):not(.title-premium-stars):not(.neo-title-bg):not(.neo-title-nebula):not(.neo-title-stars):not(.neo-title-comets):not(.neo-title-planet):not(.neo-title-grid) {
  position: relative;
  z-index: 12;
}

#title-screen.title-screen--premium .neo-logo {
  position: relative;
}

#title-screen.title-screen--premium .neo-logo::before {
  content: attr(data-title-text);
  position: absolute;
  inset: 0;
  color: rgba(151, 223, 255, 0.42);
  transform: translate(1px, 1px);
  filter: blur(0.6px);
  z-index: -1;
}

#title-screen.title-screen--premium .neo-logo::after {
  content: attr(data-title-text);
  position: absolute;
  inset: 0;
  color: rgba(211, 154, 255, 0.16);
  transform: translate(var(--glitch-x, 0px), var(--glitch-y, 0px));
  opacity: var(--glitch-o, 0);
  text-shadow: -1px 0 rgba(133, 222, 255, 0.44), 1px 0 rgba(207, 123, 255, 0.34);
  transition: opacity 120ms linear;
  z-index: -1;
}

#title-screen.title-screen--premium .neo-logo-jp {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid rgba(141, 214, 255, 0.34);
  border-radius: 999px;
  background: rgba(10, 22, 44, 0.5);
}

#title-screen.title-screen--premium #tap-start-btn,
#title-screen.title-screen--premium #title-update-btn {
  position: relative;
  overflow: hidden;
}

#title-screen.title-screen--premium #tap-start-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -52%;
  width: 46%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(227, 250, 255, 0.5), transparent);
  transform: skewX(-18deg);
  animation: title-start-sheen 2.8s ease-in-out infinite;
}

#title-screen.title-screen--premium .title-ripple {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(189, 236, 255, 0.88);
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0.95;
  pointer-events: none;
  animation: title-ripple-expand 420ms ease-out forwards;
}

#title-screen.title-screen--premium .title-ops-banner,
#title-screen.title-screen--premium .neo-event-card,
#title-screen.title-screen--premium .neo-balance-card,
#title-screen.title-screen--premium .title-news-ticker {
  backdrop-filter: blur(3px);
}

#title-screen.title-screen--premium .title-news-ticker {
  min-height: 40px;
}

#title-screen.title-screen--premium .title-news-text {
  animation: title-news-subtle 8s ease-in-out infinite;
}

@keyframes title-premium-scanline {
  0% { background-position: 0 -16px; }
  100% { background-position: 0 16px; }
}

@keyframes title-premium-star-float {
  0% { transform: translateY(0); }
  100% { transform: translateY(28px); }
}

@keyframes title-start-sheen {
  0%, 20% { left: -52%; }
  40% { left: 126%; }
  100% { left: 126%; }
}

@keyframes title-ripple-expand {
  to {
    transform: translate(-50%, -50%) scale(18);
    opacity: 0;
  }
}

@keyframes title-news-subtle {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #title-screen.title-screen--premium .title-premium-scanline,
  #title-screen.title-screen--premium .title-premium-stars i,
  #title-screen.title-screen--premium #tap-start-btn::after,
  #title-screen.title-screen--premium .title-news-text {
    animation: none !important;
  }
}

/* ===== Main Menu Premium ===== */
#menu-screen.main-menu--premium {
  --mm-bg0: #060b17;
  --mm-bg1: #0c1730;
  --mm-bg2: #142750;
  --mm-cyan: #8de3ff;
  --mm-cyan2: #66c8ff;
  --mm-violet: #9e83ff;
  --mm-gold: #ffd28a;
  --mm-text: #ebf7ff;
  --mm-sub: #b6d7f3;
  --mm-ship-a: #83ddff;
  --mm-ship-b: #66c8ff;
  --mm-ship-c: #376aa3;
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding:
    max(8px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
  background: radial-gradient(120% 85% at 50% 5%, #1a2c57 0%, #0b142a 45%, #040810 100%);
}

#menu-screen.main-menu--premium .main-menu {
  position: relative;
  width: min(97vw, 620px);
  padding: clamp(10px, 2.4vw, 16px);
  border: 1px solid rgba(137, 212, 255, 0.42);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(16, 30, 60, 0.9), rgba(7, 14, 31, 0.92)),
    radial-gradient(80% 44% at 50% 20%, rgba(98, 192, 255, 0.14), transparent 72%);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.44),
    inset 0 0 0 1px rgba(183, 233, 255, 0.1);
  display: grid;
  gap: 10px;
  overflow: hidden;
  isolation: isolate;
}

#menu-screen.main-menu--premium .menu-premium-bg,
#menu-screen.main-menu--premium .menu-premium-bg > div {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#menu-screen.main-menu--premium .menu-premium-bg {
  z-index: 0;
}

#menu-screen.main-menu--premium .menu-premium-bg__vignette {
  background:
    radial-gradient(130% 90% at 50% 20%, transparent 50%, rgba(3, 7, 16, 0.58) 100%),
    linear-gradient(180deg, rgba(2, 6, 15, 0.28), rgba(2, 6, 15, 0.54));
}

#menu-screen.main-menu--premium .menu-premium-bg__grid {
  opacity: 0.2;
  background:
    linear-gradient(rgba(130, 214, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 214, 255, 0.12) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, transparent 0, rgba(255, 255, 255, 0.8) 18%, rgba(255, 255, 255, 0.8) 82%, transparent 100%);
}

#menu-screen.main-menu--premium .menu-premium-bg__scanline {
  opacity: 0.32;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 4px);
  animation: mm-scan 8s linear infinite;
}

#menu-screen.main-menu--premium .menu-premium-bg__frame::before,
#menu-screen.main-menu--premium .menu-premium-bg__frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(141, 219, 255, 0.18);
  border-radius: 12px;
}

#menu-screen.main-menu--premium .menu-premium-bg__frame::after {
  inset: 18px;
  border-color: rgba(158, 130, 255, 0.14);
}

#menu-screen.main-menu--premium .menu-premium-bg__stars i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 1px;
  background: rgba(214, 241, 255, 0.9);
  box-shadow: 0 0 8px rgba(130, 220, 255, 0.42);
  animation: mm-star var(--dur, 16s) linear infinite;
  animation-delay: var(--delay, 0s);
  opacity: var(--alpha, 0.72);
}

#menu-screen.main-menu--premium .main-menu > :not(.menu-premium-bg):not(.menu-fx-layer) {
  position: relative;
  z-index: 2;
}

#menu-screen.main-menu--premium .menu-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(128, 209, 255, 0.36);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(21, 42, 78, 0.82), rgba(11, 25, 47, 0.86));
}

#menu-screen.main-menu--premium .menu-header__label {
  margin: 0;
  font-size: 8px;
  color: #9ecdf2;
  letter-spacing: 0.08em;
}

#menu-screen.main-menu--premium .menu-header__value {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--mm-text);
  font-family: "Press Start 2P", monospace;
  line-height: 1.35;
}

#menu-screen.main-menu--premium .menu-header__settings {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid rgba(138, 214, 255, 0.44);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(25, 52, 90, 0.9), rgba(14, 30, 54, 0.92));
  color: #d9efff;
  font-size: 16px;
}

#menu-screen.main-menu--premium .menu-home-topbar {
  border: 1px solid rgba(130, 205, 255, 0.32);
  border-radius: 12px;
  padding: 8px;
  background: linear-gradient(180deg, rgba(16, 34, 67, 0.82), rgba(9, 18, 38, 0.88));
}

#menu-screen.main-menu--premium .menu-home-resource-label,
#menu-screen.main-menu--premium .menu-home-rank-label {
  color: #96c9ee;
}

#menu-screen.main-menu--premium .menu-home-resource-value,
#menu-screen.main-menu--premium .menu-home-rank-value {
  color: #eff9ff;
  text-shadow: 0 0 8px rgba(126, 219, 255, 0.24);
}

#menu-screen.main-menu--premium .menu-title {
  margin: 2px 0 0;
  text-align: center;
  letter-spacing: 0.08em;
  font-family: "Press Start 2P", monospace;
  color: #ebf7ff;
  text-shadow: 0 0 12px rgba(112, 222, 255, 0.5), 0 2px 0 rgba(5, 13, 30, 0.9);
}

#menu-screen.main-menu--premium .menu-subtitle {
  margin: 0;
  text-align: center;
  color: var(--mm-sub);
}

#menu-screen.main-menu--premium .menu-hangar-info {
  margin: 2px 0 6px;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.05em;
  color: #b3d9f5;
  opacity: 0.9;
}

#menu-screen.main-menu--premium .menu-hangar-stage {
  position: relative;
  height: clamp(98px, 20vh, 150px);
  border: 1px solid rgba(132, 210, 255, 0.22);
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 27, 52, 0.6), rgba(8, 16, 34, 0.78)),
    radial-gradient(60% 50% at 50% 65%, rgba(116, 207, 255, 0.18), transparent 75%);
}

#menu-screen.main-menu--premium .menu-hangar-stage__pad {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 180px;
  height: 36px;
  transform: translateX(-50%);
  background:
    radial-gradient(55% 60% at 50% 50%, rgba(120, 214, 255, 0.5), rgba(120, 214, 255, 0) 75%),
    linear-gradient(rgba(126, 216, 255, 0.6) 0 0) center / 100% 2px no-repeat;
}

#menu-screen.main-menu--premium .menu-hangar-stage__beam {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 96px;
  height: 84px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(125, 227, 255, 0.16), rgba(125, 227, 255, 0));
  clip-path: polygon(22% 0%, 78% 0%, 100% 100%, 0% 100%);
  animation: mm-beam 2.2s ease-in-out infinite;
}

#menu-screen.main-menu--premium .menu-hangar-ship {
  position: absolute;
  left: 50%;
  top: 36%;
  width: 128px;
  height: 74px;
  transform: translate(-50%, -50%);
  animation: mm-ship-float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(121, 220, 255, 0.28));
}

#menu-screen.main-menu--premium .menu-hangar-ship__core,
#menu-screen.main-menu--premium .menu-hangar-ship__wing,
#menu-screen.main-menu--premium .menu-hangar-ship__thruster {
  position: absolute;
}

#menu-screen.main-menu--premium .menu-hangar-ship__core {
  left: 50%;
  top: 12px;
  width: 38px;
  height: 30px;
  transform: translateX(-50%);
  background:
    linear-gradient(#eff8ff 0 0) 15px 0 / 8px 6px no-repeat,
    linear-gradient(var(--mm-ship-a) 0 0) 7px 6px / 24px 16px no-repeat,
    linear-gradient(var(--mm-ship-c) 0 0) 8px 22px / 22px 8px no-repeat;
}

#menu-screen.main-menu--premium .menu-hangar-ship__wing {
  top: 30px;
  width: 48px;
  height: 16px;
  background:
    linear-gradient(var(--mm-ship-b) 0 0) 0 7px / 48px 3px no-repeat,
    linear-gradient(var(--mm-ship-c) 0 0) 3px 4px / 42px 8px no-repeat;
}

#menu-screen.main-menu--premium .menu-hangar-ship__wing.left { left: 10px; transform: skewX(-14deg); }
#menu-screen.main-menu--premium .menu-hangar-ship__wing.right { right: 10px; transform: skewX(14deg); }

#menu-screen.main-menu--premium .menu-hangar-ship__thruster {
  left: 50%;
  bottom: 4px;
  width: 62px;
  height: 12px;
  transform: translateX(-50%);
  background:
    radial-gradient(8px 4px at 20% 50%, rgba(150, 236, 255, 0.85), transparent 78%),
    radial-gradient(8px 4px at 50% 50%, rgba(150, 236, 255, 0.95), transparent 78%),
    radial-gradient(8px 4px at 80% 50%, rgba(150, 236, 255, 0.85), transparent 78%);
}

#menu-screen.main-menu--premium .menu-mode-meta {
  margin-top: 4px;
  font-size: 8px;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: #a9d5f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.92;
}

#menu-screen.main-menu--premium .mode-grid-sub .btn-abyss .menu-mode-meta {
  color: #e5cfff;
}

#menu-screen.main-menu--premium .menu-section-title {
  margin: 6px 0 2px;
  padding-left: 2px;
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #a5d6f8;
}

#menu-screen.main-menu--premium .mode-grid-main,
#menu-screen.main-menu--premium .mode-grid-sub,
#menu-screen.main-menu--premium .menu-list {
  gap: 8px;
}

#menu-screen.main-menu--premium .menu-btn {
  position: relative;
  min-height: 74px;
  border-radius: 12px;
  border: 1px solid rgba(137, 214, 255, 0.42);
  background: linear-gradient(180deg, rgba(23, 46, 84, 0.9), rgba(12, 25, 48, 0.93));
  box-shadow: inset 0 0 0 1px rgba(191, 236, 255, 0.08), 0 6px 16px rgba(0, 0, 0, 0.28);
  transition: transform 120ms ease, filter 140ms ease, border-color 140ms ease;
}

#menu-screen.main-menu--premium .menu-btn:hover,
#menu-screen.main-menu--premium .menu-btn:focus-visible {
  filter: brightness(1.08);
  border-color: rgba(176, 232, 255, 0.72);
}

#menu-screen.main-menu--premium .menu-btn:active {
  transform: translateY(1px) scale(0.992);
}

#menu-screen.main-menu--premium .mode-grid-main .menu-btn {
  min-height: 90px;
}

#menu-screen.main-menu--premium .mode-grid-sub .btn-abyss {
  border-color: rgba(206, 147, 255, 0.62);
  background: linear-gradient(180deg, rgba(62, 32, 88, 0.88), rgba(28, 15, 47, 0.94));
  box-shadow: inset 0 0 0 1px rgba(231, 193, 255, 0.14), 0 8px 18px rgba(36, 16, 58, 0.38);
}

#menu-screen.main-menu--premium .menu-home-dock {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

#menu-screen.main-menu--premium .menu-dock-btn {
  min-height: 56px;
}

#menu-screen.main-menu--premium .menu-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 22px;
  height: 16px;
  padding: 0 5px;
  border-radius: 8px;
  border: 1px solid rgba(255, 236, 173, 0.75);
  background: linear-gradient(180deg, rgba(255, 204, 94, 0.95), rgba(219, 133, 36, 0.95));
  color: #1f1607;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  line-height: 14px;
  text-align: center;
  letter-spacing: 0.02em;
  text-shadow: none;
  box-shadow: 0 0 8px rgba(255, 201, 102, 0.42);
  animation: mm-badge-pulse 1.7s ease-in-out infinite;
  pointer-events: none;
}

#menu-screen.main-menu--premium .menu-badge.hidden {
  display: none !important;
}

#menu-screen.main-menu--premium .menu-home-status-grid {
  gap: 8px;
}

#menu-screen.main-menu--premium .menu-weekly-status,
#menu-screen.main-menu--premium .daily-mission-panel {
  border-radius: 12px;
  border: 1px solid rgba(133, 208, 255, 0.38);
  background: linear-gradient(180deg, rgba(15, 31, 61, 0.85), rgba(8, 17, 37, 0.9));
}

#menu-screen.main-menu--premium .menu-bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(142, 214, 255, 0.34);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(13, 27, 52, 0.88), rgba(8, 17, 35, 0.92));
  backdrop-filter: blur(2px);
}

#menu-screen.main-menu--premium .menu-nav-item {
  min-height: 42px;
  border: 1px solid rgba(136, 206, 255, 0.34);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(24, 48, 84, 0.86), rgba(12, 24, 45, 0.9));
  color: #d7edff;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  letter-spacing: 0.04em;
}

#menu-screen.main-menu--premium .menu-nav-item.is-active {
  border-color: rgba(255, 215, 143, 0.68);
  color: #ffe8c0;
  box-shadow: 0 0 12px rgba(255, 214, 128, 0.24), inset 0 0 0 1px rgba(255, 237, 196, 0.2);
}

@keyframes mm-scan {
  from { background-position: 0 -30px; }
  to { background-position: 0 30px; }
}

@keyframes mm-star {
  0% { transform: translateY(0); }
  100% { transform: translateY(26px); }
}

@keyframes mm-ship-float {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, calc(-50% - 4px)); }
}

@keyframes mm-beam {
  0%, 100% { opacity: 0.42; }
  50% { opacity: 0.9; }
}

@keyframes mm-badge-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.1); }
}

@media (max-width: 430px) {
  #menu-screen.main-menu--premium .main-menu {
    width: min(98vw, 620px);
    padding: 10px;
    gap: 8px;
  }
  #menu-screen.main-menu--premium .menu-header__value {
    font-size: 11px;
  }
  #menu-screen.main-menu--premium .menu-btn {
    min-height: 68px;
  }
  #menu-screen.main-menu--premium .mode-grid-main .menu-btn {
    min-height: 80px;
  }
}

@media (max-height: 740px) {
  #menu-screen.main-menu--premium .menu-hangar-stage {
    height: 96px;
  }
  #menu-screen.main-menu--premium .menu-chip-row {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #menu-screen.main-menu--premium .menu-premium-bg__scanline,
  #menu-screen.main-menu--premium .menu-premium-bg__stars i,
  #menu-screen.main-menu--premium .menu-hangar-ship,
  #menu-screen.main-menu--premium .menu-hangar-stage__beam,
  #menu-screen.main-menu--premium .menu-badge {
    animation: none !important;
  }
}

/* ===== Stability override (mobile performance / no flicker) ===== */
#title-screen.title-screen--premium,
#menu-screen.main-menu--premium {
  contain: layout paint;
}

/* disable expensive decorative layers that caused flicker/jank */
#title-screen .neo-title-comets,
#title-screen .neo-title-planet,
#title-screen .neo-title-grid,
#title-screen .title-premium-noise,
#title-screen .title-premium-scanline,
#menu-screen .menu-fx-layer,
#menu-screen .menu-premium-bg__scanline {
  display: none !important;
}

/* stop blinking/pulsing loops on title/menu only */
#title-screen .neo-logo,
#title-screen .title-hud-lines .hud-line,
#title-screen .title-ship-thruster,
#title-screen #tap-start-btn,
#title-screen .title-news-text,
#title-screen .neo-title-nebula,
#title-screen .neo-title-stars,
#title-screen .title-premium-stars i,
#menu-screen.main-menu--premium .menu-premium-bg__stars i,
#menu-screen.main-menu--premium .menu-hangar-ship,
#menu-screen.main-menu--premium .menu-hangar-stage__beam,
#menu-screen.main-menu--premium .menu-badge {
  animation: none !important;
}

/* remove logo glitch overlay */
#title-screen.title-screen--premium .neo-logo::before,
#title-screen.title-screen--premium .neo-logo::after {
  content: none !important;
}

/* title overflow fixes */
#title-screen .neo-title-wrap {
  width: min(96vw, 520px) !important;
  max-height: calc(100vh - 16px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 10px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
}

#title-screen .neo-title-main,
#title-screen .neo-event-card,
#title-screen .neo-balance-card,
#title-screen .title-news-ticker,
#title-screen .neo-title-actions {
  width: 100% !important;
  min-width: 0 !important;
}

#title-screen .neo-logo {
  font-size: clamp(32px, 9.2vw, 56px) !important;
  letter-spacing: 0.06em !important;
  line-height: 1.05 !important;
  overflow-wrap: anywhere !important;
}

#title-screen .neo-logo-jp {
  font-size: clamp(13px, 3.8vw, 18px) !important;
}

#title-screen .neo-sub-en,
#title-screen .neo-sub-jp,
#title-screen .neo-event-text,
#title-screen .neo-balance-row,
#title-screen .title-news-text {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
}

#title-screen #tap-start-btn,
#title-screen #title-update-btn {
  min-height: 46px !important;
}

/* ===== Screen stacking guard (prevent multi-screen overlap) ===== */
#app > .screen {
  display: none !important;
  z-index: 0;
}

#app > .screen.active {
  display: flex !important;
  z-index: 20;
}

#game-screen.screen.active {
  z-index: 40;
}

#global-loading-overlay:not(.hidden) {
  z-index: 1200;
}

/* ===== REM Intro Flight (2-3s) ===== */
.cosmos-intro {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  background: #040914;
  opacity: 1;
}

.cosmos-intro.active {
  display: flex !important;
}

.cosmos-intro.warning-phase .rem-intro-bg,
.cosmos-intro.warning-phase .rem-intro-nebula,
.cosmos-intro.warning-phase .rem-intro-stars,
.cosmos-intro.warning-phase .rem-intro-grid,
.cosmos-intro.warning-phase .rem-intro-scanline,
.cosmos-intro.warning-phase .rem-intro-warp,
.cosmos-intro.warning-phase .rem-intro-ship,
.cosmos-intro.warning-phase .rem-intro-flash,
.cosmos-intro.warning-phase .rem-intro-brand,
.cosmos-intro.warning-phase .rem-intro-skip-hint,
.cosmos-intro.warning-phase .cosmos-intro-skip {
  display: none !important;
}

.intro-warning {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 18px;
  background: radial-gradient(80% 60% at 50% 25%, rgba(90, 170, 255, 0.16), rgba(4, 8, 20, 0.9));
  text-align: center;
}

.intro-warning h2 {
  margin: 0 0 4px;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(14px, 4vw, 18px);
  color: #ffd3d3;
  letter-spacing: 0.06em;
}

.intro-warning p {
  margin: 0;
  max-width: min(92vw, 620px);
  line-height: 1.7;
  font-size: clamp(12px, 3.2vw, 14px);
  color: #d8ecff;
}

#intro-warning-ok {
  margin-top: 8px;
  min-height: 44px;
  min-width: 180px;
}

.cosmos-intro .rem-intro-bg,
.cosmos-intro .rem-intro-nebula,
.cosmos-intro .rem-intro-stars,
.cosmos-intro .rem-intro-grid,
.cosmos-intro .rem-intro-scanline,
.cosmos-intro .rem-intro-warp,
.cosmos-intro .rem-intro-flash,
.cosmos-intro .rem-intro-brand {
  position: absolute;
  inset: 0;
}

.rem-intro-bg {
  background:
    radial-gradient(70% 50% at 22% 84%, rgba(102, 177, 255, 0.18), transparent 74%),
    radial-gradient(62% 44% at 80% 18%, rgba(147, 104, 255, 0.16), transparent 72%),
    linear-gradient(180deg, #050b18 0%, #050914 100%);
}

.rem-intro-nebula {
  opacity: 0.65;
  background:
    radial-gradient(40% 30% at 18% 70%, rgba(75, 210, 255, 0.2), transparent 75%),
    radial-gradient(42% 32% at 80% 20%, rgba(153, 116, 255, 0.17), transparent 75%);
}

.rem-intro-stars {
  opacity: 0.8;
  background-repeat: repeat;
}

.rem-intro-stars-a {
  background-image:
    radial-gradient(circle at 14% 18%, rgba(220, 245, 255, 0.88) 0 1px, transparent 1.2px),
    radial-gradient(circle at 64% 42%, rgba(184, 227, 255, 0.75) 0 1px, transparent 1.2px),
    radial-gradient(circle at 86% 76%, rgba(203, 236, 255, 0.7) 0 1px, transparent 1.2px);
  background-size: 170px 170px, 210px 210px, 240px 240px;
  animation: remIntroStarDriftA 2.8s linear infinite;
}

.rem-intro-stars-b {
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 30% 26%, rgba(190, 230, 255, 0.8) 0 1px, transparent 1.2px),
    radial-gradient(circle at 72% 60%, rgba(163, 212, 255, 0.68) 0 1px, transparent 1.2px);
  background-size: 300px 300px, 360px 360px;
  animation: remIntroStarDriftB 3.6s linear infinite;
}

.rem-intro-grid {
  opacity: 0.22;
  background:
    linear-gradient(rgba(122, 206, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 206, 255, 0.1) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.25) 18%, rgba(255, 255, 255, 0.84) 55%, transparent);
}

.rem-intro-scanline {
  opacity: 0.18;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.07) 0 1px,
    rgba(255, 255, 255, 0) 1px 3px
  );
}

.rem-intro-warp {
  inset: 0 6% 0 6%;
  pointer-events: none;
}

.rem-intro-warp i {
  position: absolute;
  left: 0;
  width: 42vw;
  height: 1px;
  opacity: 0;
  background: linear-gradient(90deg, rgba(115, 229, 255, 0), rgba(151, 238, 255, 0.78), rgba(115, 229, 255, 0));
  animation: remIntroWarp 1.1s linear infinite;
  animation-delay: .82s;
}

.rem-intro-warp i:nth-child(1) { top: 24%; animation-delay: .87s; }
.rem-intro-warp i:nth-child(2) { top: 34%; animation-delay: 1.03s; }
.rem-intro-warp i:nth-child(3) { top: 46%; animation-delay: 1.16s; }
.rem-intro-warp i:nth-child(4) { top: 58%; animation-delay: 1.28s; }
.rem-intro-warp i:nth-child(5) { top: 69%; animation-delay: 1.44s; }
.rem-intro-warp i:nth-child(6) { top: 79%; animation-delay: 1.60s; }

.rem-intro-ship {
  position: absolute;
  inset: auto auto auto auto;
  width: 86px;
  height: 54px;
  left: -20vw;
  top: 84vh;
  transform: translateZ(0);
  animation: remIntroShipFly 2.2s cubic-bezier(.22,.54,.18,1.05) forwards;
  animation-delay: .82s;
  z-index: 11;
}

.rem-intro-ship-trail {
  position: absolute;
  left: -116px;
  top: 26px;
  width: 112px;
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(120, 236, 255, 0), rgba(120, 236, 255, 0.78));
  filter: blur(0.35px);
}

.rem-intro-ship-core,
.rem-intro-ship-wing,
.rem-intro-ship-thruster {
  position: absolute;
  image-rendering: pixelated;
}

.rem-intro-ship-core {
  left: 34px;
  top: 8px;
  width: 24px;
  height: 32px;
  background:
    linear-gradient(#edfaff 0 0) 10px 4px / 4px 4px no-repeat,
    linear-gradient(#8bd8ff 0 0) 7px 10px / 10px 12px no-repeat,
    linear-gradient(#5ba5db 0 0) 5px 22px / 14px 6px no-repeat,
    linear-gradient(#2f4f86 0 0) 7px 11px / 10px 11px no-repeat;
  box-shadow: 0 0 8px rgba(139, 223, 255, 0.5);
}

.rem-intro-ship-wing {
  top: 18px;
  width: 32px;
  height: 16px;
  background:
    linear-gradient(#75ccff 0 0) 0 7px / 32px 3px no-repeat,
    linear-gradient(#2a4d84 0 0) 3px 3px / 24px 10px no-repeat;
}

.rem-intro-ship-wing.left {
  left: 4px;
  transform: skewX(-14deg);
}

.rem-intro-ship-wing.right {
  right: 4px;
  transform: skewX(14deg);
}

.rem-intro-ship-thruster {
  left: 26px;
  top: 30px;
  width: 34px;
  height: 12px;
  background:
    radial-gradient(9px 5px at 12% 50%, rgba(133, 240, 255, 0.95), transparent 75%),
    radial-gradient(9px 5px at 50% 50%, rgba(133, 240, 255, 0.95), transparent 75%),
    radial-gradient(9px 5px at 88% 50%, rgba(133, 240, 255, 0.95), transparent 75%);
  animation: remIntroThruster .22s steps(2, end) infinite;
  animation-delay: .82s;
}

.rem-intro-brand {
  display: grid;
  place-items: center;
  z-index: 12;
  opacity: 0;
  transition: opacity .24s ease;
  pointer-events: none;
}

.rem-intro-brand-logo {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(20px, 6vw, 34px);
  letter-spacing: 0.08em;
  color: #dff5ff;
  text-shadow: 0 0 14px rgba(109, 222, 255, 0.62), 0 3px 0 rgba(6, 16, 35, 0.9);
}

.cosmos-intro.show-brand .rem-intro-brand {
  opacity: 1;
}

.cosmos-intro.launch .rem-intro-brand {
  opacity: 0;
}

.rem-intro-flash {
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 55% 46%, rgba(127, 241, 255, 0.28), rgba(127, 241, 255, 0) 36%);
}

.cosmos-intro.flash .rem-intro-flash {
  animation: remIntroFlash .32s ease-out;
}

.cosmos-intro.accelerate .rem-intro-stars-a {
  animation-duration: 1.2s;
}

.cosmos-intro.accelerate .rem-intro-stars-b {
  animation-duration: 1.7s;
}

.cosmos-intro.accelerate .rem-intro-warp i {
  opacity: 0.75;
  animation-duration: 0.56s;
}

.cosmos-intro.fadeout {
  opacity: 0;
  transition: opacity .36s ease;
}

.rem-intro-skip-hint {
  position: absolute;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(8px, 2.2vw, 10px);
  letter-spacing: 0.08em;
  color: rgba(173, 220, 246, 0.9);
  text-shadow: 0 0 8px rgba(114, 211, 255, 0.34);
  z-index: 14;
  pointer-events: none;
}

.cosmos-intro-skip {
  position: absolute;
  inset: auto !important;
  right: max(10px, env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 15;
  width: auto;
  height: auto;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(143, 214, 255, 0.52);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(25, 53, 92, 0.88), rgba(13, 27, 52, 0.9));
  color: #d8efff;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
}

@keyframes remIntroShipFly {
  0% {
    transform: translate3d(0, 0, 0) scale(0.74) rotate(-11deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  58% {
    transform: translate3d(56vw, -22vh, 0) scale(0.96) rotate(-7deg);
    opacity: 1;
  }
  82% {
    transform: translate3d(90vw, -42vh, 0) scale(1.02) rotate(-8deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(116vw, -58vh, 0) scale(0.88) rotate(-9deg);
    opacity: 0;
  }
}

@keyframes remIntroStarDriftA {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: -110px 85px, -130px 104px, -160px 130px; }
}

@keyframes remIntroStarDriftB {
  from { background-position: 0 0, 0 0; }
  to { background-position: -85px 65px, -120px 96px; }
}

@keyframes remIntroWarp {
  0% { transform: translateX(-12vw) scaleX(0.4); opacity: 0; }
  18% { opacity: 0.7; }
  100% { transform: translateX(112vw) scaleX(1); opacity: 0; }
}

@keyframes remIntroThruster {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes remIntroFlash {
  0% { opacity: 0; }
  30% { opacity: 0.8; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .rem-intro-stars-a,
  .rem-intro-stars-b,
  .rem-intro-ship,
  .rem-intro-ship-thruster,
  .rem-intro-warp i {
    animation: none !important;
  }
  .rem-intro-warp,
  .rem-intro-grid,
  .rem-intro-scanline {
    opacity: 0.12;
  }
  .rem-intro-skip-hint {
    opacity: 0.85;
  }
}

/* ===== Remenatry Menu V2 (scoped, non-breaking) ===== */
#menu-screen.main-menu--premium.rem-menu-v2 {
  --rm-bg-0: #060b18;
  --rm-bg-1: #0e1730;
  --rm-bg-2: #18274a;
  --rm-panel: rgba(15, 29, 58, 0.86);
  --rm-panel-2: rgba(12, 24, 47, 0.92);
  --rm-line: rgba(131, 210, 255, 0.42);
  --rm-line-strong: rgba(182, 232, 255, 0.72);
  --rm-text: #ecf7ff;
  --rm-sub: #abcce8;
  --rm-cyan: #7dd8ff;
  --rm-gold: #ffd596;
  --rm-magenta: #d9a4ff;
  background:
    radial-gradient(95% 65% at 50% 8%, rgba(73, 143, 255, 0.16), transparent 72%),
    radial-gradient(45% 28% at 82% 20%, rgba(166, 108, 255, 0.14), transparent 76%),
    linear-gradient(180deg, var(--rm-bg-2), var(--rm-bg-1) 44%, var(--rm-bg-0));
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-menu {
  width: min(96vw, 760px);
  border-radius: 18px;
  border: 1px solid var(--rm-line);
  background:
    linear-gradient(180deg, rgba(14, 24, 48, 0.82), rgba(8, 15, 32, 0.88)),
    radial-gradient(64% 44% at 50% 20%, rgba(118, 208, 255, 0.14), transparent 76%);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(186, 233, 255, 0.08);
  padding: 12px;
  gap: 10px;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-premium-bg__frame::before,
#menu-screen.main-menu--premium.rem-menu-v2 .menu-premium-bg__frame::after {
  border-color: rgba(130, 209, 255, 0.24);
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(132, 210, 255, 0.3);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(20, 38, 74, 0.86), rgba(11, 22, 42, 0.9));
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-header__label {
  font-size: 8px;
  letter-spacing: 0.11em;
  color: #8fc4ea;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-header__value {
  font-size: clamp(11px, 2.9vw, 14px);
  font-weight: 700;
  color: var(--rm-text);
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-header__settings {
  min-width: 42px;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(140, 209, 255, 0.48);
  background: linear-gradient(180deg, rgba(36, 62, 105, 0.88), rgba(16, 33, 60, 0.9));
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-currency {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-home-resource,
#menu-screen.main-menu--premium.rem-menu-v2 .menu-home-rank {
  min-height: 54px;
  border: 1px solid rgba(133, 206, 255, 0.34);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(18, 35, 68, 0.86), rgba(11, 21, 40, 0.9));
  padding: 6px 8px;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-home-resource-value,
#menu-screen.main-menu--premium.rem-menu-v2 .menu-home-rank-value {
  font-size: clamp(14px, 4vw, 18px);
  letter-spacing: 0.03em;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-title {
  margin: 4px 0 0;
  font-size: clamp(16px, 5vw, 22px);
  letter-spacing: 0.08em;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-subtitle {
  margin-top: -2px;
  font-size: clamp(9px, 2.5vw, 11px);
  color: #9dc8e7;
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-hangar {
  height: clamp(116px, 22vh, 168px);
  border-radius: 14px;
  border: 1px solid rgba(140, 216, 255, 0.28);
  background:
    radial-gradient(56% 42% at 50% 70%, rgba(113, 211, 255, 0.2), transparent 78%),
    linear-gradient(180deg, rgba(13, 28, 56, 0.72), rgba(8, 15, 30, 0.84));
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-hangar-stage__pad {
  width: 210px;
  height: 38px;
  bottom: 18px;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-hangar-stage__beam {
  opacity: 0.72;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-hangar-info {
  margin-top: 2px;
  font-size: clamp(9px, 2.3vw, 11px);
  color: #b1d9f6;
  letter-spacing: 0.05em;
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-hero {
  border: 1px solid rgba(141, 215, 255, 0.3);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(17, 35, 67, 0.8), rgba(10, 19, 37, 0.86));
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-section-title {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #9ed0f0;
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-mode-grid-main,
#menu-screen.main-menu--premium.rem-menu-v2 .rem-mode-grid-sub,
#menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-facility-list,
#menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-system-list {
  gap: 8px;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-btn {
  min-height: 78px;
  border-radius: 12px;
  border: 1px solid var(--rm-line);
  background: linear-gradient(180deg, rgba(24, 46, 86, 0.9), rgba(12, 24, 45, 0.94));
  box-shadow: inset 0 0 0 1px rgba(194, 235, 255, 0.08);
  padding: 8px 10px;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-btn strong {
  font-size: clamp(11px, 3vw, 13px);
  letter-spacing: 0.03em;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-btn span {
  font-size: clamp(9px, 2.4vw, 11px);
  color: var(--rm-sub);
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-mode-meta {
  margin-top: 5px;
  font-size: 8px;
  color: #9ecdee;
}

#menu-screen.main-menu--premium.rem-menu-v2 .mode-grid-main .menu-btn {
  min-height: 90px;
}

#menu-screen.main-menu--premium.rem-menu-v2 .btn-stage {
  border-color: rgba(122, 221, 255, 0.58);
}

#menu-screen.main-menu--premium.rem-menu-v2 .btn-endless {
  border-color: rgba(207, 166, 255, 0.52);
}

#menu-screen.main-menu--premium.rem-menu-v2 .btn-cosmo {
  border-color: rgba(255, 169, 224, 0.48);
}

#menu-screen.main-menu--premium.rem-menu-v2 .btn-genkyo {
  border-color: rgba(233, 154, 255, 0.48);
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-mode-card-abyss {
  border-color: rgba(227, 133, 178, 0.62);
  background:
    radial-gradient(80% 70% at 15% 0%, rgba(109, 44, 68, 0.28), transparent 74%),
    linear-gradient(180deg, rgba(52, 27, 58, 0.92), rgba(24, 12, 36, 0.95));
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-mode-card-abyss.rem-abyss-locked {
  filter: saturate(0.72) brightness(0.9);
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-abyss-unlock {
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(223, 138, 181, 0.42);
  border-radius: 8px;
  background: rgba(34, 16, 38, 0.76);
  display: grid;
  gap: 2px;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-abyss-unlock span {
  display: block;
  font-size: 8px;
  line-height: 1.35;
  color: #f3d4e4;
  letter-spacing: 0.03em;
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-quick-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-quick-actions .menu-dock-btn {
  min-height: 60px;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-badge {
  top: 5px;
  right: 5px;
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-status-grid {
  gap: 8px;
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-weekly-status,
#menu-screen.main-menu--premium.rem-menu-v2 .daily-mission-panel {
  border-radius: 12px;
  border: 1px solid rgba(134, 205, 255, 0.38);
  background: linear-gradient(180deg, rgba(14, 28, 56, 0.86), rgba(9, 18, 35, 0.92));
}

#menu-screen.main-menu--premium.rem-menu-v2 .daily-mission-panel h3 {
  font-size: 11px;
  letter-spacing: 0.08em;
}

#menu-screen.main-menu--premium.rem-menu-v2 .daily-mission-panel p,
#menu-screen.main-menu--premium.rem-menu-v2 .menu-weekly-status {
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.4;
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-bottom-nav {
  position: sticky;
  bottom: max(0px, env(safe-area-inset-bottom));
  z-index: 6;
  border: 1px solid rgba(130, 206, 255, 0.36);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15, 30, 57, 0.9), rgba(9, 17, 35, 0.94));
}

#menu-screen.main-menu--premium.rem-menu-v2 .rem-bottom-nav .menu-nav-item {
  min-height: 44px;
  font-size: clamp(8px, 2vw, 9px);
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-btn:hover,
#menu-screen.main-menu--premium.rem-menu-v2 .menu-btn:focus-visible {
  border-color: var(--rm-line-strong);
  filter: brightness(1.06);
}

#menu-screen.main-menu--premium.rem-menu-v2 .menu-btn:active,
#menu-screen.main-menu--premium.rem-menu-v2 .menu-nav-item:active,
#menu-screen.main-menu--premium.rem-menu-v2 .menu-header__settings:active {
  transform: translateY(1px) scale(0.992);
}

@media (max-width: 480px) {
  #menu-screen.main-menu--premium.rem-menu-v2 .rem-menu {
    width: min(98vw, 760px);
    padding: 10px;
    gap: 8px;
  }
  #menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-currency {
    grid-template-columns: 1fr;
  }
  #menu-screen.main-menu--premium.rem-menu-v2 .menu-home-resource,
  #menu-screen.main-menu--premium.rem-menu-v2 .menu-home-rank {
    min-height: 50px;
  }
  #menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  #menu-screen.main-menu--premium.rem-menu-v2 .rem-menu {
    width: min(98vw, 920px);
  }
  #menu-screen.main-menu--premium.rem-menu-v2 .rem-menu-hangar {
    height: 100px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #menu-screen.main-menu--premium.rem-menu-v2 .menu-hangar-stage__beam,
  #menu-screen.main-menu--premium.rem-menu-v2 .menu-hangar-ship,
  #menu-screen.main-menu--premium.rem-menu-v2 .menu-badge {
    animation: none !important;
  }
}

/* ===== Battle UI Premium (lightweight, no enemy-hit effects) ===== */
#game-screen {
  --rb-line: rgba(137, 220, 255, 0.65);
  --rb-panel: rgba(9, 22, 43, 0.72);
  --rb-text: #e6f5ff;
  --rb-sub: #9fd6ff;
}

#game-screen .rem-battle-frame {
  position: absolute;
  inset: 8px;
  z-index: 2;
  pointer-events: none;
}

#game-screen .rem-battle-frame .corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(130, 214, 255, 0.52);
  border-style: solid;
  border-width: 0;
}
#game-screen .rem-battle-frame .corner.tl { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
#game-screen .rem-battle-frame .corner.tr { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
#game-screen .rem-battle-frame .corner.bl { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
#game-screen .rem-battle-frame .corner.br { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }

#game-screen .rem-battle-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 72% at 50% 108%, rgba(6, 12, 27, 0.05), rgba(2, 5, 12, 0.38)),
    radial-gradient(70% 32% at 50% -10%, rgba(104, 195, 255, 0.12), transparent 70%);
}

#game-screen .hud,
#game-screen .boss-hud,
#game-screen #abyss-hud {
  border: 1px solid var(--rb-line) !important;
  border-radius: 12px;
  background: var(--rb-panel);
  backdrop-filter: blur(2px);
  box-shadow: inset 0 0 0 1px rgba(184, 231, 255, 0.08), 0 6px 16px rgba(0, 0, 0, 0.24);
}

#game-screen .hud-top {
  top: calc(6px + env(safe-area-inset-top));
  padding: 6px 7px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

#game-screen .hud-block {
  min-width: 0;
}

#game-screen .hud-block .label {
  font-size: 7px;
  color: var(--rb-sub);
  letter-spacing: 0.08em;
}

#game-screen #score-value,
#game-screen #run-hi-value,
#game-screen #credit-value,
#game-screen #stage-value,
#game-screen #mode-value {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(9px, 2.5vw, 11px);
  color: var(--rb-text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#game-screen #mode-value {
  color: #b7dcff;
}

#game-screen .boss-hud {
  top: calc(50px + env(safe-area-inset-top));
  padding: 6px 8px;
}

#game-screen .status-text {
  z-index: 7;
  border-radius: 11px;
  border-color: rgba(255, 169, 198, 0.76);
  background: rgba(22, 10, 28, 0.82);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

#game-screen .status-text.boss-warning {
  border-color: rgba(255, 132, 170, 0.88);
  color: #ffd3e1;
}

#game-screen .status-text.ready-text {
  border-color: rgba(136, 221, 255, 0.82);
}

#game-screen .rem-battle-warning {
  position: absolute;
  top: 31%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  padding: 7px 10px;
  border: 1px solid rgba(255, 132, 170, 0.82);
  border-radius: 10px;
  background: rgba(45, 12, 30, 0.8);
  color: #ffd7e5;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(9px, 2.5vw, 11px);
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
}
#game-screen .rem-battle-warning.show { opacity: 1; transition: opacity .12s linear; }

#game-screen .hud-bottom {
  bottom: calc(6px + env(safe-area-inset-bottom));
  padding: 7px;
  gap: 5px;
}

#game-screen .hp-head,
#game-screen .dust-head {
  font-size: 9px;
}

#game-screen .bottom-row {
  display: grid;
  gap: 5px;
}

#game-screen .weapon-panel {
  border: 1px solid rgba(126, 209, 255, 0.44);
  border-radius: 9px;
  padding: 4px 6px;
  background: rgba(8, 19, 39, 0.75);
}

#game-screen #weapon-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(10px, 2.8vw, 12px);
}

#game-screen .item-panel {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

#game-screen .item-btn {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(135, 206, 255, 0.48);
  background: linear-gradient(180deg, rgba(29, 55, 91, 0.9), rgba(16, 30, 54, 0.92));
  font-size: clamp(8px, 2.2vw, 10px);
}

#game-screen .item-btn:disabled {
  opacity: 0.48;
  filter: saturate(0.55);
}

#game-screen .special-skill-btn {
  width: 88px;
  height: 88px;
  right: 8px;
  bottom: calc(90px + env(safe-area-inset-bottom));
  border-width: 2px;
}

#game-screen .floating-btn {
  border-radius: 10px;
  border: 1px solid rgba(136, 207, 255, 0.55);
  background: linear-gradient(180deg, rgba(30, 56, 96, 0.86), rgba(16, 30, 54, 0.9));
  min-height: 42px;
}

#game-screen .pause-btn {
  top: calc(126px + env(safe-area-inset-top));
}

#game-screen.rem-battle-paused::before {
  content: "PAUSED";
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  color: #e9f6ff;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(14px, 4vw, 18px);
  letter-spacing: 0.08em;
  background: rgba(3, 8, 20, 0.28);
  pointer-events: none;
}

#game-screen.rem-battle-hitflash::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  background: radial-gradient(70% 60% at 50% 50%, rgba(255, 92, 130, 0), rgba(255, 92, 130, 0.14));
}

@media (max-width: 420px) {
  #game-screen .hud-top {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #game-screen .hud-top .hud-block:nth-child(4),
  #game-screen .hud-top .hud-block:nth-child(5) {
    grid-column: span 1;
  }
  #game-screen .special-skill-btn {
    width: 80px;
    height: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #game-screen .status-text,
  #game-screen .rem-battle-warning,
  #game-screen .special-skill-btn.ready {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== 8bit Button Refresh ===== */
#app .primary-btn,
#app .menu-btn,
#app .shop-btn,
#app .stage-btn,
#app .item-btn,
#app .gacha-roll-btn,
#app .gacha-banner-btn,
#app .sub-link-btn,
#app .floating-btn {
  border-radius: 0 !important;
  border-width: 2px !important;
  border-style: solid !important;
  border-color: #8fdfff !important;
  background: linear-gradient(180deg, #24508f 0%, #16396c 55%, #122d55 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(220, 246, 255, 0.22),
    inset 1px 0 0 rgba(220, 246, 255, 0.16),
    inset -1px -1px 0 rgba(8, 18, 38, 0.62),
    0 0 0 1px rgba(61, 124, 184, 0.42),
    0 4px 0 rgba(8, 16, 34, 0.72) !important;
  font-family: "Press Start 2P", monospace !important;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(8, 18, 40, 0.9);
}

#app .primary-btn:hover,
#app .menu-btn:hover,
#app .shop-btn:hover,
#app .stage-btn:hover,
#app .item-btn:hover,
#app .gacha-roll-btn:hover,
#app .gacha-banner-btn:hover,
#app .sub-link-btn:hover,
#app .floating-btn:hover {
  filter: brightness(1.08) saturate(1.04);
}

#app .primary-btn:active,
#app .menu-btn:active,
#app .shop-btn:active,
#app .stage-btn:active,
#app .item-btn:active,
#app .gacha-roll-btn:active,
#app .gacha-banner-btn:active,
#app .sub-link-btn:active,
#app .floating-btn:active {
  transform: translateY(2px) !important;
  box-shadow:
    inset 0 1px 0 rgba(220, 246, 255, 0.2),
    inset 1px 0 0 rgba(220, 246, 255, 0.14),
    inset -1px -1px 0 rgba(8, 18, 38, 0.62),
    0 0 0 1px rgba(61, 124, 184, 0.42),
    0 2px 0 rgba(8, 16, 34, 0.72) !important;
}

#app .menu-btn strong,
#app .menu-btn span,
#app .gacha-banner-btn strong,
#app .gacha-banner-btn span,
#app .sub-link-btn strong,
#app .sub-link-btn span {
  text-shadow: 0 1px 0 rgba(8, 18, 40, 0.9);
}

/* ===== Hotfix 2026-05-03 ===== */
.cosmos-intro:not(.warning-phase) .intro-warning {
  display: none !important;
}

#gacha-open-screen .gacha-open-summary,
#gacha-open-screen .gacha-result-name,
#gacha-open-screen .gacha-result-copy,
#gacha-open-screen .gacha-result-kind {
  color: #eef9ff !important;
  opacity: 1 !important;
  visibility: visible !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: none !important;
  mix-blend-mode: normal !important;
}

@media (max-width: 420px) {
  #game-screen .hud-top {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 3px !important;
  }

  #game-screen #score-value,
  #game-screen #run-hi-value,
  #game-screen #credit-value,
  #game-screen #stage-value,
  #game-screen #mode-value {
    font-size: 9px !important;
  }
}

/* ===== Release Polish Pass 2026-05-11 =====
   Safe visual layer: no save data, ranking, gacha rate, or battle logic changes. */
:root {
  --rem-ink: #030711;
  --rem-space: #071226;
  --rem-panel-a: rgba(9, 21, 43, 0.92);
  --rem-panel-b: rgba(13, 35, 70, 0.84);
  --rem-cyan: #7aefff;
  --rem-cyan-soft: rgba(122, 239, 255, 0.22);
  --rem-blue: #3f8dff;
  --rem-pink: #ff8fd2;
  --rem-gold: #ffd27a;
  --rem-green: #98ffc8;
  --rem-border: rgba(132, 224, 255, 0.64);
  --rem-shadow: rgba(0, 0, 0, 0.42);
  --rem-font-ui: "DotGothic16", "Yu Gothic", "Meiryo", monospace;
  --rem-font-pixel: "Press Start 2P", "DotGothic16", monospace;
}

html {
  background:
    radial-gradient(circle at 20% 0%, rgba(72, 142, 255, 0.16), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(255, 116, 200, 0.12), transparent 36%),
    linear-gradient(180deg, #02050d 0%, #061128 55%, #030711 100%);
}

body {
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: none;
}

.screen.active:not(#game-screen) {
  background:
    radial-gradient(circle at 50% -10%, rgba(126, 235, 255, 0.12), transparent 42%),
    radial-gradient(circle at 12% 88%, rgba(255, 146, 216, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(3, 8, 20, 0.96), rgba(5, 13, 30, 0.98));
}

.screen.screen-entering:not(#game-screen) > * {
  animation: rem-screen-rise 0.34s cubic-bezier(.2, .8, .24, 1) both;
}

@keyframes rem-screen-rise {
  from { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.992); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

#title-screen,
#menu-screen,
.panel-screen {
  padding-top: max(8px, env(safe-area-inset-top));
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

#title-screen .title-wrap,
#menu-screen .menu-wrap,
.panel-screen .panel-wrap {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--rem-border) !important;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 18%),
    radial-gradient(circle at 16% 0%, rgba(122, 239, 255, 0.12), transparent 38%),
    linear-gradient(180deg, var(--rem-panel-b), var(--rem-panel-a)) !important;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(10, 40, 78, 0.72),
    inset 0 0 0 1px rgba(226, 248, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

#title-screen .title-wrap::before,
#menu-screen .menu-wrap::before,
.panel-screen .panel-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px),
    linear-gradient(90deg, transparent, rgba(120, 239, 255, 0.06), transparent);
  opacity: 0.42;
}

#title-screen .title-wrap {
  width: min(96vw, 430px) !important;
  max-height: calc(100dvh - max(14px, env(safe-area-inset-top)) - max(14px, env(safe-area-inset-bottom))) !important;
  padding: clamp(12px, 3vw, 18px) !important;
}

#title-screen .logo,
#title-screen .neo-logo {
  max-width: 100%;
  overflow-wrap: anywhere;
  letter-spacing: clamp(0.02em, 0.8vw, 0.1em);
  color: #f3fbff;
  text-shadow:
    0 0 8px rgba(130, 235, 255, 0.72),
    0 3px 0 rgba(10, 20, 42, 0.95);
}

#title-screen .neo-event-card,
#title-screen .neo-balance-card,
.title-news-ticker {
  border: 1px solid rgba(130, 221, 255, 0.42) !important;
  border-radius: 10px;
  background: rgba(8, 19, 42, 0.72) !important;
}

#menu-screen {
  align-items: stretch !important;
  justify-content: center !important;
}

#menu-screen .menu-wrap {
  width: min(100vw, 520px) !important;
  min-height: 100dvh;
  max-height: none !important;
  border-radius: 0;
  border-left: 0 !important;
  border-right: 0 !important;
  padding:
    max(12px, env(safe-area-inset-top))
    clamp(10px, 3vw, 16px)
    calc(84px + env(safe-area-inset-bottom)) !important;
}

#menu-screen .menu-header,
#menu-screen .menu-home-topbar,
#menu-screen .menu-hero-card,
#menu-screen .menu-home-status-grid > *,
#menu-screen .daily-mission-panel {
  border: 1px solid rgba(133, 224, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(25, 59, 105, 0.68), rgba(9, 22, 46, 0.82));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
}

#menu-screen .menu-section-title,
.panel-wrap h3,
.record-card h4 {
  letter-spacing: 0.06em;
  color: #c9f5ff;
  text-shadow: 0 0 8px rgba(91, 213, 255, 0.34);
}

.primary-btn,
.menu-btn,
.shop-btn,
.stage-btn,
.item-btn,
.weapon-card,
.gacha-roll-btn,
.gacha-banner-btn,
.sub-link-btn,
.floating-btn,
.menu-nav-item {
  position: relative;
  overflow: hidden;
  min-height: 44px;
  border-color: rgba(139, 228, 255, 0.82) !important;
  background:
    linear-gradient(180deg, rgba(42, 93, 150, 0.96), rgba(19, 48, 91, 0.96) 56%, rgba(11, 32, 65, 0.98)) !important;
  color: #eefaff !important;
  -webkit-text-fill-color: currentColor;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.88);
  transition: transform 0.12s ease, filter 0.12s ease, border-color 0.12s ease;
}

.primary-btn::after,
.menu-btn::after,
.shop-btn::after,
.stage-btn::after,
.gacha-roll-btn::after,
.gacha-banner-btn::after,
.sub-link-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.15) 48%, transparent 62%);
  transform: translateX(-120%);
  opacity: 0;
}

.ui-press-feedback::after {
  animation: rem-button-sheen 0.24s ease-out;
}

@keyframes rem-button-sheen {
  from { opacity: 0.9; transform: translateX(-120%); }
  to { opacity: 0; transform: translateX(120%); }
}

.primary-btn:focus-visible,
.menu-btn:focus-visible,
.shop-btn:focus-visible,
.stage-btn:focus-visible,
.item-btn:focus-visible,
.weapon-card:focus-visible,
.gacha-roll-btn:focus-visible,
.gacha-banner-btn:focus-visible,
.sub-link-btn:focus-visible,
.floating-btn:focus-visible,
.menu-nav-item:focus-visible {
  outline: 2px solid #fff7bf;
  outline-offset: 2px;
}

.primary-btn:disabled,
.menu-btn:disabled,
.shop-btn:disabled,
.stage-btn:disabled,
.item-btn:disabled,
.gacha-roll-btn:disabled,
.gacha-banner-btn:disabled,
.sub-link-btn:disabled {
  opacity: 0.48;
  filter: grayscale(0.45) brightness(0.72);
}

#menu-screen .menu-btn,
.stage-item,
.shop-item,
.record-card,
.weapon-card,
.protocol-detail,
.gacha-progress-card,
.gacha-stat,
.world-entry,
.mode-lobby-season,
.mode-lobby-rewards,
.mode-lobby-ranking {
  border: 1px solid rgba(128, 218, 255, 0.5) !important;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(24, 56, 103, 0.82), rgba(10, 24, 50, 0.88)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.22);
}

#menu-screen .mode-grid-main .menu-btn {
  min-height: 104px !important;
}

#menu-screen .mode-grid-sub .menu-btn,
#menu-screen .menu-list .menu-btn,
#menu-screen .menu-home-dock .menu-btn {
  min-height: 66px !important;
}

#menu-screen .menu-btn strong,
.menu-btn strong,
.shop-btn,
.primary-btn,
.gacha-roll-btn,
.gacha-banner-btn {
  line-height: 1.45;
}

#menu-screen .menu-btn span,
.record-line,
.panel-note,
.shop-item-meta,
.weapon-card-meta {
  line-height: 1.6;
}

#menu-screen .menu-btn.locked-item,
#menu-screen .menu-btn[disabled],
.locked-item {
  border-color: rgba(97, 118, 150, 0.48) !important;
  background:
    linear-gradient(180deg, rgba(21, 29, 48, 0.9), rgba(8, 13, 25, 0.94)) !important;
  color: rgba(210, 226, 244, 0.68) !important;
}

.stage-select-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stage-item,
.stage-btn {
  aspect-ratio: auto !important;
  min-height: 56px;
  align-content: center;
}

.stage-brief-boss-card,
.stage-brief-reward-card,
.stage-clear-wrap .record-card {
  border-color: rgba(255, 212, 133, 0.5) !important;
}

#gacha-screen .panel-wrap,
#gacha-open-screen .panel-wrap {
  border-color: rgba(255, 211, 126, 0.62) !important;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 214, 126, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(16, 26, 56, 0.92), rgba(8, 15, 32, 0.95)) !important;
}

#gacha-screen .gacha-feature-card {
  border: 1px solid rgba(255, 218, 141, 0.72);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 206, 118, 0.08), transparent 28%),
    rgba(8, 19, 42, 0.78);
}

#gacha-open-screen .gacha-open-result-grid {
  gap: 8px;
}

#gacha-open-screen .gacha-result-card {
  min-height: 104px;
  color: #f1fbff !important;
  -webkit-text-fill-color: currentColor !important;
  background:
    linear-gradient(180deg, rgba(29, 62, 112, 0.9), rgba(9, 20, 42, 0.94)) !important;
}

#gacha-open-screen .gacha-result-name {
  display: block;
  min-height: 2.8em;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.45;
}

#game-screen .hud,
#game-screen .boss-hud,
#game-screen #abyss-hud {
  border: 1px solid rgba(137, 226, 255, 0.52);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(9, 21, 44, 0.78), rgba(4, 12, 28, 0.84));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 18px rgba(0, 0, 0, 0.28);
  backdrop-filter: none;
}

#game-screen .hud-top {
  left: 8px;
  right: 8px;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 4px !important;
}

#game-screen .hud-block {
  min-width: 0 !important;
  overflow: hidden;
}

#game-screen .hud-block .label,
#game-screen #score-value,
#game-screen #run-hi-value,
#game-screen #credit-value,
#game-screen #stage-value,
#game-screen #mode-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#game-screen .hud-bottom {
  left: 8px;
  right: 8px;
  border-color: rgba(133, 224, 255, 0.58);
}

#game-screen .item-btn,
#game-screen .floating-btn,
#game-screen .special-skill-btn {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 6px 14px rgba(0, 0, 0, 0.28) !important;
}

#game-screen .special-skill-btn.ready {
  border-color: rgba(255, 221, 125, 0.95) !important;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 241, 155, 0.28), transparent 52%),
    linear-gradient(180deg, rgba(91, 69, 28, 0.94), rgba(30, 25, 42, 0.96)) !important;
}

#game-screen.special-active::before {
  opacity: 0.5;
}

.reward-banner,
.toast,
.title-badge,
.menu-badge {
  color: #06111d;
  background: linear-gradient(180deg, #fff1ac, #ffc764);
  border: 1px solid rgba(255, 247, 190, 0.9);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

@media (max-width: 430px) {
  .stage-select-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  #menu-screen .mode-grid-main,
  #menu-screen .mode-grid-sub,
  #menu-screen .menu-home-dock {
    gap: 7px;
  }

  #menu-screen .menu-btn strong {
    font-size: 10px !important;
  }

  #menu-screen .menu-btn span {
    font-size: 8px !important;
  }

  #game-screen .hud-top {
    left: 5px;
    right: 5px;
    gap: 3px !important;
  }
}

@media (max-width: 370px) {
  #title-screen .logo,
  #title-screen .neo-logo {
    font-size: clamp(20px, 8vw, 32px) !important;
  }

  .stage-select-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #game-screen .hud-block .label {
    font-size: 7px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen.screen-entering:not(#game-screen) > *,
  .ui-press-feedback::after {
    animation: none !important;
  }

  .primary-btn,
  .menu-btn,
  .shop-btn,
  .stage-btn,
  .item-btn,
  .weapon-card,
  .gacha-roll-btn,
  .gacha-banner-btn,
  .sub-link-btn,
  .floating-btn,
  .menu-nav-item {
    transition: none !important;
  }
}

/* ===== Final mobile sizing guard =====
   Keep this final so historical visual layers cannot reintroduce stretched rows. */
#menu-screen.main-menu--premium .mode-grid-main,
#menu-screen.main-menu--premium .mode-grid-sub,
#menu-screen.main-menu--premium .menu-home-dock,
#menu-screen.main-menu--premium .menu-list,
#gacha-screen .gacha-banner-select,
#gacha-screen .gacha-action-row {
  align-items: start !important;
}

#menu-screen.main-menu--premium .mode-grid-main .menu-btn,
#menu-screen.main-menu--premium .mode-grid-sub .menu-btn,
#menu-screen.main-menu--premium .menu-home-dock .menu-btn,
#menu-screen.main-menu--premium .menu-list .menu-btn {
  align-self: start !important;
  height: auto !important;
}

#menu-screen.main-menu--premium .mode-grid-main .menu-btn:not(.rem-mode-card-abyss) {
  min-height: 86px !important;
  max-height: 86px !important;
}

#menu-screen.main-menu--premium .mode-grid-sub .menu-btn:not(.rem-mode-card-abyss),
#menu-screen.main-menu--premium .rem-mode-card-abyss:not(.rem-abyss-locked) {
  min-height: 72px !important;
  max-height: 72px !important;
}

#menu-screen.main-menu--premium .menu-home-dock .menu-dock-btn {
  min-height: 58px !important;
  max-height: 58px !important;
  padding-block: 6px !important;
}

#menu-screen.main-menu--premium .menu-list .menu-btn {
  min-height: 64px !important;
  max-height: 64px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

#gacha-screen .gacha-banner-btn {
  align-self: start !important;
  min-height: 44px !important;
  height: 44px !important;
  max-height: 44px !important;
  padding: 5px 7px !important;
  line-height: 1.15 !important;
  white-space: normal !important;
}

#gacha-screen .gacha-roll-btn {
  align-self: start !important;
  min-height: 54px !important;
  height: 54px !important;
  max-height: 54px !important;
}

#app .panel-back-btn,
#app #gacha-open-skip-btn,
#app #lobby-challenge-btn,
#app #stage-brief-start-btn,
#app #stage-clear-close-btn,
#app #tutorial-guide-close-btn {
  align-self: start !important;
  min-height: 48px !important;
  height: 48px !important;
  max-height: 48px !important;
}

#menu-screen.main-menu--premium .menu-bottom-nav .menu-nav-item {
  min-height: 46px !important;
  height: 46px !important;
  max-height: 46px !important;
  padding: 6px 4px !important;
}

@media (max-width: 390px) {
  #menu-screen.main-menu--premium .mode-grid-main .menu-btn:not(.rem-mode-card-abyss) {
    min-height: 80px !important;
    max-height: 80px !important;
  }

  #menu-screen.main-menu--premium .mode-grid-sub .menu-btn:not(.rem-mode-card-abyss),
  #menu-screen.main-menu--premium .rem-mode-card-abyss:not(.rem-abyss-locked) {
    min-height: 68px !important;
    max-height: 68px !important;
  }

  #menu-screen.main-menu--premium .menu-list .menu-btn {
    min-height: 60px !important;
    max-height: 60px !important;
  }
}

/* ===== Battle quick-action layout guard =====
   These two controls are direct game-screen children.  Keep them independent
   from historical grid/flex button styles so they can never stretch over the
   combat canvas. */
#game-screen > #back-to-menu-btn.floating-btn,
#game-screen > #pause-btn.floating-btn {
  position: absolute !important;
  inset: auto max(8px, env(safe-area-inset-right)) auto auto !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto !important;
  place-content: center !important;
  align-items: center !important;
  justify-items: center !important;
  width: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  margin: 0 !important;
  padding: 5px 6px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  line-height: 1.05 !important;
  aspect-ratio: auto !important;
  pointer-events: auto !important;
  z-index: 36 !important;
}

#game-screen > #back-to-menu-btn.floating-btn {
  top: calc(92px + env(safe-area-inset-top)) !important;
  transform: none !important;
}

#game-screen > #pause-btn.floating-btn {
  top: calc(140px + env(safe-area-inset-top)) !important;
  transform: none !important;
}

#game-screen > #back-to-menu-btn.floating-btn::after {
  display: block !important;
  margin-top: 2px !important;
  font-size: 7px !important;
  line-height: 1 !important;
}

@media (max-width: 390px) {
  #game-screen > #back-to-menu-btn.floating-btn,
  #game-screen > #pause-btn.floating-btn {
    right: max(6px, env(safe-area-inset-right)) !important;
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
  }
}

/* ========================================================================
   REMENATRY HOME / COMMAND DECK
   A final, isolated menu layer.  It deliberately comes after the legacy
   visual passes so the home screen keeps one clear mobile-game hierarchy.
   ======================================================================== */
#menu-screen.main-menu--premium.rem-menu-v3 {
  --home-ink: #050914;
  --home-deep: #0a1530;
  --home-panel: rgba(11, 26, 55, 0.94);
  --home-panel-strong: rgba(16, 39, 78, 0.97);
  --home-line: rgba(116, 209, 255, 0.42);
  --home-line-strong: rgba(168, 235, 255, 0.9);
  --home-text: #edf9ff;
  --home-sub: #9fc7e2;
  --home-cyan: #75dcff;
  --home-gold: #ffd98b;
  --home-pink: #ff9dc9;
  overflow-x: clip;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  background:
    radial-gradient(90% 42% at 50% -6%, rgba(64, 160, 255, 0.2), transparent 70%),
    radial-gradient(54% 28% at 100% 18%, rgba(170, 87, 255, 0.12), transparent 72%),
    linear-gradient(180deg, #0b1939 0%, #071126 35%, var(--home-ink) 100%) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu {
  position: relative;
  isolation: isolate;
  width: min(100%, 680px) !important;
  min-height: 100%;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 12px calc(84px + env(safe-area-inset-bottom)) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-premium-bg,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-fx-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-premium-bg__grid {
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(108, 209, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 209, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, black, transparent 76%);
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-premium-bg__scanline {
  opacity: 0.1;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.28) 0 1px, transparent 1px 5px);
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-premium-bg__vignette {
  background: radial-gradient(ellipse at center, transparent 43%, rgba(0, 4, 14, 0.55) 100%);
}

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto 42px;
  align-items: center;
  gap: 7px;
  min-height: 60px;
  padding: 8px 9px !important;
  border: 1px solid var(--home-line) !important;
  border-radius: 8px !important;
  background:
    linear-gradient(90deg, rgba(41, 104, 166, 0.24), transparent 35%),
    linear-gradient(180deg, rgba(16, 42, 84, 0.95), rgba(6, 17, 39, 0.96)) !important;
  box-shadow: inset 0 1px rgba(220, 248, 255, 0.08), 0 8px 22px rgba(0, 0, 0, 0.18) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-header__pilot,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-header__meter {
  min-width: 0;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-header__label,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-resource-label,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-rank-label {
  margin: 0 0 3px !important;
  font-family: var(--rem-display-font), monospace;
  font-size: 8px !important;
  line-height: 1;
  letter-spacing: 0.11em;
  color: #87bddd !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-header__value {
  margin: 0 !important;
  overflow: hidden;
  color: var(--home-text) !important;
  font-family: var(--rem-display-font), monospace;
  font-size: clamp(12px, 3.6vw, 16px) !important;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-header__settings {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border: 1px solid rgba(141, 219, 255, 0.62) !important;
  border-radius: 6px !important;
  background: linear-gradient(180deg, rgba(48, 106, 171, 0.94), rgba(15, 38, 77, 0.97)) !important;
  color: #e8f8ff !important;
  font-size: 17px !important;
  line-height: 1;
}

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-currency {
  display: grid !important;
  grid-template-columns: 1.05fr .8fr 1.15fr;
  gap: 6px !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-resource,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-rank {
  min-width: 0;
  min-height: 54px !important;
  padding: 7px 8px !important;
  border: 1px solid rgba(112, 196, 255, 0.3) !important;
  border-radius: 7px !important;
  background: linear-gradient(180deg, rgba(18, 44, 86, 0.82), rgba(7, 19, 43, 0.9)) !important;
  box-shadow: inset 0 1px rgba(225, 249, 255, 0.05) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-resource-value,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-rank-value {
  display: block;
  margin: 0 !important;
  overflow: hidden;
  color: var(--home-gold) !important;
  font-family: var(--rem-display-font), monospace;
  font-size: clamp(11px, 3.3vw, 15px) !important;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-rank-value { color: var(--home-cyan) !important; }

#menu-screen.main-menu--premium.rem-menu-v3 .menu-title,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-subtitle {
  display: none !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-hangar {
  position: relative;
  height: clamp(150px, 26vh, 198px) !important;
  min-height: 150px !important;
  overflow: hidden;
  border: 1px solid rgba(126, 213, 255, 0.42) !important;
  border-radius: 10px !important;
  background:
    radial-gradient(31% 55% at 50% 58%, rgba(100, 226, 255, 0.28), transparent 72%),
    linear-gradient(90deg, rgba(41, 137, 216, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(16, 41, 80, 0.87), rgba(6, 14, 34, 0.96)) !important;
  background-size: auto, 22px 22px, auto !important;
  box-shadow: inset 0 0 0 1px rgba(212, 249, 255, 0.05), 0 12px 30px rgba(0, 0, 0, 0.24) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-hangar::before,
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-hangar::after {
  position: absolute;
  z-index: 1;
  top: 12px;
  font-family: var(--rem-display-font), monospace;
  font-size: 8px;
  letter-spacing: .1em;
  color: rgba(184, 235, 255, .78);
  content: "HANGAR // 01";
}

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-hangar::before { left: 13px; }
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-hangar::after { right: 13px; content: "SYSTEM READY"; color: rgba(126, 235, 204, .8); }

#menu-screen.main-menu--premium.rem-menu-v3 .menu-hangar-stage__pad {
  width: min(62vw, 245px) !important;
  height: 32px !important;
  bottom: 20px !important;
  border-radius: 50% !important;
  border-color: rgba(117, 227, 255, 0.78) !important;
  box-shadow: 0 0 22px rgba(97, 222, 255, 0.48), inset 0 0 16px rgba(91, 192, 255, 0.22) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-hangar-ship {
  transform: translateX(-50%) scale(1.14) !important;
  filter: drop-shadow(0 7px 9px rgba(0, 0, 0, .7));
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-hangar-stage__beam { opacity: .86 !important; }

#menu-screen.main-menu--premium.rem-menu-v3 .menu-hangar-info {
  margin: -5px 10px 0 !important;
  position: relative;
  z-index: 3;
  width: fit-content;
  max-width: calc(100% - 20px);
  overflow: hidden;
  padding: 5px 8px !important;
  border: 1px solid rgba(121, 212, 255, 0.44);
  border-radius: 4px;
  background: rgba(4, 13, 30, .88);
  color: #cceeff !important;
  font-family: var(--rem-display-font), monospace;
  font-size: 8px !important;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-hero {
  position: relative;
  isolation: isolate;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(112px, .75fr);
  align-items: center;
  gap: 10px;
  min-height: 92px;
  overflow: hidden;
  padding: 12px !important;
  border: 1px solid rgba(114, 225, 255, .68) !important;
  border-radius: 9px !important;
  background: linear-gradient(105deg, rgba(25, 101, 153, .43), rgba(16, 35, 74, .94) 56%, rgba(7, 17, 39, .96)) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .25), inset 0 1px rgba(229, 253, 255, .1) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-glow {
  z-index: -1;
  opacity: .7;
  background: radial-gradient(circle at 24% 50%, rgba(114, 242, 255, .28), transparent 40%);
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-copy { min-width: 0; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-kicker,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-text,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-subtext { margin: 0; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-kicker { color: #8fd7f5; font-family: var(--rem-display-font), monospace; font-size: 8px; letter-spacing: .11em; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-text { margin-top: 6px; color: #f1fbff; font-size: clamp(16px, 4.6vw, 21px); font-weight: 800; line-height: 1.1; letter-spacing: .05em; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-subtext { margin-top: 5px; color: #afd1e9; font-size: 9px; line-height: 1.4; }

#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-play {
  align-self: stretch !important;
  min-height: 66px !important;
  max-height: none !important;
  padding: 8px !important;
  border: 1px solid rgba(255, 224, 137, .92) !important;
  border-radius: 6px !important;
  background: linear-gradient(180deg, rgba(163, 113, 38, .98), rgba(67, 42, 13, .98)) !important;
  box-shadow: inset 0 1px rgba(255, 250, 214, .26), 0 0 18px rgba(255, 189, 72, .2) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-play strong { color: #fff8e7 !important; font-size: clamp(12px, 3.2vw, 15px) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-play span { color: #ffebbd !important; font-family: var(--rem-display-font), monospace; font-size: 7px !important; letter-spacing: .06em; }

#menu-screen.main-menu--premium.rem-menu-v3 .menu-chip-row {
  display: flex !important;
  gap: 6px;
  overflow-x: auto;
  padding: 0 1px 2px !important;
  scrollbar-width: none;
}
#menu-screen.main-menu--premium.rem-menu-v3 .menu-chip-row::-webkit-scrollbar { display: none; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-chip {
  flex: 0 0 auto;
  padding: 6px 7px !important;
  border: 1px solid rgba(116, 207, 255, .31);
  border-radius: 3px !important;
  background: rgba(16, 42, 78, .76);
  color: #a6d9f2 !important;
  font-family: var(--rem-display-font), monospace;
  font-size: 7px !important;
  letter-spacing: .05em;
}

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 -3px !important;
  color: #d6f4ff !important;
  font-family: var(--rem-display-font), monospace;
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: .1em;
}
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-section-title::before { width: 6px; height: 6px; background: var(--home-cyan); box-shadow: 0 0 9px var(--home-cyan); content: ""; }
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-section-title::after { height: 1px; flex: 1; background: linear-gradient(90deg, rgba(117, 220, 255, .56), transparent); content: ""; }

#menu-screen.main-menu--premium.rem-menu-v3 .rem-mode-grid-main,
#menu-screen.main-menu--premium.rem-menu-v3 .rem-mode-grid-sub,
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-quick-actions,
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-facility-list,
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-system-list {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start !important;
  gap: 8px !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn {
  position: relative;
  min-width: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 9px 10px 8px 42px !important;
  overflow: hidden;
  text-align: left;
  border: 1px solid rgba(119, 209, 255, .42) !important;
  border-radius: 7px !important;
  background: linear-gradient(135deg, rgba(47, 111, 174, .26), transparent 45%), linear-gradient(180deg, rgba(20, 47, 90, .97), rgba(8, 20, 45, .98)) !important;
  box-shadow: inset 0 1px rgba(227, 250, 255, .08), 0 6px 15px rgba(0, 0, 0, .14) !important;
  color: var(--home-text) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn::before {
  position: absolute;
  left: 10px;
  top: 50%;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid rgba(138, 222, 255, .62);
  background: rgba(35, 100, 154, .35);
  color: #c8f4ff;
  content: attr(data-icon);
  font-family: var(--rem-display-font), monospace;
  font-size: 11px;
  line-height: 1;
  transform: translateY(-50%);
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn strong,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn strong { color: #effaff !important; font-size: clamp(10px, 3vw, 13px) !important; line-height: 1.15; letter-spacing: .025em; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn span { margin-top: 4px; color: #a5cce5 !important; font-size: clamp(8px, 2.25vw, 10px) !important; line-height: 1.1; }

#menu-screen.main-menu--premium.rem-menu-v3 .mode-grid-main .menu-btn { min-height: 94px !important; max-height: 94px !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .mode-grid-main .menu-btn::before { width: 27px; height: 27px; color: var(--home-cyan); font-size: 14px; }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-stage { border-color: rgba(116, 230, 255, .78) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-stage::before { box-shadow: 0 0 13px rgba(96, 221, 255, .26); }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-endless { border-color: rgba(188, 141, 255, .68) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-endless::before { color: #d6b6ff; border-color: rgba(211, 171, 255, .7); }

#menu-screen.main-menu--premium.rem-menu-v3 .mode-grid-sub .menu-btn { min-height: 76px !important; max-height: 76px !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-genkyo { border-color: rgba(228, 137, 255, .58) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-cosmo { border-color: rgba(255, 169, 221, .58) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-ancient-knight { border-color: rgba(255, 191, 113, .62) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .rem-mode-card-abyss {
  border-color: rgba(238, 118, 161, .68) !important;
  background: radial-gradient(circle at 86% 0%, rgba(223, 54, 107, .24), transparent 45%), linear-gradient(180deg, rgba(60, 22, 55, .98), rgba(22, 10, 34, .99)) !important;
}
#menu-screen.main-menu--premium.rem-menu-v3 .rem-mode-card-abyss::before { color: #ffb2ca; border-color: rgba(255, 149, 193, .76); }
#menu-screen.main-menu--premium.rem-menu-v3 .rem-mode-card-abyss.rem-abyss-locked { opacity: .58; filter: saturate(.65); }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-abyss-unlock { display: none !important; }

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-quick-actions .menu-dock-btn {
  min-height: 72px !important;
  max-height: 72px !important;
}
#menu-screen.main-menu--premium.rem-menu-v3 .btn-gacha { border-color: rgba(255, 209, 107, .72) !important; background: linear-gradient(135deg, rgba(190, 117, 28, .26), transparent 46%), linear-gradient(180deg, rgba(72, 54, 39, .98), rgba(29, 24, 34, .99)) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-gacha::before { color: #ffe0a1; border-color: rgba(255, 219, 139, .74); }

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-facility-list .menu-btn { min-height: 72px !important; max-height: 72px !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-system-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-system-list .menu-btn { min-height: 72px !important; max-height: 72px !important; padding-left: 9px !important; text-align: center; }
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-system-list .menu-btn::before { position: static; width: 20px; height: 20px; margin: 0 auto 5px; transform: none; }
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-system-list .menu-btn span { display: none; }

#menu-screen.main-menu--premium.rem-menu-v3 .menu-badge {
  z-index: 3;
  top: 4px !important;
  right: 5px !important;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  display: grid;
  place-items: center;
  border: 1px solid #ffe7a6;
  border-radius: 50%;
  background: #c35d52;
  color: #fff8df;
  font-family: var(--rem-display-font), monospace;
  font-size: 7px;
  font-style: normal;
}

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-status-grid {
  display: grid !important;
  gap: 8px !important;
}
#menu-screen.main-menu--premium.rem-menu-v3 .menu-weekly-status,
#menu-screen.main-menu--premium.rem-menu-v3 .daily-mission-panel {
  min-height: auto !important;
  margin: 0 !important;
  padding: 10px !important;
  border: 1px solid rgba(110, 204, 255, .35) !important;
  border-radius: 7px !important;
  background: linear-gradient(180deg, rgba(16, 39, 77, .9), rgba(6, 17, 37, .95)) !important;
  color: #b9d8eb !important;
}
#menu-screen.main-menu--premium.rem-menu-v3 .daily-mission-panel h3 { margin: 0 0 7px !important; color: #e3f7ff !important; font-size: 11px !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .daily-mission-panel p,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-weekly-status { margin: 4px 0 !important; font-size: 9px !important; line-height: 1.38; }

#menu-screen.main-menu--premium.rem-menu-v3 .rem-bottom-nav {
  position: sticky !important;
  bottom: calc(6px + env(safe-area-inset-bottom));
  z-index: 10;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 62px;
  margin: 4px 0 0 !important;
  padding: 5px !important;
  border: 1px solid rgba(122, 213, 255, .47) !important;
  border-radius: 9px !important;
  background: rgba(7, 17, 38, .96) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45), inset 0 1px rgba(229, 251, 255, .08) !important;
}
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item {
  position: relative;
  min-width: 0 !important;
  min-height: 50px !important;
  height: 50px !important;
  max-height: 50px !important;
  padding: 25px 2px 4px !important;
  border: 0 !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: #9ebfd6 !important;
  font-family: var(--rem-display-font), monospace;
  font-size: 7px !important;
  letter-spacing: .02em;
}
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item::before { position: absolute; top: 7px; left: 50%; color: #83c9ec; content: "◇"; font-size: 15px; line-height: 1; transform: translateX(-50%); }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item:nth-child(2)::before { content: "▶"; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item:nth-child(3)::before { content: "▣"; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item:nth-child(4)::before { content: "✦"; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item:nth-child(5)::before { content: "⌁"; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item.is-active { background: linear-gradient(180deg, rgba(65, 165, 223, .35), rgba(22, 72, 128, .25)) !important; color: #ecfaff !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item.is-active::before { color: #f3fbff; text-shadow: 0 0 10px rgba(117, 220, 255, .75); }

#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn:focus-visible,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-header__settings:focus-visible,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item:focus-visible {
  outline: 2px solid #ffe29a !important;
  outline-offset: 2px;
}
#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn:hover,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn:focus-visible { border-color: var(--home-line-strong) !important; filter: brightness(1.08); }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn:active,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-header__settings:active,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item:active { transform: translateY(1px) scale(.985) !important; }

@media (max-width: 380px) {
  #menu-screen.main-menu--premium.rem-menu-v3 .rem-menu { padding-inline: 8px !important; gap: 9px !important; }
  #menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-currency { gap: 4px !important; }
  #menu-screen.main-menu--premium.rem-menu-v3 .menu-home-resource,
  #menu-screen.main-menu--premium.rem-menu-v3 .menu-home-rank { padding-inline: 6px !important; }
  #menu-screen.main-menu--premium.rem-menu-v3 .menu-home-resource-label,
  #menu-screen.main-menu--premium.rem-menu-v3 .menu-home-rank-label { font-size: 7px !important; letter-spacing: .04em; }
  #menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-subtext { display: none; }
  #menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-play { min-height: 58px !important; }
  #menu-screen.main-menu--premium.rem-menu-v3 .mode-grid-main .menu-btn { min-height: 86px !important; max-height: 86px !important; }
  #menu-screen.main-menu--premium.rem-menu-v3 .mode-grid-sub .menu-btn,
  #menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-facility-list .menu-btn { min-height: 68px !important; max-height: 68px !important; }
}

@media (min-width: 600px) {
  #menu-screen.main-menu--premium.rem-menu-v3 .rem-menu { padding-inline: 18px !important; }
  #menu-screen.main-menu--premium.rem-menu-v3 .rem-mode-grid-sub { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-facility-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  #menu-screen.main-menu--premium.rem-menu-v3 *,
  #menu-screen.main-menu--premium.rem-menu-v3 *::before,
  #menu-screen.main-menu--premium.rem-menu-v3 *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* ===== Home UI readability audit =====
   Remove decorative noise and keep the font roles deliberately small:
   pixel/mono for labels and figures, Japanese gothic for actual reading. */
#menu-screen.main-menu--premium.rem-menu-v3 {
  --menu-game-font: "MS Gothic", "Noto Sans Mono CJK JP", "Roboto Mono", ui-monospace, monospace;
  --menu-ui-font: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  background: linear-gradient(180deg, #0b1832 0%, #071126 42%, #050a15 100%) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-premium-bg__grid { opacity: .16; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-premium-bg__scanline { opacity: .045; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-premium-bg__vignette { background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 3, 12, .38) 100%); }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-fx-layer { display: none !important; }

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu {
  gap: 10px !important;
  font-family: var(--menu-ui-font);
}

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-hangar::before,
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-hangar::after { display: none !important; }

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-hangar {
  height: clamp(134px, 23vh, 174px) !important;
  min-height: 134px !important;
  background:
    radial-gradient(34% 45% at 50% 62%, rgba(84, 201, 255, .2), transparent 75%),
    linear-gradient(180deg, rgba(15, 37, 74, .86), rgba(6, 14, 32, .96)) !important;
  box-shadow: inset 0 0 0 1px rgba(211, 243, 255, .04) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-hangar-stage__pad {
  box-shadow: 0 0 13px rgba(97, 222, 255, .28), inset 0 0 10px rgba(91, 192, 255, .18) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-header__label,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-resource-label,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-rank-label,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-kicker,
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-section-title,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hangar-info,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-resource-value,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-rank-value {
  font-family: var(--menu-game-font) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-header__value,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn strong,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn span,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-text,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-subtext,
#menu-screen.main-menu--premium.rem-menu-v3 .daily-mission-panel,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-weekly-status {
  font-family: var(--menu-ui-font) !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-header,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-resource,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-home-rank {
  border-radius: 5px !important;
  box-shadow: none !important;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-header__value {
  font-size: clamp(13px, 3.8vw, 16px) !important;
  font-weight: 750;
  letter-spacing: 0;
}

#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-card {
  min-height: 78px !important;
  padding: 10px 11px !important;
  border-color: rgba(115, 209, 255, .48) !important;
  background: linear-gradient(90deg, rgba(30, 94, 142, .34), rgba(10, 24, 51, .96) 66%) !important;
  box-shadow: none !important;
}
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-glow { display: none; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-kicker { color: #8fc9e7; font-size: 8px; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-text { margin-top: 3px; font-size: clamp(15px, 4.3vw, 19px); letter-spacing: .01em; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-subtext { margin-top: 3px; color: #b4cfe0; font-size: 10px; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-play {
  min-height: 54px !important;
  border-color: rgba(255, 215, 126, .82) !important;
  border-radius: 5px !important;
  background: linear-gradient(180deg, #8b672a, #4e3512) !important;
  box-shadow: none !important;
}
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-play::before { display: none !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-play strong,
#menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-play span { text-align: center; }

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-section-title {
  margin-top: 8px !important;
  color: #d8effa !important;
  font-size: 10px !important;
}
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-section-title::before { box-shadow: none; }

#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn {
  padding: 9px 10px 8px 39px !important;
  border-radius: 5px !important;
  background: linear-gradient(180deg, rgba(24, 52, 94, .98), rgba(8, 20, 44, .98)) !important;
  box-shadow: none !important;
}
#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn::before {
  width: 21px;
  height: 21px;
  border: 0;
  background: transparent;
  color: #a8ddf4;
  font-family: var(--menu-game-font);
  font-size: 14px;
}
#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn strong {
  font-size: clamp(12px, 3.35vw, 14px) !important;
  font-weight: 750;
  letter-spacing: .01em;
}
#menu-screen.main-menu--premium.rem-menu-v3 .menu-btn span {
  margin-top: 3px;
  color: #a9c5d8 !important;
  font-size: clamp(9px, 2.5vw, 10px) !important;
  font-weight: 600;
}

#menu-screen.main-menu--premium.rem-menu-v3 .mode-grid-main .menu-btn { min-height: 84px !important; max-height: 84px !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .mode-grid-sub .menu-btn { min-height: 70px !important; max-height: 70px !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-quick-actions .menu-dock-btn { min-height: 66px !important; max-height: 66px !important; }

#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-facility-list { grid-template-columns: minmax(0, 1fr) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-facility-list .menu-btn { min-height: 60px !important; max-height: 60px !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .rem-menu-system-list .menu-btn { min-height: 64px !important; max-height: 64px !important; }

#menu-screen.main-menu--premium.rem-menu-v3 .btn-stage,
#menu-screen.main-menu--premium.rem-menu-v3 .btn-endless,
#menu-screen.main-menu--premium.rem-menu-v3 .btn-genkyo,
#menu-screen.main-menu--premium.rem-menu-v3 .btn-cosmo,
#menu-screen.main-menu--premium.rem-menu-v3 .btn-ancient-knight,
#menu-screen.main-menu--premium.rem-menu-v3 .rem-mode-card-abyss,
#menu-screen.main-menu--premium.rem-menu-v3 .btn-gacha { background: linear-gradient(180deg, rgba(24, 52, 94, .98), rgba(8, 20, 44, .98)) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-stage { border-color: rgba(101, 222, 255, .74) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-endless { border-color: rgba(181, 151, 255, .62) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-genkyo { border-color: rgba(224, 143, 255, .56) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-cosmo { border-color: rgba(244, 170, 215, .56) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .rem-mode-card-abyss { border-color: rgba(226, 117, 156, .62) !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .btn-gacha { border-color: rgba(255, 211, 121, .72) !important; }

#menu-screen.main-menu--premium.rem-menu-v3 .rem-bottom-nav {
  min-height: 58px;
  border-radius: 6px !important;
  box-shadow: 0 7px 16px rgba(0, 0, 0, .28) !important;
}
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item { min-height: 46px !important; height: 46px !important; max-height: 46px !important; padding-top: 23px !important; }
#menu-screen.main-menu--premium.rem-menu-v3 .menu-nav-item::before { top: 5px; font-size: 14px; text-shadow: none !important; }

/* Starlight Treasure Box: campaign-star reward archive. Scoped to avoid battle HUD changes. */
.facility-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.stb-shortcut-btn {
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid rgba(122, 231, 255, .8);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(28, 76, 130, .94), rgba(10, 28, 64, .98));
  color: #e2f8ff;
  font: 700 9px/1 var(--menu-game-font, "Press Start 2P", monospace);
  letter-spacing: .04em;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 0 12px rgba(65, 209, 255, .16);
}
.stb-shortcut-btn span { color: #ffd878; text-shadow: 0 0 8px rgba(255, 216, 120, .7); }
.stb-shortcut-btn:active { transform: translateY(1px) scale(.98); }

#starlight-treasure-screen { --stb-cyan: #72edff; --stb-gold: #ffd26d; }
#starlight-treasure-screen .stb-shell { gap: 10px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
#starlight-treasure-screen .facility-backdrop {
  background:
    radial-gradient(circle at 50% 38%, rgba(70, 139, 255, .2), transparent 33%),
    radial-gradient(circle at 82% 15%, rgba(177, 96, 255, .14), transparent 25%),
    linear-gradient(180deg, #07152e 0%, #071126 48%, #030914 100%);
}
.stb-open-count {
  display: grid;
  min-width: 54px;
  padding: 6px 7px;
  border: 1px solid rgba(255, 210, 109, .65);
  background: rgba(8, 20, 45, .82);
  text-align: center;
}
.stb-open-count span { color: #aabed5; font-size: 8px; letter-spacing: .08em; }
.stb-open-count strong { color: var(--stb-gold); font: 800 16px/1.1 var(--menu-game-font, monospace); }
.stb-balance {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid rgba(114, 237, 255, .48);
  background: linear-gradient(90deg, rgba(13, 39, 76, .9), rgba(25, 48, 94, .62), rgba(13, 39, 76, .9));
}
.stb-balance span, .stb-balance small { color: #b7cce4; font-size: 10px; }
.stb-balance strong { color: var(--stb-gold); font: 800 clamp(21px, 6vw, 27px)/1 var(--menu-game-font, monospace); text-shadow: 0 0 12px rgba(255, 210, 109, .48); }
.stb-chest-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(46vw, 224px);
  overflow: hidden;
  isolation: isolate;
  border-top: 1px solid rgba(114, 237, 255, .22);
  border-bottom: 1px solid rgba(114, 237, 255, .18);
  background: radial-gradient(ellipse at center, rgba(53, 130, 212, .24), transparent 63%);
}
.stb-chest-stage::before, .stb-chest-stage::after { content: ""; position: absolute; pointer-events: none; }
.stb-chest-stage::before { inset: 18% 18%; border: 1px solid rgba(119, 235, 255, .28); transform: rotate(45deg); }
.stb-chest-stage::after { width: 74%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,211,109,.8), transparent); bottom: 13%; }
.stb-chest-art {
  position: relative;
  z-index: 2;
  display: block;
  width: min(54vw, 252px);
  max-height: 234px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.52));
  transform: translateZ(0);
}
.stb-orbit { position: absolute; z-index: 1; border: 1px solid rgba(111, 235, 255, .35); border-radius: 50%; pointer-events: none; }
.stb-orbit--one { width: min(64vw, 300px); height: 72px; transform: rotate(-12deg); }
.stb-orbit--two { width: min(50vw, 238px); height: 116px; border-color: rgba(255, 210, 109, .28); transform: rotate(37deg); }
.stb-reward-result {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 54px;
  padding: 9px;
  border: 1px solid rgba(173, 149, 255, .45);
  background: rgba(10, 23, 53, .78);
  color: #c5d6ec;
  font-size: 11px;
  text-align: center;
}
.stb-reward-result span { color: #8bb6dc; font-size: 8px; letter-spacing: .1em; }
.stb-reward-result strong { color: #fff3c7; font-size: 13px; }
.stb-reward-result em { color: #ffd26d; font-size: 9px; font-style: normal; }
.stb-guarantee { display: grid; gap: 3px; padding: 8px 10px; border-left: 3px solid var(--stb-gold); background: rgba(77, 55, 18, .28); }
.stb-guarantee b { color: #ffe4a1; font-size: 11px; }.stb-guarantee span { color: #bdd0e4; font-size: 10px; }
.stb-claim-btn { min-height: 52px; border-color: rgba(255, 210, 109, .9) !important; background: linear-gradient(180deg, #9a7028, #48310c) !important; color: #fff5d8 !important; }
.stb-claim-btn:disabled { filter: grayscale(.75); opacity: .55; }.stb-cost-note { margin: 0; color: #a7bfd9; font-size: 10px; line-height: 1.45; text-align: center; }
#starlight-treasure-screen.stb-opening .stb-chest-art { animation: stbChestOpen .72s cubic-bezier(.16,.72,.2,1); }
#starlight-treasure-screen.stb-opening .stb-chest-stage::after { animation: stbFlash .58s ease-out; }
@keyframes stbChestOpen { 0% { transform: scale(.88); opacity:.55; } 35% { transform: scale(1.09); } 100% { transform: scale(1); opacity:1; } }
@keyframes stbFlash { 0% { opacity: 0; transform: scaleX(.25); } 35% { opacity: 1; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(1.45); } }
@media (prefers-reduced-motion: no-preference) { .stb-orbit--one { animation: stbOrbit 7s linear infinite; }.stb-orbit--two { animation: stbOrbitReverse 9s linear infinite; } }
@keyframes stbOrbit { to { transform: rotate(348deg); } } @keyframes stbOrbitReverse { to { transform: rotate(-323deg); } }
@media (max-width: 390px) { .facility-head-actions { gap: 4px; }.stb-shortcut-btn { padding: 6px 7px; font-size: 8px; }.facility-head-actions .facility-head-status { min-width: 0; }.stb-chest-stage { min-height: 175px; } }

@media (max-width: 380px) {
  #menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-card { grid-template-columns: minmax(0, 1fr) 94px; }
  #menu-screen.main-menu--premium.rem-menu-v3 .menu-hero-subtext { display: none; }
  #menu-screen.main-menu--premium.rem-menu-v3 .mode-grid-main .menu-btn { min-height: 78px !important; max-height: 78px !important; }
  #menu-screen.main-menu--premium.rem-menu-v3 .mode-grid-sub .menu-btn { min-height: 66px !important; max-height: 66px !important; }
}
