/* ==================================================================
   桜花繚乱 · SAKURA STRIKE — UI stylesheet
   ================================================================== */
:root {
  --pink: #ff6fae;
  --pink-soft: #ffb7d5;
  --cyan: #63f0dd;
  --gold: #ffd27a;
  --ink: #0a0713;
  --panel: rgba(16, 11, 26, 0.82);
  --line: rgba(255, 143, 192, 0.28);
  --serif: "Yu Mincho", "MS Mincho", "SimSun", "Songti SC", serif;
  --sans: "Segoe UI", "Yu Gothic", "Microsoft YaHei", "Hiragino Sans", sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #07050e; color: #f3ecf7; font-family: var(--sans);
  user-select: none; -webkit-user-select: none;
}
#app { position: fixed; inset: 0; }
canvas#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* =============================== HUD =============================== */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }

/* --- vitals */
#hudTopLeft {
  position: absolute; left: 26px; top: 22px;
  display: flex; align-items: center; gap: 14px;
  filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.6));
}
#portraitWrap {
  position: relative; width: 78px; height: 78px;
  border: 1.5px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 111, 174, 0.25), rgba(20, 12, 32, 0.9));
  clip-path: polygon(12% 0, 100% 0, 100% 84%, 84% 100%, 0 100%, 0 16%);
  overflow: hidden;
}
#portrait { width: 100%; height: 100%; display: block; }
#portraitRing {
  position: absolute; inset: -2px;
  border: 1px solid rgba(255, 210, 235, 0.35);
  clip-path: polygon(12% 0, 100% 0, 100% 84%, 84% 100%, 0 100%, 0 16%);
  pointer-events: none;
}
#vitalsWrap { width: 250px; }
.vlabel {
  font-size: 10px; letter-spacing: 2px; color: var(--pink-soft);
  margin-bottom: 4px; opacity: 0.9;
}
.vlabel em { font-style: normal; opacity: 0.5; font-size: 9px; letter-spacing: 1px; }
.vbar {
  position: relative; height: 15px; margin-bottom: 5px;
  background: rgba(10, 7, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transform: skewX(-16deg); overflow: hidden;
}
.vbar i {
  position: absolute; inset: 0 auto 0 0; width: 100%;
  background: linear-gradient(90deg, #ff4d8d, #ff9ec9 60%, #ffe0ee);
  box-shadow: 0 0 14px rgba(255, 111, 174, 0.8);
  transition: width 0.12s linear;
}
.vbar.hp i.low { background: linear-gradient(90deg, #d32b3f, #ff7a6b); }
.vbar span {
  position: absolute; right: 8px; top: 0; line-height: 14px;
  font-size: 11px; font-weight: 800; color: #fff; letter-spacing: 1px;
  text-shadow: 0 1px 3px #000; transform: skewX(16deg);
}
.vbar.stam { height: 5px; }
.vbar.stam i { background: linear-gradient(90deg, #3fd8c6, #9ffff2); box-shadow: none; }

/* --- top center */
#hudTopCenter {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 16px; align-items: flex-start;
}
#waveBox, #scoreBox {
  position: relative; min-width: 132px; padding: 6px 18px 8px;
  background: linear-gradient(180deg, rgba(24, 14, 36, 0.85), rgba(12, 8, 20, 0.6));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
#waveBox .lbl, #scoreBox .lbl {
  display: block; font-size: 9px; letter-spacing: 3px; color: rgba(255, 183, 213, 0.75);
}
#waveBox strong, #scoreBox strong {
  font-family: var(--serif); font-size: 27px; line-height: 1.05; font-weight: 700;
  background: linear-gradient(180deg, #fff, #ffb7d5 70%, #ff6fae);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: 2px;
}
#waveState { font-size: 10px; letter-spacing: 1px; color: #b9a8c9; }
#comboNum {
  font-style: normal; display: block; font-size: 10px; letter-spacing: 2px;
  color: var(--gold); min-height: 12px; text-shadow: 0 0 8px rgba(255, 210, 122, 0.7);
}

/* --- boss bar */
#bossBar {
  position: absolute; top: 108px; left: 50%; transform: translateX(-50%);
  width: min(560px, 52vw); text-align: center;
}
#bossName {
  display: block; font-family: var(--serif); font-size: 15px; letter-spacing: 5px;
  color: #ffe6b0; text-shadow: 0 0 14px rgba(255, 190, 90, 0.7); margin-bottom: 5px;
}
#bossBar .bb {
  height: 8px; background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 210, 122, 0.5); overflow: hidden;
}
#bossBar .bb i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #b3352f, #ff9d3d, #ffe6a0);
  box-shadow: 0 0 16px rgba(255, 160, 60, 0.9);
  transition: width 0.16s linear;
}

/* --- kill feed */
#killfeed {
  position: absolute; right: 26px; top: 120px; width: 300px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 5px;
}
.kf {
  padding: 5px 12px; font-size: 12px; letter-spacing: 0.5px;
  background: linear-gradient(90deg, rgba(12, 8, 20, 0), rgba(18, 10, 28, 0.9));
  border-right: 2px solid var(--pink);
  animation: kfIn 0.25s ease-out both;
  white-space: nowrap;
}
.kf b { color: #fff; }
.kf span { color: var(--pink-soft); }
.kf.head { border-right-color: var(--gold); }
.kf.head b { color: var(--gold); }
@keyframes kfIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* --- crosshair */
#crosshair {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0;
  --gap: 6px;
}
#crosshair .ch {
  position: absolute; background: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
  transition: opacity 0.1s;
}
#crosshair .t { width: 2px; height: 9px; left: -1px; top: calc(-1 * var(--gap) - 9px); }
#crosshair .b { width: 2px; height: 9px; left: -1px; top: var(--gap); }
#crosshair .l { width: 9px; height: 2px; top: -1px; left: calc(-1 * var(--gap) - 9px); }
#crosshair .r { width: 9px; height: 2px; top: -1px; left: var(--gap); }
#crosshair .chdot {
  position: absolute; width: 2px; height: 2px; left: -1px; top: -1px;
  background: #fff; box-shadow: 0 0 3px #000; border-radius: 50%;
}
#crosshair.static .ch { opacity: 0.85; }
#crosshair.dotmode .ch { display: none; }
#crosshair.hostile .ch, #crosshair.hostile .chdot { background: #ff4d6d; }
#crosshair.ads .ch { opacity: 0.25; }

/* --- hitmarker */
#hitmarker {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0;
  opacity: 0; pointer-events: none;
}
#hitmarker i {
  position: absolute; width: 2px; height: 9px; background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}
#hitmarker i:nth-child(1) { transform: rotate(45deg) translateY(-13px); }
#hitmarker i:nth-child(2) { transform: rotate(135deg) translateY(-13px); }
#hitmarker i:nth-child(3) { transform: rotate(225deg) translateY(-13px); }
#hitmarker i:nth-child(4) { transform: rotate(315deg) translateY(-13px); }
#hitmarker.on { animation: hitPop 0.22s ease-out both; }
#hitmarker.head i { background: var(--gold); height: 12px; box-shadow: 0 0 8px rgba(255, 210, 122, 0.9); }
@keyframes hitPop {
  0% { opacity: 1; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(1.15); }
}

/* --- damage numbers */
#dmgNums { position: absolute; inset: 0; overflow: hidden; }
.dnum {
  position: absolute; transform: translate(-50%, -50%);
  font-family: var(--serif); font-weight: 800; font-size: 20px; color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 12px rgba(255, 120, 170, 0.55);
  animation: dnumRise 0.72s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  pointer-events: none;
}
.dnum.head { color: #ffe08a; font-size: 27px; text-shadow: 0 2px 8px #000, 0 0 18px rgba(255, 190, 60, 0.9); }
.dnum.kill { color: #ff5d94; font-size: 24px; }
@keyframes dnumRise {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -80%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(0.95); }
}

/* --- damage direction */
#dmgDirs { position: absolute; inset: 0; }
.ddir {
  position: absolute; left: 50%; top: 50%; width: 190px; height: 190px;
  margin: -95px 0 0 -95px; border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(255, 60, 90, 0.7);
  filter: drop-shadow(0 0 8px rgba(255, 40, 80, 0.6));
  animation: ddirFade 1.1s ease-out forwards;
  pointer-events: none;
}
@keyframes ddirFade { 0% { opacity: 0.95; } 100% { opacity: 0; } }

/* --- minimap */
#minimapWrap {
  position: absolute; left: 26px; bottom: 26px;
  width: 190px; height: 190px;
  background: rgba(10, 7, 18, 0.62);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  overflow: hidden;
}
#minimap { width: 100%; height: 100%; display: block; }
.mm-top {
  position: absolute; left: 10px; right: 10px; top: 6px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; letter-spacing: 2px; color: var(--pink-soft);
}
#enemyCount { color: var(--gold); font-weight: 700; }
.mm-compass {
  position: absolute; right: 8px; bottom: 6px; font-size: 9px;
  color: rgba(255, 255, 255, 0.35); letter-spacing: 1px;
}

/* --- weapon hud */
#weaponHud {
  position: absolute; right: 26px; bottom: 24px; text-align: right;
  min-width: 250px;
}
.whead { border-right: 2px solid var(--pink); padding-right: 10px; }
#weaponName {
  font-family: var(--serif); font-size: 26px; letter-spacing: 4px; line-height: 1.1;
  background: linear-gradient(180deg, #fff, #ffb7d5);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
#weaponType { font-size: 10px; letter-spacing: 3px; color: rgba(255, 183, 213, 0.7); margin-top: 2px; }
#ammoBox {
  margin-top: 2px; font-family: var(--serif); line-height: 1;
  display: flex; align-items: baseline; justify-content: flex-end; gap: 6px;
}
#ammoMag {
  font-size: 54px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(180deg, #ffffff, #ffd0e4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 24px rgba(255, 111, 174, 0.35);
}
#ammoMag.low { color: #ff5566; -webkit-text-fill-color: #ff5566; }
#ammoBox .slash { font-size: 22px; color: rgba(255, 255, 255, 0.25); }
#ammoRes { font-size: 22px; color: rgba(255, 255, 255, 0.55); }
#reloadBar {
  height: 4px; background: rgba(255, 255, 255, 0.12); margin: 6px 0 6px auto; width: 70%;
  overflow: hidden;
}
#reloadBar i { display: block; height: 100%; width: 0; background: var(--pink); }
#reloadBar i::after {
  content: ''; display: block; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  animation: reloadShine 0.9s linear infinite;
}
@keyframes reloadShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
#slots { display: flex; justify-content: flex-end; gap: 5px; margin-top: 8px; }
.slot {
  width: 40px; padding: 3px 0 4px; text-align: center;
  background: rgba(12, 8, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 9px; color: rgba(255, 255, 255, 0.45); line-height: 1.25;
}
.slot b { display: block; font-size: 11px; color: rgba(255, 255, 255, 0.75); }
.slot.on {
  border-color: var(--pink); color: #fff;
  background: linear-gradient(180deg, rgba(255, 111, 174, 0.3), rgba(255, 111, 174, 0.06));
  box-shadow: 0 0 12px rgba(255, 111, 174, 0.45) inset;
}
.slot.empty { opacity: 0.3; }

/* --- banner */
#banner {
  position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%);
  text-align: center; opacity: 0; pointer-events: none; width: 80%;
}
#banner.show { animation: bannerIn 2.6s ease-out both; }
#banner .bn-sub { font-size: 12px; letter-spacing: 10px; color: var(--pink-soft); }
#banner .bn-main {
  font-family: var(--serif); font-size: clamp(34px, 6vw, 68px); letter-spacing: 12px;
  color: #fff; text-shadow: 0 0 24px rgba(255, 111, 174, 0.8), 0 0 60px rgba(255, 111, 174, 0.4);
  margin: 2px 0;
}
#banner .bn-tip { font-size: 13px; letter-spacing: 2px; color: rgba(255, 255, 255, 0.65); }
@keyframes bannerIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.94); letter-spacing: 18px; }
  15% { opacity: 1; }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -54%) scale(1.02); }
}

#toast {
  position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%);
  font-size: 12px; letter-spacing: 2px; color: #ffe6b0;
  background: rgba(12, 8, 20, 0.75); padding: 6px 16px;
  border-left: 2px solid var(--gold); opacity: 0; transition: opacity 0.25s;
}
#toast.show { opacity: 1; }

/* --- scope */
#scope { position: absolute; inset: 0; }
#scope .sc-lens {
  position: absolute; left: 50%; top: 50%; width: 74vh; height: 74vh;
  transform: translate(-50%, -50%); border-radius: 50%;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.97), inset 0 0 60px rgba(0, 0, 0, 0.85);
  border: 2px solid rgba(180, 220, 255, 0.35);
}
#scope .sc-h, #scope .sc-v {
  position: absolute; left: 50%; top: 50%; background: rgba(190, 230, 255, 0.6);
}
#scope .sc-h { width: 74vh; height: 1px; transform: translate(-50%, -50%); }
#scope .sc-v { height: 74vh; width: 1px; transform: translate(-50%, -50%); }
#scope .sc-reticle {
  position: absolute; left: 50%; top: 50%; width: 2px; height: 2px;
  background: #ff4d6d; border-radius: 50%; box-shadow: 0 0 8px #ff4d6d;
}
#scope .sc-ticks {
  position: absolute; left: 50%; top: 50%; width: 74vh; height: 74vh;
  transform: translate(-50%, -50%); border-radius: 50%;
  background:
    repeating-linear-gradient(90deg, transparent 0 3.6vh, rgba(160, 210, 255, 0.25) 3.6vh calc(3.6vh + 1px));
  mask: radial-gradient(circle, transparent 26%, #000 26.2%, #000 34%, transparent 34.2%);
  -webkit-mask: radial-gradient(circle, transparent 26%, #000 26.2%, #000 34%, transparent 34.2%);
}

#vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 46%, rgba(4, 2, 10, 0.55) 100%);
  mix-blend-mode: multiply;
}
#dmgVignette {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 38%, rgba(255, 20, 60, 0.75) 100%);
  transition: opacity 0.18s;
}
#lowhp {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(180, 0, 30, 0.6) 100%);
}
#lowhp.on { animation: lowhpPulse 1.4s ease-in-out infinite; }
@keyframes lowhpPulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.65; } }

/* kill feedback */
#killFlash {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255, 30, 60, 0.05) 30%, rgba(180, 0, 30, 0.55) 100%);
  mix-blend-mode: screen;
}
#killFlash.on { animation: killPulse 0.4s ease-out; }
@keyframes killPulse { 0% { opacity: 0.85; } 100% { opacity: 0; } }

#slashFx {
  position: absolute; inset: -10%; pointer-events: none; opacity: 0;
  background: linear-gradient(112deg, transparent 38%, rgba(255, 255, 255, 0.95) 47%,
    rgba(255, 150, 205, 0.85) 50%, rgba(255, 255, 255, 0.9) 53%, transparent 62%);
  filter: blur(0.4px);
}
#slashFx.on { animation: slashSweep 0.34s cubic-bezier(0.2, 0.7, 0.4, 1); }
@keyframes slashSweep {
  0% { opacity: 0; transform: translate(-18%, 12%) rotate(-6deg) scaleY(0.2); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(14%, -14%) rotate(-6deg) scaleY(1); }
}

/* grab / struggle prompt */
#grabPrompt {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%, 0);
  text-align: center; padding: 14px 30px 18px;
  background: linear-gradient(180deg, rgba(60, 8, 18, 0.88), rgba(20, 4, 10, 0.9));
  border: 1px solid rgba(255, 80, 110, 0.6);
  box-shadow: 0 0 40px rgba(255, 40, 80, 0.35);
  animation: grabShake 0.14s linear infinite;
}
@keyframes grabShake {
  0%, 100% { transform: translate(-50%, 0) rotate(-0.4deg); }
  50% { transform: translate(-50%, -2px) rotate(0.4deg); }
}
.gp-title { font-family: var(--serif); font-size: 24px; letter-spacing: 6px; color: #ff8a9a; text-shadow: 0 0 16px rgba(255, 40, 70, 0.8); }
.gp-keys { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 10px; font-size: 12px; color: rgba(255, 255, 255, 0.75); letter-spacing: 2px; }
.gp-keys kbd { min-width: 34px; padding: 4px 6px; font-size: 12px; }
.gp-bar { width: 240px; height: 10px; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 90, 120, 0.5); }
.gp-bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #ff3b5c, #ffd166); box-shadow: 0 0 12px rgba(255, 80, 100, 0.9); }

/* speed / bhop readout */
#speedo {
  position: absolute; left: 50%; bottom: 108px; transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 5px;
  padding: 3px 16px; letter-spacing: 2px;
  background: linear-gradient(90deg, rgba(12, 8, 20, 0), rgba(12, 8, 20, 0.55), rgba(12, 8, 20, 0));
  border-top: 1px solid rgba(255, 143, 192, 0.25);
  opacity: 0.85; transition: opacity 0.2s;
}
#speedo b { font-family: var(--serif); font-size: 24px; color: #fff; text-shadow: 0 0 12px rgba(255, 111, 174, 0.6); }
#speedo span { font-size: 9px; color: rgba(255, 255, 255, 0.45); letter-spacing: 1px; }
#speedo em { font-style: normal; font-size: 10px; color: var(--gold); letter-spacing: 2px; min-width: 64px; text-align: left; }
#speedo.fast b { color: #ffd27a; }

/* operator cards */
.chargrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 6px; }
.ccard {
  position: relative; padding: 6px 8px 7px; cursor: pointer; text-align: left;
  background: linear-gradient(160deg, rgba(30, 18, 44, 0.92), rgba(12, 8, 20, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  transition: border-color 0.15s, transform 0.15s;
}
.ccard:hover { transform: translateY(-2px); border-color: rgba(255, 143, 192, 0.6); }
.ccard.on { border-color: var(--c, var(--pink)); box-shadow: 0 0 0 1px var(--c), 0 0 22px -6px var(--c); }
.ccard img { width: 44px; height: 44px; object-fit: cover; float: left; margin-right: 7px; border-radius: 4px; }
.ccard .cn { font-family: var(--serif); font-size: 14px; letter-spacing: 2px; }
.ccard .cs { font-size: 9px; letter-spacing: 1px; color: var(--c, var(--pink-soft)); }
.ccard .cd2 { clear: both; font-size: 9px; line-height: 1.5; color: rgba(255, 255, 255, 0.42); padding-top: 4px; }

/* ability chips */
#abilities {
  position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%);
  display: flex; gap: 10px; pointer-events: none;
}
.ab {
  position: relative; width: 74px; height: 38px; overflow: hidden;
  background: rgba(12, 8, 20, 0.62);
  border: 1px solid rgba(255, 143, 192, 0.35);
  text-align: center; letter-spacing: 1px;
}
.ab b {
  display: block; font-size: 10px; color: var(--pink-soft); line-height: 1;
  padding-top: 5px;
}
.ab span { font-size: 11px; color: #fff; letter-spacing: 1px; }
.ab i {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, #ff6fae, #ffd27a);
}
.ab.ready { box-shadow: 0 0 14px -4px var(--pink); border-color: var(--pink); }
.ab.ready b { color: var(--gold); }
#hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 2px; color: rgba(255, 255, 255, 0.32);
}

/* =============================== SCREENS =============================== */
.screen {
  position: absolute; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(90, 30, 60, 0.5), transparent 60%),
    radial-gradient(ellipse at 50% 0%, rgba(40, 20, 70, 0.7), transparent 55%),
    linear-gradient(180deg, rgba(7, 5, 14, 0.55), rgba(7, 5, 14, 0.42) 45%, rgba(7, 5, 14, 0.82));
}
.screen::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
  opacity: 0.5;
}
.sp { position: absolute; inset: 0; display: flex; flex-direction: column; animation: fadeIn 0.32s ease-out both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --- menu background */
.menu-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.menu-bg .moon { display: none; }
.menu-bg .torii-sil {
  display: none;
}
.menu-bg .hill {
  position: absolute; bottom: -12%; width: 120%; height: 43%;
  border-radius: 50% 50% 0 0; filter: blur(1px); opacity: 0.55;
}
.menu-bg .hill.a { left: -20%; background: linear-gradient(#150c22, #0b0714); }
.menu-bg .hill.b { right: -30%; bottom: -20%; height: 48%; background: linear-gradient(#0f0a1a, #07050e); }
#petals { position: absolute; inset: 0; }
.petal {
  position: absolute; top: -8vh; width: 14px; height: 14px;
  background: radial-gradient(circle at 30% 30%, #fff, #ffb6d6 60%, #ff7fb2);
  border-radius: 60% 10% 60% 10%;
  opacity: 0.75;
  animation: petalFall linear infinite;
}
@keyframes petalFall {
  0% { transform: translate3d(0, -10vh, 0) rotate(0deg); }
  100% { transform: translate3d(14vw, 110vh, 0) rotate(620deg); }
}

/* --- title */
#screen-title { align-items: center; justify-content: center; }
.logo { text-align: center; margin-top: -4vh; }
.logo-top {
  font-size: 12px; letter-spacing: 10px; color: rgba(255, 183, 213, 0.75);
  margin-bottom: 6px;
}
.logo-jp {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, 11vw, 128px); letter-spacing: 16px; line-height: 1;
  background: linear-gradient(180deg, #fff 10%, #ffd6e6 45%, #ff6fae 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 28px rgba(255, 111, 174, 0.55));
  text-indent: 16px;
}
.logo-en {
  font-size: clamp(11px, 1.5vw, 16px); letter-spacing: 10px; margin-top: 8px;
  color: #ffd9e8;
}
.logo-line {
  width: 220px; height: 1px; margin: 14px auto 10px;
  background: linear-gradient(90deg, transparent, var(--pink), transparent);
}
.logo-sub { font-size: 12px; letter-spacing: 6px; color: rgba(255, 255, 255, 0.55); }
.menu-buttons { margin-top: 34px; display: flex; flex-direction: column; gap: 10px; width: 380px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.btn {
  position: relative; flex: 1; padding: 11px 20px; text-align: left;
  background: linear-gradient(100deg, rgba(28, 16, 42, 0.92), rgba(18, 11, 28, 0.78));
  border: 1px solid rgba(255, 143, 192, 0.25);
  color: #f6eaf9; overflow: hidden;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform 0.16s, border-color 0.16s, background 0.16s;
}
.btn::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--pink); opacity: 0.7;
}
.btn b { display: block; font-size: 17px; letter-spacing: 4px; font-weight: 600; }
.btn span { font-size: 9px; letter-spacing: 3px; color: rgba(255, 183, 213, 0.6); }
.btn:hover { transform: translateY(-2px); border-color: var(--pink); background: linear-gradient(100deg, rgba(52, 22, 62, 0.95), rgba(26, 14, 38, 0.85)); }
.btn:hover::before { width: 5px; opacity: 1; box-shadow: 0 0 14px var(--pink); }
.btn.primary {
  padding: 15px 22px;
  background: linear-gradient(100deg, rgba(255, 111, 174, 0.28), rgba(60, 20, 50, 0.9));
  border-color: rgba(255, 143, 192, 0.6);
}
.btn.primary b { font-size: 21px; letter-spacing: 8px; }
.btn.primary:hover { background: linear-gradient(100deg, rgba(255, 111, 174, 0.45), rgba(80, 26, 62, 0.9)); }
.menu-foot {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 1px; color: rgba(255, 255, 255, 0.32);
  white-space: nowrap;
}

/* --- panels */
.panel-head {
  display: flex; align-items: center; gap: 22px; padding: 22px 34px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.panel-head h2 {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: 26px; letter-spacing: 8px; color: #fff;
}
.panel-sub { font-size: 10px; letter-spacing: 4px; color: rgba(255, 183, 213, 0.5); }
.back {
  background: none; border: 1px solid rgba(255, 255, 255, 0.16); color: #e8d9ec;
  padding: 7px 14px; font-size: 12px; letter-spacing: 1px;
}
.back:hover { border-color: var(--pink); color: #fff; }
.panel-body { flex: 1; display: flex; gap: 22px; padding: 18px 34px; overflow: hidden; }
.panel-body.settings { flex-direction: column; max-width: 720px; width: 100%; margin: 0 auto; overflow-y: auto; }
.panel-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 34px 20px; border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.col { display: flex; flex-direction: column; min-height: 0; }
.col.weapons { flex: 1.35; }
.col.maps { flex: 1; }
.col-title {
  font-family: var(--serif); font-size: 15px; letter-spacing: 5px; margin-bottom: 10px;
  color: #ffd9e8;
}
.col-title span { font-family: var(--sans); font-size: 9px; letter-spacing: 2px; color: rgba(255, 255, 255, 0.35); }
.grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  overflow-y: auto; padding-right: 4px;
}
.wcard {
  position: relative; padding: 8px; text-align: left; cursor: pointer;
  background: linear-gradient(160deg, rgba(28, 16, 42, 0.9), rgba(12, 8, 20, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.1);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.wcard:hover { transform: translateY(-2px); border-color: rgba(255, 143, 192, 0.6); }
.wcard.on {
  border-color: var(--c, var(--pink));
  background: linear-gradient(160deg, color-mix(in srgb, var(--c, #ff6fae) 22%, rgba(20, 12, 30, 0.95)), rgba(12, 8, 20, 0.95));
  box-shadow: 0 0 0 1px var(--c, var(--pink)), 0 0 26px -6px var(--c, var(--pink));
}
.wcard .thumb {
  height: 74px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 60%, rgba(255, 255, 255, 0.07), transparent 70%);
  margin-bottom: 4px;
}
.wcard .thumb img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)); }
.wcard .wname { font-family: var(--serif); font-size: 15px; letter-spacing: 2px; }
.wcard .wtype { font-size: 9px; letter-spacing: 1px; color: rgba(255, 255, 255, 0.4); }
.wcard .rar {
  position: absolute; right: 6px; top: 6px; font-size: 8px; letter-spacing: 1px;
  padding: 1px 5px; background: rgba(0, 0, 0, 0.5); color: var(--c, var(--pink));
  border: 1px solid currentColor;
}
.wcard .bars { display: flex; gap: 2px; margin-top: 5px; }
.wcard .bars i {
  height: 3px; flex: 1; background: rgba(255, 255, 255, 0.12);
}
.wcard .bars i.k { background: var(--c, var(--pink)); box-shadow: 0 0 6px var(--c, var(--pink)); }
.detail {
  margin-top: 10px; padding: 10px 12px; min-height: 78px;
  background: rgba(10, 7, 18, 0.55); border-left: 2px solid var(--line);
  font-size: 12px; line-height: 1.7; color: rgba(255, 255, 255, 0.72);
}
.detail b { color: #fff; font-family: var(--serif); letter-spacing: 2px; }
.detail .statrow { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; font-size: 10px; color: rgba(255, 255, 255, 0.45); letter-spacing: 1px; }
.detail .statrow em { font-style: normal; color: var(--pink-soft); }

.mapgrid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.mcard {
  position: relative; height: 96px; cursor: pointer; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: border-color 0.15s, transform 0.15s;
}
.mcard:hover { transform: translateY(-2px); border-color: rgba(255, 143, 192, 0.6); }
.mcard.on { border-color: var(--pink); box-shadow: 0 0 24px -6px var(--pink); }
.mcard .art { position: absolute; inset: 0; }
.mcard[data-map="shrine"] .art {
  background:
    radial-gradient(circle at 76% 22%, rgba(255, 210, 235, 0.95) 0 6%, rgba(255, 130, 190, 0.35) 9%, transparent 40%),
    linear-gradient(180deg, #2a1030, #4a1c38 60%, #1a0d18 100%);
}
.mcard[data-map="market"] .art {
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 120, 80, 0.55), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(80, 255, 220, 0.35), transparent 40%),
    linear-gradient(180deg, #0a0718, #24102a 55%, #160a12 100%);
}
.mcard[data-map="bamboo"] .art {
  background:
    repeating-linear-gradient(90deg, rgba(60, 140, 110, 0.5) 0 3px, transparent 3px 22px),
    radial-gradient(circle at 50% 0%, rgba(190, 255, 235, 0.35), transparent 60%),
    linear-gradient(180deg, #07201c, #103028 60%, #08120f 100%);
}
.mcard[data-map="city"] .art {
  background:
    repeating-linear-gradient(90deg, rgba(140, 190, 255, 0.16) 0 14px, transparent 14px 26px),
    repeating-linear-gradient(0deg, rgba(255, 220, 150, 0.2) 0 6px, transparent 6px 18px),
    radial-gradient(circle at 78% 24%, rgba(110, 230, 255, 0.4), transparent 45%),
    linear-gradient(180deg, #0a1028, #1c2440 55%, #0a0e18 100%);
}
.mcard[data-map="anime"] .art {
  background:
    radial-gradient(circle at 24% 26%, rgba(255, 240, 200, 0.85) 0 5%, transparent 22%),
    radial-gradient(circle at 70% 70%, rgba(255, 160, 210, 0.55), transparent 50%),
    linear-gradient(180deg, #2f5fb8, #8f63c8 45%, #ffb6cc 100%);
}
.mcard .tagline {
  position: absolute; left: 105px; right: 12px; bottom: 10px; font-size: 9px;
  letter-spacing: 1px; color: rgba(255, 255, 255, 0.55);
}
.mcard .mname {
  position: absolute; left: 105px; bottom: 26px;
  font-family: var(--serif); font-size: 20px; letter-spacing: 4px; color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
.mcard .msub { position: absolute; left: 106px; bottom: 46px; font-size: 8px; letter-spacing: 2px; color: var(--pink-soft); }
.mcard .arr { position: absolute; left: 0; top: 0; bottom: 0; width: 92px; background: rgba(0, 0, 0, 0.28); }
.loadout-summary { display: flex; gap: 26px; font-size: 11px; color: rgba(255, 255, 255, 0.45); letter-spacing: 2px; }
.loadout-summary b { display: block; font-family: var(--serif); font-size: 19px; letter-spacing: 3px; color: #fff; }
.btn.deploy { padding: 12px 42px; text-align: center; }

/* settings */
.setrow {
  display: flex; align-items: center; gap: 16px; padding: 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 13px;
}
.setrow > span { width: 160px; letter-spacing: 2px; color: #e8d9ec; }
.setrow input[type="range"] { flex: 1; accent-color: var(--pink); }
.setrow input[type="checkbox"] { width: 44px; height: 22px; accent-color: var(--pink); }
.setrow select {
  flex: 1; background: rgba(10, 7, 18, 0.9); color: #f3ecf7;
  border: 1px solid rgba(255, 255, 255, 0.18); padding: 7px 10px; font-size: 12px;
}
.setrow em { font-style: normal; width: 56px; text-align: right; font-size: 11px; color: var(--pink-soft); }
.hintText { font-size: 11px; color: rgba(255, 255, 255, 0.3); letter-spacing: 1px; }

/* help */
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 26px; align-content: start; }
.keys > div { display: flex; align-items: center; gap: 12px; font-size: 12px; color: rgba(255, 255, 255, 0.75); }
kbd {
  font-family: var(--sans); min-width: 92px; text-align: center; padding: 5px 8px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom-width: 2px; font-size: 10px; letter-spacing: 1px; color: #fff;
}
.tips { margin-left: 20px; max-width: 560px; }
.tips h3 { font-family: var(--serif); font-size: 15px; letter-spacing: 4px; color: var(--pink-soft); font-weight: 400; }
.tips p { font-size: 12px; line-height: 1.8; color: rgba(255, 255, 255, 0.6); margin: 4px 0; }

/* pause / result */
#pause, #result { background: rgba(6, 4, 12, 0.86); backdrop-filter: blur(6px); }
.pause-inner, .result-inner {
  position: relative; width: min(620px, 90vw); padding: 34px 40px;
  background: linear-gradient(160deg, rgba(30, 16, 44, 0.95), rgba(10, 7, 18, 0.96));
  border: 1px solid var(--line);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
  text-align: center;
}
.pause-inner h2, .result-inner h2 {
  margin: 0; font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: 14px;
  background: linear-gradient(180deg, #fff, #ffb7d5);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pause-sub, .r-sub { font-size: 9px; letter-spacing: 6px; color: rgba(255, 183, 213, 0.5); margin-bottom: 18px; }
.pause-stats, .result-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 22px;
}
.result-grid { grid-template-columns: repeat(3, 1fr); }
.pause-stats > div, .result-grid > div {
  padding: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.07);
}
.pause-stats span, .result-grid span { display: block; font-size: 9px; letter-spacing: 2px; color: rgba(255, 255, 255, 0.4); }
.pause-stats b, .result-grid b { font-family: var(--serif); font-size: 25px; letter-spacing: 2px; color: #fff; }
.pause-inner .btn { margin-top: 8px; width: 100%; text-align: center; }
.pause-inner .btn b { letter-spacing: 6px; }
.result-head { text-align: center; }
.r-rank {
  font-family: var(--serif); font-size: 72px; line-height: 1; letter-spacing: 4px;
  background: linear-gradient(180deg, #fff3c4, #ffcf5c 60%, #ff8a3d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(255, 190, 90, 0.6));
}
.result-buttons { display: flex; gap: 12px; }
.result-buttons .btn { text-align: center; }

/* click-to-start / loading */
#clickToStart {
  position: absolute; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 3, 10, 0.55); backdrop-filter: blur(3px); cursor: pointer;
}
.cts-inner { text-align: center; letter-spacing: 4px; color: #fff; font-size: 14px; }
.cts-icon { font-size: 40px; color: var(--pink); margin-bottom: 8px; animation: pulse 1.6s ease-in-out infinite; }
.cts-inner small { display: block; font-size: 9px; letter-spacing: 3px; color: rgba(255, 255, 255, 0.4); margin-top: 6px; }
@keyframes pulse { 0%, 100% { opacity: 0.5; transform: scale(0.95); } 50% { opacity: 1; transform: scale(1.05); } }
#loading {
  position: absolute; inset: 0; z-index: 200; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  background: #07050e; transition: opacity 0.4s;
}
#loading.gone { opacity: 0; pointer-events: none; }
.ld-ring {
  width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid rgba(255, 111, 174, 0.2); border-top-color: var(--pink);
  animation: spin 0.9s linear infinite;
}
.ld-text { font-size: 11px; letter-spacing: 4px; color: rgba(255, 183, 213, 0.7); }
@keyframes spin { to { transform: rotate(360deg); } }

/* scrollbars */
.grid::-webkit-scrollbar, .panel-body::-webkit-scrollbar { width: 6px; }
.grid::-webkit-scrollbar-thumb, .panel-body::-webkit-scrollbar-thumb { background: rgba(255, 111, 174, 0.35); }

@media (max-width: 980px) {
  .panel-body { flex-direction: column; overflow-y: auto; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  #minimapWrap { width: 140px; height: 140px; }
  #vitalsWrap { width: 170px; }
}
