﻿@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&family=DotGothic16&display=swap");

: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; }
.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 .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-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);
}

.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-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-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::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-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-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;
}

@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 gachaBurstFlash {
  0% { opacity: 0; }
  28% { opacity: 1; }
  100% { 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; }
.hp-fill { width: 100%; height: 100%; background: #8eff9b; }

.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;
}

.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;
}

@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; }
}

.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); }
}
