:root {
  --bg: #140f24; --panel: #1f1836; --panel2: #2a2148; --line: #4a3d7a; --gold: #fbbf24;
  --txt: #f1ecff; --mut: #a99fcf; --hp: #e5394b; --mp: #3b82f6; --ward: #e8f4ff; --exp: #a3e635;
  --acc: #7df9ff; --red: #ff5a6a; --green: #4ade80;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--txt);
  font-family: 'Pixelify Sans', system-ui, sans-serif; font-size: 15px; user-select: none; }
img { image-rendering: pixelated; }
button { font-family: inherit; color: inherit; cursor: pointer; }
.screen { position: fixed; inset: 0; display: none; }
.screen.active { display: block; }
.ico { width: 18px; height: 18px; vertical-align: -4px; }
.mut { color: var(--mut); } .gold { color: var(--gold); } .red { color: var(--red); } .green { color: var(--green); }

/* ---------- przyciski ---------- */
.btn { background: linear-gradient(#4b3b8f, #33276a); border: 2px solid #8b7be0; border-radius: 10px; padding: 10px 16px;
  font-size: 16px; font-weight: 600; box-shadow: 0 3px 0 #1a1238; transition: transform .05s; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #1a1238; }
.btn.gold { background: linear-gradient(#d99b18, #a8700a); border-color: #ffd36b; color: #fff; }
.btn.red { background: linear-gradient(#b8283a, #7c1625); border-color: #ff7b8a; }
.btn.green { background: linear-gradient(#2f9e57, #1d6b3a); border-color: #74f0a2; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; filter: grayscale(.6); }
.btn.block { width: 100%; display: block; margin: 6px 0; }

/* ---------- ekran tytułowy ---------- */
#title { background: #000 url(../assets/title_bg.jpg) center/cover; }
.title-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(60px + var(--safe-t)) 20px calc(40px + var(--safe-b)); background: linear-gradient(transparent 40%, rgba(10,6,24,.85)); }
.logo { font-size: 48px; letter-spacing: 5px; margin: 0; text-align: center; color: #fff;
  text-shadow: 0 0 20px #b06bff, 0 0 35px rgba(176, 107, 255, 0.6), 0 4px 0 #3b1d7a, 0 6px 14px #000; line-height: 1.1; }
.logo small { display: block; }
#title-menu { width: 100%; max-width: 420px; }
.create-box { background: rgba(20,15,36,.92); border: 2px solid var(--line); border-radius: 14px; padding: 14px; }
.create-box input { width: 100%; padding: 12px; font: inherit; font-size: 17px; background: #0d0a18; color: var(--txt);
  border: 2px solid var(--line); border-radius: 8px; margin: 6px 0 12px; }
.class-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; max-height: 38vh; overflow: auto; }
.class-pick .opt { background: var(--panel2); border: 2px solid var(--line); border-radius: 10px; padding: 6px 4px; text-align: center; font-size: 13px; }
.class-pick .opt img { width: 56px; height: 56px; display: block; margin: 0 auto; }
.class-pick .opt.sel { border-color: var(--gold); box-shadow: 0 0 10px var(--gold); }
.class-desc { font-size: 13px; color: var(--mut); min-height: 36px; margin: 8px 0; }

/* ---------- mapa ---------- */
#map { position: absolute; inset: 0; background: #1b2a22; }
.fantasy-tiles { filter: sepia(.55) saturate(1.5) hue-rotate(55deg) brightness(.72) contrast(1.15); }
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution { font-size: 9px; background: rgba(0,0,0,.4) !important; color: #aaa; margin-bottom: calc(70px + var(--safe-b)) !important; }
.leaflet-control-attribution a { color: #ccc; }
.ent-icon { background: none; border: none; }
.ent-icon img { width: 100%; height: 100%; filter: drop-shadow(0 3px 2px rgba(0,0,0,.7)); transition: opacity .3s; }
.ent-icon.far img { opacity: .55; }
.ent-icon .lvl { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); background: rgba(10,6,24,.85);
  border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; font-size: 11px; white-space: nowrap; }
.ent-icon .lvl.berserk { border-color: var(--red); color: var(--red); }
.ent-icon .lvl.boss { border-color: var(--gold); color: var(--gold); font-size: 12px; }
.ent-icon .elem-dot { position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; border: 1px solid #000; }
.ent-icon .tag { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); font-size: 10px; white-space: nowrap;
  background: rgba(10,6,24,.8); padding: 0 4px; border-radius: 4px; }
.ent-monster img { animation: bob 2.4s ease-in-out infinite; }
.raid-aura { position: absolute; inset: -10%; border-radius: 50%; background: radial-gradient(rgba(255,60,60,.5), transparent 65%); animation: pulse 1.6s infinite; }
.player-icon img { position: relative; z-index: 2; }
.player-icon .pulse { position: absolute; left: 50%; bottom: 4px; width: 40px; height: 14px; margin-left: -20px; border-radius: 50%;
  background: rgba(125,249,255,.5); animation: pulse 1.8s infinite; }
.player-icon.aura-storm .pulse { background: rgba(70,180,255,.8); box-shadow: 0 0 16px #4db2ff, 0 0 28px #1f6fff; animation: pulse 1.2s infinite; }
.player-icon.aura-blood .pulse { background: rgba(255,30,50,.8); box-shadow: 0 0 16px #ff2a3d, 0 0 28px #990010; animation: pulse 1.2s infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }

/* ---------- HUD ---------- */
#hud { position: absolute; top: calc(6px + var(--safe-t)); left: 6px; right: 6px; z-index: 900; display: flex; gap: 8px; align-items: center;
  background: rgba(20,15,36,.88); border: 2px solid var(--line); border-radius: 12px; padding: 6px 8px; }
.hud-portrait { width: 52px; height: 52px; border-radius: 10px; background: var(--panel2) center/90% no-repeat; border: 2px solid var(--line); flex: none; }
.hud-main { flex: 1; min-width: 0; }
.hud-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lvl-badge { background: var(--gold); color: #000; border-radius: 6px; padding: 0 5px; font-size: 12px; }
.hud-cur { font-size: 13px; text-align: right; flex: none; }
.bar { position: relative; height: 12px; background: #0b0816; border: 1px solid #000; border-radius: 6px; overflow: hidden; margin-top: 3px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .35s; }
.bar span { position: absolute; inset: 0; font-size: 10px; line-height: 11px; text-align: center; text-shadow: 0 1px 1px #000; }
.bar.hp i { background: linear-gradient(#ff6b7a, var(--hp)); }
.bar.mp i { background: linear-gradient(#6ba7ff, var(--mp)); }
.bar.ward i { background: linear-gradient(#ffffff, #b9d8ff); }
.bar.ward span { color: #123; text-shadow: none; }
.bar.exp { height: 5px; } .bar.exp i { background: var(--exp); }
.bar.big { height: 18px; } .bar.big span { font-size: 12px; line-height: 17px; }
.bar.thin { height: 6px; }
#gps-chip { position: absolute; top: calc(78px + var(--safe-t)); left: 8px; z-index: 900; font-size: 11px; background: rgba(20,15,36,.85);
  padding: 2px 8px; border-radius: 8px; border: 1px solid var(--line); }
#gps-chip.sim { border-color: var(--gold); color: var(--gold); }
#buff-row { position: absolute; top: calc(78px + var(--safe-t)); right: 8px; z-index: 900; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; }
#buff-row .b { font-size: 11px; background: rgba(20,15,36,.85); border: 1px solid var(--green); border-radius: 8px; padding: 1px 6px; }
.round-btn { position: absolute; z-index: 900; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line);
  background: rgba(20,15,36,.9); font-size: 24px; right: 10px; bottom: calc(90px + var(--safe-b)); display: none; }
.round-btn.show { display: block; }
#bottom-nav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 900; display: flex; background: rgba(20,15,36,.95);
  border-top: 2px solid var(--line); padding: 4px 2px calc(4px + var(--safe-b)); }
#bottom-nav button { flex: 1; background: none; border: none; display: flex; flex-direction: column; align-items: center; font-size: 11px; padding: 2px; }
#bottom-nav img { width: 36px; height: 36px; }

/* ---------- okna ---------- */
.modal { position: fixed; inset: 0; z-index: 2000; display: none; background: rgba(5,3,12,.6); align-items: flex-end; justify-content: center; }
.modal.open { display: flex; }
.modal-box { width: 100%; max-width: 560px; max-height: 92vh; background: var(--panel); border: 2px solid var(--line); border-bottom: none;
  border-radius: 16px 16px 0 0; display: flex; flex-direction: column; padding-bottom: var(--safe-b); animation: slideUp .2s; }
.popup { align-items: center; z-index: 2100; }
.modal-box.small { max-width: 400px; border-radius: 16px; border-bottom: 2px solid var(--line); padding: 16px; max-height: 85vh; overflow: auto; width: 92%; }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } }
.modal-head { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 20px; flex: 1; }
.x { background: none; border: none; font-size: 22px; }
.modal-tabs { display: flex; overflow-x: auto; gap: 4px; padding: 6px 8px 0; }
.modal-tabs:empty { display: none; }
.modal-tabs button { background: var(--panel2); border: 1px solid var(--line); border-bottom: none; border-radius: 8px 8px 0 0; padding: 6px 12px; white-space: nowrap; font-size: 13px; }
.modal-tabs button.on { background: var(--line); color: #fff; }
.modal-body { overflow-y: auto; padding: 12px 14px 20px; flex: 1; -webkit-overflow-scrolling: touch; }
.section-t { font-size: 13px; color: var(--mut); text-transform: uppercase; letter-spacing: 1px; margin: 14px 0 6px; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.card.click:active { background: #352a5c; }
.card.sel { border-color: var(--gold); }
.card.locked { opacity: .55; }
.card .t { font-weight: 600; }
.card .s { font-size: 12px; color: var(--mut); }
.list-ico { width: 44px; height: 44px; flex: none; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 14px; }
.stat-grid div { display: flex; justify-content: space-between; border-bottom: 1px dashed #3a3060; padding: 2px 0; }
.equip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.slot { aspect-ratio: 1; background: #120d22; border: 2px solid var(--line); border-radius: 10px; position: relative; display: flex; align-items: center; justify-content: center; }
.slot img { width: 80%; height: 80%; }
.slot img.empty { opacity: .18; }
.slot .q { position: absolute; bottom: 2px; right: 4px; font-size: 10px; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.chip { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); margin: 1px; }
.tree-tier { margin: 8px 0; }
.tree-tier .tt { font-size: 13px; color: var(--gold); }
.skill-el { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.price { color: var(--gold); white-space: nowrap; }
.empty-msg { text-align: center; color: var(--mut); padding: 30px 0; }

/* ---------- battle (Starborn-style side view) ---------- */
#battle { z-index: 1500; overflow: hidden; background: #000; }
.battle-bg { position: absolute; inset: 0; background: #120d22 center / cover no-repeat; }
.battle-bg::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(5,3,12,.55), transparent 22%, transparent 70%, rgba(5,3,12,.6)); }
.bg-anim { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bg-anim > * { position: absolute; display: block; }
.bg-swirl { border-radius: 50%; will-change: transform;
  -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent 92%); mask-image: radial-gradient(closest-side, #000 60%, transparent 92%); }
.bg-sway { left: 0; right: 0; transform-origin: 50% 100%; animation: bgSway 4.5s ease-in-out infinite;
  -webkit-mask-image: linear-gradient(transparent, #000 30%); mask-image: linear-gradient(transparent, #000 30%); }
.bg-glow { border-radius: 50%; mix-blend-mode: screen; }
.bg-torch { border-radius: 50%; mix-blend-mode: screen; animation: torch 1.4s infinite;
  background: radial-gradient(closest-side, rgba(255,190,90,.75), rgba(255,120,30,.25) 55%, transparent); }
.ember { width: 4px; height: 4px; border-radius: 50%; background: #ffb347; box-shadow: 0 0 6px 2px rgba(255,140,40,.8);
  animation: drift linear infinite; }
.ember.small { width: 3px; height: 3px; background: #ff9a5a; }
.ember.torch-spark { background: #ffd27a; }
.mote { width: 3px; height: 3px; border-radius: 50%; animation: drift linear infinite; }
.mote.pollen { background: #fffbd0; box-shadow: 0 0 4px #fff7a8; }
.mote.dust { background: rgba(255,225,180,.7); box-shadow: 0 0 3px rgba(255,200,140,.6); }
.twinkle { width: 2px; height: 2px; background: #fff; border-radius: 50%; box-shadow: 0 0 4px 1px #fff; animation: twinkle ease-in-out infinite; }
.firefly { width: 4px; height: 4px; border-radius: 50%; background: #e8ff7a; box-shadow: 0 0 8px 3px rgba(210,255,90,.75);
  animation: wander ease-in-out infinite alternate, twinkle 1.7s ease-in-out infinite; }
.butterfly { width: 7px; height: 5px; background: #ffe066; border-radius: 50% 50% 40% 40%; box-shadow: 0 0 3px rgba(0,0,0,.4);
  animation: wander ease-in-out infinite alternate, flap .25s steps(2) infinite; }
@keyframes bgSpin { to { transform: rotate(360deg); } }
@keyframes bgSway { 0%, 100% { transform: skewX(0deg); } 30% { transform: skewX(-1.3deg); } 70% { transform: skewX(1deg); } }
@keyframes bgPulse { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes bgFloatGlow { 0%, 100% { opacity: .6; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
@keyframes torch { 0%, 100% { opacity: .85; transform: scale(1); } 18% { opacity: .6; transform: scale(.94); } 35% { opacity: 1; transform: scale(1.05); }
  52% { opacity: .7; } 70% { opacity: .95; transform: scale(1.02); } 85% { opacity: .65; transform: scale(.96); } }
@keyframes drift { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: 1; } 80% { opacity: .9; } 100% { transform: translate(var(--dx, 0), var(--dy, -60px)); opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
@keyframes wander { 0% { transform: translate(0, 0); } 50% { transform: translate(calc(var(--dx) * .5), var(--dy)); } 100% { transform: translate(var(--dx), calc(var(--dy) * -.4)); } }
@keyframes flap { 50% { transform: scaleX(.3); } }

/* ---- Hell Raid Boss interactive background effects ---- */
/* Falling damned body silhouettes */
.hell-body { width: 18px; height: 32px; opacity: 0; filter: drop-shadow(0 0 6px rgba(180,20,20,.7));
  animation: hellFall linear infinite; }
.hell-body svg { width: 100%; height: 100%; }
@keyframes hellFall { 0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  8% { opacity: .7; } 75% { opacity: .55; } 100% { transform: translateY(var(--fall-dy, 400px)) rotate(var(--fall-rot, 280deg)); opacity: 0; } }

/* Blood rain drops */
.blood-drop { width: 2px; height: 12px; border-radius: 0 0 2px 2px;
  background: linear-gradient(rgba(160,10,10,.0), rgba(160,10,10,.85));
  animation: bloodFall linear infinite; }
@keyframes bloodFall { 0% { transform: translateY(0); opacity: 0; } 5% { opacity: 1; }
  90% { opacity: .7; } 100% { transform: translateY(var(--rain-dy, 500px)); opacity: 0; } }

/* Gore mist rising from ground */
.gore-mist { border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(120,10,10,.35), transparent);
  animation: goreMistRise ease-in-out infinite alternate; }
@keyframes goreMistRise { 0% { transform: translateY(0) scale(1); opacity: .4; }
  100% { transform: translateY(var(--mist-dy, -30px)) scale(1.15); opacity: .15; } }

/* Swarming flies (Beelzebub) */
.hell-fly { width: 4px; height: 3px; background: #1a1a1a; border-radius: 50% 50% 40% 40%;
  box-shadow: 0 0 3px rgba(0,0,0,.8), 0 0 1px rgba(60,180,60,.3);
  animation: flySwarm ease-in-out infinite alternate; }
@keyframes flySwarm { 0% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(calc(var(--fly-dx) * .4), calc(var(--fly-dy) * .6)) rotate(45deg); }
  50% { transform: translate(var(--fly-dx), var(--fly-dy)) rotate(-30deg); }
  75% { transform: translate(calc(var(--fly-dx) * .7), calc(var(--fly-dy) * .2)) rotate(60deg); }
  100% { transform: translate(calc(var(--fly-dx) * .3), calc(var(--fly-dy) * .8)) rotate(-40deg); } }

/* Molten gold sparks (Mammon) */
.gold-spark { width: 3px; height: 3px; border-radius: 50%;
  background: #ffd700; box-shadow: 0 0 6px 2px rgba(255,215,0,.8), 0 0 12px rgba(255,180,0,.4);
  animation: drift linear infinite; }

/* Blood splash pulse at horizon */
.blood-splash { border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(180,0,0,.45), rgba(120,0,0,.15), transparent);
  animation: bloodSplashPulse 2.8s ease-in-out infinite; }
@keyframes bloodSplashPulse { 0%, 100% { transform: scale(1); opacity: .35; }
  50% { transform: scale(1.2); opacity: .7; } }

/* Crimson vignette overlay for hell backgrounds */
.hell-vignette { inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(80,0,0,.35) 80%, rgba(40,0,0,.55) 100%);
  mix-blend-mode: multiply; }

.battle-top { position: absolute; top: calc(6px + var(--safe-t, 0px)); left: 8px; right: 8px; z-index: 10; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: auto; }
.foe-info { flex: 1; min-width: 0; max-width: 60%; }
.foe-name { font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; text-shadow: 0 2px 0 #000, 0 0 6px #000; }
.foe-sub { font-size: 11.5px; text-shadow: 0 1px 2px #000; }
.foe-sub .el { margin-left: 6px; }
.status-row { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.status-row .st { font-size: 10px; background: rgba(0,0,0,.6); border-radius: 5px; padding: 0 3px; border: 1px solid; }

.battle-top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: auto; }
.log-btn { background: linear-gradient(135deg, #2e141d, #14080d) !important; border: 1px solid #ffd36b !important; color: #ffd36b !important; font-family: Cinzel, serif !important; font-weight: 700 !important; font-size: 11px !important; padding: 3px 9px !important; border-radius: 5px !important; box-shadow: 0 2px 6px rgba(0,0,0,0.7) !important; cursor: pointer !important; pointer-events: auto !important; z-index: 12 !important; white-space: nowrap !important; }
.log-btn:active { transform: scale(0.95); }

.battle-feed { position: absolute; top: calc(46px + var(--safe-t, 0px)); right: 8px; left: auto; max-width: 56%; max-height: 48px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; pointer-events: none; z-index: 8; text-align: right; }
.battle-feed p { margin: 1px 0; font-size: 11px; line-height: 13px; text-shadow: 0 1px 3px #000, 0 0 2px #000; background: rgba(10, 4, 6, 0.75); padding: 2px 7px; border-radius: 4px; display: inline-block; align-self: flex-end; max-width: 100%; box-sizing: border-box; }
.battle-feed p:not(:nth-last-child(-n+3)) { display: none; }
.battle-feed .me { color: #bfefff; } .battle-feed .foe { color: #ffc2c8; } .battle-feed .sys { color: var(--gold); }
.raid-bar { position: absolute; top: calc(70px + var(--safe-t, 0px)); left: 10px; right: 10px; z-index: 4; display: none; }
.raid-bar.on { display: block; }
.cast-banner { position: absolute; top: calc(120px + var(--safe-t, 0px)); left: 50%; transform: translate(-50%, -6px); z-index: 9; min-width: 140px;
  padding: 3px 14px 5px; text-align: center; background: rgba(18,12,30,.92); border: 2px solid #6b5a3a; border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0,0,0,.6); opacity: 0; transition: opacity .15s, transform .15s; pointer-events: none; }
#battle:has(#raid-bar.on) .cast-banner { top: calc(144px + var(--safe-t, 0px)); }
.cast-banner.on { opacity: 1; transform: translate(-50%, 0); }
.cast-banner small { display: block; font-size: 9px; color: var(--mut); }
.cast-banner b { font-size: 14.5px; white-space: nowrap; }

/* battle stage, formation, fighters, summons: see css/battle_arena.css (single source of truth) */
.ward-bubble { position: absolute; inset: -8% -14% -4%; border-radius: 50%; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle, transparent 52%, rgba(190,225,255,.35) 66%, rgba(240,250,255,.85) 71%, transparent 74%);
  animation: wardShimmer 3s ease-in-out infinite; }
@keyframes shadowPulse { 50% { transform: scale(.8); opacity: .6; } }
@keyframes wardShimmer { 50% { filter: brightness(1.35) hue-rotate(15deg); } }

.unit-bars .bar { height: 5px; margin-top: 1px; border-radius: 1.5px; border: 1px solid rgba(0,0,0,.55); box-shadow: none; background: rgba(20,8,18,.35); backdrop-filter: blur(2px); }
.unit-bars .bar span { font-size: 6.5px; line-height: 1; }
.unit-bars .bar.hp { background: rgba(58,13,20,.35); }
.unit-bars .bar.ward { background: rgba(13,29,58,.35); }
.unit-bars .bar.ward i { background: linear-gradient(rgba(127,182,255,.75), rgba(47,111,224,.75)); }
.unit-bars .bar.ward span { color: #fff; text-shadow: 0 1px 1px #000; }
.unit-bars .bar.mp { background: rgba(31,13,58,.35); }
.unit-bars .bar.mp i { background: linear-gradient(rgba(197,139,255,.75), rgba(123,63,224,.75)); }

.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: visible; }
.fx-layer > * { position: absolute; left: 0; top: 0; pointer-events: none; }
.dmg-pop { font-size: 30px; font-weight: 800; color: #ffc83b; white-space: nowrap; transform: translate(-50%, 0);
  text-shadow: 0 0 3px #000, 0 2px 0 #000, 2px 0 0 #000, -2px 0 0 #000, 0 0 6px rgba(255, 180, 0, 0.5); animation: pop 1.1s forwards; }
.dmg-pop.foe-hit { color: #ffc83b; text-shadow: 0 0 3px #000, 0 2px 0 #000, 2px 0 0 #000, -2px 0 0 #000, 0 0 8px rgba(255, 180, 0, 0.6); }
.dmg-pop.crit, .dmg-pop.foe-hit.crit { color: #ffff00 !important; font-size: 42px; font-weight: 900;
  text-shadow: 0 0 6px #ffff00, 0 0 16px #ffea00, 0 2px 0 #000, 2px 0 0 #000, -2px 0 0 #000, 0 0 24px rgba(255, 255, 0, 0.9) !important; }
.dmg-pop.ally-hit { color: #ff6b6b; text-shadow: 0 0 3px #000, 0 2px 0 #000, 2px 0 0 #000, -2px 0 0 #000; }
.dmg-pop.heal { color: #6dff9b; }
.dmg-pop.miss { color: #ddd; font-size: 22px; }
.dmg-pop.ward { color: #9fd0ff; }
.dmg-pop.mana { color: #c58bff; font-size: 22px; }
@keyframes pop { 0% { transform: translate(-50%, 10px) scale(.5); opacity: 0; } 15% { transform: translate(-50%, -14px) scale(1.2); opacity: 1; }
  30% { transform: translate(-50%, -10px) scale(1); } 100% { transform: translate(-50%, -64px); opacity: 0; } }
.orb { width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; }
.orb.big { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
.trail { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; animation: trail .35s forwards; }
@keyframes trail { to { transform: var(--t) scale(.1); opacity: 0; } }
.burst { width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 3px solid; animation: burst .5s ease-out forwards; }
@keyframes burst { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(5); opacity: 0; } }
.spark { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.slash { width: 120px; height: 10px; margin: -5px 0 0 -60px; border-radius: 50%;
  background: linear-gradient(90deg, transparent, #fff 40%, #fff 60%, transparent); box-shadow: 0 0 12px #fff; animation: slash .3s ease-out forwards; }
@keyframes slash { 0% { transform: rotate(-35deg) scaleX(.1); opacity: 1; } 60% { transform: rotate(-35deg) scaleX(1.2); opacity: 1; } 100% { transform: rotate(-35deg) scaleX(1.3); opacity: 0; } }
.slash.x2 { animation-name: slash2; }
@keyframes slash2 { 0% { transform: rotate(35deg) scaleX(.1); opacity: 1; } 60% { transform: rotate(35deg) scaleX(1.2); opacity: 1; } 100% { transform: rotate(35deg) scaleX(1.3); opacity: 0; } }
.bolt { overflow: visible; filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 12px var(--c)); }
.pillar { width: 70px; margin-left: -35px; border-radius: 30px 30px 6px 6px; animation: pillar .6s ease-out forwards;
  background: linear-gradient(transparent, rgba(255,255,255,.9) 40%, #fff); }
@keyframes pillar { 0% { transform: scaleX(.1); opacity: 0; } 25% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1.4); opacity: 0; } }
.rock { width: 14px; height: 12px; margin: -6px 0 0 -7px; background: #8a6a3e; border: 2px solid #4a3519; border-radius: 3px; }
.flame { width: 16px; height: 22px; margin: -11px 0 0 -8px; border-radius: 50% 50% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff6b0, #ff9a2b 45%, rgba(255,60,20,.6) 70%, transparent); }
.drop { width: 7px; height: 10px; margin: -5px 0 0 -3px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #8fd3ff; box-shadow: 0 0 4px #3ba7ff; }
.vortex { width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; animation: vortex .7s ease-in forwards;
  background: conic-gradient(from 0deg, transparent, var(--c), transparent 40%, var(--c), transparent 75%); }
@keyframes vortex { 0% { transform: rotate(0) scale(.2); opacity: 0; } 30% { opacity: 1; } 100% { transform: rotate(540deg) scale(1.3); opacity: 0; } }
.rune { width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; border: 2px dashed var(--c); box-shadow: 0 0 10px var(--c), inset 0 0 10px var(--c);
  animation: rune .8s ease-out forwards; }
@keyframes rune { 0% { transform: scale(.2) rotate(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.3) rotate(180deg); opacity: 0; } }
.flash { position: absolute; inset: 0; z-index: 7; pointer-events: none; animation: flash .25s forwards; }
@keyframes flash { from { opacity: .7; } to { opacity: 0; } }
#battle.hurt .battle-stage { filter: drop-shadow(0 0 0 red); }
#battle.hurt::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 60px rgba(255,30,50,.7); z-index: 8; pointer-events: none; }

.battle-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  background: linear-gradient(to bottom, rgba(10,7,16,0) 0%, rgba(10,7,16,0.95) 18px, #0a0710 100%);
  padding: 8px 12px calc(10px + var(--safe-b)); }
.battle-actions { display: flex; flex-direction: column; gap: 6px; max-width: 520px; margin: 0 auto; width: 100%; }
.battle-actions.resolving { opacity: 0.85; pointer-events: none; }

/* Authentic Starborn 2x3 Battle Action Grid */
.b-starborn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.starborn-abtn { position: relative; min-height: 52px; height: 52px; background: rgba(32, 20, 26, 0.78);
  border: 1.5px solid rgba(255, 255, 255, 0.16); border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; color: #f3e6d0; font-family: 'Cinzel', serif;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08); cursor: pointer;
  transition: all 0.15s ease; padding: 4px 8px; }
.starborn-abtn:active { transform: translateY(1px); background: rgba(54, 30, 42, 0.9); border-color: rgba(255, 211, 107, 0.5); }
.starborn-abtn:disabled { opacity: 0.45; cursor: not-allowed; }
.starborn-abtn .starborn-icon { font-size: 19px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8)); }
.starborn-abtn .starborn-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: #f3e6d0; }
.starborn-abtn .mana-corner { position: absolute; right: 8px; top: 6px; font-size: 9.5px; font-family: 'Cinzel', serif; font-weight: 700; letter-spacing: 0.03em; color: #93c5fd; }
.starborn-abtn.quick-spell { border-color: rgba(147, 197, 253, 0.35); background: linear-gradient(180deg, rgba(28, 22, 42, 0.82), rgba(16, 12, 26, 0.85)); }
.starborn-abtn.flee { border-color: rgba(239, 68, 68, 0.35); }
.starborn-abtn.flee .starborn-label { color: #fca5a5; }

/* Spells Catalog View */
.b-spells-list { display: flex; flex-direction: column; gap: 8px; max-height: 38vh; overflow-y: auto; padding: 4px; scrollbar-width: thin; }
.starborn-spell-card { position: relative; width: 100%; min-height: 50px; background: rgba(30, 20, 28, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.18); border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; color: #f3e6d0; font-family: 'Cinzel', serif;
  cursor: pointer; transition: all 0.15s ease; box-shadow: 0 2px 6px rgba(0,0,0,0.4); padding: 6px; }
.starborn-spell-card:active { transform: translateY(1px); border-color: #ffd36b; }
.starborn-spell-card:disabled { opacity: 0.45; cursor: not-allowed; }
.starborn-spell-card .starborn-icon { font-size: 18px; line-height: 1; }
.starborn-spell-card .starborn-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.starborn-spell-card .mana-corner { position: absolute; right: 10px; top: 7px; font-size: 10px; font-family: 'Cinzel', serif; font-weight: 700; color: #93c5fd; }

/* Items Catalog View */
.b-items-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 38vh; overflow-y: auto; padding: 4px; scrollbar-width: thin; }
.starborn-item-card { position: relative; min-height: 52px; background: rgba(30, 20, 28, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.18); border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; color: #f3e6d0; font-family: 'Cinzel', serif;
  cursor: pointer; transition: all 0.15s ease; box-shadow: 0 2px 6px rgba(0,0,0,0.4); padding: 6px; }
.starborn-item-card:active { transform: translateY(1px); border-color: #4ade80; }
.starborn-item-card img { width: 22px; height: 22px; object-fit: contain; }
.starborn-item-card .starborn-label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.starborn-item-card .count-corner { position: absolute; right: 10px; top: 7px; font-size: 10.5px; font-family: monospace; font-weight: 700; color: #ffd36b; }

/* Circular close button */
.starborn-close-row { display: flex; justify-content: center; align-items: center; padding: 6px 0 2px; }
.starborn-circle-close { width: 44px; height: 44px; border-radius: 50%; background: rgba(22, 14, 18, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.45); color: #fff; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.6); }
.starborn-circle-close:active { transform: scale(0.92); border-color: #ffd36b; color: #ffd36b; }

.battle-actions .wait { text-align: center; padding: 12px; color: var(--mut); font-size: 13px; }

/* ---------- toasty ---------- */
#toasts { position: fixed; left: 0; right: 0; top: calc(100px + var(--safe-t)); z-index: 3000; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: rgba(20,15,36,.95); border: 2px solid var(--line); border-radius: 10px; padding: 8px 14px; max-width: 90%; font-size: 14px; animation: slideUp .2s; transition: opacity .4s, transform .4s; text-align: center; }
.toast.warn { border-color: var(--gold); } .toast.good { border-color: var(--green); } .toast.bad { border-color: var(--red); }
.toast.out { opacity: 0; transform: translateY(-10px); }

/* ---------- popup przedmiotu ---------- */
.item-head { display: flex; gap: 10px; align-items: center; }
.item-head img { width: 64px; height: 64px; background: #120d22; border-radius: 10px; border: 2px solid var(--line); }
.item-name { font-size: 18px; font-weight: 700; }
.cmp-up { color: var(--green); font-size: 12px; } .cmp-down { color: var(--red); font-size: 12px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.btn-row .btn { flex: 1; }

/* ===== additions: MapLibre markers, battle fx, misc ===== */
.maplibregl-ctrl-attrib { font-size: 9px; background: rgba(0,0,0,.45) !important; color: #bbb; }
.maplibregl-ctrl-bottom-left { bottom: calc(64px + var(--safe-b)); }
.maplibregl-ctrl-attrib a { color: #ddd; }
.maplibregl-marker.ent-icon { cursor: pointer; }
.ent-icon:not(.maplibregl-marker) { position: relative; }
.ent-icon .glow { position: absolute; left: 10%; right: 10%; bottom: 0; height: 30%; border-radius: 50%; filter: blur(6px); opacity: .7; animation: glow 2s ease-in-out infinite; }
.ent-icon.vanish { animation: vanish .4s forwards; }
.ent-icon.far { filter: saturate(.6); }
.ent-node img, .ent-cache img { animation: bob 3s ease-in-out infinite; }
.player-icon { width: 70px; height: 70px; }
.player-icon img { width: 100%; height: 100%; filter: drop-shadow(0 4px 3px rgba(0,0,0,.8)); }
@keyframes glow { 50% { opacity: .35; transform: scale(1.2); } }
@keyframes vanish { to { transform: scale(1.6); opacity: 0; filter: brightness(3); } }
#game.dim #hud, #game.dim #bottom-nav { visibility: hidden; }
/* PERF: #battle is opaque and full-screen - stop painting the map (canvas + animated markers) underneath it. */
#game.dim > * { visibility: hidden !important; }
#game.dim * { animation-play-state: paused !important; }

.center { text-align: center; }
.levelup { margin-top: 10px; padding: 8px; text-align: center; border: 2px solid var(--gold); border-radius: 10px; color: var(--gold); font-weight: 700; animation: pulseGold 1s infinite alternate; }
@keyframes pulseGold { to { box-shadow: 0 0 14px var(--gold); } }
.reward-list > div { padding: 3px 0; border-bottom: 1px dashed #3a3060; }
.item-line { gap: 8px; }
.item-line.click { cursor: pointer; }
.list-ico.small { width: 36px; height: 36px; }
.slot-label { text-align: center; font-size: 10px; color: var(--mut); margin-top: 2px; }
.slot.inv { cursor: pointer; }
.slot.inv.eq { box-shadow: inset 0 0 0 2px rgba(251,191,36,.35); }
.slot .plus { position: absolute; top: 2px; left: 4px; font-size: 10px; color: var(--acc); }
.slot .eqmark { position: absolute; top: 2px; right: 4px; font-size: 10px; color: #000; background: var(--gold); border-radius: 4px; padding: 0 3px; }
.slot.codex img { width: 85%; height: 85%; }
.intro-text { font-size: 17px; line-height: 1.5; min-height: 110px; margin: 4px 0 12px; }
.intro-text.fade { animation: fadeIn .8s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }
h2.center { margin: 4px 0 10px; }

/* ===== v2: typography & atmosphere (Cinzel titles, Fira Sans body, pixel numbers, blood-red primary buttons) ===== */
html, body { font-family: 'Fira Sans', system-ui, sans-serif; font-size: 15px; }
.logo, .foe-name, .modal-head h2, h2, h3, .section-t, .cast-banner b, .item-name, .tree-tier .tt, .intro-text,
.class-pick .opt, #bottom-nav span, .battle-actions .abtn, .btn { font-family: 'Cinzel', serif; }
.btn, .battle-actions .abtn { font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.intro-text { font-size: 18px; line-height: 1.6; text-shadow: 0 2px 6px #000; }
.section-t { font-size: 14px; color: #d9c7b8; letter-spacing: .14em; border-bottom: 2px solid rgba(217,199,184,.35); padding-bottom: 3px; }
.modal-head h2 { font-size: 22px; letter-spacing: .06em; }
.card .t { font-size: 15px; } .card .s { font-size: 13px; }
.dmg-pop, .bar span, .lvl-badge, .ent-icon .lvl, .battle-actions .abtn .mana { font-family: 'Pixelify Sans', monospace; }
.battle-actions .abtn { font-size: 11.5px; letter-spacing: 0.03em; }
.foe-name { font-weight: 900; }

/* blood-red primary actions with dripping blood */
.btn.red, .btn.gold { position: relative; overflow: visible; color: #f6e7e2;
  background: linear-gradient(#9b111c, #5a070d 70%, #3d0408); border: 2px solid #c42a35;
  box-shadow: 0 3px 0 #1a0204, inset 0 1px 0 rgba(255,140,140,.25), 0 0 12px rgba(160,0,10,.35); text-shadow: 0 2px 2px #000; }
.btn.red::after, .btn.gold::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: -5px; height: 7px; pointer-events: none;
  background: radial-gradient(circle at 10% 0, #6d0810 4px, transparent 5px), radial-gradient(circle at 35% 0, #6d0810 3px, transparent 4px),
    radial-gradient(circle at 62% 0, #6d0810 5px, transparent 6px), radial-gradient(circle at 88% 0, #6d0810 3px, transparent 4px); }
.drip { position: absolute; top: 100%; width: 5px; height: 6px; margin-left: -2px; border-radius: 0 0 3px 3px; pointer-events: none;
  background: linear-gradient(#7a0a12, #a3101c); transform-origin: top; animation: drip 4.5s ease-in infinite; }
.drip::after { content: ''; position: absolute; left: -1.5px; bottom: -5px; width: 8px; height: 8px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 35%, #d42a36, #8c0c16 70%); }
@keyframes drip { 0% { height: 2px; opacity: 1; transform: translateY(0); } 55% { height: 16px; transform: translateY(0); opacity: 1; }
  70% { height: 18px; transform: translateY(0); } 100% { height: 18px; transform: translateY(46px); opacity: 0; } }

/* ===== cosmetics: aura + manifestation canvases ===== */
.cosm-cv { position: absolute; left: -50%; width: 200%; top: -50%; height: 165%; pointer-events: none; }
.cosm-cv.back { z-index: 1; }
.cosm-cv.front { z-index: 4; }
.cosm-stage { position: relative; height: 230px; margin: 4px -12px 10px; border-radius: 12px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 85%, #2a0d14 0%, #120814 55%, #07040b 100%); border: 1px solid #3a1420; }
.cosm-stage .hostbox { position: absolute; left: 50%; bottom: 26px; width: 120px; height: 120px; margin-left: -60px; }
.cosm-stage .hostbox img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain; animation: breathe 2.2s ease-in-out infinite; transform-origin: 50% 100%; }
.cosm-stage .label { position: absolute; left: 0; right: 0; top: 10px; text-align: center; font-family: Cinzel, serif; font-size: 18px; letter-spacing: .06em; color: #f3e6d0; text-shadow: 0 2px 6px #000; z-index: 6; }
.cosm-stage .label small { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.ichor-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 15px; }
.ichor-bar b { font-family: 'Pixelify Sans', monospace; font-size: 20px; color: #ff4a5a; text-shadow: 0 0 8px rgba(255,30,50,.6); }
.cosm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cosm-card { position: relative; border: 2px solid #3a2030; border-radius: 10px; background: #140a12; padding: 8px; text-align: center; cursor: pointer; }
.cosm-card.sel { border-color: #ff3045; box-shadow: 0 0 12px rgba(255,40,60,.45); }
.cosm-card .mini { position: relative; width: 64px; height: 64px; margin: 18px auto 10px; }
.cosm-card .mini.aura-mini-storm { filter: drop-shadow(0 0 10px #4db2ff); }
.cosm-card .mini.aura-mini-blood { filter: drop-shadow(0 0 10px #ff2a3d); }
.cosm-card .mini img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain; }
.cosm-card .t { font-family: Cinzel, serif; font-size: 14px; font-weight: 700; line-height: 1.2; }
.cosm-card .r { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.cosm-card .pr { margin-top: 4px; font-family: 'Pixelify Sans', monospace; font-size: 14px; color: #ff6070; }
.cosm-card .pr.own { color: #8fd18f; }
.cosm-card .badge { position: absolute; top: 6px; right: 6px; font-size: 10px; letter-spacing: .1em; padding: 2px 6px; border-radius: 6px; background: #ff3045; color: #fff; z-index: 6; }
.pack { display: flex; align-items: center; gap: 12px; }
.pack .amt { font-family: 'Pixelify Sans', monospace; font-size: 22px; color: #ff4a5a; min-width: 90px; }
.pack .amt small { display: block; font-size: 12px; color: #8fd18f; }

/* ===== Ward v2: violet bubble + violet Ward bar, only while a Ward spell is active; mana is blue ===== */
.ward-bubble { background: radial-gradient(circle, rgba(150,70,255,.10) 40%, rgba(160,90,255,.28) 62%, rgba(215,170,255,.85) 70%, rgba(150,70,255,.25) 73%, transparent 76%);
  box-shadow: 0 0 22px rgba(150,70,255,.35); }
.unit-bars .bar.ward { background: rgba(31,13,58,.35); }
.unit-bars .bar.ward i { background: linear-gradient(rgba(213,155,255,.75), rgba(138,63,240,.75)); }
.unit-bars .bar.mp { background: rgba(13,29,58,.35); }
.unit-bars .bar.mp i { background: linear-gradient(rgba(127,182,255,.75), rgba(47,111,224,.75)); }
.status-row .st.ward-chip { color: #d9b3ff; border-color: #a35cff; }
.addon-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.addon-slot { background: #140a12; border: 2px solid #3a2030; border-radius: 10px; color: #f3e6d0; padding: 8px; font-family: Cinzel, serif; font-size: 14px; font-weight: 700; }
.addon-slot small { display: block; font-family: 'Fira Sans', sans-serif; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #b9a; font-weight: 400; }
.addon-slot.on { border-color: #ff3045; box-shadow: 0 0 10px rgba(255,40,60,.4); }

/* ===== TRACHU UNIVERSAL PRODUCTIONS - CINEMATIC LAUNCH / SPLASH SCREEN ===== */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  cursor: pointer;
  transition: opacity 0.85s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.85s ease-out;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(60, 30, 5, 0.4) 0%, rgba(15, 8, 20, 0.8) 45%, #000 85%);
  animation: splashBackdropPulse 4s ease-in-out infinite alternate;
}

.splash-content {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: splashFadeIn 0.5s ease-out forwards;
}

.splash-video-wrap {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.splash-video, .splash-video img, .splash-video video, video.splash-video {
  position: absolute;
  inset: 0;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  object-fit: contain !important;   /* whole logo always visible, aspect ratio kept (black letterbox) */
  object-position: center center !important;
  background: #000;
  filter: none !important;
  border-radius: 0 !important;
}

.splash-glow {
  display: none !important;
}

.splash-sound-hint {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 15, 30, 0.85);
  border: 1px solid rgba(255, 215, 120, 0.5);
  color: #ffd978;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 8px 18px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7), 0 0 15px rgba(255, 190, 60, 0.3);
  z-index: 10;
  animation: pulseGold 1.5s infinite alternate;
  pointer-events: none;
  white-space: nowrap;
}

.splash-skip-btn {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  background: rgba(15, 10, 25, 0.75);
  border: 1px solid rgba(255, 215, 120, 0.4);
  color: #ffd978;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, transform 0.1s;
}

.splash-skip-btn:active {
  transform: scale(0.95);
  background: rgba(30, 20, 50, 0.95);
}

@keyframes splashCameraIn {
  0% { transform: scale(0.92); opacity: 0; filter: brightness(0.3); }
  25% { opacity: 1; filter: brightness(1.2); }
  100% { transform: scale(1.03); opacity: 1; filter: brightness(1); }
}

@keyframes splashGlowPulse {
  0% { opacity: 0.4; transform: scale(0.92); }
  100% { opacity: 0.9; transform: scale(1.15); }
}

@keyframes splashBackdropPulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

@keyframes splashTextBreathe {
  0% { opacity: 0.25; }
  100% { opacity: 0.75; }
}

/* ==========================================================================
   HELL CHASM MAP ENTITY & POPUP
   ========================================================================== */
.ent-hell_chasm {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.9));
}
.ent-hell_chasm img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}
.ent-hell_chasm:hover img {
  transform: scale(1.08);
}
.ent-hell_chasm .chasm-vortex-ring {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  z-index: 1;
  background: radial-gradient(circle, var(--chasm-glow, rgba(255, 60, 0, 0.8)) 0%, transparent 70%);
  animation: chasmVortexPulse 2.4s ease-in-out infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}
@keyframes chasmVortexPulse {
  0%, 100% { transform: scale(0.88); opacity: 0.55; }
  50% { transform: scale(1.18); opacity: 0.98; }
}
.ent-hell_chasm .chasm-tag {
  background: rgba(18, 5, 8, 0.92);
  border: 1px solid #ff4400;
  color: #ffcc66;
  font-weight: bold;
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(255, 60, 0, 0.5);
  font-size: 9px;
  padding: 1px 4px;
}

.chasm-popup-body {
  text-align: center;
  padding: 6px;
}
.chasm-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1.5px;
  color: #ff3300;
  background: rgba(40, 10, 10, 0.85);
  border: 1px solid #ff3300;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.chasm-preview-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px 0;
  background: radial-gradient(circle, rgba(60, 15, 10, 0.6) 0%, transparent 75%);
  padding: 6px;
  border-radius: 8px;
}
