/* ===== Starborn layout, Starborn look =====
   Full-screen windows on a flat dark background, painted header with currencies + icon row,
   boxed tabs, big round X at the bottom centre, list rows with VIEW, paper doll, radial hub.
   Colours: black/wine panels, bone borders (#d9c7b8), blood-red accents. Body 15px, titles 26px, buttons >= 52px. */
:root { --bone: #d9c7b8; --bone-d: rgba(217,199,184,.28); --wine: #1a0b10; --wine2: #24101a; --blood: #b3121f; --blood-l: #ff3b4a; }

/* ---------- window shell ---------- */
.modal.win { align-items: stretch; justify-content: flex-start; flex-direction: column; background: radial-gradient(ellipse at 50% 0, #2a0e16 0, #0e070b 55%, #070406 100%); }
.modal.win.open { display: flex; }
.modal.win .modal-body { flex: 1; overflow-y: auto; padding: 12px 14px calc(96px + var(--safe-b)); max-width: 640px; width: 100%; margin: 0 auto; }
.win-head { position: relative; padding: calc(8px + var(--safe-t)) 12px 8px; background:
  linear-gradient(180deg, rgba(90,10,20,.55), rgba(20,6,10,.9)), repeating-linear-gradient(115deg, rgba(255,255,255,.015) 0 6px, transparent 6px 14px);
  border-bottom: 2px solid var(--bone-d); box-shadow: 0 6px 18px rgba(0,0,0,.6); }
.win-head::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; pointer-events: none;
  background: radial-gradient(circle at 12% 0, #6d0810 4px, transparent 5px), radial-gradient(circle at 47% 0, #6d0810 3px, transparent 4px), radial-gradient(circle at 83% 0, #6d0810 5px, transparent 6px); }
.win-cur { display: flex; gap: 14px; align-items: center; font-family: 'Pixelify Sans', monospace; font-size: 16px; }
.win-cur .c i { font-style: normal; margin-right: 4px; }
.win-cur .gold i { color: var(--gold); } .win-cur .orn i { color: #d78bff; }
.win-ichor { margin-left: auto; background: rgba(120,10,20,.6); border: 1px solid #c42a35; border-radius: 14px; padding: 3px 10px; font: inherit; color: #ffd2d6; }
.win-ichor i { font-style: normal; color: var(--blood-l); margin-right: 4px; }
.win-nav { display: flex; justify-content: space-around; margin-top: 8px; }
.wn { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 58px; padding: 2px; opacity: .72; }
.wn img { width: 44px; height: 44px; object-fit: contain; border-radius: 50%; background: radial-gradient(circle, #3a1520, #12070b 70%); border: 2px solid var(--bone-d); padding: 4px; }
.wn span { font-family: Cinzel, serif; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bone); }
.wn.on { opacity: 1; } .wn.on img { border-color: var(--blood-l); box-shadow: 0 0 12px rgba(255,40,60,.55); }
.win-title { text-align: center; margin-top: 6px; font-family: Cinzel, serif; font-size: 26px; font-weight: 900; letter-spacing: .08em; color: #f3e6d0; text-shadow: 0 2px 8px #000; }
.win-title small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: #b99; }
.modal.win .modal-tabs { display: flex; gap: 0; padding: 10px 12px 0; max-width: 640px; width: 100%; margin: 0 auto; overflow-x: auto; }
.modal.win .modal-tabs:empty { display: none; }
.modal.win .modal-tabs button { flex: 1; min-height: 42px; background: #12080c; border: 1px solid var(--bone-d); border-radius: 0; margin-left: -1px; padding: 8px 10px;
  font-family: Cinzel, serif; font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #a99; white-space: nowrap; }
.modal.win .modal-tabs button:first-child { border-radius: 8px 0 0 8px; } .modal.win .modal-tabs button:last-child { border-radius: 0 8px 8px 0; }
.modal.win .modal-tabs button.on { background: linear-gradient(#4a1420, #2a0a12); color: #fff; border-color: var(--bone); }
.xbtn { position: fixed; left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%); z-index: 2200; width: 62px; height: 62px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a1520, #12070b 75%); border: 3px solid var(--bone); color: var(--bone); font-size: 26px; line-height: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,.8), 0 0 0 4px rgba(0,0,0,.45); }
.xbtn:active { transform: translateX(-50%) scale(.94); }
.modal:not(.open) .xbtn { display: none; }

/* ---------- popups (dim, centred) ---------- */
.popup .modal-box.small { background: linear-gradient(#1c0b11, #0f070a); border: 2px solid var(--bone-d); border-radius: 14px; }
.popup.dim { background: rgba(0,0,0,.82); }
.popup.dim .modal-box.small { padding-bottom: 20px; }
.popup .xbtn { position: absolute; }
.pop-t { font-family: Cinzel, serif; font-size: 22px; letter-spacing: .06em; text-align: center; color: #f3e6d0; margin: 2px 0 10px; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.btn-row .btn { min-height: 48px; min-width: 110px; }

/* ---------- shared list rows (Starborn inventory style) ---------- */
.lrow { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 6px 0; background: linear-gradient(90deg, #1d0c12, #140910);
  border: 1px solid var(--bone-d); border-radius: 10px; }
.lrow.dim { opacity: .55; }
.lrow .grow, .grow { flex: 1; min-width: 0; }
.li { width: 44px; height: 44px; object-fit: contain; flex: none; }
.lt { font-family: Cinzel, serif; font-weight: 700; font-size: 15px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.ls { font-size: 12.5px; color: #b9a6a0; margin-top: 2px; }
.qty { font-family: 'Pixelify Sans', monospace; color: #e8d6c6; font-weight: 400; }
.eqb { display: inline-block; margin-left: 6px; font-family: 'Pixelify Sans', monospace; font-size: 11px; color: #000; background: var(--gold); border-radius: 4px; padding: 0 4px; vertical-align: 2px; }
.btn.view { min-width: 70px; min-height: 40px; background: #12080c; border: 1px solid var(--bone); color: var(--bone); box-shadow: none; font-size: 12px; }
.cb { width: 22px; height: 22px; accent-color: var(--blood); flex: none; }
.empty-msg { text-align: center; color: #9a8a88; padding: 26px 10px; font-style: italic; }
.section-t { margin: 16px 0 6px; }

/* ---------- stone slot ---------- */
.stone { position: relative; width: 70px; height: 70px; margin: 0 auto; border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: radial-gradient(circle at 40% 30%, #3a2a2a, #1a1212 70%); border: 2px solid #5b4a44; box-shadow: inset 0 0 12px rgba(0,0,0,.8), 0 3px 0 #000; }
.stone img { width: 52px; height: 52px; object-fit: contain; }
.stone .sx { color: #6d5a55; font-size: 22px; }
.stone.locked::after { content: '\1F512'; position: absolute; right: -4px; top: -6px; font-size: 14px; }
.qhelp { width: 26px; height: 26px; border-radius: 50%; background: #12080c; border: 1px solid var(--bone); color: var(--bone); font-weight: 700; flex: none; }

/* ---------- character hub ---------- */
.hub { position: relative; height: min(118vw, 480px); max-width: 480px; margin: 0 auto; }
.hub-core { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); text-align: center; }
.hub-circle { width: 150px; height: 150px; border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, #3a0d16 0, #12070b 70%); border: 3px solid var(--bone); box-shadow: 0 0 30px rgba(180,10,30,.45), inset 0 0 30px #000; }
.hub-circle img { width: 110px; height: 110px; object-fit: contain; animation: breathe 2.4s ease-in-out infinite; }
.hub-cls { font-family: Cinzel, serif; font-weight: 900; font-size: 22px; margin-top: 8px; color: #f3e6d0; }
.hub-lvl { font-size: 13px; color: #c9b5ad; letter-spacing: .08em; }
.hub-it { position: absolute; transform: translate(-50%, -50%); width: 84px; background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hub-it img { width: 54px; height: 54px; object-fit: contain; border-radius: 50%; padding: 6px; background: radial-gradient(circle, #2c1018, #0e0609 70%); border: 2px solid var(--bone-d); }
.hub-it span { font-family: Cinzel, serif; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bone); text-align: center; line-height: 1.15; }
.hub-it:active img { border-color: var(--blood-l); }
.hub-buffs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 12px; min-height: 38px; }
.hub-buffs .hb { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 14px; cursor: pointer; }
.hub-buffs .hb img { width: 22px; height: 22px; object-fit: contain; }
.hb { font-size: 12px; background: #1a0b10; border: 1px solid var(--bone-d); border-radius: 12px; padding: 3px 9px; color: #d9c7b8; }
.hb b { font-family: 'Pixelify Sans', monospace; color: #8fd18f; }
.hub-foot { display: flex; gap: 8px; justify-content: center; }
.hub-foot button { flex: 1; max-width: 150px; min-height: 52px; background: #12080c; border: 1px solid var(--bone-d); border-radius: 10px; color: var(--bone);
  font-family: Cinzel, serif; font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.hub-foot i { font-style: normal; display: block; font-size: 18px; }

/* ---------- status ---------- */
.st-banner { text-align: center; padding: 10px; }
.st-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid rgba(217,199,184,.12); }
.st-row .k { flex: 1; font-family: Cinzel, serif; font-weight: 700; letter-spacing: .1em; font-size: 14px; color: #cdb9ae; }
.st-row .v { font-family: 'Pixelify Sans', monospace; font-size: 17px; color: #f3e6d0; }

/* ---------- equipment paper doll ---------- */
.doll { position: relative; padding: 6px 0 4px; }
.doll-bg { position: absolute; left: 50%; top: 50%; width: 76%; max-width: 360px; transform: translate(-50%, -50%); opacity: .13; filter: grayscale(1) !important; pointer-events: none; }
.doll-grid { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; }
.dcell { text-align: center; min-height: 40px; }
.dlabel { font-family: Cinzel, serif; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #bfa99f; margin-bottom: 5px; }
.dname { font-family: Cinzel, serif; font-weight: 700; font-size: 12.5px; margin-top: 5px; line-height: 1.15; }
.dstat { font-family: 'Pixelify Sans', monospace; font-size: 12px; color: #b9a6a0; white-space: pre; }
.doll-sum { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding: 10px; background: #12080c; border: 1px solid var(--bone-d); border-radius: 10px; font-size: 12px; color: #bfa99f; }
.doll-sum b { font-family: 'Pixelify Sans', monospace; font-size: 15px; color: #f3e6d0; }

/* ---------- inventory ---------- */
.inv-bar { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.inv-search { flex: 1; min-width: 0; min-height: 42px; padding: 0 12px; font: inherit; background: #0d0609; color: #f3e6d0; border: 1px solid var(--bone-d); border-radius: 10px; }
.inv-sort { min-height: 42px; font: inherit; background: #0d0609; color: #f3e6d0; border: 1px solid var(--bone-d); border-radius: 10px; padding: 0 6px; }
.vts { display: flex; } .vt { width: 42px; height: 42px; background: #0d0609; border: 1px solid var(--bone-d); color: #a99; font-size: 18px; }
.vt:first-child { border-radius: 10px 0 0 10px; } .vt:last-child { border-radius: 0 10px 10px 0; margin-left: -1px; }
.vt.on { color: #fff; background: #3a1018; border-color: var(--bone); }
.inv-wrap { display: flex; gap: 8px; align-items: flex-start; }
.inv-side { flex: none; width: 86px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; }
.inv-side .ic { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; min-height: 56px; background: #12080c;
  border: 1px solid rgba(217,199,184,.16); border-radius: 10px; color: #a99; }
.inv-side .ic img { width: 28px; height: 28px; object-fit: contain; opacity: .8; }
.inv-side .ic span { font-family: Cinzel, serif; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; text-align: center; }
.inv-side .ic em { position: absolute; top: 2px; right: 3px; font-style: normal; font-family: 'Pixelify Sans', monospace; font-size: 10px; background: var(--blood); color: #fff; border-radius: 8px; padding: 0 5px; }
.inv-side .ic.on { background: linear-gradient(#4a1420, #250a10); border-color: var(--bone); color: #fff; }
.inv-side .ic.on img { opacity: 1; }
.inv-list { flex: 1; min-width: 0; }
.inv-list .lrow { margin: 0 0 6px; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.bulk { position: sticky; bottom: 70px; margin-top: 8px; }

/* ---------- spells ---------- */
.sp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 12px; }
.sp-grid.one { grid-template-columns: 1fr; width: 33%; margin: 0 auto 12px; }
.spcell { text-align: center; }
.spname { font-family: Cinzel, serif; font-weight: 700; font-size: 12.5px; margin-top: 6px; line-height: 1.15; }
.sppow { font-family: 'Pixelify Sans', monospace; font-size: 11.5px; color: #b9a6a0; }
.orb { width: 44px; height: 44px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff 30%), color-mix(in srgb, var(--c) 55%, #000 45%) 70%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent); text-shadow: 0 1px 2px #000; }
.stone .orb { width: 50px; height: 50px; }
.star.s { font-size: 11px; }

/* ---------- classes ---------- */
.tier-mark { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; font-family: Cinzel, serif; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; color: #bfa99f; }
.tier-mark::after { content: ''; flex: 1; height: 1px; background: var(--bone-d); }
.cls-card { display: flex; gap: 12px; align-items: center; padding: 10px; margin: 6px 0; background: linear-gradient(90deg, #1d0c12, #140910); border: 1px solid var(--bone-d); border-radius: 12px; cursor: pointer; }
.cls-card img { width: 58px; height: 58px; object-fit: contain; }
.cls-card.cur { border-color: var(--blood-l); box-shadow: 0 0 10px rgba(255,40,60,.35); }
.cls-card.locked { opacity: .55; }

/* ---------- quests ---------- */
.qcard { padding: 12px; margin: 8px 0; background: linear-gradient(#1d0c12, #120709); border: 1px solid var(--bone-d); border-radius: 12px; }
.qcard.done { opacity: .6; }
.qcat { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #c25; }
.qt { font-family: Cinzel, serif; font-weight: 700; font-size: 17px; margin: 3px 0; color: #f3e6d0; }
.qbar { height: 8px; background: #0b0507; border: 1px solid var(--bone-d); border-radius: 5px; overflow: hidden; margin: 8px 0 6px; }
.qbar i { display: block; height: 100%; background: linear-gradient(90deg, #7a0a12, #e0303f); }
.qprog { font-family: 'Pixelify Sans', monospace; color: #cdb9ae; }
.row { display: flex; align-items: center; gap: 8px; }

/* ---------- map monster popup / flee ---------- */
.mon-pop { text-align: center; }
.mp-name { font-family: Cinzel, serif; font-weight: 900; font-size: 26px; color: #f3e6d0; letter-spacing: .04em; }
.mp-lvl { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #c9a; }
.mon-pop img { width: 150px; height: 150px; object-fit: contain; margin: 8px auto; display: block; animation: breathe 2.2s ease-in-out infinite; }
.mp-hp { position: relative; height: 14px; max-width: 260px; margin: 2px auto 14px; background: #200508; border: 1px solid #6d1a22; border-radius: 7px; overflow: hidden; }
.mp-hp i { display: block; height: 100%; background: linear-gradient(#ff4a5a, #a3101c); }
.mp-hp span { position: absolute; inset: 0; font-family: 'Pixelify Sans', monospace; font-size: 11px; line-height: 14px; }
.battle-btn { min-width: 200px; min-height: 54px; font-size: 18px; }
.mp-info { margin-top: 12px; font-size: 14px; }
.mp-ready { margin-top: 6px; font-size: 13px; color: #a99; font-style: italic; }
.flee-pop { text-align: center; }
.flee-pop h2 { font-family: Cinzel, serif; color: #ff3b4a; text-transform: uppercase; letter-spacing: .08em; font-size: 22px; }

/* ---------- map items sheet ---------- */
.qitems { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qitems .abtn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 92px; padding: 8px 4px; background: #12080c; border: 1px solid var(--bone-d); border-radius: 12px; font-size: 11px; color: #e8d6c6; }
.qitems .abtn img { width: 40px; height: 40px; object-fit: contain; }
.qitems .abtn .mana { position: absolute; top: 4px; right: 6px; font-family: 'Pixelify Sans', monospace; font-size: 12px; color: #fff; }

/* ---------- battle: potion grid, victory ---------- */
.battle-actions .bitems { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bitem { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 76px; padding: 6px 2px; background: rgba(18,8,12,.92); border: 1px solid var(--bone-d); border-radius: 10px; color: #e8d6c6; font-size: 10.5px; line-height: 1.1; }
.bitem img { width: 36px; height: 36px; object-fit: contain; }
.bitem em { position: absolute; top: 3px; right: 5px; font-style: normal; font-family: 'Pixelify Sans', monospace; font-size: 13px; color: #fff; text-shadow: 0 1px 2px #000; }
.found-t { text-align: center; font-family: Cinzel, serif; color: #cdb9ae; letter-spacing: .08em; margin: -4px 0 8px; }

/* ---------- MAP HUD (Starborn layout) ---------- */
#hud { display: none; }
#area-name { position: absolute; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 900; pointer-events: none; white-space: nowrap;
  font-family: Cinzel, serif; font-weight: 900; font-size: 16px; letter-spacing: .32em; text-transform: uppercase; color: #f3e6d0; text-shadow: 0 2px 6px #000, 0 0 12px rgba(160,0,20,.6); }
#gps-chip { top: calc(36px + var(--safe-t)) !important; }
#left-col { position: absolute; left: 8px; top: calc(70px + var(--safe-t)); z-index: 900; display: flex; flex-direction: column; gap: 10px; }
#left-col button { width: 58px; background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; }
#left-col img { width: 50px; height: 50px; object-fit: contain; border-radius: 50%; padding: 6px; background: radial-gradient(circle, #2c1018, #0e0609 75%); border: 2px solid var(--bone); box-shadow: 0 3px 8px rgba(0,0,0,.7); }
#left-col span { font-family: Cinzel, serif; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #f3e6d0; text-shadow: 0 1px 3px #000; }
#quest-bar { display: none !important; }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-bottom-left, .mapboxgl-ctrl-bottom-left { display: none !important; }
#bottom-nav { background: linear-gradient(transparent, rgba(8,3,5,.94) 38%); border: none; align-items: flex-end; justify-content: space-around; padding: 0 6px calc(14px + var(--safe-b)); height: auto; }
#bottom-nav .nb { flex: 1; max-width: 96px; background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; cursor: pointer; }
#bottom-nav .nb img { width: 50px; height: 50px; object-fit: contain; border-radius: 50%; padding: 7px; background: radial-gradient(circle, #2c1018, #0e0609 75%); border: 2px solid var(--bone); box-shadow: 0 3px 8px rgba(0,0,0,.7); }
#bottom-nav .nb.locked img { filter: grayscale(1) opacity(0.55); border-color: rgba(217,199,184,0.35); }
#bottom-nav .nb.small img { width: 44px; height: 44px; }
#bottom-nav .nb span { font-family: Cinzel, serif; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #f3e6d0; white-space: nowrap; line-height: 1.1; }
#bottom-nav .nb.locked span { color: #8f8379; }
#bottom-nav .nb.hero { position: relative; max-width: 110px; }
.nav-port { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, #4a0d18, #12070b 75%); border: 3px solid var(--bone); box-shadow: 0 0 16px rgba(180,10,30,.5), 0 4px 10px #000; }
.nav-port img { width: 60px !important; height: 60px !important; border: none !important; background: none !important; padding: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
.nav-bars { width: 84px; display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.nav-bars i { display: block; height: 6px; background: #1a0508; border: 1px solid #000; border-radius: 3px; overflow: hidden; }
.nav-bars b { display: block; height: 100%; }
.nav-bars .hp b { background: linear-gradient(#ff4a5a, #a3101c); }
.nav-bars .mp b { background: linear-gradient(#7fb6ff, #2f6fe0); }
#nav-lvl { position: absolute; top: -4px; right: 6px; font-style: normal; font-family: 'Pixelify Sans', monospace; font-size: 13px; min-width: 24px; height: 24px; line-height: 20px;
  border-radius: 12px; background: #5a070d; border: 2px solid var(--bone); color: #fff; text-align: center; }
#btn-center { bottom: calc(160px + var(--safe-b)) !important; }

/* ---------- continue (dungeon/tower resume) ---------- */
#resume-col { position: absolute; right: 8px; top: calc(120px + var(--safe-t)); z-index: 900; display: flex; flex-direction: column; gap: 10px; }
#resume-col button { width: 64px; background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; }
#resume-col img { width: 52px; height: 52px; object-fit: contain; border-radius: 50%; padding: 6px; background: radial-gradient(circle, #4a0d18, #12070b 75%);
  border: 2px solid var(--blood-l); box-shadow: 0 0 14px rgba(255,40,60,.55); animation: resumePulse 2s ease-in-out infinite; }
#resume-col span { font-family: Cinzel, serif; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #ffd2d6; text-shadow: 0 1px 3px #000; text-align: center; line-height: 1.1; }
@keyframes resumePulse { 50% { box-shadow: 0 0 22px rgba(255,40,60,.9); } }

/* ---------- map scale: smaller heroes & monsters, bosses bigger, raids biggest; bare level numbers above heads ---------- */
.player-icon { width: 52px !important; height: 52px !important; }
.ent-icon .lvl { top: -15px; bottom: auto !important; background: none !important; border: none !important; padding: 0 !important; border-radius: 0;
  font-size: 13px; line-height: 1; color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 0 0 4px #000; }
.ent-icon .lvl.berserk { color: #ff5a6a; }
.ent-icon .lvl.boss { color: #ffd36b; font-size: 15px; top: -18px; }
.ent-icon .lvl.raid { color: #ff3b4a; font-size: 19px; top: -24px; }
.ent-icon .elem-dot { width: 8px; height: 8px; }
.rune-drop { color: #ff8a95; font-family: Cinzel, serif; font-weight: 700; }

/* ---------- Starborn map HUD structure: left column with badges, top-right dial, centred quest bar, locked nav slots ---------- */
#area-name { font-weight: 700; font-size: 15px; }
#gps-chip { top: calc(76px + var(--safe-t)) !important; bottom: auto !important; right: 8px !important; left: auto !important; font-size: 10px !important; padding: 1px 6px !important; opacity: .75; z-index: 950; }
#left-col { top: calc(40px + var(--safe-t)); gap: 8px; }
#left-col button { position: relative; }
#left-col img { width: 46px; height: 46px; }
#left-col em { position: absolute; right: 2px; top: 30px; font-style: normal; font-family: 'Pixelify Sans', monospace; font-size: 13px; color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; }
#left-col #inbox-n { top: -2px; right: 0; background: var(--blood); border-radius: 8px; padding: 0 5px; font-size: 11px; }
#top-right { position: absolute; top: calc(6px + var(--safe-t)); right: 6px; z-index: 900; display: flex; align-items: flex-start; gap: 6px; }
#buff-row {
  position: absolute !important;
  top: calc(32px + var(--safe-t)) !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  z-index: 920 !important;
  display: flex !important;
  gap: 6px !important;
  align-items: center !important;
  pointer-events: auto !important;
  max-width: 90vw !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
}
.map-buff-chip {
  background: rgba(18, 8, 12, 0.92) !important;
  border: 1.5px solid rgba(217, 199, 184, 0.4) !important;
  border-radius: 12px !important;
  padding: 2px 7px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-family: 'Pixelify Sans', monospace !important;
  font-size: 11px !important;
  color: #ffd36b !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.7) !important;
}
.map-buff-chip img {
  width: 16px !important;
  height: 16px !important;
  object-fit: contain !important;
}
#daynight { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; position: relative; border: 3px solid var(--bone); box-shadow: 0 3px 8px #000;
  background: conic-gradient(from var(--rot, 0deg), #1b2a5a 0 50%, #c98a2a 50% 100%); }
#daynight i { position: absolute; left: 50%; top: 6px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #ffd36b; box-shadow: 0 0 10px #ffb02e; }
#daynight.night i { background: #e9e4ff; box-shadow: 0 0 10px #b9b0ff, inset -5px -2px 0 #9b8fd8; }
#near-ico { position: relative; width: 44px; height: 44px; }
#near-ico img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 3px #000); }
#near-ico b { position: absolute; right: -2px; bottom: -2px; font-family: 'Pixelify Sans', monospace; font-size: 13px; color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; }
#quest-bar { text-align: center; }
#quest-bar .qb-main small { color: #d9c7b8; letter-spacing: .06em; text-transform: none; font-size: 13px; }
#quest-bar .qb-main b { font-size: 17px; letter-spacing: .02em; }
#quest-bar .qb-main em { display: block; font-style: normal; font-size: 13px; color: #cdb9ae; }
#bottom-nav .nb { max-width: none; }
#bottom-nav .nb img { width: 58px; height: 58px; }
#bottom-nav .nb span { margin-top: -14px; font-size: 13px; text-shadow: 0 2px 3px #000, 0 0 6px #000; }
#bottom-nav .nb.locked img { filter: grayscale(1) brightness(.45); }
#bottom-nav .nb.locked span { color: #8a7f7a; }
#bottom-nav .nb.hero span { display: none; }

/* ---------- map size order & rank auras ---------- */
.player-icon { width: 54px !important; height: 54px !important; }
.ent-icon.rk-berserk::before, .ent-icon.rk-risen::before, .fighter.aura-berserk::before, .fighter.aura-risen::before {
  content: ''; position: absolute; left: 50%; top: 55%; width: 120%; height: 120%; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; z-index: 0;
  animation: rankAura 1.6s ease-in-out infinite; }
.ent-icon.rk-berserk::before, .fighter.aura-berserk::before { background: radial-gradient(circle, rgba(255,30,30,.55) 0, rgba(255,0,0,.18) 45%, transparent 68%); }
.ent-icon.rk-risen::before, .fighter.aura-risen::before { background: radial-gradient(circle, rgba(255,214,110,.6) 0, rgba(255,170,30,.2) 45%, transparent 68%); animation-duration: 2.2s; }
.fighter.aura-berserk::before, .fighter.aura-risen::before { width: 110%; height: 90%; top: 50%; }
.ent-icon img, .fighter img { position: relative; z-index: 1; }
@keyframes rankAura { 0%, 100% { opacity: .65; transform: translate(-50%, -50%) scale(.92); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } }
.ent-icon .lvl.risen { color: #ffd36b; }
.ent-icon .lvl.berserk { color: #ff4a4a; }
.hub-foot img { display: block; width: 26px; height: 26px; margin: 0 auto 2px; object-fit: contain; }

/* ---------- Starborn-measured scale (map + HUD) ---------- */
.player-icon { width: 56px !important; height: 56px !important; z-index: 500 !important; pointer-events: auto; }
.player-icon .pulse { width: 36px; margin-left: -18px; height: 12px; }
.ent-icon .lvl { font-size: 11px; top: -12px; }
.ent-icon .lvl.boss { font-size: 13px; top: -15px; }
.ent-icon .lvl.raid { font-size: 16px; top: -19px; }
#area-name { font-size: 12.5px; letter-spacing: .34em; top: calc(10px + var(--safe-t)); }
#left-col { top: calc(38px + var(--safe-t)); left: 6px; gap: 6px; }
#left-col button { width: 50px; }
#left-col img { width: 42px; height: 42px; padding: 4px; }
#left-col span { font-size: 10px; }
#left-col em { top: 26px; font-size: 12px; }
#daynight { width: 56px; height: 56px; }
#top-right { top: calc(4px + var(--safe-t)); }
#gps-chip { top: calc(66px + var(--safe-t)) !important; }
#quest-bar { left: 9%; right: 9%; max-width: none; padding: 6px 10px; bottom: calc(92px + var(--safe-b)); border-color: rgba(217,199,184,.55); }
#quest-bar .qb-ico img { width: 30px; height: 30px; }
#quest-bar .qb-main small { font-size: 12px; }
#quest-bar .qb-main b { font-size: 16px; }
#quest-bar .qb-main em { font-size: 12px; }
#bottom-nav .nb img { width: 58px; height: 58px; }
#bottom-nav .nb span { font-size: 13px; }
.nav-port { width: 68px; height: 68px; }
.nav-port img { width: 56px !important; height: 56px !important; }
.nav-bars { width: 72px; }
#nav-lvl { top: -2px; right: 10px; }

/* ---------- living hero: outfit + aura + 2 add-ons everywhere, breathing / walking ---------- */
.hero-fig { position: relative; display: inline-block; flex: none; }
.hero-fig img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 100%; animation: breathe 2.2s ease-in-out infinite; }
.nav-port .hero-fig { width: 56px; height: 56px; margin-top: 6px; }
.hub-circle { overflow: hidden; }
.hub-circle .hero-fig { width: 104px; height: 104px; margin-top: 10px; }
.hub-circle .hero-fig img { animation-duration: 2.4s; }
.st-banner .hero-fig { width: 96px; height: 96px; margin: 0 auto 4px; display: block; }
.player-icon img { transform-origin: 50% 100%; animation: breathe 2.2s ease-in-out infinite; transition: scale .18s; }
.player-icon.face-l img { scale: -1 1; }
.player-icon.walking img { animation: breathe 2.2s ease-in-out infinite; }
.player-icon.walking .pulse { animation: walkGlide 1.4s ease-in-out infinite; }
@keyframes walkGlide { 0%, 100% { opacity: .58; transform: scale(1); } 50% { opacity: .42; transform: scale(1.06); } }

.st-banner .hero-fig { margin-bottom: 16px; }
/* ---------- day / night dial (SVG, see js/daynight.js) ---------- */
#daynight { width: 58px; height: 58px; border: none; border-radius: 50%; overflow: visible; background: none; box-shadow: none;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.85)) drop-shadow(0 0 6px rgba(150,20,30,.35)); }
#daynight svg { display: block; width: 100%; height: 100%; overflow: visible; }
#daynight .dn-star { fill: #fff; animation: dnTwinkle 2.8s ease-in-out infinite; }
#daynight .dn-rays { transform-box: fill-box; transform-origin: center; animation: dnSpin 36s linear infinite; }
#daynight .dn-sunglow { transform-box: fill-box; transform-origin: center; animation: dnPulse 3.2s ease-in-out infinite; }
#daynight .dn-moonglow { transform-box: fill-box; transform-origin: center; animation: dnPulse 4.4s ease-in-out infinite; }
#daynight .dn-cloud { animation: dnDrift 26s ease-in-out infinite alternate; }
#daynight .dn-cloud.c2 { animation-duration: 34s; animation-direction: alternate-reverse; }
#daynight .dn-drip { transform-box: fill-box; transform-origin: 50% 0; animation: dnDrip 3.6s ease-in infinite; }
#daynight.night #dnWin { animation: dnFlicker 1.7s steps(3) infinite; }
@keyframes dnTwinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes dnSpin { to { transform: rotate(360deg); } }
@keyframes dnPulse { 0%, 100% { transform: scale(.9); opacity: .85; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes dnDrift { from { transform: translateX(-6px); } to { transform: translateX(8px); } }
@keyframes dnDrip { 0%, 55% { transform: scaleY(.25); opacity: 1; } 85% { transform: scaleY(1.25); opacity: 1; } 100% { transform: translateY(3px) scaleY(1); opacity: 0; } }
@keyframes dnFlicker { 0% { opacity: .9; } 50% { opacity: .55; } 100% { opacity: 1; } }

/* dark v2 hero sprites: thin pale rim so the hero reads on the map */
.player-icon { filter: drop-shadow(0 0 1.2px rgba(255,236,214,.6)) drop-shadow(0 2px 2px rgba(0,0,0,.8)); }

/* flyers hover on the map (wing frames swap in js/flap.js) */
.ent-icon img[src*="monsters/bat"], .ent-icon img[src*="monsters/harpy"], .ent-icon img[src*="monsters/dragon"], .ent-icon img[src*="monsters/wraith"], .ent-icon img[src*="monsters/lumen"] { animation: mapHover 1.9s ease-in-out infinite; }
@keyframes mapHover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ===== battle: several foes = Starborn zig-zag column on the right, red HP box with number, white hand on the target =====
   layout of foes / summons lives in css/battle_arena.css */
.tgt-hand { position: absolute; left: -24px; top: 38%; width: 24px; height: 30px; z-index: 6; pointer-events: none; transform: rotate(90deg); animation: tgtHand .9s ease-in-out infinite; filter: drop-shadow(0 2px 2px rgba(0,0,0,.75)); }
@keyframes tgtHand { 0%, 100% { transform: translateX(0) rotate(90deg); } 50% { transform: translateX(5px) rotate(90deg); } }
#place-bar { position: fixed; left: 8px; right: 8px; top: calc(54px + var(--safe-t)); z-index: 1500; display: none; align-items: center; gap: 10px; padding: 8px 10px;
  background: linear-gradient(180deg, rgba(40,10,16,.95), rgba(14,6,10,.95)); border: 1px solid #b8893a; border-radius: 10px; box-shadow: 0 4px 18px rgba(0,0,0,.7); }
#place-bar.open { display: flex; }
.reward-list .mat-drop { display: flex; align-items: center; justify-content: center; gap: 6px; }
.reward-list .mat-drop img { width: 20px; height: 20px; object-fit: contain; }
#place-bar img { width: 46px; height: 46px; object-fit: contain; }
#place-bar .pb-t { flex: 1; display: flex; flex-direction: column; font-size: 12px; color: #e8dcc8; }
#place-bar .pb-t b { font-family: Cinzel, serif; color: #ffd36b; font-size: 14px; }

/* ===== battle: turn order (Starborn, top right) + turn counter ===== */
.turn-order { position: relative; display: flex; gap: 3px; z-index: 6; pointer-events: none; }
.turn-order .to { width: 28px; height: 28px; border: 2px solid #8a7550; border-radius: 6px; background: radial-gradient(circle, #3a2a1a, #120a08); overflow: hidden; opacity: .8; transition: transform .2s; }
.turn-order .to.foe { border-color: #8a1a22; }
.turn-order .to.on { opacity: 1; transform: scale(1.15); border-color: #ffd36b; box-shadow: 0 0 8px #ffb02e; }
.turn-order .to img { width: 100%; height: 100%; object-fit: contain; }
.turn-num { position: absolute; left: 8px; top: 16%; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffe58a, #e0a020 70%, #8a5a08); border: 2px solid #3a2208; color: #2a1404; font: 700 17px/34px Cinzel, serif; text-align: center; z-index: 6; box-shadow: 0 2px 6px rgba(0,0,0,.6); pointer-events: none; }

/* ===== adornments: faceted gems + slots ===== */
.gem { position: relative; flex: none; display: inline-block; transform: rotate(45deg) scale(.74); border-radius: 18%;
  background: conic-gradient(from 20deg, color-mix(in srgb, var(--g) 45%, #fff), var(--g) 25%, color-mix(in srgb, var(--g) 55%, #000) 50%, var(--g) 75%, color-mix(in srgb, var(--g) 45%, #fff));
  box-shadow: 0 0 10px color-mix(in srgb, var(--g) 70%, transparent), inset 0 0 0 2px rgba(0,0,0,.5), inset 0 0 8px rgba(0,0,0,.45); animation: gemPulse 2.6s ease-in-out infinite; }
.gem::after { content: ''; position: absolute; inset: 20%; border-radius: 14%; background: linear-gradient(135deg, rgba(255,255,255,.8), rgba(255,255,255,0) 55%); }
.gem::before { content: ''; position: absolute; left: 14%; top: 14%; width: 22%; height: 22%; border-radius: 50%; background: #fff; filter: blur(1px); opacity: 0; animation: gemGlint 3.4s ease-in-out infinite; }
@keyframes gemPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }
@keyframes gemGlint { 0%, 70%, 100% { opacity: 0; } 80% { opacity: .95; } }
.adorn-sec { margin: 6px 0 10px; }
.adorn-slots { display: flex; gap: 16px; justify-content: center; }
.aslot-w { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 72px; }
.aslot { width: 50px; height: 50px; border-radius: 50%; border: 2px solid #8a7550; background: radial-gradient(circle at 50% 40%, #3a2416, #0d0806 75%); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: inset 0 0 10px #000, 0 0 0 1px #000; }
.aslot.empty { border-style: dashed; color: #8a7550; font: 700 22px/1 Cinzel, serif; }
.aslot:active { transform: scale(.94); }
.aslot-l { font-size: 9px; color: #d8c8b0; text-align: center; line-height: 1.2; }
.acount { font: 700 13px Cinzel, serif; color: #f3e6d0; padding: 0 6px; }

.player-icon {
  scale: var(--zoom-scale, 1);
  transform-origin: 50% 100%;
}

/* ===== Starborn-style Categorized Spells & Loadout UI ===== */
.sp-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.4);
  line-height: 1.3;
}
.sp-cast { color: #facc15; border-color: #ca8a04; background: rgba(202,138,4,0.18); }
.sp-buff { color: #4ade80; border-color: #16a34a; background: rgba(22,163,74,0.18); }
.sp-debuff { color: #f87171; border-color: #dc2626; background: rgba(220,38,38,0.18); }
.sp-status { color: #c084fc; border-color: #9333ea; background: rgba(147,51,234,0.18); }
.sp-el { background: rgba(0,0,0,0.5); }

.sp-badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 3px 0;
}

.sp-cat-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sp-cat-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #ccc;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sp-cat-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.sp-cat-btn.active {
  background: #ffd36b;
  color: #1a0f02;
  border-color: #ffe58a;
  box-shadow: 0 0 6px rgba(255,211,107,0.4);
}

.sp-search-inp {
  width: 100%;
  padding: 7px 10px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  margin: 6px 0;
  box-sizing: border-box;
}

.sp-picker-modal {
  display: flex;
  flex-direction: column;
  max-height: 75vh;
}
.sp-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sp-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 52vh;
  padding-right: 2px;
}

.sp-pick-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 10px;
  transition: border-color 0.15s ease;
}
.sp-pick-card:hover { border-color: rgba(255,211,107,0.3); }
.sp-pick-card.equipped { border-color: rgba(74,222,128,0.4); background: rgba(74,222,128,0.05); }

.sp-pick-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
}
.sp-pick-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.sp-mana-badge {
  font-size: 10px;
  color: #93c5fd;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.3);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}
.sp-pick-desc {
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
  line-height: 1.3;
}

.sp-slots-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.sp-slot-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(20, 16, 28, 0.7);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.sp-slot-card:hover {
  border-color: #ffd36b;
  box-shadow: 0 0 8px rgba(255,211,107,0.25);
  transform: translateY(-1px);
}
.sp-slot-num {
  font-family: Cinzel, serif;
  font-weight: 700;
  font-size: 14px;
  color: #ffd36b;
  width: 22px;
  text-align: center;
}
.sp-slot-empty {
  color: #777;
  font-style: italic;
  font-size: 12px;
}
.sp-lib-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 40vh;
  overflow-y: auto;
}

/* Loadout active checkbox toggle banner */
.loadout-active-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: rgba(18, 22, 30, 0.88);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.loadout-active-toggle.default-info {
  border-color: rgba(255, 215, 0, 0.45);
  background: rgba(30, 24, 12, 0.65);
}
.loadout-active-toggle .toggle-lbl {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  width: 100%;
  margin: 0;
}
.loadout-active-toggle input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #ffd36b;
  cursor: pointer;
  flex-shrink: 0;
}
.loadout-active-toggle .toggle-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.loadout-active-toggle .toggle-txt b {
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.3px;
}
.loadout-active-toggle .toggle-txt small {
  color: #94a3b8;
  font-size: 10px;
}

/* Auto-Heal Glowing Cross & Button */
.auto-heal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(16, 32, 24, 0.75);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.auto-heal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(16, 185, 129, 0.5));
  border: 1.5px solid #4ade80;
  border-radius: 20px;
  padding: 6px 14px;
  color: #fff;
  font-family: Cinzel, serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.6px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.4), inset 0 0 8px rgba(74, 222, 128, 0.2);
  transition: all 0.2s ease;
  animation: autoHealGlow 2.4s ease-in-out infinite;
}
.auto-heal-btn:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.45), rgba(16, 185, 129, 0.65));
  box-shadow: 0 0 18px rgba(74, 222, 128, 0.75);
  transform: translateY(-1px);
}
.auto-heal-btn:active {
  transform: scale(0.96);
}
.auto-heal-btn .cross-icon {
  font-size: 15px;
  color: #86efac;
  text-shadow: 0 0 8px #4ade80, 0 0 14px #22c55e;
  line-height: 1;
}
.auto-heal-btn .auto-heal-txt {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
@keyframes autoHealGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.35);
    border-color: #4ade80;
  }
  50% {
    box-shadow: 0 0 18px rgba(74, 222, 128, 0.8), 0 0 28px rgba(34, 197, 94, 0.4);
    border-color: #86efac;
  }
}

/* Holy Cross Auto-heal Item Tile inside Curatives */
.abtn.auto-heal-tile {
  background: linear-gradient(135deg, rgba(50, 38, 12, 0.85), rgba(28, 20, 6, 0.95)) !important;
  border: 1px solid rgba(255, 215, 64, 0.5) !important;
  box-shadow: 0 0 10px rgba(255, 215, 64, 0.25), inset 0 0 8px rgba(255, 215, 64, 0.12);
  color: #ffe680 !important;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.abtn.auto-heal-tile:hover {
  border-color: #ffd700 !important;
  background: linear-gradient(135deg, rgba(70, 52, 16, 0.95), rgba(40, 28, 8, 1)) !important;
  box-shadow: 0 0 18px rgba(255, 215, 64, 0.6), inset 0 0 12px rgba(255, 215, 64, 0.3);
  transform: translateY(-1px);
}
.abtn.auto-heal-tile:active {
  transform: scale(0.97);
}
.abtn.auto-heal-tile img.holy-cross-icon {
  width: 28px !important;
  height: 28px !important;
  object-fit: contain;
  filter: drop-shadow(0 0 4px #ffd700) drop-shadow(0 0 8px rgba(255, 215, 64, 0.6));
  animation: holyCrossPulse 2.4s ease-in-out infinite;
}
@keyframes holyCrossPulse {
  0%, 100% {
    filter: drop-shadow(0 0 3px #ffd700) drop-shadow(0 0 6px rgba(255, 215, 64, 0.5));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 7px #fff099) drop-shadow(0 0 14px rgba(255, 225, 100, 0.85));
    transform: scale(1.08);
  }
}

/* Apocalypse Flame Cinematic Battle Animation */
.apocalypse-meteor {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffea70 30%, #ff4500 70%, transparent 100%);
  box-shadow: 0 0 32px 12px #ff3300, 0 0 65px 22px rgba(255, 100, 0, 0.88);
  pointer-events: none;
  z-index: 50;
}
.apocalypse-crater {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 80, 0, 0.95) 0%, rgba(220, 30, 0, 0.6) 50%, transparent 85%);
  box-shadow: 0 0 35px #ff4500, inset 0 0 20px #ffea00;
  z-index: 45;
  animation: apocalypseFire 1.2s ease-out forwards;
}
@keyframes apocalypseFire {
  0% { transform: scale(0.2); opacity: 1; filter: brightness(3); }
  40% { transform: scale(2.2); opacity: 0.95; filter: brightness(2.2); }
  100% { transform: scale(3.2); opacity: 0; filter: brightness(1); }
}
.battle-stage.apocalypse-flash {
  animation: apocFlash 0.8s ease-out;
}
@keyframes apocFlash {
  0% { filter: brightness(3.5) saturate(2.5) hue-rotate(-20deg); }
  35% { filter: brightness(2.2) saturate(2); }
  100% { filter: none; }
}





/* ===== Responsive #place-bar (no squished text or overlapping buttons) ===== */
#place-bar {
  position: fixed !important;
  bottom: calc(72px + var(--safe-b)) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 92% !important;
  max-width: 440px !important;
  background: rgba(18, 8, 12, 0.96) !important;
  border: 1.5px solid var(--blood-l) !important;
  border-radius: 12px !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.85) !important;
  padding: 12px 14px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
  z-index: 990 !important;
}

/* ===== Monumental Celestial Spire / Tower Scale on Map (Starborn Towers of Olympia) ===== */
.ent-tower, .ent-icon.tall, .ent-icon.tall-spire, .building-placement-ghost.tall-spire {
  width: 74px !important;
  height: 190px !important;
  position: relative !important;
  pointer-events: auto !important;
}
.tower-tall, .ent-icon.tall img, .ent-icon.tall-spire img, .building-placement-ghost.tall-spire img {
  width: 74px !important;
  height: 190px !important;
  object-fit: contain !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.92)) drop-shadow(0 0 20px var(--tower-glow, rgba(255,215,0,0.7))) !important;
  pointer-events: auto !important;
}
.tower-aura {
  position: absolute !important;
  bottom: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100px !important;
  height: 50px !important;
  background: radial-gradient(ellipse at bottom, var(--tower-glow, rgba(255,215,0,0.65)) 0%, transparent 70%) !important;
  pointer-events: none !important;
}

/* ===== Starborn (early alpha) Branding & Auth Styling ===== */
.alpha-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(255, 211, 107, 0.22), rgba(184, 115, 255, 0.22));
  border: 1px solid rgba(255, 211, 107, 0.5);
  color: #ffd36b;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(255, 211, 107, 0.25);
  vertical-align: middle;
}

.alpha-tag {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Cinzel', serif;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: 4px !important;
  text-transform: uppercase;
  color: #ffd36b !important;
  background: radial-gradient(ellipse at center, rgba(38, 12, 60, 0.96) 0%, rgba(12, 5, 24, 0.96) 100%) !important;
  border: 1.5px solid #ffd36b !important;
  border-radius: 20px !important;
  padding: 5px 20px !important;
  margin-top: 12px !important;
  box-shadow: 0 0 20px rgba(255, 211, 107, 0.6), 0 4px 15px rgba(0, 0, 0, 0.9) !important;
  text-shadow: 0 0 10px rgba(255, 211, 107, 0.8), 0 2px 4px rgba(0, 0, 0, 0.9) !important;
}

.auth-box {
  width: 100%;
  max-width: 400px;
  max-height: 86vh;
  overflow-y: auto;
  background: rgba(14, 10, 22, 0.96);
  border: 1.5px solid rgba(255, 211, 107, 0.45);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.9), 0 0 25px rgba(255, 211, 107, 0.2);
  border-radius: 16px;
  padding: 16px 18px 28px;
  backdrop-filter: blur(12px);
  margin: 0 auto;
  box-sizing: border-box;
}

.auth-form {
  padding-bottom: 8px;
}

.auth-class-card {
  background: rgba(28, 18, 44, 0.9);
  border: 1px solid rgba(255, 211, 107, 0.4);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  text-align: left;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.auth-class-role {
  color: #ffd36b;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
}

.auth-class-diff {
  color: #e0dce8;
  font-size: 11.5px;
  line-height: 1.45;
  margin-bottom: 6px;
}

.auth-class-bonuses {
  color: #74f0a2;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 8px;
}

.auth-tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #aaa;
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: rgba(255, 211, 107, 0.18);
  border-color: #ffd36b;
  color: #ffd36b;
  box-shadow: 0 0 10px rgba(255, 211, 107, 0.3);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.auth-field label {
  display: block;
  font-size: 11px;
  color: #ffd36b;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.auth-field input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 9px 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.auth-field input:focus {
  border-color: #ffd36b;
  box-shadow: 0 0 8px rgba(255, 211, 107, 0.3);
}

.auth-hint {
  font-size: 10px;
  color: #8e8a9f;
  margin-top: 3px;
  line-height: 1.3;
}

.auth-error {
  color: #ff5e62;
  font-size: 12px;
  min-height: 16px;
  font-weight: 600;
  text-align: center;
  margin: 4px 0;
}

/* ===== Starborn Store, Premium & Legal Badges ===== */
.premium-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 140, 0, 0.25));
  border: 1px solid #ffd700;
  color: #ffd700;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 9px;
  border-radius: 12px;
  margin: 4px 0;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
}

.premium-status-active {
  background: rgba(255, 215, 0, 0.15) !important;
  border: 1px solid #ffd700 !important;
  color: #ffd700 !important;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25) !important;
}

.premium-status-inactive {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #888 !important;
}

.alert-box {
  background: rgba(255, 94, 98, 0.12) !important;
  border: 1px solid rgba(255, 94, 98, 0.4) !important;
  color: #ffb8b8 !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

.info-box {
  background: rgba(255, 211, 107, 0.08) !important;
  border: 1px solid rgba(255, 211, 107, 0.25) !important;
  color: #e0dbe8 !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

/* ===== Starter Class Description Card Styling ===== */
.auth-class-card {
  margin-top: 10px;
  background: rgba(20, 16, 28, 0.85);
  border: 1px solid rgba(255, 211, 107, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.25s ease;
}

.auth-class-role {
  color: #ffd36b;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.auth-class-diff {
  color: #e0dbe8;
  font-size: 11px;
  line-height: 1.45;
  margin-bottom: 6px;
}

.auth-class-bonuses {
  color: #8be9fd;
  font-size: 10px;
  font-weight: 600;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 4px;
}

/* ===== Install Gate (Blocks in-browser gameplay) ===== */
#install-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  background: radial-gradient(circle at center, #1b122e 0%, #09060f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  text-align: center;
  color: #e0dbe8;
  font-family: 'Fira Sans', sans-serif;
}

.install-gate-content {
  max-width: 420px;
  width: 100%;
  background: rgba(18, 12, 30, 0.95);
  border: 1px solid rgba(255, 211, 107, 0.4);
  box-shadow: 0 10px 40px rgba(0,0,0,0.9), 0 0 25px rgba(255, 211, 107, 0.2);
  border-radius: 16px;
  padding: 24px 20px;
  backdrop-filter: blur(10px);
}

.install-gate-logo {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  font-weight: 900;
  color: #ffd36b;
  letter-spacing: 2px;
  margin-bottom: 2px;
  text-shadow: 0 0 12px rgba(255, 211, 107, 0.6);
}

.install-gate-badge {
  display: inline-block;
  background: rgba(255, 94, 98, 0.2);
  border: 1px solid #ff5e62;
  color: #ff9d9f;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 12px;
  margin: 8px 0 12px;
}

.install-gate-steps {
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 12px;
  line-height: 1.5;
}

.install-gate-steps b {
  color: #ffd36b;
}
