:root {
  --void: #0f8f4a;
  --purple: #39ff88;
  --magenta: #7dffb2;
  --pale: #eafff1;
  --pale-dim: #b9e6c8;
  --ink: #040208;
  --line: rgba(204, 68, 255, 0.55);
  --line-soft: rgba(204, 68, 255, 0.24);
  --display: 'Oxanium', 'Arial Narrow', sans-serif;
  --text: 'Chakra Petch', 'Arial Narrow', sans-serif;
  --mono: 'Azeret Mono', 'Courier New', monospace;
  --slot: clamp(44px, 4.4vw, 58px);
  --slot-m: clamp(42px, 11.5vw, 54px);
  --cut: polygon(0 16px, 16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
  --cut-sm: polygon(0 7px, 7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
}

* { box-sizing: border-box; border-radius: 0 !important; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--pale);
  font-family: var(--text);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
body { position: fixed; inset: 0; }
button { font-family: inherit; color: inherit; cursor: pointer; }
img { -webkit-user-drag: none; user-select: none; }
::selection { background: rgba(255, 63, 208, 0.35); }

#app { position: fixed; inset: 0; overflow: hidden; background: #000; }
#app, #app * { touch-action: none; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(0,0,0,0) 42%, rgba(0,0,0,0.38) 78%, rgba(0,0,0,0.74) 100%);
}
#labels, #dmg-layer { position: fixed; inset: 0; pointer-events: none; z-index: 12; overflow: hidden; }
#dmg-layer { z-index: 13; }

/* ---------- HUD ---------- */
#hud {
  position: fixed; inset: 0; pointer-events: none; z-index: 15;
  opacity: 0; transition: opacity 0.8s ease;
}
body[data-state="title"] #hud,
body[data-state="class"] #hud,
body[data-state="play"] #hud { opacity: 1; }
body[data-state="title"] #hud .skill-slot,
body[data-state="title"] #hud .tiny-btn,
body[data-state="title"] #hud .inv-cell,
body[data-state="title"] #hud .combo-plate { pointer-events: none; }

.hud-tl { position: fixed; top: 14px; left: 16px; display: flex; gap: 10px; align-items: flex-start; }
.fist-mini { width: 48px; height: 58px; display: flex; align-items: flex-start; justify-content: center; }
.fist-mini img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(57,255,136,0.55));
}
.ident { padding-top: 3px; }
.handle {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  letter-spacing: 0.10em; color: var(--pale); text-shadow: 0 0 10px rgba(57,255,136,0.55);
  white-space: nowrap; max-width: 42vw; overflow: hidden; text-overflow: ellipsis;
}
.sub {
  font-size: 8px; letter-spacing: 0.26em; color: var(--pale-dim);
  margin-top: 2px; margin-bottom: 2px; text-transform: uppercase;
}
.sub .dot { color: var(--magenta); }
.sub b { font-family: var(--mono); color: var(--pale); font-weight: 500; }
.bar-stack { margin-top: 13px; width: clamp(190px, 22vw, 274px); }
.hp-bar, .en-bar {
  position: relative; overflow: hidden;
  background: rgba(5,24,13,0.86);
  border: 1px solid rgba(57,255,136,0.4);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.55), inset 0 0 14px rgba(15,143,74,0.2);
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.hp-bar { width: 100%; height: clamp(15px, 1.5vw, 20px); }
.hp-bar .fill {
  position: absolute; left: 1px; top: 1px; bottom: 1px; width: 100%;
  background: linear-gradient(90deg, #0b8f45, #7dffb2 68%, #a2ffc4);
  box-shadow: 0 0 16px rgba(125,255,178,0.6);
  transition: width 0.18s linear;
}
.hp-bar .fill::after, .en-bar .fill::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.34), rgba(255,255,255,0));
}
.en-bar {
  width: 74%; height: clamp(9px, 0.9vw, 12px); margin-top: 5px;
}
.en-bar .fill {
  position: absolute; left: 1px; top: 1px; bottom: 1px; width: 100%;
  background: linear-gradient(90deg, #0a6b35, #35d47a 65%, #c9ffe0);
  box-shadow: 0 0 12px rgba(53,212,122,0.6);
  transition: width 0.18s linear;
}
.bar-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em;
  color: #fff; text-shadow: 0 0 4px #000, 0 0 8px #000; z-index: 2;
}
.en-bar .bar-text { font-size: 7px; justify-content: flex-end; padding-right: 8px; }

.hud-tr { position: fixed; top: 12px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; }
.minimap-wrap { display: flex; flex-direction: column; align-items: flex-end; }
.minimap { position: relative; width: clamp(116px, 12vw, 176px); height: clamp(116px, 12vw, 176px); }
.minimap canvas {
  position: absolute; inset: 3%; width: 94%; height: 94%;
  clip-path: circle(50% at 50% 50%);
  background: radial-gradient(circle at 50% 50%, #04140a 0%, #020105 72%);
}
.minimap .ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.compass {
  position: absolute; font-family: var(--mono); font-size: 7px; color: rgba(220,255,232,0.72);
  letter-spacing: 0.1em; text-shadow: 0 0 6px #000;
}
.compass.n { top: -1px; left: 50%; transform: translateX(-50%); }
.compass.s { bottom: -1px; left: 50%; transform: translateX(-50%); }
.compass.e { right: 0; top: 50%; transform: translateY(-50%); }
.compass.w { left: 0; top: 50%; transform: translateY(-50%); }
.mini-readout {
  display: flex; gap: 12px; justify-content: flex-end;
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em;
  color: rgba(185,230,200,0.78); margin-top: 2px;
}
.inv-row { display: flex; gap: 6px; margin-top: 8px; }
.inv-cell {
  position: relative; width: 40px; height: 48px; padding: 0;
  background: rgba(2,8,4,0.62);
  border: 1px solid var(--line-soft);
  clip-path: var(--cut-sm);
  box-shadow: inset 0 0 12px rgba(15,143,74,0.16);
  pointer-events: auto;
  transition: border-color 0.15s, background 0.15s;
}
.inv-cell:hover { border-color: var(--magenta); background: rgba(8,34,18,0.9); }
.inv-cell img { width: 100%; height: 100%; object-fit: contain; padding: 5px 4px 9px; filter: drop-shadow(0 0 5px rgba(57,255,136,0.55)); }
.inv-cell .count {
  position: absolute; right: 3px; bottom: 1px;
  font-family: var(--mono); font-size: 9px; color: var(--pale);
  text-shadow: 0 0 4px #000, 0 0 6px #000;
}
.inv-cell.zero { opacity: 0.42; }
.gold-readout {
  display: flex; align-items: center; gap: 6px; margin-top: 5px;
  font-family: var(--mono); font-size: 12px; color: var(--pale);
  text-shadow: 0 0 8px rgba(57,255,136,0.55);
}
.gold-readout img { width: 20px; height: 20px; object-fit: contain; }

.zone-name {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  text-align: center; opacity: 0; transition: opacity 0.6s;
}
body[data-state="play"] .zone-name { opacity: 1; }
.zone-name span {
  display: block; font-family: var(--display); font-weight: 600;
  font-size: 14px; letter-spacing: 0.42em; color: var(--pale);
  text-shadow: 0 0 12px rgba(57,255,136,0.6);
}
.zone-name small {
  display: block; font-size: 8px; letter-spacing: 0.5em; margin-top: 3px;
  color: rgba(185,230,200,0.66);
}

.hud-bl { position: fixed; left: 16px; bottom: 98px; z-index: 16; }
.chat-log {
  width: min(300px, 26vw); max-height: 148px; overflow: hidden;
  padding: 10px 12px 9px;
  background: rgba(2,8,4,0.58);
  border: 1px solid var(--line-soft);
  clip-path: var(--cut);
  box-shadow: inset 0 0 18px rgba(15,143,74,0.14);
  font-size: 11px; line-height: 1.62; letter-spacing: 0.045em;
  color: #d9c9f0;
}
.chat-line { display: flex; gap: 7px; animation: chat-in 0.25s ease both; }
.chat-line::before { content: '·'; color: var(--magenta); text-shadow: 0 0 6px var(--magenta); }
.chat-line.danger { color: #9dffc2; }
.chat-line.economy { color: #97e2b0; }
.chat-line.loot { color: #dcffe8; }
.chat-line.system { color: #b9e6c8; }
@keyframes chat-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

.hud-bottom {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: flex-end; z-index: 20;
}
.skill-row { display: flex; align-items: flex-end; gap: 6px; pointer-events: auto; }
.skill-slot {
  position: relative; width: var(--slot); height: var(--slot); padding: 0;
  background: linear-gradient(180deg, rgba(8,30,14,0.92), rgba(3,1,7,0.96));
  border: 1px solid rgba(57,255,136,0.62);
  clip-path: var(--cut-sm);
  box-shadow: inset 0 0 15px rgba(15,143,74,0.22);
  transition: border-color 0.12s, filter 0.15s;
  overflow: hidden;
}
.skill-slot:hover { border-color: var(--magenta); }
.skill-slot .icon {
  position: absolute; left: 9%; top: 6%; width: 82%; height: 82%;
  object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 0 7px rgba(57,255,136,0.55));
}
.skill-slot .cd-sweep {
  position: absolute; inset: 0; pointer-events: none;
  background: conic-gradient(from 0deg, rgba(2,0,6,0.84) calc(var(--cd, 0) * 1%), transparent 0);
}
.skill-slot .skill-key {
  position: absolute; left: 3px; bottom: 1px;
  font-family: var(--mono); font-size: 9px; color: var(--pale);
  background: rgba(0,0,0,0.7); border: 1px solid rgba(57,255,136,0.35);
  padding: 0 3px; z-index: 3;
}
.skill-slot .skill-cost {
  position: absolute; right: 3px; bottom: 1px;
  font-family: var(--mono); font-size: 8px; color: #b4ffd0; z-index: 3;
  text-shadow: 0 0 4px #000;
}
.skill-slot.unfunded { filter: grayscale(0.9) brightness(0.5); border-color: rgba(90,130,100,0.35); }
.skill-slot.ready { animation: ready-flash 0.34s ease; }
.skill-slot.ultimate { border-color: rgba(125,255,178,0.9); box-shadow: inset 0 0 22px rgba(125,255,178,0.28); }
@keyframes ready-flash {
  0% { background: rgba(125,255,178,0.55); box-shadow: 0 0 26px rgba(125,255,178,0.9); }
  100% { background: linear-gradient(180deg, rgba(8,30,14,0.92), rgba(3,1,7,0.96)); }
}
.resource-cell {
  position: relative; width: 26px; height: calc(var(--slot) * 1.2);
  background: rgba(2,8,4,0.9);
  border: 1px solid rgba(57,255,136,0.55);
  clip-path: var(--cut-sm);
  margin: 0 2px;
  box-shadow: inset 0 0 14px rgba(15,143,74,0.24);
}
.resource-cell img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.85; }
.resource-cell .res-fill {
  position: absolute; left: 23%; right: 23%; bottom: 16%;
  height: calc((100% - 32%) * var(--res, 1));
  background: linear-gradient(180deg, #dcffe8, #39ff88 32%, #0f8f4a 82%);
  box-shadow: 0 0 12px rgba(57,255,136,0.6);
  transition: height 0.12s linear;
}
.resource-cell .res-num {
  position: absolute; left: 0; right: 0; bottom: 2px; text-align: center;
  font-family: var(--mono); font-size: 7px; color: #fff;
  text-shadow: 0 0 4px #000, 0 0 8px #000; z-index: 2;
}
.resource-cell::after {
  content: 'EN'; position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 7px; letter-spacing: 0.12em; color: rgba(220,255,232,0.7);
}
.combo-plate { position: relative; width: 152px; height: 60px; margin-left: 14px; opacity: 0.22; transition: opacity 0.2s; }
.combo-plate img { position: absolute; inset: 0; width: 100%; height: 100%; }
.combo-plate .combo-inner {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.combo-plate b {
  font-family: var(--mono); font-weight: 500; font-size: 30px; color: #fff;
  text-shadow: 0 0 10px #39ff88, 0 0 22px rgba(125,255,178,0.8);
  line-height: 1;
}
.combo-plate span { font-size: 8px; letter-spacing: 0.3em; color: var(--pale-dim); }
.combo-plate.live { opacity: 1; }
.combo-plate.pop b { animation: combo-pop 0.18s ease; }
@keyframes combo-pop { 0% { transform: scale(1.4); } 100% { transform: scale(1); } }

.hud-br {
  position: fixed; right: 16px; bottom: 16px; z-index: 22;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.link-status { font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; color: rgba(185,230,200,0.55); }
.br-actions { display: flex; gap: 5px; }
.tiny-btn {
  pointer-events: auto; background: rgba(3,14,7,0.72);
  border: 1px solid var(--line-soft); color: var(--pale-dim);
  font-family: var(--text); font-size: 8px; letter-spacing: 0.18em;
  padding: 5px 8px; clip-path: var(--cut-sm);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.tiny-btn:hover { border-color: var(--magenta); color: var(--pale); background: rgba(10,40,22,0.85); }
.hint-bar {
  position: fixed; left: 50%; bottom: 9px; transform: translateX(-50%);
  font-family: var(--mono); font-size: 7px; letter-spacing: 0.18em;
  color: rgba(185,230,200,0.4); white-space: nowrap; pointer-events: none;
}
.auto-strip { position: fixed; left: 16px; bottom: 174px; z-index: 22; }

/* ---------- World labels ---------- */
.self-label { z-index: 13; }
.self-label .wl-name { color: #effff5; font-size: 8px; letter-spacing: 0.28em; text-shadow: 0 0 12px rgba(57,255,136,0.95), 0 0 4px #000; }

.world-label {
  position: absolute; left: 0; top: 0; text-align: center; pointer-events: none;
  transition: opacity 0.2s; white-space: nowrap;
}
.world-label .wl-name {
  display: block; font-family: var(--text); font-size: 11px; letter-spacing: 0.06em;
  color: #effff5; text-shadow: 0 0 6px #000, 0 0 14px rgba(57,255,136,0.45);
}
.world-label .wl-class { display: block; font-size: 7px; letter-spacing: 0.16em; color: #86c99c; text-shadow: 0 0 6px #000; }
.world-label .wl-hp { display: none; }
.enemy-label { position: absolute; left: 0; top: 0; text-align: center; pointer-events: none; transition: opacity 0.2s; white-space: nowrap; }
.enemy-label span { font-family: var(--text); font-size: 8px; letter-spacing: 0.14em; color: #b8f5ce; text-shadow: 0 0 5px #000; }
.enemy-label span b { font-family: var(--mono); font-weight: 400; color: #86c99c; }
.enemy-label .el-hp { width: 58px; height: 3px; margin: 2px auto 0; background: rgba(0,0,0,0.7); border: 1px solid rgba(57,255,136,0.4); }
.enemy-label .el-hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #0f8f4a, #7dffb2); }
.enemy-label.elite span { font-size: 10px; color: #a8ffc8; }
.enemy-label.elite .el-hp { width: 92px; height: 4px; border-color: rgba(125,255,178,0.7); }

/* ---------- Damage numbers ---------- */
.dmg {
  position: absolute; left: 0; top: 0;
  font-family: var(--mono); font-weight: 500; font-size: 26px;
  color: #ffffff; letter-spacing: -0.02em;
  text-shadow: 0 0 8px #0f8f4a, 0 0 20px rgba(57,255,136,0.7);
  will-change: transform, opacity; pointer-events: none;
}
.dmg.crit {
  font-size: 38px;
  text-shadow: 0 0 3px #fff, 0 0 12px #fff, 0 0 26px #7dffb2, 0 0 44px rgba(125,255,178,0.7);
}
.dmg.bleed { font-size: 15px; color: #8fd6a7; }
.dmg.heal { color: #dcffe8; }
.dmg.float-note { font-family: var(--text); color: #dcffe8; font-size: 11px !important; letter-spacing: 0.12em; text-shadow: 0 0 10px #39ff88; }

/* ---------- Panels ---------- */
.panel-shell { filter: none; }
.panel-cut {
  position: relative; padding: 1px; clip-path: var(--cut);
  background: linear-gradient(140deg, rgba(125,255,178,0.9), rgba(15,143,74,0.35) 42%, rgba(57,255,136,0.85));
}
.panel-in {
  position: relative; height: 100%; padding: 22px 24px;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(15,143,74,0.14), transparent 55%),
    linear-gradient(180deg, rgba(10,6,17,0.95), rgba(2,8,4,0.97));
  clip-path: polygon(0 15px, 15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
  box-shadow: inset 0 0 34px rgba(15,143,74,0.12);
}
.panel-kicker, .kicker {
  font-family: var(--text); font-size: 8px; letter-spacing: 0.34em;
  color: #8fd6a7; text-transform: uppercase;
}
.live-dot {
  display: inline-block; width: 5px; height: 5px; margin-right: 7px;
  background: var(--magenta); box-shadow: 0 0 8px var(--magenta);
  animation: live-pulse 1.8s ease-in-out infinite;
}
@keyframes live-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- Title art ---------- */
#title-art {
  position: fixed; inset: 0; z-index: 8; overflow: hidden; pointer-events: none;
  opacity: 0; transition: opacity 1.1s ease;
}
body[data-state="title"] #title-art,
body[data-state="class"] #title-art { opacity: 1; }
body[data-state="play"] #title-art { opacity: 0; }
.title-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 58%;
  filter: brightness(0.72) contrast(1.16) saturate(0.92);
  transform: scale(1.03);
  translate: calc(var(--par-x, 0px) * 0.45) calc(var(--par-y, 0px) * 0.45);
  animation: bg-breathe 26s ease-in-out infinite alternate;
}
@keyframes bg-breathe {
  from { transform: scale(1.03) translateY(0); }
  to { transform: scale(1.075) translateY(-0.6%); }
}
#title-art::before {
  content: ''; position: absolute; inset: 0; z-index: 3;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.86) 0%, rgba(0,0,0,0.10) 26%, rgba(0,0,0,0) 52%, rgba(0,0,0,0.22) 76%, rgba(0,0,0,0.88) 100%),
    radial-gradient(ellipse at 50% 52%, rgba(0,0,0,0) 34%, rgba(0,0,0,0.42) 100%);
}
.hero-stage {
  position: absolute; left: 50%; bottom: 10.5vh; transform: translateX(-50%);
  translate: calc(var(--par-x, 0px) * 0.8) calc(var(--par-y, 0px) * 0.55);
  height: min(60vh, 640px); aspect-ratio: 1 / 1; z-index: 2;
  pointer-events: none;
}
.hero-glow {
  position: absolute; left: 50%; bottom: 2%; width: 74%; height: 34%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 70%, rgba(125,255,178,0.34), rgba(15,143,74,0.14) 46%, rgba(0,0,0,0) 72%);
  filter: blur(9px);
}
.hero-figure {
  position: absolute; left: 50%; bottom: 0; height: 100%; width: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 0 22px rgba(15,143,74,0.35)) contrast(1.06);
}
.hero-reflection {
  position: absolute; left: 50%; top: 98%; height: 74%; width: auto;
  transform: translateX(-50%) scaleY(-1);
  opacity: 0.17;
  filter: blur(2px) saturate(0.8) brightness(0.8);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.92), rgba(0,0,0,0));
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.92), rgba(0,0,0,0));
  pointer-events: none;
}

/* ---------- Title lockup ---------- */
#title-screen {
  position: fixed; inset: 0; z-index: 20; pointer-events: none;
  display: flex; flex-direction: column; align-items: center;
  padding-top: clamp(22px, 4.4vh, 58px);
  opacity: 0; transition: opacity 1s ease;
}
body[data-state="title"] #title-screen,
body[data-state="class"] #title-screen { opacity: 1; }
body[data-state="play"] #title-screen { opacity: 0; }
.title-lockup {
  position: relative; display: flex; align-items: center; justify-content: center;
  max-width: 96vw; isolation: isolate;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.title-wordmark {
  display: block; width: min(92vw, 1240px); height: auto;
  filter: drop-shadow(0 0 26px rgba(57,255,136,0.55));
}
.tagline-img {
  display: block; width: min(68vw, 860px); height: auto; margin: 0 auto;
}
.fist-wash {
  position: absolute; left: 50%; top: 50%; z-index: 0;
  height: clamp(180px, 24vw, 380px); width: auto;
  transform: translate(-50%, -52%);
  opacity: 0.58;
  filter: brightness(1.24) saturate(0.7) contrast(1.08) drop-shadow(0 0 30px rgba(57,255,136,0.8));
  -webkit-mask-image: radial-gradient(ellipse at 50% 48%, #000 40%, rgba(0,0,0,0.55) 66%, rgba(0,0,0,0) 86%);
  mask-image: radial-gradient(ellipse at 50% 48%, #000 40%, rgba(0,0,0,0.55) 66%, rgba(0,0,0,0) 86%);
  animation: fist-land 1.1s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
.title-lockup h1 {
  position: relative; z-index: 2; margin: 0; padding: 0;
  display: block; font-size: 0; line-height: 0;
}
@keyframes fist-land {
  0% { transform: translate(-50%, -52%) scale(1.5); opacity: 0; }
  70% { opacity: 0.42; }
  100% { transform: translate(-50%, -52%) scale(1); opacity: 0.42; }
}
.tagline {
  position: relative; z-index: 3;
  margin-top: 6px; padding: 0 18px;
}
.tagline::before {
  content: ''; position: absolute; inset: -9px -34px; z-index: -1;
  background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0.96), rgba(0,0,0,0.78) 46%, rgba(0,0,0,0) 76%);
  pointer-events: none;
}

@media (min-width: 761px) {
  #title-screen { padding-top: 6vh; }
}

/* ---------- Login ---------- */
#login-panel {
  position: fixed; z-index: 30; right: 6vw; top: 50%;
  width: min(400px, 88vw); transform: translateY(-38%);
  opacity: 0; pointer-events: none; transition: opacity 0.8s ease, transform 0.8s ease;
}
body[data-state="title"] #login-panel { opacity: 1; pointer-events: auto; transform: translateY(-42%); }
body[data-state="class"] #login-panel,
body[data-state="play"] #login-panel { opacity: 0; transform: translateY(-36%); }
@media (min-width: 761px) {
  body[data-state="title"] #login-panel { top: auto; bottom: 4vh; transform: none; }
}
#login-panel .panel-in { overflow: hidden; padding: 24px 26px 18px; }
.panel-ghost-fist {
  position: absolute; right: -34px; top: -80px; width: 240px; opacity: 0.08;
  pointer-events: none; filter: drop-shadow(0 0 30px rgba(57,255,136,0.5));
}
.panel-ghost-fist img { width: 100%; height: auto; }
.account-line { margin-top: 16px; padding: 10px 0 12px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.account-line b {
  display: block; font-family: var(--mono); font-size: 20px; font-weight: 500;
  letter-spacing: 0.06em; color: var(--pale); text-shadow: 0 0 14px rgba(57,255,136,0.6);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-line span { display: block; margin-top: 4px; font-size: 8px; letter-spacing: 0.22em; color: #86c99c; }
.primary {
  position: relative; width: 100%; margin-top: 16px; padding: 13px 14px;
  background: linear-gradient(90deg, rgba(15,143,74,0.28), rgba(125,255,178,0.3));
  border: 1px solid rgba(125,255,178,0.85);
  clip-path: var(--cut-sm);
  color: #fff; font-family: var(--text); font-size: 12px; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase;
  box-shadow: inset 0 0 22px rgba(125,255,178,0.16);
  transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.primary:hover {
  background: linear-gradient(90deg, rgba(53,212,122,0.5), rgba(125,255,178,0.55));
  box-shadow: inset 0 0 30px rgba(125,255,178,0.32), 0 0 22px rgba(125,255,178,0.35);
}
.primary em { font-style: normal; font-size: 8px; letter-spacing: 0.16em; color: #dcffe8; opacity: 0.75; }
.secondary {
  width: 100%; margin-top: 8px; padding: 10px 12px;
  background: rgba(6,22,12,0.8); border: 1px solid var(--line-soft);
  clip-path: var(--cut-sm); color: var(--pale-dim);
  font-family: var(--text); font-size: 10px; letter-spacing: 0.18em;
  transition: border-color 0.15s, color 0.15s;
}
.secondary:hover { border-color: var(--purple); color: var(--pale); }
.secondary em { font-style: normal; float: right; font-family: var(--mono); font-size: 8px; color: #8fd6a7; }
.panel-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; font-family: var(--mono); font-size: 7px;
  letter-spacing: 0.12em; color: rgba(185,230,200,0.55);
}
.panel-foot span { display: flex; align-items: center; gap: 5px; }
.panel-foot i { width: 5px; height: 5px; background: #64ff9e; box-shadow: 0 0 8px #64ff9e; display: inline-block; }
.link-btn {
  margin-top: 10px; width: 100%; padding: 7px;
  background: transparent; border: 1px solid rgba(57,255,136,0.24);
  clip-path: var(--cut-sm); color: #86c99c;
  font-size: 8px; letter-spacing: 0.26em;
}
.link-btn:hover { border-color: var(--purple); color: var(--pale); }

/* ---------- Class select ---------- */
#class-screen { position: fixed; inset: 0; z-index: 40; display: none; }
body[data-state="class"] #class-screen { display: flex; }
.class-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 46%, rgba(5,22,11,0.62), rgba(0,0,0,0.94) 78%);
}
.class-layout {
  position: relative; z-index: 1; margin: auto; width: min(880px, 94vw);
  display: flex; flex-direction: column; gap: 14px;
  max-height: 92vh; overflow-y: auto; overflow-x: hidden;
  padding: 18px 2px 22px;
  scrollbar-width: none;
}
.class-layout::-webkit-scrollbar { display: none; }
.class-card .panel-in { padding: 26px 30px 24px; }
.class-head { display: flex; gap: 20px; align-items: center; }
.class-sigil {
  width: clamp(84px, 10vw, 138px); height: clamp(100px, 12vw, 158px);
  object-fit: contain; filter: drop-shadow(0 0 22px rgba(57,255,136,0.65));
  flex: none;
}
.class-title .kicker { margin-bottom: 5px; }
.class-title h2 {
  margin: 0; font-family: var(--display); font-weight: 700;
  font-size: clamp(28px, 3.4vw, 44px); letter-spacing: 0.16em;
  color: #effff5; text-shadow: 0 0 18px rgba(57,255,136,0.75), 0 0 50px rgba(15,143,74,0.5);
}
.class-title .role { margin: 4px 0 0; font-size: 9px; letter-spacing: 0.26em; color: #8fd6a7; }
.class-desc {
  margin: 18px 0 16px; max-width: 62ch; font-size: 13px; line-height: 1.65;
  color: var(--pale-dim); letter-spacing: 0.02em;
}
.stat-ladder {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px;
  border-top: 1px solid var(--line-soft);
}
.stat-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid rgba(57,255,136,0.12);
}
.stat-row span { font-size: 8px; letter-spacing: 0.24em; color: #86c99c; }
.stat-row b { font-family: var(--mono); font-weight: 500; font-size: 15px; color: var(--pale); }
.stat-row b em { font-style: normal; font-size: 9px; color: #8fd6a7; }
.material-note {
  margin-top: 16px; padding: 8px 0 8px 12px; border-left: 2px solid var(--magenta);
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.16em; color: #8fd6a7;
}
.material-note span { display: block; margin-top: 4px; color: var(--pale-dim); }
.deploy { margin-top: 18px; }
.other-classes { display: flex; gap: 10px; }
.other-class {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: rgba(6,3,11,0.72); border: 1px solid rgba(57,255,136,0.16);
  clip-path: var(--cut-sm); padding: 9px 12px; opacity: 0.5;
}
.other-class img { width: 40px; height: 48px; object-fit: contain; opacity: 0.85; }
.other-class.c-cyan img { filter: hue-rotate(40deg) saturate(1.4) brightness(1.1); }
.other-class.c-ember img { filter: hue-rotate(292deg) saturate(2) brightness(1.15); }
.other-class.c-void img { filter: grayscale(0.7) brightness(0.7); }
.other-class div { font-size: 8px; letter-spacing: 0.18em; color: var(--pale-dim); }
.other-class div b { display: block; font-size: 9px; letter-spacing: 0.16em; color: var(--pale); margin-bottom: 3px; }

/* ---------- Death ---------- */
#death-screen {
  position: fixed; inset: 0; z-index: 44; display: none;
  align-items: center; justify-content: center; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0.1) 20%, rgba(0,0,0,0.72) 100%);
}
body[data-dead="true"] #death-screen { display: flex; }
.death-inner { text-align: center; }
.death-kicker { font-size: 8px; letter-spacing: 0.5em; color: #9dffc2; text-shadow: 0 0 14px rgba(125,255,178,0.8); }
.death-inner h2 {
  margin: 8px 0 0; font-family: var(--display); font-weight: 700;
  font-size: clamp(44px, 8vw, 92px); letter-spacing: 0.2em; color: #effff5;
  text-shadow: 0 0 22px rgba(125,255,178,0.9), 0 0 60px rgba(15,143,74,0.7);
  animation: death-pulse 1.6s ease-in-out infinite;
}
@keyframes death-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
.death-inner p { margin: 8px 0 18px; font-size: 9px; letter-spacing: 0.42em; color: #8fd6a7; }
.respawn { font-family: var(--mono); color: #fff; text-shadow: 0 0 18px rgba(57,255,136,0.8); }
.respawn span { font-size: 46px; }
.respawn small { display: block; font-size: 8px; letter-spacing: 0.34em; color: #8fd6a7; margin-top: 3px; }

/* ---------- Exchange / Ladder ---------- */
#exchange-screen, #ladder-screen {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(0,0,0,0.66);
}
body[data-panel="exchange"] #exchange-screen { display: flex; }
body[data-panel="ladder"] #ladder-screen { display: flex; }
.exchange-panel { width: min(480px, 94vw); }
.ladder-panel { width: min(440px, 94vw); }
.exchange-panel .panel-in, .ladder-panel .panel-in { padding: 24px 26px; }
.exchange-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.exchange-head h2 {
  margin: 5px 0 0; font-family: var(--display); font-weight: 700;
  font-size: 26px; letter-spacing: 0.18em; color: #effff5;
  text-shadow: 0 0 16px rgba(57,255,136,0.7);
}
.close-btn {
  background: transparent; border: 1px solid var(--line-soft);
  clip-path: var(--cut-sm); color: #86c99c; font-size: 8px;
  letter-spacing: 0.22em; padding: 5px 9px;
}
.close-btn:hover { border-color: var(--magenta); color: var(--pale); }
.exchange-balance {
  display: flex; gap: 26px; margin: 18px 0 12px; padding: 10px 0;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  font-size: 8px; letter-spacing: 0.2em; color: #86c99c;
}
.exchange-balance b { font-family: var(--mono); font-size: 16px; font-weight: 500; color: var(--pale); margin-left: 6px; }
.exchange-actions { display: flex; flex-direction: column; gap: 2px; }
.exchange-actions .primary { margin-top: 6px; }
.exchange-note { margin: 16px 0 0; font-size: 8px; letter-spacing: 0.16em; line-height: 1.7; color: rgba(185,230,200,0.5); }
.ladder-list { margin-top: 16px; border-top: 1px solid var(--line-soft); }
.ladder-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid rgba(57,255,136,0.12);
}
.ladder-row .rank { font-family: var(--mono); font-size: 14px; color: #8fd6a7; width: 26px; }
.ladder-row .who { flex: 1; font-size: 11px; letter-spacing: 0.08em; color: var(--pale); }
.ladder-row a { color: var(--pale); text-decoration: none; border-bottom: 1px solid rgba(57,255,136,0.35); }
.ladder-row .val { font-family: var(--mono); font-size: 14px; color: #fff; text-shadow: 0 0 10px rgba(57,255,136,0.6); }
.ladder-row.mine .who { color: #9dffc2; }
.ladder-empty { padding: 20px 0; font-size: 9px; letter-spacing: 0.22em; color: #86c99c; text-align: center; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; top: 18%; left: 50%; z-index: 80; transform: translate(-50%, -8px);
  max-width: 86vw; padding: 9px 16px;
  background: rgba(2,8,4,0.86); border-left: 2px solid var(--magenta);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--pale);
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
  clip-path: var(--cut-sm);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Quest tracker and log ---------- */
#quest-tracker {
  position: fixed; left: 16px; top: 104px; width: min(262px, 62vw); z-index: 16;
  padding: 9px 12px 10px;
  background: rgba(2,10,6,0.74); border: 1px solid rgba(57,255,136,0.38);
  clip-path: var(--cut-sm); box-shadow: inset 0 0 18px rgba(15,143,74,0.14);
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
body[data-state="play"] #quest-tracker { opacity: 1; }
.qt-kicker { font-family: var(--text); font-size: 7px; letter-spacing: 0.3em; color: #7dffb2; }
.qt-name { margin-top: 3px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: #effff5; }
.qt-desc { margin-top: 3px; font-size: 9px; line-height: 1.45; color: rgba(214,240,222,0.72); }
.qt-bar { margin-top: 7px; height: 5px; background: rgba(5,24,13,0.9); border: 1px solid rgba(57,255,136,0.25); }
#qt-fill { display: block; height: 100%; width: 0%; background: linear-gradient(90deg,#0b8f45,#7dffb2); box-shadow: 0 0 9px rgba(125,255,178,0.55); transition: width 0.2s; }
.qt-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; }
#qt-progress { font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; color: #b9e6c8; }
#quest-btn {
  pointer-events: auto; padding: 3px 8px; border: 1px solid rgba(57,255,136,0.55);
  background: rgba(5,24,13,0.8); color: #dcffe8; font-family: var(--text);
  font-size: 7px; letter-spacing: 0.18em; clip-path: var(--cut-sm); cursor: pointer;
}
#quest-btn:hover { border-color: var(--magenta); }
.qt-rep { margin-top: 6px; padding-top: 5px; border-top: 1px solid rgba(57,255,136,0.16);
  font-family: var(--text); font-size: 6px; letter-spacing: 0.12em; color: #8fd6a7; }
.qt-rep.ready { color: #effff5; text-shadow: 0 0 8px rgba(57,255,136,0.7); }

#quest-screen {
  position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center;
  padding: 18px; background: rgba(0,0,0,0.66);
}
body[data-panel="quests"] #quest-screen { display: flex; }
.quest-panel { width: min(760px, 94vw); max-height: 90vh; }
.quest-panel .panel-in { max-height: 90vh; overflow: auto; }
.quest-section { margin-top: 15px; }
.quest-section h3 { margin: 0 0 8px; font-family: var(--text); font-size: 8px; letter-spacing: 0.3em; color: #7dffb2; }
.quest-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 7px;
  background: rgba(4,16,9,0.72); border: 1px solid rgba(57,255,136,0.22);
  clip-path: var(--cut-sm);
}
.quest-row.done { border-color: rgba(125,255,178,0.7); box-shadow: inset 0 0 16px rgba(15,143,74,0.18); }
.quest-row.locked { opacity: 0.45; }
.qr-body { flex: 1; min-width: 0; }
.qr-name { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: #effff5; }
.qr-desc { margin-top: 2px; font-size: 9px; color: rgba(214,240,222,0.68); }
.qr-bar { margin-top: 6px; height: 4px; background: rgba(5,24,13,0.9); border: 1px solid rgba(57,255,136,0.22); }
.qr-bar i { display: block; height: 100%; background: linear-gradient(90deg,#0b8f45,#7dffb2); }
.qr-meta { margin-top: 4px; display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 8px; color: #8fd6a7; }
.qr-tag { font-family: var(--text); font-size: 6px; letter-spacing: 0.16em; color: #7dffb2; }
.quest-claim {
  flex: 0 0 auto; padding: 7px 12px; border: 1px solid rgba(125,255,178,0.8);
  background: rgba(15,143,74,0.28); color: #effff5; font-family: var(--text);
  font-size: 8px; letter-spacing: 0.18em; clip-path: var(--cut-sm); cursor: pointer;
}
.quest-claim:disabled { opacity: 0.4; cursor: default; }
.guide-open { margin-top: 14px; }

#guide-screen {
  position: fixed; left: auto; right: 16px; top: 72px; width: min(372px, calc(100vw - 32px));
  max-height: calc(100vh - 90px); overflow: auto;
  z-index: 55; display: none; pointer-events: auto;
}
body[data-guide="true"] #guide-screen { display: block; }
.guide-panel .panel-in { padding: 18px 20px 16px; }
.guide-panel h2 { margin: 4px 0 10px; font-family: var(--display); font-size: 26px; letter-spacing: 0.14em; color: #effff5; text-shadow: 0 0 18px rgba(57,255,136,0.6); }
.guide-list { list-style: none; margin: 0 0 14px; padding: 0; }
.guide-list li { display: flex; gap: 9px; padding: 5px 0; border-bottom: 1px solid rgba(57,255,136,0.12); }
.guide-list b { flex: 0 0 56px; font-family: var(--text); font-size: 7px; letter-spacing: 0.18em; color: #7dffb2; }
.guide-list span { font-size: 10px; line-height: 1.45; color: rgba(220,255,232,0.8); }

@media (max-width: 760px) {
  #quest-tracker { left: 10px; top: 96px; width: min(232px, 62vw); padding: 8px 10px 9px; }
  .qt-name { font-size: 10px; }
  .qt-desc { font-size: 8px; }
  .qt-rep { font-size: 5px; }
  #guide-screen { left: 10px; right: 10px; top: 236px; width: auto; max-height: none; overflow: visible; }
  .guide-panel .panel-in { padding: 12px 12px 10px; }
  .guide-panel h2 { font-size: 18px; margin: 2px 0 6px; }
  .guide-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; margin: 0 0 7px; }
  .guide-list li { display: flex; flex-direction: column; gap: 1px; padding: 3px 0; border-bottom: 0; }
  .guide-list b { flex: none; font-size: 6px; letter-spacing: 0.12em; }
  .guide-list span { font-size: 7px; line-height: 1.3; }
  .guide-panel .primary { margin-top: 2px; padding: 9px; font-size: 9px; }
}

/* ---------- Touch stick ---------- */
#stick {
  display: none; position: fixed; left: 0; top: 0;
  width: 124px; height: 124px; z-index: 24; pointer-events: none;
  transform: translate(-50%, -50%);
}
#stick.visible { display: block; }
.stick-label {
  position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  margin-top: 6px; text-align: center; white-space: nowrap;
  font-family: var(--mono); font-size: 7px; letter-spacing: 0.3em;
  color: rgba(185,230,200,0.7); text-shadow: 0 0 8px rgba(57,255,136,0.5);
}
.stick-base {
  width: 124px; height: 124px; border: 1.5px solid rgba(125,255,178,0.66);
  background: radial-gradient(circle at 50% 42%, rgba(24,82,50,0.58), rgba(4,14,9,0.74) 72%);
  box-shadow: inset 0 0 24px rgba(57,255,136,0.26), 0 0 20px rgba(57,255,136,0.22);
  position: relative; clip-path: circle(50% at 50% 50%);
  filter: drop-shadow(0 0 10px rgba(57,255,136,0.35));
  pointer-events: none;
}
.stick-knob {
  position: absolute; left: 50%; top: 50%; width: 50px; height: 50px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 40% 34%, rgba(230,255,240,0.95), rgba(96,255,166,0.78) 44%, rgba(15,143,74,0.55));
  border: 1.5px solid rgba(205,255,225,0.92);
  box-shadow: 0 0 24px rgba(57,255,136,0.6), inset 0 0 9px rgba(255,255,255,0.28);
  clip-path: circle(50% at 50% 50%);
}

/* ---------- Loading ---------- */
#loading-screen {
  position: fixed; inset: 0; z-index: 100; background: #000; overflow: hidden;
  transition: opacity 0.8s ease;
}
#loading-screen.gone { opacity: 0; pointer-events: none; }
.load-eagle {
  position: absolute; left: 50%; top: 52%; width: min(56vw, 720px);
  transform: translate(-50%, -50%);
  animation: eagle-cross 2.5s cubic-bezier(0.35, 0, 0.75, 1) forwards;
  filter: drop-shadow(0 0 30px rgba(57,255,136,0.5));
}
.load-eagle .eagle-frame { display: block; width: 100%; height: auto; position: absolute; inset: 0; }
.load-eagle .eagle-frame.high { animation: wing-a 0.46s steps(1, end) infinite; }
.load-eagle .eagle-frame.low { animation: wing-b 0.46s steps(1, end) infinite; }
@keyframes wing-a { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes wing-b { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes eagle-cross {
  0% { transform: translate(-115vw, 34vh) rotate(-9deg) scale(0.82); opacity: 0.2; }
  18% { opacity: 1; }
  78% { opacity: 1; }
  100% { transform: translate(70vw, -62vh) rotate(9deg) scale(1.06); opacity: 0; }
}
.ion-trail {
  position: absolute; left: -30%; top: 55%; width: 130%; height: 3px;
  background: linear-gradient(90deg, rgba(125,255,178,0), rgba(125,255,178,0.7) 55%, rgba(57,255,136,0.15));
  transform: rotate(-32deg) scaleX(1.2);
  filter: blur(2px);
  opacity: 0.7;
}
.load-progress {
  position: absolute; left: 7%; right: 7%; bottom: 6%;
  height: 1px; background: rgba(15,143,74,0.22);
}
.load-progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #0f8f4a, #7dffb2 72%, #a8ffc8);
  box-shadow: 0 0 10px rgba(125,255,178,0.8);
  transition: width 0.18s linear;
}
.load-status {
  position: absolute; left: 7%; right: 7%; bottom: 7.4%;
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 7px; letter-spacing: 0.22em; color: rgba(185,230,200,0.45);
}
.load-wordmark {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
}
.load-wordmark span {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(64px, 13vw, 190px); line-height: 0.8; letter-spacing: 0.12em;
  color: #effff5; opacity: 0; transform: translateY(0.35em);
  text-shadow: 0 0 2px #fff, 0 0 20px rgba(57,255,136,0.9), 0 0 70px rgba(15,143,74,0.7);
}
.load-wordmark img {
  height: clamp(60px, 10vw, 150px); width: auto; margin-right: -0.32em;
  opacity: 0; transform: scale(1.8) rotate(-16deg);
  filter: drop-shadow(0 0 24px rgba(57,255,136,0.7));
}
#loading-screen.reveal .load-wordmark { opacity: 1; }
#loading-screen.reveal .load-wordmark span { animation: letter-rise 0.75s cubic-bezier(0.2,0.9,0.2,1) both; }
#loading-screen.reveal .load-wordmark span:nth-child(1) { animation-delay: 0.02s; }
#loading-screen.reveal .load-wordmark span:nth-child(2) { animation-delay: 0.09s; }
#loading-screen.reveal .load-wordmark span:nth-child(3) { animation-delay: 0.16s; }
#loading-screen.reveal .load-wordmark span:nth-child(4) { animation-delay: 0.23s; }
#loading-screen.reveal .load-wordmark span:nth-child(5) { animation-delay: 0.30s; }
#loading-screen.reveal .load-wordmark img { animation: fist-in 0.8s cubic-bezier(0.2,0.9,0.2,1) 0.42s both; }
@keyframes letter-rise {
  0% { opacity: 0; transform: translateY(0.35em); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0); text-shadow: 0 0 2px #fff, 0 0 20px rgba(57,255,136,0.9), 0 0 70px rgba(15,143,74,0.7); }
}
@keyframes fist-in {
  0% { opacity: 0; transform: scale(1.8) rotate(-16deg); }
  70% { opacity: 1; }
  100% { opacity: 1; transform: scale(1) rotate(-5deg); }
}
#loading-screen .load-eagle { translate: calc(var(--par-x, 0px) * 0.9) calc(var(--par-y, 0px) * 0.6); }
#loading-screen .load-wordmark { translate: calc(var(--par-x, 0px) * 0.7) calc(var(--par-y, 0px) * 0.5); }
#loading-screen .load-progress, #loading-screen .load-status { translate: calc(var(--par-x, 0px) * 0.25) 0px; }
.class-layout { translate: calc(var(--par-x, 0px) * 0.16) calc(var(--par-y, 0px) * 0.12); }
#login-panel { translate: calc(var(--par-x, 0px) * 0.06) calc(var(--par-y, 0px) * 0.05); }
#loading-screen.blackout .load-eagle { opacity: 0; transition: opacity 0.5s ease; }
#loading-screen.blackout .ion-trail { opacity: 0; transition: opacity 0.5s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hud-bl { bottom: 104px; }
  .chat-log { width: min(300px, 42vw); max-height: 108px; font-size: 10px; }
  .auto-strip { bottom: 238px; }
  .combo-plate { width: 124px; height: 52px; margin-left: 10px; }
  .combo-plate b { font-size: 24px; }
}

@media (max-width: 760px) {
  .hud-tl { top: 10px; left: 10px; gap: 7px; }
  .fist-mini { width: 34px; height: 42px; }
  .handle { font-size: 11px; max-width: 46vw; }
  .sub { font-size: 7px; letter-spacing: 0.2em; }
  .bar-stack { width: clamp(140px, 42vw, 200px); }
  .hp-bar { height: 34px; }
  .hud-tr { top: 8px; right: 10px; }
  .minimap { width: 104px; height: 104px; }
  .inv-row { gap: 4px; margin-top: 5px; }
  .inv-cell { width: 32px; height: 39px; }
  .inv-cell .count { font-size: 8px; }
  .gold-readout { font-size: 10px; }
  .gold-readout img { width: 16px; height: 16px; }
  .mini-readout { font-size: 7px; gap: 7px; }
  .zone-name { top: 176px; }
  .zone-name span { font-size: 9px; letter-spacing: 0.3em; }
  .zone-name small { font-size: 6px; letter-spacing: 0.34em; }
  .hud-bl { display: none; }
  .hud-bottom {
    left: auto; right: 8px; bottom: 12px; transform: none;
    display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  }
  .skill-row {
    position: relative; display: grid;
    grid-template-columns: repeat(4, var(--slot-m));
    grid-auto-rows: var(--slot-m); gap: 5px;
  }
  .skill-slot { width: var(--slot-m); height: var(--slot-m); }
  .skill-slot .skill-key { font-size: 7px; }
  .skill-slot .skill-cost { font-size: 6px; }
  .resource-cell {
    position: absolute; right: 100%; margin-right: 8px; bottom: 0;
    width: 20px; height: calc(var(--slot-m) * 2 + 5px);
    margin-left: 0;
  }
  .resource-cell::after { display: none; }
  .combo-plate { margin: 0; width: 108px; height: 42px; }
  .combo-plate b { font-size: 21px; }
  .combo-plate span { font-size: 6px; letter-spacing: 0.2em; }
  .hud-br { left: 10px; right: auto; top: 142px; bottom: auto; align-items: flex-start; gap: 4px; }
  .link-status { font-size: 6px; }
  .br-actions { flex-direction: column; gap: 3px; }
  .tiny-btn { font-size: 7px; padding: 4px 6px; }
  .hint-bar { display: none; }
  .auto-strip { display: none; }
  .world-label .wl-name { font-size: 9px; }
  .world-label .wl-class { font-size: 6px; }
  .enemy-label span { font-size: 7px; }
  .dmg { font-size: 20px; }
  .dmg.crit { font-size: 30px; }
  .dmg.bleed { font-size: 12px; }

  #title-screen { padding-top: 10vh; }
  .title-wordmark { width: 94vw; }
  .tagline-img { width: 74vw; }
  .fist-mark { height: 0.82em; margin-right: -0.26em; }

  #login-panel {
    right: 10px; left: 10px; top: auto; bottom: 12px;
    width: auto; transform: none;
  }
  body[data-state="title"] #login-panel { transform: none; }
  #login-panel .panel-in { padding: 18px 18px 14px; }
  .panel-ghost-fist { width: 180px; right: -24px; top: -56px; }
  .account-line b { font-size: 17px; }
  .primary { padding: 12px; font-size: 10px; }

  .class-layout { width: 94vw; max-height: 94vh; padding-top: 10px; }
  .class-card .panel-in { padding: 18px 16px 16px; }
  .class-head { gap: 12px; align-items: flex-start; }
  .class-sigil { width: 72px; height: 86px; }
  .class-title h2 { font-size: 26px; letter-spacing: 0.12em; }
  .class-title .role { font-size: 7px; letter-spacing: 0.18em; }
  .class-desc { font-size: 11px; margin: 13px 0 12px; }
  .stat-ladder { grid-template-columns: 1fr; gap: 0; }
  .stat-row { padding: 5px 0; }
  .stat-row b { font-size: 13px; }
  .material-note { font-size: 7px; }
  .other-classes { gap: 6px; }
  .other-class { padding: 7px 8px; gap: 7px; }
  .other-class img { width: 28px; height: 34px; }
  .other-class div { font-size: 6px; letter-spacing: 0.12em; }
  .other-class div b { font-size: 7px; }

  .respawn span { font-size: 38px; }
}

@media (min-width: 761px) and (pointer: fine) {
  body[data-state="play"] #basic-attack { display: flex; left: 16px; right: auto; bottom: 24px; }
  body[data-state="play"] #auto-attack { display: flex; left: 88px; right: auto; bottom: 34px; }
}

@media (max-height: 560px) and (orientation: landscape) {
  #basic-attack { right: auto; left: 50%; transform: translateX(-50%); bottom: 18px; }
  #auto-attack { right: auto; left: calc(50% - 120px); bottom: 28px; }
}

@media (pointer: coarse) {
  .skill-slot { pointer-events: auto; }
}

@media (pointer: coarse) and (min-width: 761px) {
  .hud-bl { bottom: 20px; }
  .auto-strip { display: none; }
}

@media (max-height: 560px) and (orientation: landscape) {
  #title-screen { padding-top: 2vh; }
  .title-wordmark { width: min(44vw, 520px); }
  .tagline-img { width: min(34vw, 400px); }
  #login-panel { top: auto; bottom: 2vh; right: 2vw; width: min(320px, 36vw); transform: none; }
  body[data-state="title"] #login-panel { transform: none; }
  .hud-tl { top: 6px; }
  .hud-tr { top: 4px; }
  .minimap { width: 88px; height: 88px; }
  .inv-cell { width: 28px; height: 34px; }
  .hud-br { bottom: 8px; }
  .chat-log { max-height: 70px; font-size: 8px; width: 230px; }
  .hud-bl { bottom: 96px; }
  .auto-strip { display: none; }
}


/* key-art HUD: only the live essentials on the banner */
body[data-state="title"] .hud-tl,
body[data-state="class"] .hud-tl,
body[data-state="title"] .hud-tr,
body[data-state="class"] .hud-tr { opacity: 0; pointer-events: none; }
body[data-state="title"] .handle,
body[data-state="title"] .sub,
body[data-state="title"] .hud-bl,
body[data-state="title"] .zone-name,
body[data-state="title"] .hint-bar,
body[data-state="title"] .hud-br,
body[data-state="title"] .auto-strip { opacity: 0; pointer-events: none; }
body[data-state="title"] .inv-row,
body[data-state="title"] .gold-readout,
body[data-state="class"] .inv-row,
body[data-state="class"] .gold-readout { display: none; }
#labels { opacity: 0; transition: opacity 0.6s ease; }
body[data-state="play"] #labels { opacity: 1; }
body[data-state="class"] .hud-bl,
body[data-state="class"] .hud-br,
body[data-state="class"] .inv-row,
body[data-state="class"] .gold-readout,
body[data-state="class"] .zone-name,
body[data-state="class"] .hint-bar { opacity: 0; }
body[data-state="title"] .sub { display: none; }

/* skill plate depth: bevel lip and inset glyph */
.skill-slot::before {
  content: ''; position: absolute; inset: 2px; z-index: 1; pointer-events: none;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), inset 0 -1px 0 rgba(0,0,0,0.8);
  clip-path: polygon(0 4px, 4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%);
}
.skill-slot::after {
  content: ''; position: absolute; left: 8%; right: 8%; bottom: 0; height: 2px; z-index: 1;
  background: linear-gradient(90deg, rgba(125,255,178,0), rgba(125,255,178,0.55), rgba(125,255,178,0));
  pointer-events: none;
}
.skill-slot .skill-key, .skill-slot .skill-cost { z-index: 4; }

/* loading fist sits behind the full wordmark */
.load-wordmark { position: absolute; }
.load-wordmark img {
  position: absolute; left: 50%; top: 50%;
  height: 1.55em; width: auto; opacity: 0;
  transform: translate(-50%, -50%) scale(1.5);
  filter: brightness(1.1) saturate(0.7) drop-shadow(0 0 32px rgba(57,255,136,0.8));
  z-index: 0;
}
.load-wordmark span { position: relative; z-index: 1; }
#loading-screen.reveal .load-wordmark img { animation: load-fist 0.9s cubic-bezier(0.2,0.9,0.2,1) 0.44s both; }
@keyframes load-fist {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
  70% { opacity: 0.38; }
  100% { opacity: 0.38; transform: translate(-50%, -50%) scale(1); }
}

#basic-attack {
  display: none; position: fixed; z-index: 24; align-items: center; justify-content: center;
  flex-direction: column; gap: 1px; width: 64px; height: 64px; padding: 4px;
  border-radius: 50% !important; border: 1.5px solid rgba(125,255,178,0.85);
  background: radial-gradient(circle at 50% 38%, rgba(26,92,56,0.96), rgba(2,8,5,0.98) 72%);
  box-shadow: inset 0 0 18px rgba(15,143,74,0.3), 0 0 18px rgba(57,255,136,0.25);
  color: #effff5; pointer-events: auto;
}
#basic-attack img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 7px rgba(57,255,136,0.7)); pointer-events: none; }
#basic-attack span { font-family: var(--text); font-size: 6px; letter-spacing: 0.16em; color: #d8ffe8; pointer-events: none; }
#auto-attack {
  display: none; position: fixed; z-index: 24; align-items: center; justify-content: center;
  width: 66px; height: 27px; padding: 0;
  border-radius: 50% !important; border: 1px solid rgba(125,255,178,0.6);
  background: rgba(3,16,9,0.9); color: rgba(216,255,232,0.75);
  font-family: var(--text); font-size: 6px; letter-spacing: 0.14em;
  pointer-events: auto;
}
#auto-attack.on {
  color: #05200f; background: #7dffb2; border-color: #dcffe8;
  box-shadow: 0 0 16px rgba(57,255,136,0.8);
}

/* ---------- Radial skill wheel (touch / phone) ---------- */
@media (max-width: 760px), (pointer: coarse), (max-width: 1024px) and (orientation: portrait), (max-height: 560px) and (orientation: landscape) {
  body[data-state="play"] #basic-attack { display: flex; }
  #basic-attack { right: calc(var(--slot-m) * 4 + 18px); bottom: 20px; }
  body[data-state="play"] #auto-attack { display: flex; }
  #auto-attack { right: calc(var(--slot-m) * 4 + 90px); bottom: 30px; }
  .hud-bottom {
    left: auto; right: 4px; bottom: 8px; top: auto; transform: none;
    width: calc(var(--slot-m) * 4);
    height: calc(var(--slot-m) * 4);
    display: block; pointer-events: none;
  }
  .skill-row {
    position: relative; display: block;
    width: 100%; height: 100%;
    pointer-events: none;
    --rad: calc(var(--slot-m) * 1.32);
  }
  .skill-row::before {
    content: ''; position: absolute; inset: 14%; border-radius: 50%;
    border: 1px solid rgba(57,255,136,0.20);
    box-shadow: inset 0 0 26px rgba(15,143,74,0.16), 0 0 22px rgba(15,143,74,0.12);
    pointer-events: none;
  }
  .skill-slot {
    position: absolute; left: 50%; top: 50%;
    width: var(--slot-m); height: var(--slot-m);
    margin: calc(var(--slot-m) / -2) 0 0 calc(var(--slot-m) / -2);
    transform: rotate(var(--ang)) translate(var(--rad)) rotate(calc(var(--ang) * -1));
    pointer-events: auto;
    border-radius: 50% !important;
    clip-path: none;
    border: 1.5px solid rgba(57,255,136,0.75);
    background: radial-gradient(circle at 50% 36%, rgba(20,70,42,0.96), rgba(2,8,5,0.98) 72%);
    box-shadow: inset 0 0 18px rgba(15,143,74,0.25), 0 0 14px rgba(57,255,136,0.18);
  }
  .skill-slot::before { inset: 3px; border-radius: 50% !important; clip-path: none; }
  .skill-slot::after { display: none; }
  .skill-slot .skill-key {
    left: 7px; bottom: 5px; width: 15px; height: 15px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50% !important;
  }
  .skill-slot .skill-cost { right: 7px; bottom: 5px; }
  .skill-slot:nth-of-type(1) { --ang: 90deg; }
  .skill-slot:nth-of-type(2) { --ang: 141.43deg; }
  .skill-slot:nth-of-type(3) { --ang: 192.86deg; }
  .skill-slot:nth-of-type(4) { --ang: 244.29deg; }
  .skill-slot:nth-of-type(5) { --ang: 295.71deg; }
  .skill-slot:nth-of-type(6) { --ang: 347.14deg; }
  .skill-slot:nth-of-type(7) { --ang: 38.57deg; }
  .resource-cell {
    position: absolute; left: 50%; top: 50%; right: auto; bottom: auto;
    transform: translate(-50%, -50%);
    width: 20px; height: calc(var(--slot-m) * 1.3);
    margin: 0; pointer-events: none;
  }
  .resource-cell::after { display: none; }
  .combo-plate {
    position: absolute; right: 0; bottom: calc(100% + 2px);
    margin: 0; width: 104px; height: 40px;
  }
  .combo-plate b { font-size: 22px; }
}
