/* Mockup polish pass: chunky display font, flexible tablet width, screen-by-screen finish. */
@font-face {
    font-family: 'Lilita One';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/LilitaOne-latin.woff2') format('woff2');
}
:root {
    --disp: 'Lilita One', 'Fredoka', system-ui, sans-serif;
    --ol: 0 2px 0 #10213d, 1.5px 1.5px 0 #10213d, -1.5px -1.5px 0 #10213d, -1.5px 1.5px 0 #10213d, 1.5px -1.5px 0 #10213d;
    --ol-brown: 0 3px 0 #6b2408, 1.5px 1.5px 0 #4a1a05, -1.5px -1.5px 0 #4a1a05, -1.5px 1.5px 0 #4a1a05, 1.5px -1.5px 0 #4a1a05;
}

/* Menus use the real phone size (see art.css). Cap width on large tablets. */
#app .menu-screen { width: 100%; max-width: 560px; height: 100%; }

/* Display font on every headline, button and label that the mockups draw in the chunky face. */
.lx-name, .lx-pwr, .cur b, .stage-title, .orb-label, .side-btn, .battle-btn, .fight-btn, .find-match, .claim-btn,
.ad-double, .pull, .pass-banner b, .pass-banner small, .ad-chest, .ban-copy b, .map-title, .node-label, .nm-box,
.map-float span, .mile-copy b, .mile-chests button, .summon-banner h2, .pity-card p, .starter-copy, .limited,
.pass-card, .close-wide, .nav-btn, .pvp-title, .rank-count, .rank-step, .online-copy b, .online-actions button,
.ladder-top, .vs-mark, .vs-side, .trophy-badge, #resultTitle, .result-stage, .result-rating, .result-goal,
.loot-label, .loot-row, .exp-list, .up-banner h2, .up-name, .gear-slot, .rune-btn, .ped-caption, .skill-panel h3,
.skill-node, .up-upgrade, .up-ascend, .up-back, .stage-plate, .boost-tag, .float-tag, .pvp-who b, .pvp-who small,
.result-top b, .result-top small, .lx-star b, .lx-star small, .nrg-time, .stat-line, #screenDaily h2, #screenDaily h3,
#screenDaily .menu-btn, .store-block h3, .store-block .menu-btn, .screen-head h2 {
    font-family: var(--disp);
    font-weight: 400;
    letter-spacing: .01em;
}

/* ---------- Shared pieces ---------- */
.cur {
    background: linear-gradient(180deg, #0d2244 0%, #0a1a35 100%);
    border: 2px solid #3b5d94;
    border-radius: 12px;
    min-height: 34px;
    height: 34px;
    padding: 0 0 0 2px;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 2px 0 rgba(0,0,0,.4);
    gap: 4px;
}
.cur b { font-size: 16px; color: #fff; text-shadow: var(--ol); text-align: right; padding-right: 2px; }
.cur .ico { width: 30px; height: 30px; margin-left: -10px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.plus {
    width: 44px; height: 44px; min-width: 44px; min-height: 44px; flex: 0 0 44px;
    margin: -5px -3px -5px -8px;
}
.plus img { width: 28px; height: 28px; }
.cur.nrg { background: linear-gradient(180deg, #0d2244 0%, #0a1a35 100%); border-color: #3b5d94; }

.stone-panel {
    background: linear-gradient(180deg, #1d4f93 0%, #173f7a 55%, #123264 100%);
    border: 5px solid #7d8794;
    border-color: #a5adb7 #6b7480 #565e69 #8d96a1;
    border-radius: 12px;
    box-shadow: inset 0 0 0 2px #2c3644, inset 0 3px 0 2px rgba(255,255,255,.12), 0 4px 0 rgba(0,0,0,.4);
}

/* ---------- Lobby ---------- */
#screenTitle { padding: 6px 10px 8px 8px; gap: 4px; background-position: center 30%; }
#screenTitle::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
    background: linear-gradient(180deg, rgba(14,40,86,0) 0%, rgba(14,40,86,.75) 45%, #10306a 100%);
    pointer-events: none; z-index: 0;
}
#screenTitle > * { position: relative; z-index: 1; }
#screenTitle .lx-top { align-items: flex-start; gap: 6px; }
#screenTitle .lx-profile {
    flex: 0 1 auto; width: 47%; max-width: 250px;
    background: linear-gradient(180deg, rgba(19,44,84,.92), rgba(12,30,60,.92));
    border: 2px solid #3b5d94; border-radius: 14px; padding: 4px 8px 5px 2px; margin-top: 4px;
    box-shadow: 0 2px 0 rgba(0,0,0,.4);
}
#screenTitle .lx-star { width: 66px; height: 66px; flex: 0 0 66px; margin: -10px -2px -10px -6px; }
#screenTitle .lx-star small { top: 20px; font-size: 10px; color: #7c2d12; }
#screenTitle .lx-star b { top: 31px; font-size: 20px; }
#screenTitle .lx-name { font-size: 16px; text-shadow: var(--ol); }
#screenTitle .lx-xp { height: 6px; border: 0; background: #0a1426; }
#screenTitle .lx-xp i { background: linear-gradient(90deg, #fde047, #facc15); }
#screenTitle .lx-pwr { font-size: 12px; color: #fff; text-shadow: var(--ol); }
#screenTitle .lx-pwr b { color: #fbbf24; font-weight: 400; }
#screenTitle .lx-wallet {
    flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 4px; align-items: center; margin-top: 4px;
}
#screenTitle .lx-wallet .cur { min-width: 0; }
#screenTitle .lx-wallet .cur.nrg { grid-column: 2; }
#screenTitle .lx-wallet .nrg-time {
    grid-column: 2; justify-self: center; margin-top: -4px;
    background: #0a1a35; border: 1px solid #3b5d94; border-radius: 8px; padding: 0 6px; font-size: 10px; line-height: 14px; color: #fff;
}

#screenTitle .lx-banners {
    position: relative; display: grid; grid-template-columns: 34% 1fr 62px; align-items: center; gap: 0;
    margin: 6px 0 0; padding: 4px 6px;
    background: linear-gradient(180deg, #17407c, #0f2c5a);
    border: 3px solid #f2c94c; border-radius: 12px;
    box-shadow: inset 0 0 0 2px #7a4c0c, 0 3px 0 rgba(0,0,0,.4);
    min-height: 74px;
}
#screenTitle .lx-banner, #screenTitle .lx-banner.quests {
    background: none; border: 0; border-image: none; box-shadow: none; padding: 0 4px; min-height: 0; color: #fff;
}
#screenTitle .lx-banner.login { border-right: 2px solid rgba(242,201,76,.55); border-radius: 0; gap: 4px; height: 100%; }
#screenTitle .cal-art { width: 46px; height: 46px; flex: 0 0 46px; }
#screenTitle .lx-banner.login .ban-copy b { font-size: 15px; line-height: 1.02; color: #fde68a; text-shadow: var(--ol); text-align: center; white-space: normal; }
#screenTitle .lx-banner.login .ban-copy small { font-family: var(--disp); font-weight: 400; color: #fff; font-size: 10px; text-align: center; text-shadow: var(--ol); }
#screenTitle .lx-banner.quests { flex-direction: column; align-items: stretch; justify-content: center; gap: 3px; padding-left: 8px; }
#screenTitle .lx-banner.quests .ban-copy b { font-size: 14px; color: #fff; text-shadow: var(--ol); }
#screenTitle .qbar { height: 12px; border: 2px solid #0a1426; background: #0a1426; margin: 0; border-radius: 6px; }
#screenTitle .qbar i { background: linear-gradient(180deg, #86efac, #22c55e 60%, #15803d); }
#screenTitle .qchecks { margin: 0; }
#screenTitle .lx-chest { width: 60px; flex: none; justify-self: end; }
#screenTitle .lx-chest img { width: 60px; height: 60px; }
#screenTitle .lx-chest .bang { top: -14px; right: -12px; width: 20px; height: 20px; font-size: 13px; }

#screenTitle .lx-stage { margin-top: 2px; }
#screenTitle .lx-diorama { border: 0; box-shadow: none; border-radius: 0; background: transparent; overflow: visible; }
#screenTitle .stage-title { font-size: 22px; top: 2px; color: #fff; text-shadow: var(--ol); }
#screenTitle .lx-stage .lx-col { top: 34px; bottom: 30%; width: 84px; justify-content: space-between; }
#screenTitle .lx-stage .lx-col:first-child { left: -4px; }
#screenTitle .lx-stage .lx-col:last-child { right: -4px; }
#screenTitle .orb-btn { width: 84px; gap: 0; }
#screenTitle .orb { width: 62px; height: 62px; }
#screenTitle .orb-label { font-size: 12px; line-height: 1; max-width: 84px; color: #fff; text-shadow: var(--ol); margin-top: -4px; }
#screenTitle .orb-label small { font-size: 10px; }
#screenTitle .float-tag { top: -4px; right: 6px; width: 40px; min-height: 30px; font-size: 9px; line-height: .95; padding: 2px 4px 6px; }

/* Name plates under each 3D hero */
.stage-plate {
    width: 74px; padding: 3px 4px 4px; border-radius: 8px;
    background: linear-gradient(180deg, #146b6a, #0c4b52);
    border: 2px solid #5eead4; box-shadow: inset 0 0 0 1px #053a3f, 0 3px 0 rgba(0,0,0,.45);
}
.stage-plate.lead { width: 92px; background: linear-gradient(180deg, #b52a1c, #7d1810); border-color: #fbbf24; padding-top: 4px; }
.stage-plate .pname { font-size: 13px; letter-spacing: .04em; text-shadow: var(--ol); }
.stage-plate .star { width: 11px; height: 11px; }
.stage-plate .ppower { font-size: 11px; color: #fff; text-shadow: var(--ol); }
.stage-plate .ppower::before { content: "⚡"; color: #fbbf24; font-size: 9px; margin-right: 2px; }
.stage-plate .lvl-tab { top: -16px; font-family: var(--disp); font-weight: 400; font-size: 11px; padding: 1px 8px; background: linear-gradient(180deg, #2a1a10, #120a05); border: 2px solid #8a5a2b; border-bottom: 0; border-radius: 7px 7px 0 0; }

/* Dock */
#screenTitle .lx-dock { gap: 8px; padding: 0 2px; }
#screenTitle .dock-row { gap: 6px; align-items: center; }
#screenTitle .side-btn {
    width: 92px; flex: 0 0 92px; height: 92px; border-radius: 16px; padding: 6px 2px 4px;
    font-size: 14px; line-height: 1; text-transform: uppercase; text-shadow: var(--ol);
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
#screenTitle .side-ico { width: 46px; height: 46px; margin: 0 auto 2px; }
#screenTitle .battle-btn {
    height: 104px; font-size: 38px; letter-spacing: .02em; text-shadow: var(--ol-brown);
    background: url("../assets/ui/ui/btn-battle.png") center / 100% 100% no-repeat; border: 0; box-shadow: none;
}
#screenTitle .boost-tag {
    top: -14px; right: -8px; width: auto; min-height: 0; padding: 2px 6px; font-size: 10px; line-height: 1.05;
    background: linear-gradient(180deg, #ef4444, #b91c1c); border: 2px solid #fde68a; border-radius: 9px; transform: none;
    text-shadow: 0 1px 0 #7f1d1d; white-space: normal; max-width: 70px; text-align: center;
}
#screenTitle .battle-btn .boost-tag { top: -2px; right: 18px; max-width: none; white-space: nowrap; }
#screenTitle .boost-tag.free { background: linear-gradient(180deg, #ef4444, #b91c1c); color: #fff; }
#screenTitle .ad-chest {
    align-self: center; width: 186px; height: 52px; min-height: 52px; padding: 0 10px 0 6px; gap: 6px;
    border-radius: 12px; justify-content: flex-start; position: relative;
    background: linear-gradient(180deg, #2f7ad8, #1b4fa6); border: 3px solid #0d2c5c;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.4), 0 3px 0 rgba(0,0,0,.4);
    display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; text-align: center;
}
#screenTitle .ad-chest .ad-ico { grid-row: 1 / span 2; width: 44px; height: 44px; }
#screenTitle .ad-chest .ad-flag {
    background: none; border: 0; color: #fff; font-size: 20px; line-height: 1; padding: 0; text-shadow: var(--ol); align-self: end;
}
#screenTitle .ad-chest > span:last-child { font-size: 12px; line-height: 1.1; color: #fff; text-shadow: var(--ol); }
#screenTitle .ad-chest::after {
    content: "▶"; position: absolute; top: -6px; right: -6px; width: 18px; height: 16px; font-size: 8px; line-height: 13px;
    background: #2563eb; border: 2px solid #fff; border-radius: 4px; color: #fff;
}

/* Menus are full-bleed like the mockups; the gold game frame is only for battles. */
#app:has(#battleScreen:not(.active)) { border-width: 0; }

/* Never flash white behind a 3D view: sky behind the battle board, transparent menu stages. */
#webglCanvas { background: #8fd3ff; }
#lobbyStage, #heroPreview { background: transparent !important; }

/* ---------- Hero upgrade ---------- */
#screenHeroes.has-detail {
    padding: 8px 10px 8px;
    background:
        radial-gradient(ellipse at 50% 42%, rgba(120,180,255,.35), transparent 55%),
        linear-gradient(180deg, #1f5aa8 0%, #18488c 45%, #123a74 100%);
}
#screenHeroes.has-detail #heroDetail { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.up-top { gap: 6px; justify-content: flex-end; }
.up-top .up-back {
    margin-right: auto; height: 40px; min-height: 40px; padding: 0 12px 0 8px; border-radius: 12px;
    font-family: var(--disp); font-weight: 400; font-size: 18px; text-shadow: var(--ol);
    background: linear-gradient(180deg, #4aa6f2, #1d5fc4); border: 3px solid #0c2c5e;
}
.up-top .cur { min-width: 112px; }
.up-banner {
    margin: 6px -10px 0; padding: 6px 54px 8px; border-radius: 0;
    background: linear-gradient(180deg, #c3c7cd 0%, #9ea4ac 45%, #7c838c 100%);
    border: 0; border-top: 3px solid #d9dde2; border-bottom: 4px solid #4b525b;
    box-shadow: 0 4px 0 rgba(0,0,0,.35), inset 0 0 0 1px rgba(0,0,0,.2);
}
.up-banner h2 { font-size: 32px; line-height: 1; color: #ffd84a; text-shadow: var(--ol-brown); letter-spacing: .02em; }
.up-banner .lx-star { width: 64px; height: 64px; right: 8px; top: -8px; }
.up-banner .lx-star small { position: absolute; left: 0; right: 0; top: 19px; margin: 0; font-size: 9px; text-align: center; }
.up-banner .lx-star b { position: absolute; left: 0; right: 0; top: 29px; font-size: 20px; text-align: center; }
.up-name { margin-top: 6px; }
.up-name .stars { display: flex; justify-content: center; gap: 2px; }
.up-name .star { width: 28px !important; height: 28px !important; }
.up-name .stars .star:nth-child(3) { width: 34px !important; height: 34px !important; margin-top: -4px; }
.up-name h3 { font-family: var(--disp); font-weight: 400; font-size: 24px; color: #fff; text-shadow: var(--ol); letter-spacing: .02em; }
#screenHeroes.has-detail .up-mid {
    grid-template-columns: 86px 1fr 118px; gap: 2px; align-items: stretch; min-height: 0; flex: 1 1 auto; position: relative;
}
.gear-col { gap: 6px; justify-content: flex-start; z-index: 2; }
.gear-slot {
    display: flex; flex-direction: column; align-items: center; gap: 0; color: #fff;
    font-size: 15px; text-shadow: var(--ol); background: none; border: 0; padding: 0; min-height: 0;
}
.gear-slot .gico { width: 80px !important; height: 80px !important; }
.stat-col { gap: 4px; align-items: stretch; z-index: 2; }
.stat-line {
    display: grid !important; grid-template-columns: 22px 1fr 34px !important; gap: 3px; align-items: center;
    font-family: var(--disp); font-weight: 400; font-size: 12px; color: #fff;
}
.stat-line .st-ico { font-size: 17px; line-height: 1; filter: drop-shadow(0 1px 0 #000); }
.stat-line .st-head { display: flex; justify-content: space-between; align-items: baseline; text-shadow: var(--ol); line-height: 1; }
.stat-line .st-head b { font-weight: 400; font-size: 13px; }
.stat-line .st-head em { font-style: normal; font-size: 9px; color: #86efac; }
.stat-line .bar { position: relative; height: 12px; border-radius: 4px; border: 2px solid #0a1426; background: #0a1426; margin-top: 2px; overflow: hidden; }
.stat-line .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.stat-line .bar span { position: absolute; right: 3px; top: -2px; font-size: 10px; text-shadow: var(--ol); }
.stat-line.hp .bar i { background: linear-gradient(180deg, #86efac, #22c55e); }
.stat-line.atk .bar i { background: linear-gradient(180deg, #fca5a5, #ef4444); }
.stat-line.def .bar i { background: linear-gradient(180deg, #93c5fd, #3b82f6); }
.stat-line .plus { width: 34px; height: 34px; min-width: 34px; min-height: 34px; flex: none; margin: 0; }
.stat-line .plus img { width: 30px; height: 30px; }
.stat-col .rune-btn {
    width: 84px; align-self: center; display: flex; flex-direction: column; align-items: center;
    font-family: var(--disp); font-weight: 400; font-size: 15px; color: #fff; text-shadow: var(--ol); background: none; margin-top: 4px;
}
.stat-col .rune-btn img { width: 76px !important; height: 76px !important; }
#screenHeroes.has-detail .pedestal-col { min-height: 0; height: auto; margin: 0 -40px; z-index: 1; }
#screenHeroes.has-detail #heroPreview { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; }
#screenHeroes.has-detail .ped-stars { bottom: 22px; }
#screenHeroes.has-detail .ped-stars .star { width: 20px; height: 20px; }
#screenHeroes.has-detail .ped-caption { bottom: 0; font-family: var(--disp); font-size: 16px; color: #fff; text-shadow: var(--ol); }

/* Skill tree */
#screenHeroes.has-detail .skill-panel {
    position: relative; margin-top: 18px; padding: 18px 8px 6px; border-image: none;
    background: linear-gradient(180deg, #1b4686, #153a70); border: 5px solid #8d96a1;
    border-color: #a5adb7 #6b7480 #565e69 #8d96a1; border-radius: 14px;
    box-shadow: inset 0 0 0 2px #2c3644, 0 4px 0 rgba(0,0,0,.4);
}
.skill-panel h3 {
    position: absolute; top: -20px; left: 50%; transform: translateX(-50%); margin: 0; white-space: nowrap;
    padding: 4px 22px; font-size: 20px; color: #fff; text-shadow: var(--ol); letter-spacing: .02em;
    background: linear-gradient(180deg, #b9bec5, #868d96); border: 3px solid #4b525b; border-radius: 6px;
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}
.skill-board.tree2 { display: block; position: relative; height: 112px; min-height: 0; }
.skill-board.tree2 .wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.skill-board.tree2 .skill-node.special { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 30%; display: flex; flex-direction: column; align-items: center; }
.skill-board.tree2 .skill-node.special img { width: 78px; height: 78px; filter: drop-shadow(0 0 8px rgba(251,146,60,.8)); }
.skill-board.tree2 .skill-node.special .flag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: none; border: 0; color: #fde047; font-size: 14px; text-shadow: var(--ol); }
.skill-board.tree2 .skill-node.special small { position: static; font-size: 14px; color: #fff; text-shadow: var(--ol); margin-top: -2px; }
.skill-board.tree2 .tnode { position: absolute; transform: translate(-50%, -50%); }
.skill-board.tree2 .tnode.t0 { left: 56.6%; top: 26%; }
.skill-board.tree2 .tnode.t1 { left: 56.6%; top: 74%; }
.skill-board.tree2 .tnode.t2 { left: 88%; top: 26%; }
.skill-board.tree2 .tnode .skill-node img { width: 48px; height: 48px; }
.skill-board.tree2 .skill-node .nlv { width: 20px; height: 20px; line-height: 18px; font-size: 12px; font-family: var(--disp); background: #16a34a; color: #fff; border: 2px solid #fff; right: -4px; bottom: -2px; }

.skill-board.tree3 { display: block; position: relative; height: 140px; min-height: 0; margin: 0 0 2px; }
.skill-board.tree3 .wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.skill-board.tree3 > .skill-node.special { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 28%; display: flex; flex-direction: column; align-items: center; z-index: 2; }
.skill-board.tree3 > .skill-node.special img { width: 64px; height: 64px; filter: drop-shadow(0 0 8px rgba(251,146,60,.8)); }
.skill-board.tree3 > .skill-node.special .flag { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); background: none; border: 0; color: #fde047; font-size: 11px; text-shadow: var(--ol); }
.skill-board.tree3 > .skill-node.special small { position: static; font-size: 11px; color: #fff; text-shadow: var(--ol); margin-top: -2px; max-width: 96px; text-align: center; line-height: 1.05; }
.skill-board.tree3 .tnode { position: absolute; transform: translate(-50%, -50%); z-index: 2; }
.skill-board.tree3 .tnode.core { left: 42%; top: 50%; }
.skill-board.tree3 .tnode.a0 { left: 66%; top: 22%; }
.skill-board.tree3 .tnode.a1 { left: 90%; top: 22%; }
.skill-board.tree3 .tnode.b0 { left: 66%; top: 78%; }
.skill-board.tree3 .tnode.b1 { left: 90%; top: 78%; }
.skill-inspect {
    display: flex; align-items: center; gap: 8px; margin-top: 2px; min-height: 42px;
}
.skill-inspect-copy { flex: 1 1 auto; min-width: 0; }
.skill-inspect-copy b { display: block; font-family: var(--disp); font-size: 13px; color: #fff; text-shadow: var(--ol); line-height: 1.1; }
.skill-inspect-copy p { margin: 1px 0; font-size: 11px; line-height: 1.2; color: #fde68a; text-shadow: 0 1px 0 #000; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skill-inspect-copy small { color: #fef08a; font-size: 10px; }
.skill-unlock {
    flex: 0 0 auto; height: 40px; min-width: 78px; padding: 0 10px;
    font-family: var(--disp); font-size: 13px; color: #3b1d08;
    background: linear-gradient(180deg, #fde047, #f59e0b); border: 2px solid #7c2d12; border-radius: 8px;
}
.skill-unlock:disabled { filter: grayscale(.5) brightness(.85); opacity: .75; }
.skill-respec-row { text-align: right; margin-top: 2px; }
.skill-respec {
    background: none; border: 0; color: #e0f2fe; font-size: 11px; text-decoration: underline; padding: 2px 0;
    font-family: var(--disp); text-shadow: var(--ol);
}
.skill-respec:disabled { opacity: .45; text-decoration: none; }
.skill-node.inspect { filter: none; }
.skill-node.inspect img { outline: 2px solid #fde047; outline-offset: 1px; border-radius: 10px; }
.skill-node.ready:not(.owned) img { filter: saturate(1.1); }
.skill-node.blocked { filter: grayscale(.85) brightness(.7); }
.skill-board.tree3 .skill-node.core, .skill-board.tree3 .skill-node.path {
    display: flex; flex-direction: column; align-items: center; background: transparent; border: 0;
}
.skill-board.tree3 .skill-node.core img, .skill-board.tree3 .skill-node.path img { width: 42px; height: 42px; }
.skill-board.tree3 .skill-node.core small, .skill-board.tree3 .skill-node.path small {
    position: static; display: block; margin-top: 1px; font-size: 9px; color: #fff; text-shadow: var(--ol);
    max-width: 72px; text-align: center; line-height: 1.05;
}
.skill-board.tree3 .skill-node .nlv { width: 16px; height: 16px; line-height: 14px; font-size: 10px; font-family: var(--disp); background: #16a34a; color: #fff; border: 2px solid #fff; right: -3px; bottom: 10px; }
.skill-board.tree3 .path-lab {
    position: absolute; z-index: 2; font-family: var(--disp); font-size: 10px; letter-spacing: .04em;
    color: #fde047; text-shadow: var(--ol); transform: translateX(-50%);
}
.skill-board.tree3 .path-lab.lab-a { left: 78%; top: 2px; }
.skill-board.tree3 .path-lab.lab-b { left: 78%; top: auto; bottom: 2px; }
#screenHeroes.has-detail .rarity-pip { margin: 2px 0 0; text-align: center; font-family: var(--disp); font-size: 12px; color: #fde68a; text-shadow: var(--ol); background: none; }

/* Upgrade / Ascend */
#screenHeroes.has-detail .up-actions { gap: 10px; margin-top: 6px; align-items: center; }
.up-upgrade, .up-ascend { height: 84px; font-size: 30px; line-height: 1; text-shadow: var(--ol); }
.up-upgrade {
    background: linear-gradient(180deg, #6ee7a8 0%, #22c55e 45%, #15803d 100%); border: 4px solid #0b3b1f; border-radius: 16px;
    box-shadow: inset 0 3px 0 rgba(255,255,255,.55), inset 0 -6px 0 rgba(0,0,0,.2), 0 0 0 3px #8d96a1, 0 5px 0 3px #4b525b;
}
.up-upgrade small, .up-ascend small { font-size: 18px; margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.up-upgrade .coin-ico { width: 22px; height: 22px; }
.up-ascend {
    background: url("../assets/ui/ui/btn-ascend.png") center / 100% 100% no-repeat; border: 0; box-shadow: none; padding: 6px 16px 10px;
}
.up-ascend small { font-size: 14px; }
.up-upgrade[disabled], .up-ascend[disabled] { filter: saturate(.75) brightness(.9); opacity: 1; }
#screenHeroes.has-detail .hero-ad {
    align-self: center; width: 186px; height: 52px; min-height: 52px; margin-top: 6px; padding: 0 10px 0 6px;
    display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; text-align: center;
    background: linear-gradient(180deg, #2f7ad8, #1b4fa6); border: 3px solid #0d2c5c; border-radius: 12px;
}
.hero-ad .ad-ico { grid-row: 1 / span 2; width: 44px; height: 44px; margin: 0; }
.hero-ad .ad-flag { background: none; border: 0; color: #fff; font-family: var(--disp); font-weight: 400; font-size: 20px; line-height: 1; padding: 0; text-shadow: var(--ol); align-self: end; }
.hero-ad .ad-sub { font-family: var(--disp); font-size: 12px; color: #fff; text-shadow: var(--ol); }

/* ---------- Summon & Store ---------- */
#screenSummon { padding: 6px 10px 8px; gap: 0; background-size: cover; background-position: center top; background-color: #2a0f5c; }
#screenSummon::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background: linear-gradient(180deg, rgba(20,8,50,0) 0%, rgba(20,8,50,0) 38%, rgba(18,40,96,.65) 60%, #12306a 100%);
}
#screenSummon > * { position: relative; z-index: 1; }
.summon-top { justify-content: flex-end; gap: 6px; }
.summon-top .lx-star { position: absolute; left: 2px; top: 0; width: 60px; height: 60px; z-index: 3; }
.summon-top .lx-star small { position: absolute; left: 0; right: 0; top: 18px; margin: 0; font-size: 9px; text-align: center; }
.summon-top .lx-star b { position: absolute; left: 0; right: 0; top: 28px; font-size: 19px; text-align: center; }
.summon-top .cur { min-width: 112px; }
#screenSummon .summon-banner {
    margin: 6px -10px 0; padding: 8px 40px 9px; border-radius: 0; position: relative;
    background: linear-gradient(180deg, #4b78b8 0%, #2c5694 50%, #1e3f75 100%);
    border: 0; border-top: 3px solid #86a9dc; border-bottom: 4px solid #12285a;
    box-shadow: 0 4px 0 rgba(0,0,0,.35);
}
#screenSummon .summon-banner h2 { font-size: 30px; line-height: 1; color: #fff; text-shadow: var(--ol); text-align: center; }
#screenSummon .summon-banner .close-x { position: absolute; right: 8px; top: auto; bottom: -50px; width: 44px; height: 44px; }
#screenSummon .summon-banner .close-x img { width: 38px; height: 38px; }
#screenSummon .summon-body { gap: 10px; padding: 0 2px 8px; overflow-y: auto; }
#screenSummon .portal-stage { height: 190px; flex: 0 0 190px; margin-top: -2px; }
#screenSummon .portal-art { width: 250px; max-width: 72%; filter: drop-shadow(0 0 22px rgba(192,132,252,.75)); }
#screenSummon .pity-card {
    margin: -14px 26px 0; padding: 6px 12px 8px; border-image: none;
    background: linear-gradient(180deg, #59616c, #3e454e); border: 4px solid #8d96a1; border-color: #b0b7c0 #6b7480 #4b525b #8d96a1;
    border-radius: 12px; box-shadow: 0 4px 0 rgba(0,0,0,.4);
}
#screenSummon .pity-card p { font-size: 15px; color: #fff; text-shadow: var(--ol); }
#screenSummon .pity-card b { color: #fbbf24; font-weight: 400; }
#screenSummon .pity-track { height: 18px; margin-top: 5px; border-radius: 6px; background: #13244a; border: 3px solid #0a1426; overflow: hidden; }
#screenSummon .pity-track i { display: block; height: 100%; background: linear-gradient(180deg, #fde68a, #f59e0b 60%, #d97706); }
#screenSummon .rarity-legend { display: none; }
#screenSummon .pull-row { gap: 14px; margin-top: 4px; }
#screenSummon .pull { height: 76px; font-size: 28px; line-height: 1; border-radius: 14px; text-shadow: var(--ol); }
#screenSummon .pull small { font-size: 15px; margin-top: 2px; }
#screenSummon .pull.one {
    background: linear-gradient(180deg, #67b9ff 0%, #2f86ea 45%, #1b5cc0 100%); border: 4px solid #0c2c5e;
    box-shadow: inset 0 3px 0 rgba(255,255,255,.55), inset 0 -6px 0 rgba(0,0,0,.2), 0 0 0 3px #8d96a1, 0 5px 0 3px #4b525b;
}
#screenSummon .pull.ten {
    background: linear-gradient(180deg, #fff2a8 0%, #ffd23f 30%, #f9a51a 70%, #e07a10 100%); border: 4px solid #7c3a0a;
    box-shadow: inset 0 3px 0 rgba(255,255,255,.7), inset 0 -6px 0 rgba(146,64,14,.35), 0 0 0 3px #8d96a1, 0 5px 0 3px #4b525b, 0 0 22px rgba(192,132,252,.9);
    text-shadow: var(--ol-brown);
}
#screenSummon .pull.ten small { color: #b45309; text-shadow: 0 1px 0 #fde68a; }
#screenSummon .boost-tag.star {
    top: -22px; right: -10px; width: 64px; height: 56px; min-height: 0; padding: 8px 6px 6px; font-size: 11px; line-height: 1; color: #7c2d12;
    background: radial-gradient(circle at 50% 45%, #fff7c2, #fbbf24 60%, #d97706);
    clip-path: polygon(50% 0, 62% 30%, 98% 32%, 70% 54%, 80% 90%, 50% 70%, 20% 90%, 30% 54%, 2% 32%, 38% 30%);
    text-shadow: none; transform: rotate(10deg); border: 0;
}
#screenSummon .float-tag { top: -14px; right: -6px; }
.starter-banner {
    position: relative; display: flex; align-items: center; justify-content: flex-end; min-height: 128px; padding: 8px 14px 10px 40%;
    background: url("../assets/ui/ui/banner-starter.jpg") left center / cover no-repeat; border: 4px solid #f2c94c; border-radius: 12px;
    box-shadow: inset 0 0 0 2px #7a4c0c, 0 4px 0 rgba(0,0,0,.4); overflow: hidden; cursor: pointer;
}
.starter-copy { align-items: center; gap: 0; font-family: var(--disp); margin-right: 22%; }
.starter-copy b { font-weight: 400; font-size: 26px; line-height: 1; color: #fff; text-shadow: var(--ol); }
.starter-copy .off { font-size: 34px; color: #ffe14a; text-shadow: var(--ol-brown); }
.starter-copy .buy-now {
    margin-top: 4px; padding: 3px 16px 4px; font-size: 20px; color: #7c2d12; border-radius: 9px; line-height: 1;
    background: linear-gradient(180deg, #fff7c2, #fbbf24 55%, #f59e0b); border: 3px solid #7c3a0a; box-shadow: 0 3px 0 #6b2408; text-shadow: none;
}
.starter-copy .buy-now small { display: block; font-size: 10px; color: #92400e; }
.starter-banner .limited {
    position: absolute; right: -34px; bottom: 14px; width: 150px; padding: 4px 0; transform: rotate(-38deg);
    background: linear-gradient(180deg, #ef4444, #b91c1c); border-top: 3px solid #fde68a; border-bottom: 3px solid #fde68a;
    font-size: 17px; line-height: 1; text-align: center; color: #fff; text-shadow: var(--ol);
}
#screenSummon .pass-card {
    padding: 0 0 4px; border-image: none; overflow: hidden;
    background: #23324f; border: 4px solid #f2c94c; border-radius: 12px; box-shadow: inset 0 0 0 2px #7a4c0c, 0 4px 0 rgba(0,0,0,.4);
}
#screenSummon .pass-card h3 {
    margin: 0; padding: 6px 0 5px; font-size: 20px; color: #fff; text-shadow: var(--ol);
    background: linear-gradient(180deg, #a3aab3, #6e7680); border-bottom: 3px solid #4b525b;
}
.pass-track { gap: 0; align-items: stretch; }
.pass-track .lbl { width: 62px; flex: 0 0 62px; display: flex; align-items: center; justify-content: center; }
.pass-track .lbl img { width: 42px; height: 42px; }
.pass-track.free { background: linear-gradient(180deg, #4d8fd6, #3168b3); }
.pass-track.free .lbl { background: linear-gradient(180deg, #74b4f0, #4d8fd6); }
.pass-track.prem { background: linear-gradient(180deg, #e7b53a, #c98a16); }
.pass-track.prem .lbl { background: linear-gradient(180deg, #f8d468, #e7b53a); }
.pass-track.prem .lbl b { font-size: 12px; color: #7c2d12; }
.pass-slots { gap: 6px; padding: 7px 6px; }
.pass-slots button {
    position: relative; flex: 1; height: 54px; min-height: 44px; border-radius: 8px; padding: 0;
    background: linear-gradient(180deg, #2f4f7d, #22385c); border: 2px solid #1a2a45; box-shadow: inset 0 2px 0 rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pass-track.prem .pass-slots button { background: linear-gradient(180deg, #4a5466, #343c4b); }
.pass-slots .rw { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.pass-slots .rwn { position: absolute; right: 4px; bottom: 1px; font-family: var(--disp); font-size: 11px; color: #fff; text-shadow: var(--ol); }
.pass-slots .lk { position: absolute; right: -4px; top: -6px; width: 20px; height: 20px; }
.pass-slots .ck { position: absolute; right: -2px; top: -8px; color: #4ade80; font-size: 18px; text-shadow: var(--ol); }
.pass-slots button.locked { filter: none; }
.pass-slots button.locked .rw { filter: grayscale(.2) brightness(.85); }
.pass-barrow { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: #1a2440; }
.pass-barrow .lbl { width: 46px; font-family: var(--disp); color: #fff; text-shadow: var(--ol); font-size: 14px; }
.pass-barrow .pass-bar { flex: 1; height: 14px; margin: 0; border-radius: 7px; border: 2px solid #0a1426; background: #0a1426; }
.pass-barrow .pass-bar i { background: linear-gradient(180deg, #86efac, #22c55e 60%, #15803d); }
.pass-tier {
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-family: var(--disp); color: #fff; font-size: 14px;
    background: #2b3a55; border: 2px solid #a5adb7; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); text-shadow: var(--ol);
}
#btnPremiumPass {
    display: block; margin: 6px auto 2px; padding: 4px 14px; border-radius: 9px; font-family: var(--disp); font-size: 15px; color: #7c2d12;
    background: linear-gradient(180deg, #fff7c2, #fbbf24 55%, #f59e0b); border: 3px solid #7c3a0a; box-shadow: 0 3px 0 #6b2408; cursor: pointer;
}
#screenSummon .store-block {
    border-image: none; padding: 8px 10px 10px; background: linear-gradient(180deg, #1d4f93, #123264); border: 4px solid #f2c94c; border-radius: 12px;
    box-shadow: inset 0 0 0 2px #7a4c0c, 0 4px 0 rgba(0,0,0,.4);
}
#screenSummon .store-block h3 { font-size: 22px; color: #ffe14a; text-shadow: var(--ol-brown); }
#screenSummon .store-block .menu-btn {
    border-radius: 12px; font-size: 18px; color: #fff; text-shadow: var(--ol);
    background: linear-gradient(180deg, #67b9ff 0%, #2f86ea 45%, #1b5cc0 100%); border: 3px solid #0c2c5e; box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 3px 0 #0c2c5e;
}
#screenSummon .store-block .menu-btn.primary { background: linear-gradient(180deg, #fff2a8 0%, #ffd23f 30%, #f9a51a 70%, #e07a10 100%); border-color: #7c3a0a; box-shadow: inset 0 2px 0 rgba(255,255,255,.7), 0 3px 0 #6b2408; text-shadow: var(--ol-brown); }
#screenSummon .summon-nav {
    margin: 0 -10px -8px; padding: 8px 10px 10px; gap: 10px;
    background: linear-gradient(180deg, #24508f, #173a70); border-top: 3px solid #4b78b8; box-shadow: 0 -3px 0 rgba(0,0,0,.25);
}
#screenSummon .summon-nav .close-x.big { width: 52px; height: 52px; margin-right: auto; }
#screenSummon .summon-nav .close-x.big img { width: 48px; height: 48px; }
#screenSummon .close-wide {
    flex: 0 0 140px; height: 58px; font-size: 26px; text-shadow: var(--ol-brown); color: #fff; border-radius: 14px;
    background: linear-gradient(180deg, #fff2a8 0%, #ffd23f 30%, #f9a51a 70%, #e07a10 100%); border: 4px solid #7c3a0a;
    box-shadow: inset 0 3px 0 rgba(255,255,255,.7), 0 0 0 3px #8d96a1, 0 5px 0 3px #4b525b; margin-right: auto;
}
.sq-btn {
    width: 52px; height: 52px; flex: 0 0 52px; border-radius: 10px; padding: 2px; cursor: pointer; position: relative;
    background: linear-gradient(180deg, #4aa6f2, #1d5fc4); border: 3px solid #0c2c5e; box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 3px 0 #0c2c5e;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.sq-btn img { width: 34px; height: 34px; }
.sq-btn span { font-family: var(--disp); font-size: 12px; color: #fff; text-shadow: var(--ol); margin-top: -6px; }
#screenSummon .summon-body > * { flex-shrink: 0; }
#screenSummon .portal-stage { height: 176px; flex-basis: 176px; }
#screenSummon .portal-art { width: 230px; }
.starter-banner { padding-left: 36%; justify-content: flex-start; }
.starter-copy { margin-right: 0; }
.starter-banner .limited { right: -46px; bottom: 12px; width: 150px; font-size: 13px; padding: 3px 0; }
#screenSummon .starter-copy { margin-right: 34px; white-space: nowrap; }
#screenSummon .starter-copy .off { font-size: 32px; }
#screenSummon .starter-banner { overflow: hidden; }
#screenSummon .starter-banner .limited { top: auto; right: -50px; bottom: 22px; width: 180px; height: auto; padding: 3px 0; font-size: 13px; }

/* ---------- World campaign ---------- */
#screenMap { padding: 4px 8px 4px 6px; gap: 2px; background: linear-gradient(180deg, #2a6cc4 0%, #3d8ee0 40%, #2b74cc 100%); }
#screenMap .map-top { align-items: flex-start; gap: 4px; }
#screenMap .map-top .map-back {
    position: absolute; left: 0; top: 86px; z-index: 5; width: 46px; height: 46px; min-width: 46px; padding: 0;
    font-size: 0; border-radius: 10px; background: linear-gradient(180deg, #f87171, #dc2626 55%, #991b1b); border: 3px solid #4c0a0a;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 3px 0 #4c0a0a;
}
#screenMap .map-top .map-back::before { content: ""; display: block; margin: 0 auto; width: 0; height: 0; border-top: 11px solid transparent; border-bottom: 11px solid transparent; border-right: 15px solid #fff; filter: drop-shadow(0 2px 0 #4c0a0a); }
#screenMap .lx-profile {
    flex: 0 1 auto; width: 47%; max-width: 250px; margin-top: 4px; padding: 4px 8px 5px 2px;
    background: linear-gradient(180deg, rgba(19,44,84,.92), rgba(12,30,60,.92)); border: 2px solid #3b5d94; border-radius: 14px; box-shadow: 0 2px 0 rgba(0,0,0,.4);
}
#screenMap .lx-star { width: 60px; height: 60px; flex: 0 0 60px; margin: -8px -2px -8px -6px; position: relative; display: block; }
#screenMap .lx-star small { position: absolute; left: 0; right: 0; top: 20px; margin: 0; font-size: 10px; text-align: center; color: #7c2d12; }
#screenMap .lx-star b { position: absolute; left: 0; right: 0; top: 31px; font-size: 20px; text-align: center; color: #7c2d12; }
#screenMap .lx-name { font-size: 16px; text-shadow: var(--ol); }
#screenMap .lx-pwr { font-size: 12px; color: #fff; text-shadow: var(--ol); }
#screenMap .lx-pwr b { color: #fbbf24; font-weight: 400; }
#screenMap .lx-wallet { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-items: center; margin-top: 2px; }
#screenMap .lx-wallet .cur { min-width: 0; }
#screenMap .lx-wallet .cur.nrg { grid-column: 2; }
#screenMap .lx-wallet .nrg-time { grid-column: 2; justify-self: center; margin-top: -4px; background: #0a1a35; border: 1px solid #3b5d94; border-radius: 8px; padding: 0 6px; font-size: 10px; line-height: 14px; color: #fff; }
#screenMap .map-banner-row { position: relative; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; padding: 0 64px 2px 8px; margin-top: 0; min-height: 40px; }
#screenMap .map-banner-row .map-modes { width: 100%; order: 3; display: flex; justify-content: center; gap: 4px; margin: 0; padding: 0; }
#screenMap .map-banner-row .mode-chip { min-height: 24px; padding: 1px 8px 1px 4px; font-size: 12px; }
#screenMap .map-title {
    margin: 0; padding: 5px 16px 6px; font-size: 20px; line-height: 1; color: #fde68a; text-shadow: var(--ol-brown); white-space: nowrap;
    background: linear-gradient(180deg, #6b4a2a, #4a3018); border: 3px solid #f2c94c; border-radius: 8px; box-shadow: inset 0 0 0 2px #2a1a0a, 0 3px 0 rgba(0,0,0,.4);
    clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
}
#screenMap .nm-box { position: absolute; right: 0; top: -2px; flex-direction: column; gap: 2px; font-family: var(--disp); font-size: 11px; color: #fff; text-shadow: var(--ol); text-align: center; }
#screenMap .nm-switch { width: 56px; height: 28px; background: #1e293b; border: 3px solid #0a1426; min-height: 28px; }
#screenMap .nm-switch i { width: 20px; height: 20px; top: 1px; left: 2px; background: #e5e7eb; }
#screenMap .nm-switch::after { content: "💀"; position: absolute; right: 4px; top: 2px; font-size: 14px; }
#screenMap .nm-switch.on { background: #7f1d1d; }
#screenMap .nm-switch.on i { left: 30px; }
#screenMap .map-body { position: relative; margin: 0 -10px 0 -8px; overflow: hidden; }
#screenMap .world-map { position: absolute; inset: 0; background: transparent !important; box-shadow: none; border: 0; container-type: size; z-index: 1; overflow: hidden; }
/* Fill the map body: full width, no letterbox or blurred side bands.
   Stretch the 9:16 island to the visible height so first and last stages stay on screen. */
.map-inner {
    position: absolute; left: 0; right: 0; top: 0; bottom: 0;
    width: 100%; height: 100%; transform: none; aspect-ratio: auto;
    background: url("../assets/ui/bg/bg-campaign-islands.jpg") center / 100% 100% no-repeat;
}
#screenMap .map-node { position: absolute; transform: translate(-50%, -50%); width: 64px; min-height: 52px; display: flex; flex-direction: column; align-items: center; background: none; border: 0; padding: 0; z-index: 2; }
#screenMap .map-node .bubble {
    width: 46px; height: 36px; border-radius: 50%; font-family: var(--disp); font-size: 22px; line-height: 34px; color: #fff; text-shadow: var(--ol);
    background: radial-gradient(ellipse at 50% 35%, #8a929c, #5b636e 60%, #3c434c); border: 2px solid #2a2f36; box-shadow: 0 3px 0 #22272e, inset 0 2px 0 rgba(255,255,255,.35);
}
#screenMap .map-node.current { z-index: 4; }
#screenMap .map-node.current .bubble { background: radial-gradient(ellipse at 50% 35%, #86efac, #22c55e 60%, #15803d); border-color: #0b3b1f; box-shadow: 0 3px 0 #0b3b1f, 0 0 0 3px #fde047, 0 0 10px #fde047; }
#screenMap .map-node.locked .bubble img { width: 28px; height: 28px; }
#screenMap .map-node .nstars { margin-top: 1px; }
#screenMap .map-node .star { width: 14px; height: 14px; }
#screenMap .map-node .skull { width: 32px; height: 32px; top: -26px; right: auto; left: 50%; transform: translateX(-50%); }
#screenMap .map-node .hero-pin { top: -38px; font-size: 28px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.4)); }
#screenMap .node-label {
    position: absolute; transform: translateX(-50%); width: max-content; max-width: 118px; text-align: center; pointer-events: none;
    font-family: var(--disp); font-size: 16px; line-height: 1.05; color: #fff; text-shadow: var(--ol); z-index: 5;
    overflow: visible; white-space: normal;
}
#screenMap .map-float { position: absolute; z-index: 6; background: none; border: 0; display: flex; flex-direction: column; align-items: center; width: auto; min-width: 76px; }
#screenMap .map-float .mf-ico { width: 60px; height: 60px; margin: 0; }
#screenMap .map-float span:not(.bang) { font-size: 15px; color: #fff; text-shadow: var(--ol); margin-top: -2px; white-space: nowrap; }
#screenMap .map-float.loot { left: 2px; top: 4%; }
#screenMap .map-float.squad { right: 2px; top: 4%; }
#screenMap .map-float .bang { top: -6px; right: 4px; width: 20px; height: 20px; font-size: 13px; }
#screenMap .map-dock { gap: 4px; position: relative; z-index: 2; margin: 0 -2px 0; }
#screenMap .dock-row { gap: 6px; align-items: center; }
#screenMap .side-btn {
    width: 84px; flex: 0 0 84px; height: 84px; border-radius: 16px; padding: 4px 2px 3px;
    font-size: 14px; line-height: 1; text-transform: uppercase; text-shadow: var(--ol);
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
#screenMap .side-ico { width: 46px; height: 46px; margin: 0 auto 2px; }
#screenMap .battle-btn.start-stage {
    height: 86px; font-size: 26px; text-shadow: var(--ol-brown);
    background: url("../assets/ui/ui/btn-battle.png") center / 100% 100% no-repeat; border: 0; box-shadow: none;
}
#screenMap .boost-tag {
    top: -14px; right: -8px; width: auto; min-height: 0; padding: 2px 6px; font-size: 10px; line-height: 1.05;
    background: linear-gradient(180deg, #ef4444, #b91c1c); border: 2px solid #fde68a; border-radius: 9px; transform: none; color: #fff;
    text-shadow: 0 1px 0 #7f1d1d; white-space: normal; max-width: 70px; text-align: center;
}
#screenMap .mile-row { gap: 6px; align-items: center; }
#screenMap .mile-copy { display: grid; grid-template-columns: 1fr; gap: 2px; }
#screenMap .mile-copy b { font-size: 14px; color: #fde68a; text-shadow: var(--ol); font-weight: 400; }
#screenMap .mile-track { height: 16px; border: 2px solid #0a1426; background: #0a1426; border-radius: 8px; position: relative; }
#screenMap .mile-track i { background: linear-gradient(180deg, #fde68a, #f59e0b 60%, #d97706); }
#screenMap #mileCount { font-family: var(--disp); font-size: 12px; color: #fff; text-shadow: var(--ol); margin-top: -18px; text-align: center; position: relative; }
#screenMap .mile-chests { gap: 4px; }
#screenMap .mile-chests button {
    position: relative; width: 46px; min-height: 48px; padding: 0; background: none; border: 0; box-shadow: none;
    display: flex; flex-direction: column; align-items: center; font-family: var(--disp); color: #fff; text-shadow: var(--ol); font-size: 11px;
}
#screenMap .mile-chests button img { width: 36px; height: 36px; }
#screenMap .mile-chests button img.silver { filter: grayscale(1) brightness(1.15); }
#screenMap .mile-chests button span { margin-top: -2px; white-space: nowrap; font-size: 10px; }
#screenMap .mile-chests button em { position: absolute; top: -6px; right: -4px; font-style: normal; background: #dc2626; border: 2px solid #fff; border-radius: 50%; width: 20px; height: 20px; line-height: 16px; font-size: 10px; }
#screenMap .mile-chests button.ready img { filter: drop-shadow(0 0 6px #fde047); }
#screenMap .fight-btn {
    width: 100px; height: 54px; font-size: 26px; color: #fff; text-shadow: var(--ol); border-radius: 12px;
    background: linear-gradient(180deg, #f87171, #dc2626 55%, #991b1b); border: 3px solid #4c0a0a; box-shadow: inset 0 3px 0 rgba(255,255,255,.45), 0 0 0 3px #8d96a1, 0 5px 0 3px #4b525b;
}
#screenMap .fight-btn .boost-tag { top: -16px; right: -8px; }
/* map-inner size is the cover-fit rule above */

/* ---------- Shared stone-framed screens (PvP, results) ---------- */
#screenPvp, #screenResult { padding: 22px 22px 22px; }
#screenPvp::after, #screenResult::after {
    content: ""; position: absolute; inset: 0; z-index: 30; pointer-events: none;
    border: 28px solid transparent; border-image: url("../assets/ui/ui/frame-stone.png") 96 / 28px stretch;
}
#screenPvp {
    gap: 8px;
    background: radial-gradient(ellipse at 50% 30%, rgba(90,150,240,.35), transparent 60%),
                repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 9px),
                linear-gradient(180deg, #1f4f96 0%, #183f7d 50%, #133468 100%) !important;
}
.pvp-head, .result-top { position: relative; z-index: 31; margin: -12px -10px 0; }
.pvp-who {
    gap: 6px; padding: 3px 12px 3px 3px; border-radius: 10px;
    background: linear-gradient(180deg, #24406c, #172c4e); border: 2px solid #6b7c96; box-shadow: 0 2px 0 rgba(0,0,0,.4);
}
.pvp-ava { width: 42px; height: 42px; border-radius: 8px; overflow: hidden; background: linear-gradient(180deg, #4a8fd8, #1e4f96); border: 2px solid #f2c94c; padding: 0; }
.pvp-ava .ava-img, .exp-face .ava-img, .shard-face { width: 100%; height: 100%; object-fit: cover; display: block; }
.pvp-who b { color: #fde68a; font-size: 15px; text-shadow: var(--ol); font-weight: 400; }
.pvp-who small { color: #fff; font-size: 14px; text-shadow: var(--ol); font-weight: 400; }
.pvp-head .cur, .result-wallet .cur { min-width: 96px; height: 30px; min-height: 30px; border-radius: 9px; padding: 0 8px; }
.pvp-head .cur span { font-size: 0; width: 24px; height: 24px; background: url("../assets/ui/icons/icon-gold-coin.png") center / contain no-repeat; order: 2; }
.result-wallet .cur .ico { margin: 0 -6px 0 0; width: 26px; height: 26px; }
.pvp-title {
    margin: 2px 0 0; padding: 0; background: none !important; box-shadow: none !important; border: 0;
    font-size: 38px; line-height: .95; color: #ffd84a; text-shadow: var(--ol-brown); letter-spacing: .01em;
}
.pvp-title br + * , .pvp-title { text-align: center; }
#screenPvp .rank-card, #screenPvp .online-card, #screenPvp .ladder-card {
    border-image: none; border-radius: 12px; padding: 8px 10px;
    background: linear-gradient(180deg, #1b4686, #143a72); border: 5px solid #8d96a1; border-color: #a5adb7 #6b7480 #565e69 #8d96a1;
    box-shadow: inset 0 0 0 2px #2c3644, 0 4px 0 rgba(0,0,0,.4);
}
#screenPvp .rank-card { position: relative; padding-top: 16px; padding-bottom: 14px; margin-top: 8px; }
#screenPvp .rank-count {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%); white-space: nowrap;
    padding: 2px 18px; font-size: 15px; color: #fde68a; text-shadow: var(--ol);
    background: linear-gradient(180deg, #2a4a7a, #17305a); border: 2px solid #8d96a1; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}
#screenPvp .rank-track { margin: 2px 0 0; }
#screenPvp .rank-track::before { top: 18px; height: 10px; background: #0a1426; }
#screenPvp .rank-fill { top: 18px; height: 10px; background: linear-gradient(180deg, #fde68a, #f59e0b); }
#screenPvp .rank-step { font-size: 13px; color: #fff; text-shadow: var(--ol); width: 20%; }
#screenPvp .rank-step .pip, #screenPvp .rank-step .pip img { width: 44px; height: 44px; }
#screenPvp .rank-step .pip { margin-bottom: 0; background: none !important; }
#screenPvp .rank-step .cur-tab {
    position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); padding: 1px 10px; font-size: 12px; color: #fde68a;
    background: linear-gradient(180deg, #6b4a2a, #4a3018); border: 2px solid #f2c94c; border-radius: 0 0 8px 8px; white-space: nowrap; text-shadow: var(--ol);
}
#screenPvp .rank-record { display: none; }
#screenPvp .online-card { gap: 10px; margin-top: 8px; }
#screenPvp .portal-mini { width: 110px; height: 110px; box-shadow: none; background: none; border-radius: 0; }
#screenPvp .online-copy b { font-size: 22px; color: #fff; text-shadow: var(--ol); text-align: center; font-weight: 400; }
#screenPvp #pvpRoomCode { font-family: var(--disp); font-size: 14px; color: #fff; text-shadow: var(--ol); background: #12264a; border-radius: 6px; padding: 4px 8px; }
#screenPvp .online-actions { gap: 8px; }
#screenPvp .online-actions button {
    flex: 1; height: 40px; font-size: 18px; border-radius: 10px; text-shadow: var(--ol);
    background: linear-gradient(180deg, #67b9ff, #2f86ea 50%, #1b5cc0); border: 3px solid #0c2c5e; box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 0 0 2px #8d96a1, 0 3px 0 2px #4b525b;
}
#screenPvp #btnPvpHost { background: linear-gradient(180deg, #fff2a8, #ffd23f 35%, #f9a51a 75%, #e07a10); border-color: #7c3a0a; text-shadow: var(--ol-brown); }
#screenPvp .pass-banner {
    position: relative; height: 72px; padding: 6px 12px 6px 92px; justify-content: center; text-align: center; border-radius: 10px;
    background: url("../assets/ui/ui/banner-passplay.jpg") center / 100% 100% no-repeat; border: 0; box-shadow: 0 4px 0 rgba(0,0,0,.4);
}
#screenPvp .pass-banner b { display: block; font-size: 28px; line-height: 1; color: #fff; text-shadow: var(--ol); font-weight: 400; }
#screenPvp .pass-banner small { font-size: 16px; color: #fde68a; text-shadow: var(--ol); }
#screenPvp .pass-ico {
    position: absolute; left: 12px; top: -10px; width: 68px; height: 88px; border-radius: 0; font-size: 34px;
    background: linear-gradient(180deg, #a855f7, #6d28d9); border: 3px solid #f2c94c;
    clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
}
#screenPvp .ladder-card {
    background: url("../assets/ui/ui/bg-ladder-vs.jpg") center / cover no-repeat; padding: 6px 8px 8px; margin-top: 2px;
}
#screenPvp .ladder-top { justify-content: center; position: relative; text-align: center; }
#screenPvp .ladder-top b { font-size: 24px; color: #fff; text-shadow: var(--ol); font-weight: 400; display: block; line-height: 1; }
#screenPvp .ladder-top small { font-size: 18px; color: #ffd84a; text-shadow: var(--ol-brown); }
#screenPvp .trophy-badge {
    position: absolute; right: -4px; top: -2px; width: 68px; font-size: 11px; line-height: 1; padding: 3px 4px; color: #fde68a;
    background: linear-gradient(180deg, #6b4a2a, #4a3018); border: 2px solid #8d96a1; border-radius: 6px; text-shadow: var(--ol);
}
#screenPvp .trophy-badge::after { content: " 🏆"; }
#screenPvp .versus { display: flex; align-items: center; margin-top: 2px; }
#screenPvp .vs-side { font-size: 16px; color: #fff; text-shadow: var(--ol); line-height: 1.05; }
#screenPvp .vs-faces { gap: 0; height: 92px; align-items: flex-end; }
#screenPvp .vs-fig { width: 64px; height: 86px; object-fit: contain; margin: 0 -8px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
#screenPvp .vs-faces .vs-fig:nth-child(2) { height: 92px; width: 70px; z-index: 1; }
#screenPvp .vs-faces.shadow .vs-fig { filter: brightness(0) drop-shadow(0 0 2px rgba(0,0,0,.6)); }
#screenPvp .vs-pwr { font-size: 14px; }
#screenPvp .vs-mark { font-size: 46px; color: #ffd84a; text-shadow: var(--ol-brown); padding: 0 2px; }
#screenPvp .find-match {
    height: 82px; margin: 4px 6px 0; font-size: 30px; line-height: 1; color: #fff; text-shadow: var(--ol-brown); border-radius: 14px;
    background: linear-gradient(180deg, #fff2a8 0%, #ffd23f 30%, #f9a51a 70%, #e07a10 100%); border: 4px solid #7c3a0a;
    box-shadow: inset 0 3px 0 rgba(255,255,255,.7), inset 0 -6px 0 rgba(146,64,14,.35), 0 0 0 4px #f2c94c, 0 6px 0 4px #7a4c0c, 0 0 26px rgba(253,224,71,.6);
}
#screenPvp .find-match small { font-size: 18px; margin-top: 2px; }
#screenPvp .pvp-nav { justify-content: center; gap: 14px; margin-top: auto; padding-bottom: 2px; }
#screenPvp .nav-btn {
    width: 108px; height: 46px; font-size: 20px; border-radius: 10px; text-shadow: var(--ol);
    background: linear-gradient(180deg, #a38360, #6f5236); border: 3px solid #3a2a18; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 0 0 2px #8d96a1, 0 3px 0 2px #4b525b;
}
#screenPvp .nav-btn.hub { background: linear-gradient(180deg, #67b9ff, #2f86ea 50%, #1b5cc0); border-color: #0c2c5e; }

/* ---------- Victory / defeat ---------- */
#screenResult { gap: 2px; background-size: cover; background-position: center top; }
#screenResult::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background: linear-gradient(180deg, rgba(20,50,110,0) 0%, rgba(20,50,110,.25) 40%, #163b78 62%, #12306a 100%);
}
#screenResult > * { position: relative; z-index: 1; }
#screenResult .result-top { align-items: flex-start; }
#screenResult .result-wallet { gap: 4px; align-items: flex-end; }
#screenResult .result-wallet .cur b { order: 0; }
#screenResult .victory-banner.ribbon { margin: 18px -12px 0; min-height: 96px; display: flex; align-items: center; justify-content: center; }
#screenResult .victory-banner.ribbon::before {
    content: "★ ★ ★ ★ ★"; display: block; position: absolute; top: -34px; left: 0; right: 0; font-size: 34px; letter-spacing: 2px;
    color: #ffd84a; text-shadow: 0 3px 0 #b45309, 0 0 10px rgba(253,224,71,.8); background: none; width: auto; height: auto; clip-path: none;
}
#resultTitle { font-family: var(--disp); font-weight: 400; font-size: 58px !important; line-height: 1; padding: 0 0 10px !important; color: #ffd84a !important; -webkit-text-fill-color: #ffd84a !important; text-shadow: 0 4px 0 #7c2d12, 2px 2px 0 #4a1a05, -2px -2px 0 #4a1a05, -2px 2px 0 #4a1a05, 2px -2px 0 #4a1a05 !important; }
.result-stage { font-size: 28px; color: #fff; text-shadow: var(--ol); margin: 2px 0 0; letter-spacing: .02em; }
.result-rating { font-size: 17px; color: #fde68a; text-shadow: var(--ol); letter-spacing: .02em; }
#resultStars { font-size: 52px; line-height: 1; letter-spacing: 6px; color: #ffd84a; text-shadow: 0 3px 0 #b45309, 0 0 10px rgba(253,224,71,.5); }
.result-goal { font-size: 15px; color: #fde68a; text-shadow: var(--ol); }
.loot-chest-img { width: 170px; margin-top: 2px; }
#screenResult .loot-label { font-size: 18px; color: #fde68a; text-shadow: var(--ol); margin-top: -6px; }
#screenResult .loot-row { gap: 6px; flex-wrap: nowrap; padding: 0 2px; }
#screenResult .loot-tile {
    flex: 1; width: auto; max-width: 72px; padding: 0; background: none; border: 0; font-size: 12px; line-height: 1.05; color: #fff; text-shadow: var(--ol);
}
#screenResult .loot-tile .ico {
    height: 64px; display: flex; align-items: center; justify-content: center; border-radius: 10px; margin-bottom: 3px; overflow: hidden;
    background: linear-gradient(180deg, #7f5a2a, #5a3d1a); border: 3px solid #f2c94c; box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 3px 0 rgba(0,0,0,.4);
}
#screenResult .loot-tile.epic .ico { background: linear-gradient(180deg, #8b5cf6, #5b21b6); border-color: #e9d5ff; }
#screenResult .loot-tile.rare .ico { background: linear-gradient(180deg, #6366f1, #3730a3); border-color: #c7d2fe; }
#screenResult .loot-tile.common .ico { background: linear-gradient(180deg, #8a6a4a, #5c4630); border-color: #d6b98c; }
#screenResult .loot-tile.legendary .ico { background: linear-gradient(180deg, #f97316, #b45309); border-color: #fde68a; }
#screenResult .loot-tile .ico img { width: 52px; height: 52px; object-fit: contain; }
#screenResult .loot-tile .ico .shard-face { width: 100%; height: 100%; }
#screenResult .exp-list { margin: 6px 4px 0; display: flex; flex-direction: column; gap: 5px; }
#screenResult .exp-row { grid-template-columns: 34px 82px 1fr; grid-template-rows: auto auto; gap: 0 6px; font-family: var(--disp); font-weight: 400; color: #fff; text-shadow: var(--ol); font-size: 17px; }
#screenResult .exp-row .exp-face { grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 6px; overflow: hidden; border: 2px solid #f2c94c; background: #2a4a7a; display: flex; align-items: center; justify-content: center; font-size: 20px; }
#screenResult .exp-row > span:nth-child(2) { grid-row: 1 / span 2; align-self: center; }
#screenResult .exp-row > span:nth-child(4) { grid-column: 3; grid-row: 1; text-align: right; color: #4ade80; font-size: 14px; }
#screenResult .exp-row .bar { grid-column: 3; grid-row: 2; height: 12px; border: 2px solid #0a1426; background: #0a1426; border-radius: 6px; }
#screenResult .exp-row:nth-child(1) .bar i { background: linear-gradient(180deg, #fde68a, #f59e0b); }
#screenResult .exp-row:nth-child(2) .bar i { background: linear-gradient(180deg, #7dd3fc, #0ea5e9); }
#screenResult .exp-row:nth-child(3) .bar i { background: linear-gradient(180deg, #86efac, #22c55e); }
#screenResult .ad-double {
    margin: 10px 22px 0; height: 62px; font-size: 20px; line-height: 1.05; border-radius: 12px; text-shadow: var(--ol); color: #fff;
    background: linear-gradient(180deg, #fdba74, #f97316 45%, #c2410c); border: 4px solid #7c2d12;
    box-shadow: inset 0 3px 0 rgba(255,255,255,.5), 0 0 0 3px #8d96a1, 0 5px 0 3px #4b525b;
}
#screenResult .claim-btn {
    margin: 12px 46px 0; height: 56px; font-size: 22px; border-radius: 12px; color: #fff; text-shadow: var(--ol-brown);
    background: linear-gradient(180deg, #fff2a8 0%, #ffd23f 30%, #f9a51a 70%, #e07a10 100%); border: 4px solid #7c3a0a;
    box-shadow: inset 0 3px 0 rgba(255,255,255,.7), 0 0 0 3px #8d96a1, 0 5px 0 3px #4b525b;
}
#screenResult .retry-link { font-family: var(--disp); font-weight: 400; font-size: 15px; color: #fff; text-shadow: var(--ol); margin-top: 6px; }
#screenResult.lose .victory-banner.ribbon::before { content: ""; }
#screenPvp::after, #screenResult::after { border-width: 60px; border-image: url("../assets/ui/ui/frame-stone.png") 96 / 60px stretch; }
#screenPvp .versus { overflow: hidden; }
#screenPvp .vs-side { min-width: 0; flex: 1 1 0; }
#screenPvp .vs-fig { width: 56px; height: 80px; margin: 0 -7px; }
#screenPvp .vs-faces .vs-fig:nth-child(2) { width: 62px; height: 88px; }
#screenPvp .vs-mark { flex: 0 0 auto; }
#screenResult { padding-top: 18px; padding-bottom: 18px; }
#screenResult .result-top { margin-top: -4px; }
#screenResult .victory-banner.ribbon { margin-top: 10px; min-height: 84px; }
#screenResult .victory-banner.ribbon::before { top: -28px; font-size: 28px; }
#resultTitle { font-size: 50px !important; }
.result-stage { font-size: 24px; }
.result-rating { font-size: 15px; margin: 0; }
#resultStars { font-size: 42px; }
.result-goal { font-size: 13px; margin: 0 0 2px; }
.loot-chest-img { width: 128px; }
#screenResult .loot-tile .ico { height: 56px; }
#screenResult .loot-tile .ico img { width: 44px; height: 44px; }
#screenResult .exp-list { gap: 3px; margin-top: 4px; }
#screenResult .ad-double { height: 54px; margin-top: 8px; font-size: 18px; }
#screenResult .claim-btn { height: 50px; margin-top: 10px; font-size: 20px; }
#screenResult .retry-link { margin-top: 2px; font-size: 13px; }
#screenResult .result-wallet { margin-top: 6px; }

/* ---------- Daily ---------- */
#screenDaily {
    padding: 0 10px 10px; gap: 0;
    background: radial-gradient(ellipse at 50% 20%, rgba(120,180,255,.3), transparent 55%),
                repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 9px),
                linear-gradient(180deg, #1f5aa8 0%, #18488c 45%, #123a74 100%);
}
#screenDaily .screen-head {
    margin: 0 -10px 10px; padding: 8px 10px; min-height: 60px; align-items: center;
    background: linear-gradient(180deg, #4b78b8 0%, #2c5694 50%, #1e3f75 100%); border-bottom: 4px solid #12285a; box-shadow: 0 4px 0 rgba(0,0,0,.3);
}
#screenDaily .screen-head h2 { font-size: 30px; color: #fff; text-shadow: var(--ol); }
#screenDaily .screen-head .back-btn, #screenHowTo .back-btn, #screenGuilds .back-btn, #screenSettings .back-btn {
    width: 46px; height: 46px; border-radius: 12px; font-size: 20px; color: #fff;
    background: linear-gradient(180deg, #4aa6f2, #1d5fc4); border: 3px solid #0c2c5e; box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 3px 0 #0c2c5e;
}
#screenDaily .gem-chip { font-family: var(--disp); font-size: 16px; color: #fff; text-shadow: var(--ol); background: #0a1a35; border: 2px solid #3b5d94; border-radius: 12px; padding: 4px 10px; }
#screenDaily .screen-body { display: flex; flex-direction: column; gap: 22px; padding: 14px 2px 10px; }
#screenDaily .daily-card {
    position: relative; margin: 0; padding: 22px 12px 12px; border-image: none; border-radius: 14px; text-align: center;
    background: linear-gradient(180deg, #1b4686, #143a72); border: 5px solid #8d96a1; border-color: #a5adb7 #6b7480 #565e69 #8d96a1;
    box-shadow: inset 0 0 0 2px #2c3644, 0 4px 0 rgba(0,0,0,.4);
}
#screenDaily .daily-card h3 {
    position: absolute; top: -20px; left: 50%; transform: translateX(-50%); margin: 0; white-space: nowrap; gap: 6px;
    padding: 3px 20px; font-size: 20px; color: #fff; text-shadow: var(--ol);
    background: linear-gradient(180deg, #b9bec5, #868d96); border: 3px solid #4b525b; border-radius: 6px;
}
#screenDaily .daily-card h3 .dh { width: 30px; height: 30px; margin: -6px 0; }
#screenDaily .login-cal { gap: 5px; margin: 6px 0 10px; }
#screenDaily .login-day {
    position: relative; display: flex; flex-direction: column; align-items: center; padding: 3px 0 4px; border-radius: 8px;
    background: linear-gradient(180deg, #2f4f7d, #22385c); border: 2px solid #4b6a9a; font-family: var(--disp); color: #fff; text-shadow: var(--ol); line-height: 1;
}
#screenDaily .login-day .ld-day { font-size: 11px; }
#screenDaily .login-day img { width: 30px; height: 30px; margin: 2px 0; }
#screenDaily .login-day .ld-amt { font-size: 12px; }
#screenDaily .login-day .ld-ck { position: absolute; top: -6px; right: -4px; font-style: normal; color: #4ade80; font-size: 16px; }
#screenDaily .login-day.current { background: linear-gradient(180deg, #f8d468, #d99a1c); border-color: #fff3b0; box-shadow: 0 0 10px rgba(253,224,71,.8); }
#screenDaily .login-day.claimed { opacity: 1; filter: saturate(.8); }
#screenDaily .menu-btn {
    min-height: 50px; border-radius: 12px; font-size: 20px; color: #fff; text-shadow: var(--ol-brown);
    background: linear-gradient(180deg, #fff2a8 0%, #ffd23f 30%, #f9a51a 70%, #e07a10 100%); border: 4px solid #7c3a0a;
    box-shadow: inset 0 3px 0 rgba(255,255,255,.7), 0 4px 0 #6b2408;
}
#screenDaily .menu-btn[disabled] { filter: grayscale(.55) brightness(.85); }
#screenDaily .quest-list { display: flex; flex-direction: column; gap: 8px; }
#screenDaily .quest-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; text-align: left;
    background: rgba(8,22,50,.55); border: 2px solid #3b5d94;
}
#screenDaily .q-copy { flex: 1; min-width: 0; }
#screenDaily .q-copy p { margin: 0 0 4px; font-family: var(--disp); font-size: 15px; color: #fff; text-shadow: var(--ol); }
#screenDaily .q-bar { position: relative; height: 16px; border-radius: 8px; border: 2px solid #0a1426; background: #0a1426; overflow: hidden; }
#screenDaily .q-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #86efac, #22c55e 60%, #15803d); }
#screenDaily .q-bar span { position: absolute; right: 6px; top: -2px; font-family: var(--disp); font-size: 12px; color: #fff; text-shadow: var(--ol); }
#screenDaily .quest-row .menu-btn { min-height: 44px; width: 88px; font-size: 16px; padding: 0; }
#screenDaily .quest-row .menu-btn:not(.primary) { background: linear-gradient(180deg, #67b9ff, #2f86ea 50%, #1b5cc0); border-color: #0c2c5e; box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 3px 0 #0c2c5e; text-shadow: var(--ol); }
#screenDaily .daily-chest-art { width: 120px; display: block; margin: -4px auto 0; filter: drop-shadow(0 6px 0 rgba(0,0,0,.3)); }
#screenDaily #freeChestHint, #screenDaily #spinResult { font-family: var(--disp); font-size: 16px; color: #fde68a; text-shadow: var(--ol); margin: 4px 0 8px; }
#screenDaily .spin-wheel { width: 170px; height: 170px; filter: drop-shadow(0 6px 0 rgba(0,0,0,.35)); }
#app.wide-menu #screenDaily .screen-body { display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 26px 12px; }
#app.wide-menu #screenDaily .daily-card:first-child, #app.wide-menu #screenDaily .daily-card:nth-child(2) { grid-column: 1 / -1; }
#screenSummon .summon-banner { z-index: 5; }
#screenSummon .store-block.flash { animation: storeFlash .9s ease-out; }
@keyframes storeFlash { 0%, 40% { box-shadow: 0 0 0 4px #fde047, 0 0 24px rgba(253,224,71,.9); } 100% { box-shadow: none; } }


/* ===== Fix pass: mockup match + mobile layout ===== */

/* Global toast sits in #app, above controls, never on the mid-screen card */
#app { position: relative; }
#toast.game-toast,
#toast {
    position: absolute;
    left: 50%;
    top: auto;
    bottom: max(96px, calc(env(safe-area-inset-bottom, 0px) + 88px));
    transform: translateX(-50%);
    z-index: 400;
    pointer-events: none;
    max-width: min(340px, calc(100% - 24px));
}

/* Lobby: Campaign label already in HTML; keep energy + Guilds on-screen */
#screenTitle { padding-right: max(10px, env(safe-area-inset-right, 0px)); }
#screenTitle .lx-top { min-width: 0; overflow-x: hidden; }
#screenTitle .lx-wallet { min-width: 0; }
#screenTitle .lx-wallet .plus,
#screenMap .lx-wallet .plus { margin: -5px 0 -5px -4px; }
#screenMap { padding-right: max(10px, env(safe-area-inset-right, 0px)); }
#screenMap .lx-top,
#screenMap .lx-wallet { min-width: 0; }
#screenMap .map-modes { gap: 4px; margin: 0; }
#screenMap .mode-pill { min-height: 24px; padding: 2px 8px; font-size: 12px; }

/* Hero Upgrade: mockup 3-col mid (gear | pedestal | stats/runes), skill tree scrolls, actions sticky */
#screenHeroes.has-detail #heroDetail {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    height: 100%;
    gap: 2px;
}
#screenHeroes.has-detail .up-top,
#screenHeroes.has-detail .up-banner,
#screenHeroes.has-detail .up-dock {
    flex: 0 0 auto;
}
#screenHeroes.has-detail .up-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 2px 10px;
}
#screenHeroes.has-detail .up-body .up-name { flex: 0 0 auto; position: relative; }
#screenHeroes.has-detail .up-mid {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) 112px;
    gap: 2px;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 140px;
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#screenHeroes.has-detail .pedestal-col {
    position: relative;
    height: auto;
    min-height: 140px;
    margin: 0 -16px;
    z-index: 1;
    overflow: visible;
}
#screenHeroes.has-detail .up-mid #heroPreview,
#screenHeroes.has-detail #heroPreview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    pointer-events: none;
}
#screenHeroes.has-detail .gear-col,
#screenHeroes.has-detail .stat-col {
    position: relative;
    z-index: 2;
    min-width: 0;
}
#screenHeroes.has-detail .skill-panel {
    position: relative;
    flex: 0 0 auto;
    margin-top: 8px;
    padding: 10px 8px 6px;
    z-index: 2;
}
#screenHeroes.has-detail .skill-panel h3 {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    display: block;
    margin: 0 auto 4px;
    width: max-content;
    max-width: 100%;
}
#screenHeroes.has-detail .up-dock {
    position: relative;
    z-index: 6;
    padding: 4px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(18,58,116,0), #123a74 26%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
#screenHeroes.has-detail .up-actions {
    width: 100%;
    margin-top: 0;
}
#screenHeroes.has-detail #gearGrid, #screenHeroes.has-detail #gearWorkshop { display: none; }
#screenHeroes.has-detail .hero-ad { margin-top: 0; }

#screenHeroes.has-detail .up-body .rarity-pip { display: none; }
#screenHeroes.has-detail .gear-slot .gico { width: 56px !important; height: 56px !important; }
#screenHeroes.has-detail .gear-slot { font-size: 11px; }
#screenHeroes.has-detail .stat-col .rune-btn { width: 64px; font-size: 12px; margin-top: 2px; }
#screenHeroes.has-detail .stat-col .rune-btn img { width: 52px !important; height: 52px !important; }
#screenHeroes.has-detail .skill-board.tree3 .path-lab.lab-b { left: 54%; bottom: auto; top: 62%; }

@media (max-height: 700px) {
    #screenHeroes.has-detail .up-mid { min-height: 150px; }
    #screenHeroes.has-detail .pedestal-col { min-height: 150px; margin: 0 -8px; }
    #screenHeroes.has-detail .up-upgrade,
    #screenHeroes.has-detail .up-ascend {
        height: 64px;
        font-size: 22px;
    }
    #screenHeroes.has-detail .up-upgrade small,
    #screenHeroes.has-detail .up-ascend small { font-size: 14px; }
    #screenHeroes.has-detail .skill-board.tree2 { height: 96px; }
    #screenHeroes.has-detail .skill-board.tree3 { height: 132px; }
    #screenHeroes.has-detail .skill-board.tree3 > .skill-node.special img { width: 54px; height: 54px; }
    #screenHeroes.has-detail .skill-board.tree3 .skill-node.core img,
    #screenHeroes.has-detail .skill-board.tree3 .skill-node.path img { width: 36px; height: 36px; }
    .skill-inspect { min-height: 44px; }
    .skill-inspect-copy p { font-size: 10px; }
}

/* PvP: one rival card, sticky FIND MATCH */
#screenPvp {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 14px 16px 8px;
}
#screenPvp .pvp-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 8px;
}
#screenPvp .pvp-dock {
    flex: 0 0 auto;
    position: relative;
    z-index: 32;
    padding: 8px 0 calc(6px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(19,52,104,0), #133468 22%);
}
#screenPvp .find-match { width: 100%; }
#screenPvp #ghostCard,
#screenPvp .ghost-card { display: none !important; }

/* Battle HUD: one tip at a time; hide squad-buff ribbon during onboarding */
#arenaContainer.onboard-active #synergyBanner,
#arenaContainer.onboard-active #tutorialBanner,
#arenaContainer.onboard-active #tipText.is-callout {
    display: none !important;
}

#btnSummonOne.is-free small { color: #bbf7d0; }
#starDustLabel.hidden { display: none !important; }

/* ---------- Battle bottom bar (mockup 1) ---------- */
#battleScreen { --bot-h: 108px; }
#camResetFab.hidden { display: none !important; }
#bottomHud {
    position: relative;
    background:
        linear-gradient(180deg, #d7bf96 0%, #b08955 18%, #7a542e 55%, #4a3218 100%);
    border-top: 5px solid #f3e2c0;
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,.28),
        inset 0 -8px 0 #2a180c,
        0 -3px 0 #1a0e06;
    overflow: visible;
    z-index: 24;
}
#bottomHud::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 10px solid transparent;
    border-bottom-width: 0;
    border-image: url("../assets/ui/ui/frame-stone.png") 80 fill / 10px 10px 0 10px;
    opacity: .9;
    z-index: 1;
}
#bottomHudInner {
    position: relative;
    z-index: 2;
    height: var(--bot-h);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    gap: 4px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
}
#bottomHud .hud-tools {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    padding-left: 2px;
    flex: 0 0 auto;
}
#bottomHud .hud-tool {
    appearance: none;
    width: 56px;
    min-width: 56px;
    height: 50px;
    padding: 2px 2px 3px;
    border-radius: 12px;
    border: 3px solid #3b2410;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    cursor: pointer;
    color: #fff;
    font-family: inherit;
    line-height: 1;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 3px 0 #2a180c;
}
#bottomHud .hud-tool.cam {
    background: linear-gradient(180deg, #8a94a0, #4b5563 55%, #1f2937);
}
#bottomHud .hud-tool.cam.is-on {
    background: linear-gradient(180deg, #7dd3fc, #2563eb 55%, #1e3a8a);
    border-color: #1e3a8a;
}
#bottomHud .hud-tool.emote {
    background: linear-gradient(180deg, #7dd3fc, #2563eb 50%, #1e3a8a);
    border-color: #1e3a8a;
}
#bottomHud .hud-tool.aimline {
    background: linear-gradient(180deg, #8a94a0, #4b5563 55%, #1f2937);
}
#bottomHud .hud-tool.aimline.is-on {
    background: linear-gradient(180deg, #fde68a, #f59e0b 55%, #b45309);
    border-color: #92400e;
}
#bottomHud .hud-tool-ico { font-size: 20px; line-height: 1; }
#bottomHud .hud-tool small {
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 #000;
    color: #fff;
}
#bottomHud .hud-main {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}
#skillBtn.skill-dock,
#bottomHud #skillBtn {
    appearance: none;
    position: relative;
    flex: 0 0 74px;
    width: 74px;
    height: 74px;
    min-width: 74px;
    min-height: 74px;
    margin: 0 0 10px;
    padding: 0 0 16px;
    border-radius: 50%;
    border: 4px solid #f5c04a;
    background:
        radial-gradient(circle at 50% 38%, #fb923c 0%, #c2410c 55%, #7c2d12 100%);
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,.35),
        0 0 0 3px #3b2410,
        0 4px 0 #2a180c,
        0 0 16px rgba(251,146,60,.45);
    color: #fff;
    cursor: pointer;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
#skillBtn.skill-dock .skill-ico {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 2px 0 rgba(0,0,0,.45));
    margin-top: 2px;
}
#skillBtn.skill-dock .skill-name,
#bottomHud #skillBtnLabel {
    position: absolute;
    left: 50%;
    bottom: -4px;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .04em;
    text-shadow: 0 2px 0 #000;
    white-space: nowrap;
    color: #fff7ed;
}
#skillBtn.skill-dock .skill-charge {
    position: absolute;
    top: -6px;
    right: -4px;
    min-width: 22px;
    padding: 1px 4px;
    border-radius: 8px;
    background: #0f172a;
    border: 2px solid #f5c04a;
    font-size: 8px;
    font-weight: 800;
    color: #fde68a;
    line-height: 1.1;
}
#skillBtn.skill-dock .skill-charge.hidden { display: none; }
#skillBtn.skill-dock::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    background: conic-gradient(#fde047 calc(var(--charge, 0) * 1%), rgba(15, 23, 42, 0.55) 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
    opacity: 0.95;
}
#skillBtn.skill-dock.ready::before {
    background: conic-gradient(#86efac 0 100%, #86efac 0);
    filter: drop-shadow(0 0 6px rgba(134,239,172,.85));
}
#skillBtn.skill-dock.armed::before {
    background: conic-gradient(#facc15 0 100%, #facc15 0);
    filter: drop-shadow(0 0 8px rgba(250,204,21,.95));
}
#skillBtn.skill-dock.need-pulse {
    animation: skillNeedPulse .4s ease;
}
#skillBtn.skill-dock .skill-charge.need-flash {
    background: #7f1d1d;
    color: #fef08a;
    transform: scale(1.15);
}
@keyframes skillNeedPulse {
    0%, 100% { transform: scale(1); }
    35% { transform: scale(1.08); }
    60% { transform: scale(0.96); }
}
#skillBtn.skill-dock .skill-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#skillBtn.skill-dock.ready {
    box-shadow:
        inset 0 3px 0 rgba(255,255,255,.45),
        0 0 0 3px #3b2410,
        0 4px 0 #2a180c,
        0 0 22px rgba(250,204,21,.85);
}
#skillBtn.skill-dock.is-locked {
    filter: saturate(.7) brightness(.85);
}
#bottomHud .hero-deck {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    width: auto;
}
#bottomHud .hero-card {
    flex: 0 0 64px;
    width: 64px;
    min-width: 58px;
    max-width: 70px;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none;
    border-radius: 0;
}
#bottomHud .hero-card .hero-portrait {
    width: 62px;
    height: 62px;
    border-radius: 12px;
    border: 3px solid #f5c04a;
    overflow: hidden;
    box-shadow: 0 3px 0 #3b2410, inset 0 0 0 1px rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
}
#bottomHud .hero-card.card-active .hero-portrait {
    border-color: #4ade80;
    box-shadow: 0 0 0 2px #14532d, 0 0 12px rgba(74,222,128,.75), 0 3px 0 #3b2410;
    transform: translateY(-3px);
}
#bottomHud .hero-card .hero-face {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}
#bottomHud .hero-card .hero-face-emoji { font-size: 32px; line-height: 1; }
#bottomHud .hero-card .elem-badge {
    top: -4px;
    left: -4px;
    width: 18px;
    height: 18px;
    font-size: 10px;
    z-index: 2;
}
#bottomHud .hero-card .hero-name {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 #000;
    color: #fff;
    line-height: 1;
    max-width: 70px;
    text-align: center;
}
#bottomHud .hero-card .hero-hp {
    width: 56px;
    max-width: 56px;
    height: 4px;
    margin-top: 1px;
    border-radius: 99px;
}
#bottomHud .hero-card .active-badge {
    top: -12px;
    font-size: 7px;
    padding: 0 5px;
}
#bottomHud #launchBtn {
    appearance: none;
    flex: 0 0 86px;
    width: 86px;
    min-width: 86px;
    height: 86px;
    border-radius: 16px;
    border: 4px solid #fff3c4;
    background:
        radial-gradient(circle at 50% 28%, #ffe9a8 0%, #f5c04a 38%, #ea8c12 70%, #c2410c 100%);
    box-shadow:
        inset 0 4px 0 rgba(255,255,255,.55),
        0 0 0 3px #5b3a10,
        0 5px 0 #3b2410,
        0 0 18px rgba(251,191,36,.55);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: .04em;
    color: #fff;
    text-shadow: 0 2px 0 #7c2d12, 0 0 4px #7c2d12;
    margin-bottom: 2px;
}
#bottomHud #launchBtn::before { inset: -10px; }
#app.landscape { --bot-h: 100px; }
#app.landscape #bottomHudInner {
    flex-direction: column;
    padding: 4px 12px 6px;
}
#app.landscape #bottomHud .hud-main { width: 100%; }
#app.landscape #bottomHud .hero-card {
    flex: 0 0 64px;
    width: 64px;
    min-width: 58px;
}
#app.landscape #bottomHud #launchBtn {
    width: 80px;
    min-width: 80px;
    height: 80px;
    font-size: 14px;
}

@media (max-height: 700px) {
    #battleScreen { --bot-h: 96px; }
    #skillBtn.skill-dock,
    #bottomHud #skillBtn { width: 64px; height: 64px; flex-basis: 64px; min-width: 64px; min-height: 64px; }
    #bottomHud #launchBtn { width: 74px; min-width: 74px; height: 74px; font-size: 13px; }
    #bottomHud .hero-card .hero-portrait { width: 54px; height: 54px; }
}

@media (max-width: 430px) {
    #bottomHud .hud-tools { gap: 5px; }
    #bottomHud .hud-tool { width: 48px; min-width: 48px; height: 48px; }
}
@media (max-width: 360px) {
    #bottomHud .hud-tool { width: 44px; min-width: 44px; }
    #bottomHud .hero-card { flex-basis: 54px; width: 54px; min-width: 52px; }
    #bottomHud .hero-card .hero-portrait { width: 52px; height: 52px; }
    #skillBtn.skill-dock,
    #bottomHud #skillBtn { width: 62px; height: 62px; flex-basis: 62px; min-width: 62px; }
    #bottomHud #launchBtn { width: 72px; min-width: 72px; height: 72px; }
}

/* Emote wheel sits above the dock EMOTE button */
#emoteWheel {
    bottom: calc(var(--bot-h) * var(--ui-scale) + 8px);
    left: 72px;
}

/* Victory: keep claim/ad pinned in view on short phones */
#screenResult {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#screenResult .ad-double,
#screenResult .claim-btn { flex-shrink: 0; }

/* Victory dock stays on-screen; body scrolls */
#screenResult {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 8px;
}
#screenResult .result-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
#screenResult .result-dock {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(15,40,80,0), rgba(15,40,80,.95) 28%);
    z-index: 5;
}
#screenResult .ad-double,
#screenResult .claim-btn { width: min(340px, 100%); }

/* Energy + stays inside the phone frame */
#screenTitle .lx-wallet .plus,
#screenMap .lx-wallet .plus {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    flex: 0 0 32px;
    margin: 0;
}
#screenTitle .lx-wallet,
#screenMap .lx-wallet { padding-right: 6px; max-width: 100%; box-sizing: border-box; }
#screenTitle .lx-profile { width: 42%; }
#screenTitle, #screenMap { overflow-x: hidden; }

#screenResult #resultLoot { order: 2; }
#screenResult #resultHeroes { order: 3; }
#screenResult #resultObjectives { order: 4; }
#screenResult #resultUnlocks { order: 5; }

/* ---------- Hero Roster (style reference, real data/nav) ---------- */
#screenHeroes.roster-screen:not(.has-detail) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: calc(6px + var(--safe-t)) 8px calc(6px + var(--safe-b)) 8px;
    gap: 6px;
    background-color: #1a2240;
    background-size: cover;
    background-position: center top;
}
#screenHeroes.roster-screen:not(.has-detail)::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(10,16,32,.35) 0%, rgba(10,16,32,.55) 100%);
    z-index: 0;
}
#screenHeroes.roster-screen:not(.has-detail) > * { position: relative; z-index: 1; }

#screenHeroes.has-detail .roster-top,
#screenHeroes.has-detail .roster-banner,
#screenHeroes.has-detail .roster-filters,
#screenHeroes.has-detail .roster-power-btn,
#screenHeroes.has-detail .roster-dock { display: none !important; }

.roster-top {
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
}
.roster-back {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 4px;
    border-radius: 10px;
    background: linear-gradient(180deg, #f87171, #dc2626 55%, #991b1b);
    border: 3px solid #4c0a0a;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 3px 0 rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
}
.roster-back img { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 1px 0 #4c0a0a); }
.roster-wallet {
    flex: 1;
    display: flex;
    gap: 6px;
    min-width: 0;
    justify-content: flex-end;
}
.roster-wallet .cur { min-width: 0; }
.roster-banner {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    margin: 0;
}
.roster-title {
    margin: 0;
    padding: 7px 22px 8px;
    font-family: var(--disp);
    font-size: 22px;
    line-height: 1;
    font-weight: 400;
    color: #fde68a;
    text-shadow: var(--ol-brown);
    white-space: nowrap;
    background: url("../assets/ui/ui/banner-title-plate.png") center / 100% 100% no-repeat;
    border: 0;
    border-radius: 0;
}
.roster-filters {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
}
.roster-filters::-webkit-scrollbar { display: none; }
.roster-tab {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 2px 10px 2px 6px;
    border-radius: 18px;
    border: 2px solid #c9a227;
    background: linear-gradient(180deg, #3b2a14, #1c140c);
    color: #fde68a;
    font-family: var(--disp);
    font-size: 12px;
    letter-spacing: .02em;
    text-shadow: var(--ol);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 0 rgba(0,0,0,.35);
}
.roster-tab img { width: 26px; height: 26px; object-fit: contain; }
.roster-tab.on {
    background: linear-gradient(180deg, #f6d36b, #c9a227 60%, #8a6a14);
    color: #3b2208;
    text-shadow: 0 1px 0 #fff3c4;
    border-color: #ffe9a0;
}

#screenHeroes:not(.has-detail) #heroGrid.roster-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: max-content;
    gap: 10px 8px;
    align-content: start;
    align-items: start;
    padding: 8px 2px 10px;
    background: none;
}

#screenHeroes:not(.has-detail) #gearWorkshop,
#screenHeroes:not(.has-detail) .gear-workshop {
    display: none !important;
}
#screenHeroes .roster-card.collect-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 256 / 519;
    min-height: 0;
    height: auto !important;
    min-height: unset !important;
    padding: 0 !important;
    margin: 0;
    overflow: visible;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    filter: none;
    color: #fff;
    align-self: start;
}
#screenHeroes .roster-card.collect-card.locked { filter: none; }
.roster-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    z-index: 3;
}
.roster-portrait {
    position: absolute;
    left: 12%;
    right: 12%;
    top: 8%;
    bottom: 24%;
    overflow: hidden;
    z-index: 1;
    background: radial-gradient(ellipse at 50% 30%, #3a4a66, #10182a 72%);
    display: block;
}
.roster-portrait .roster-face {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center 15%;
    filter: none;
}
.roster-card.locked .roster-face {
    /* Own portrait, dimmed — not a generic black silhouette. */
    filter: grayscale(1) brightness(0.72) contrast(0.95);
    opacity: 0.9;
}
.roster-elem {
    position: absolute;
    top: 5.5%;
    right: 6%;
    width: 26%;
    height: auto;
    z-index: 4;
    pointer-events: none;
    filter: drop-shadow(0 1px 1px #000);
}
.roster-lv {
    position: absolute;
    left: 9%;
    top: 15%;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    pointer-events: none;
    font-family: var(--disp);
    font-size: 11px;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 0 #000, 0 0 3px #000;
    background: rgba(8, 8, 12, .62);
    border-radius: 6px;
    padding: 2px 4px 3px;
}
.roster-stars { display: flex; gap: 0; }
.roster-stars .star { width: 11px; height: 11px; }
.roster-name {
    position: absolute;
    left: 7.5%;
    right: 7.5%;
    bottom: 4%;
    height: 16%;
    z-index: 4;
    font-family: var(--disp);
    font-size: 12px;
    line-height: 1.1;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 0 #1a1208, 0 0 3px #000;
    text-transform: uppercase;
    letter-spacing: .03em;
    pointer-events: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #2a1b0c;
    border-radius: 0 0 6px 6px;
    padding: 5px 2px 14px;
    box-sizing: border-box;
}
.roster-shards {
    position: absolute;
    left: 16%;
    right: 10%;
    bottom: 4.6%;
    height: 9px;
    z-index: 5;
    background: #1a1208;
    border: 1px solid #5b4318;
    border-radius: 6px;
    overflow: visible;
    pointer-events: none;
}
.roster-shards i {
    display: block;
    height: 100%;
    background: linear-gradient(180deg, #86efac, #16a34a 70%);
    border-radius: 5px;
}
.roster-shards span {
    position: absolute;
    inset: 0;
    text-align: center;
    font-family: var(--disp);
    font-size: 9px;
    line-height: 9px;
    color: #fff;
    text-shadow: 0 1px 0 #000;
}
.roster-shards .shard-up {
    position: absolute;
    left: -13px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    filter: drop-shadow(0 1px 0 #000);
}
.roster-tag {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 86%;
    height: auto;
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(0 2px 0 rgba(0,0,0,.45));
}
.roster-lock {
    position: absolute;
    left: 10%;
    right: 10%;
    top: 36%;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}
.roster-lock img { width: 28px; height: 28px; filter: drop-shadow(0 2px 0 #000); }
.roster-lock span {
    font-family: var(--disp);
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
    color: #fde68a;
    text-shadow: 0 1px 0 #000;
    background: rgba(20,12,4,.72);
    border-radius: 6px;
    padding: 2px 4px;
}

.roster-power-btn {
    flex: 0 0 auto;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 8px 12px 10px;
    font-family: var(--disp);
    font-size: 20px;
    letter-spacing: .03em;
    color: #fff;
    text-shadow: 0 2px 0 #14532d;
    background: url("../assets/ui/ui/btn-green.png") center / 100% 100% no-repeat;
    border: 0;
    box-shadow: 0 4px 0 rgba(5, 46, 22, .45);
}
.roster-dock {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 -2px;
}
.roster-dock .dock-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.roster-dock .side-btn {
    width: 92px;
    flex: 0 0 92px;
    height: 86px;
    border-radius: 16px;
    padding: 6px 2px 4px;
    font-family: var(--disp);
    font-size: 13px;
    line-height: 1.05;
    text-transform: uppercase;
    text-shadow: var(--ol);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    background: linear-gradient(180deg, #3b82f6, #1d4ed8 60%, #1e3a8a);
    border: 3px solid #0b1f4a;
    box-shadow: inset 0 3px 0 rgba(255,255,255,.28), 0 3px 0 rgba(0,0,0,.35);
}
.roster-dock .side-btn.on,
.roster-dock .side-btn[aria-current="page"] {
    box-shadow: inset 0 3px 0 rgba(255,255,255,.28), 0 0 0 3px #fde047, 0 3px 0 rgba(0,0,0,.35);
}
.roster-dock .side-ico { width: 42px; height: 42px; margin: 0 auto 2px; object-fit: contain; }
.roster-dock .battle-btn {
    flex: 1 1 auto;
    height: 86px;
    min-width: 0;
    font-family: var(--disp);
    font-size: 22px;
    line-height: 1.05;
    color: #fff8d6;
    text-shadow: var(--ol-brown);
    background: url("../assets/ui/ui/btn-battle.png") center / 100% 100% no-repeat;
    border: 0;
    box-shadow: none;
    padding: 8px 6px;
}

/* Team-select cards: portrait sits in its own column so it cannot
   cover the name or level, and has no dark backdrop box. */
#app #screenTeam .collect-card,
#screenTeam .collect-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    grid-template-rows: auto auto;
    grid-template-areas:
        "name art"
        "meta art";
    column-gap: 6px;
    row-gap: 2px;
    align-items: center;
    min-height: 92px;
    padding: 8px 10px 8px 12px;
    overflow: hidden;
    text-align: left;
}
#app #screenTeam .collect-card .cc-name,
#screenTeam .collect-card .cc-name {
    grid-area: name;
    position: relative;
    z-index: 2;
    min-width: 0;
    font-size: 15px;
    line-height: 1.15;
    padding-right: 2px;
    pointer-events: none;
    white-space: normal;
    overflow: visible;
}
#app #screenTeam .collect-card .cc-meta,
#screenTeam .collect-card .cc-meta {
    grid-area: meta;
    position: relative;
    z-index: 2;
    min-width: 0;
    font-size: 11px;
    line-height: 1.2;
    margin-top: 0;
    padding-right: 2px;
    pointer-events: none;
    white-space: normal;
    overflow: visible;
    opacity: 0.95;
}
#app #screenTeam .collect-card .roster-portrait,
#screenTeam .collect-card .roster-portrait {
    grid-area: art;
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 76px;
    height: 76px;
    max-width: 76px;
    max-height: 76px;
    background: none;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
    border: 0;
    box-shadow: none;
    border-radius: 10px;
}
#app #screenTeam .collect-card .cc-face,
#screenTeam .collect-card .cc-face {
    width: 76px;
    height: 76px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 2px 1px rgba(0,0,0,.4));
    background: transparent;
    display: block;
}
#app #screenTeam .collect-card .lock-pip,
#screenTeam .collect-card .lock-pip {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
}
#app #screenTeam .collect-card.locked,
#screenTeam .collect-card.locked {
    filter: grayscale(0.82) brightness(0.78);
}

.hud-tool-ico img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,.5));
}
#menuBtn {
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* File-backed hamburger, so a broken <img> cannot leave a torn-picture hole. */
    background-image: url('../assets/ui/icons/icon-hud-menu.png'), linear-gradient(180deg, #fbbf24, #ea580c);
    background-size: 26px 26px, auto;
    background-position: center, 0 0;
    background-repeat: no-repeat, no-repeat;
}
#menuBtn .menu-ico {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex: 0 0 26px;
    display: block;
    /* Occupy the layout box and feed the naturalWidth check, but paint
       the hamburger via the button background so a decode failure cannot
       leave Chrome's torn-picture glyph on the HUD. */
    opacity: 0;
}
.st-ico img { width: 22px; height: 22px; object-fit: contain; display: block; filter: drop-shadow(0 1px 0 #000); }

@media (max-width: 370px) {
    .roster-title { font-size: 18px; padding: 6px 16px 7px; }
    .roster-name { font-size: 10px; }
    .roster-tab { font-size: 11px; height: 32px; padding: 2px 8px 2px 4px; }
    .roster-tab img { width: 22px; height: 22px; }
    .roster-dock .side-btn { width: 82px; flex-basis: 82px; height: 80px; font-size: 11px; }
    .roster-dock .battle-btn { height: 80px; font-size: 18px; }
    .roster-power-btn { font-size: 18px; min-height: 48px; }
    .roster-stars .star { width: 9px; height: 9px; }
}

/* ---------- Phase 1: art-styled overlays, toggles, HUD, map chips ---------- */
.art-page .art-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.art-page .art-head .roster-title { flex: 1; text-align: center; margin: 0; }
.art-page .screen-body { padding: 6px 2px 12px; }
.howto-ico, .set-ico {
    width: 22px;
    height: 22px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 4px;
    filter: drop-shadow(0 1px 0 #000);
}
.howto-screen .info-card h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--disp);
    color: #fde68a;
}
.settings-screen .setting-row {
    border: 2px solid #f2c94c;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 3px 0 rgba(0,0,0,.35);
    font-family: var(--disp);
    color: #fff8d6;
    text-shadow: var(--ol);
}
.settings-screen .setting-row span { display: flex; align-items: center; gap: 6px; }

.art-toggle {
    position: relative;
    min-width: 86px;
    min-height: 36px;
    padding: 0 10px 0 36px;
    border-radius: 18px;
    border: 3px solid #14532d;
    background: linear-gradient(180deg, #4ade80, #16a34a 60%, #166534);
    color: #052e16;
    font-family: var(--disp);
    font-size: 14px;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 2px 0 rgba(0,0,0,.35);
}
.art-toggle .knob {
    position: absolute;
    left: 4px;
    top: 50%;
    width: 24px;
    height: 24px;
    margin-top: -12px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff, #fde68a 55%, #c9a227);
    border: 2px solid #7c4a03;
    box-shadow: 0 1px 0 #000;
}
.art-toggle.off {
    padding: 0 36px 0 10px;
    background: linear-gradient(180deg, #64748b, #334155 60%, #1e293b);
    border-color: #0f172a;
    color: #e2e8f0;
}
.art-toggle.off .knob { left: auto; right: 4px; filter: grayscale(.4); }
.art-toggle .tog-lab { position: relative; z-index: 1; }
#setQuality.art-toggle { min-width: 110px; }

.art-btn.green, .menu-btn.primary.art-btn {
    background: url("../assets/ui/ui/btn-green.png") center / 100% 100% no-repeat;
    border: 0;
    color: #fff;
    text-shadow: 0 2px 0 #14532d;
    box-shadow: 0 4px 0 rgba(5, 46, 22, .45);
    min-height: 48px;
}
.art-btn.blue {
    background: url("../assets/ui/ui/btn-blue.png") center / 100% 100% no-repeat;
    border: 0;
    color: #fff;
    text-shadow: 0 2px 0 #0c2340;
    box-shadow: 0 4px 0 rgba(8, 30, 70, .45);
    min-height: 48px;
}
.art-btn.danger {
    background: linear-gradient(180deg, #f87171, #dc2626 55%, #991b1b);
    border: 3px solid #4c0a0a;
    color: #fff;
    text-shadow: 0 2px 0 #7f1d1d;
    min-height: 48px;
}
.art-overlay .art-modal {
    width: min(360px, 100%);
    background:
        url("../assets/ui/ui/panel-gold-frame.png") center / 100% 100% no-repeat,
        linear-gradient(180deg, #3b2a1a, #1c140c);
    border: 0;
    padding: 28px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 8px 0 rgba(0,0,0,.45);
}
.art-overlay .art-modal .modal-title {
    font-family: var(--disp);
    color: #fde68a;
    text-align: center;
    margin: 0 0 4px;
    text-shadow: var(--ol-brown);
}
.art-overlay .art-modal .modal-sub { color: #fff8d6; text-align: center; text-shadow: var(--ol); }
.art-overlay .title-row { display: flex; gap: 8px; }
.art-overlay .title-row .menu-btn { flex: 1; }

.portrait .face, #playerPortrait, #enemyPortrait {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
}
.portrait .face img, #playerPortrait img, #enemyPortrait img {
    width: 140%;
    height: 140%;
    object-fit: cover;
    object-position: center 20%;
}
.trophy-pip { display: flex; align-items: center; gap: 1px; padding: 0 4px 0 2px; }
.trophy-pip img { width: 10px; height: 10px; object-fit: contain; }
.chest { display: inline-flex; width: 16px; height: 16px; }
.chest img { width: 16px; height: 16px; object-fit: contain; }
#menuPanel .mini-ico { width: 16px; height: 16px; vertical-align: middle; margin-right: 2px; }
#camResetFab img { width: 22px; height: 22px; }

.status-pips {
    position: absolute;
    left: 2px;
    bottom: 16px;
    display: flex;
    gap: 1px;
    z-index: 3;
    pointer-events: none;
}
.status-pips img { width: 14px; height: 14px; filter: drop-shadow(0 1px 0 #000); }
.hero-card { position: relative; }
.hero-card .elem-badge {
    width: 18px;
    height: 18px;
    object-fit: contain;
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 2;
}

.map-modes.art-modes {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0 8px 4px;
}
.mode-chip {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 3px 10px 3px 6px;
    border-radius: 16px;
    border: 2px solid #f2c94c;
    background: linear-gradient(180deg, #3b2a14, #1c140c);
    color: #fde68a;
    font-family: var(--disp);
    font-size: 12px;
    text-shadow: var(--ol);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 0 rgba(0,0,0,.35);
}
.mode-chip img { width: 18px; height: 18px; object-fit: contain; }

.aura-pill.ped-aura {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    right: auto;
    top: auto;
    z-index: 5;
    min-width: 84px;
    min-height: 36px;
    padding: 3px 8px 3px 5px;
}
#screenHeroes.has-detail .pedestal-col { position: relative; }
#screenHeroes.has-detail .ped-stars { bottom: 54px; }
#screenHeroes.has-detail .ped-caption { bottom: 2px; }

@media (max-width: 370px) {
    .art-toggle { min-width: 76px; min-height: 34px; font-size: 12px; }
    .mode-chip { font-size: 11px; padding: 2px 8px 2px 4px; }
    .aura-pill.ped-aura { min-width: 72px; }
}


/* ---- Phase 3: lobby hubs, defeat, pass, medals, board, mail, events ---- */
.lx-hubs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 0 10px 6px;
    flex-shrink: 0;
}
.hub-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 4px 2px 3px;
    border: 0;
    border-radius: 12px;
    background: rgba(8, 12, 28, 0.55);
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.35);
    color: #fde68a;
    font: 700 11px/1.1 'Fredoka', sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.hub-chip img { width: 22px; height: 22px; object-fit: contain; }
.hub-chip .notify-dot { position: absolute; top: 4px; right: 6px; }
.hub-body { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 24px; }
.hub-banner { margin: 0; color: #fecaca; font: 800 22px/1.1 'Fredoka', sans-serif; text-align: center; letter-spacing: 0.06em; }
.hub-kicker { margin: 0; text-align: center; color: #fde68a; font: 700 13px 'Fredoka', sans-serif; }
.hub-note { margin: 0; color: #cbd5e1; font: 500 12px/1.4 'Fredoka', sans-serif; text-align: center; }
.premium-note { color: #fde68a; }
.defeat-mark { width: 88px; height: 88px; margin: 8px auto 0; display: block; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.55)); }
.hub-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hub-stats div { background: rgba(8,12,28,0.55); border-radius: 10px; padding: 8px 4px; text-align: center; box-shadow: inset 0 0 0 1px rgba(251,191,36,0.25); }
.hub-stats small { display: block; color: #94a3b8; font: 600 9px 'Fredoka', sans-serif; text-transform: uppercase; }
.hub-stats b { color: #f8fafc; font: 800 16px 'Fredoka', sans-serif; }
.defeat-screen .art-btn, .hub-screen .art-btn { width: 100%; min-height: 44px; }
.art-btn.mini { width: auto; min-height: 36px; padding: 6px 12px; font-size: 11px; margin-top: 6px; }
.pass-head { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; align-items: center; }
.pass-head div { text-align: center; }
.pass-head small { display: block; color: #94a3b8; font: 600 9px 'Fredoka', sans-serif; text-transform: uppercase; }
.pass-head b { color: #fde68a; font: 800 20px 'Fredoka', sans-serif; }
.pass-bar { display: block; height: 10px; border-radius: 99px; background: rgba(15,23,42,0.8); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(251,191,36,0.3); }
.pass-bar > i, .pass-bar #passXpFill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f59e0b, #fde68a); }
.pass-xp { text-align: left !important; }
.pass-xp span { display: block; color: #e2e8f0; font: 600 11px 'Fredoka', sans-serif; margin-bottom: 4px; }
.pass-track { display: flex; flex-direction: column; gap: 8px; }
.pass-row { display: grid; grid-template-columns: 36px 1fr 1fr; gap: 8px; align-items: start; background: rgba(8,12,28,0.5); border-radius: 12px; padding: 8px; box-shadow: inset 0 0 0 1px rgba(148,163,184,0.2); }
.pass-row.ready { box-shadow: inset 0 0 0 1px rgba(251,191,36,0.55); }
.pass-rk { width: 28px; height: 28px; border-radius: 50%; background: #1e293b; color: #fde68a; display: flex; align-items: center; justify-content: center; font: 800 12px 'Fredoka', sans-serif; }
.pass-free, .pass-prem { display: flex; flex-direction: column; gap: 2px; color: #e2e8f0; font: 600 11px/1.3 'Fredoka', sans-serif; }
.pass-free b, .pass-prem b { color: #fde68a; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.claimed-lab, .locked-lab { color: #94a3b8; }
.hub-list { display: flex; flex-direction: column; gap: 8px; }
.hub-card { background: rgba(8,12,28,0.55); border-radius: 12px; padding: 10px; box-shadow: inset 0 0 0 1px rgba(251,191,36,0.25); color: #e2e8f0; }
.hub-card.you { box-shadow: inset 0 0 0 1px #fbbf24; }
.hub-card.unread { box-shadow: inset 0 0 0 1px #38bdf8; }
.hub-card.ready { box-shadow: inset 0 0 0 1px #4ade80; }
.hub-card-top { display: flex; gap: 8px; align-items: center; }
.hub-card-top img { width: 28px; height: 28px; object-fit: contain; }
.hub-card-top div { flex: 1; min-width: 0; }
.hub-card-top b { display: block; font: 800 13px 'Fredoka', sans-serif; color: #f8fafc; }
.hub-card-top small { display: block; color: #94a3b8; font: 500 11px/1.3 'Fredoka', sans-serif; }
.hub-card .troph { color: #fde68a; font: 800 16px 'Fredoka', sans-serif; }
.rank-num { width: 24px; text-align: center; color: #fde68a; font: 800 16px 'Fredoka', sans-serif; }
.hub-meter { display: block; height: 8px; border-radius: 99px; background: rgba(15,23,42,0.8); overflow: hidden; margin: 8px 0 4px; }
.hub-meter i { display: block; height: 100%; background: linear-gradient(90deg, #22d3ee, #a3e635); }
.hub-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hub-tab { min-height: 40px; border: 0; border-radius: 10px; background: rgba(8,12,28,0.55); color: #cbd5e1; font: 700 12px 'Fredoka', sans-serif; box-shadow: inset 0 0 0 1px rgba(148,163,184,0.3); }
.hub-tab.on { color: #0b1220; background: #fde68a; box-shadow: none; }
@media (max-width: 360px) {
    .hub-chip { min-height: 44px; font-size: 10px; }
    .hub-stats { grid-template-columns: repeat(2, 1fr); }
    .pass-head { grid-template-columns: 52px 1fr 52px; }
}

#screenDefeat .loot-label { text-align: center; color: #fde68a; font: 700 16px 'Fredoka', sans-serif; }
#screenDefeat #defeatLoot.loot-row { display: flex; justify-content: center; gap: 8px; }
#screenDefeat #defeatLoot .loot-tile {
    width: 88px; flex: 0 0 88px; padding: 0; background: none; border: 0;
    font: 800 12px 'Fredoka', sans-serif; color: #fff; text-align: center;
}
#screenDefeat #defeatLoot .loot-tile .ico {
    height: 64px; display: flex; align-items: center; justify-content: center;
    border-radius: 10px; margin-bottom: 4px; overflow: hidden;
    background: linear-gradient(180deg, #7f5a2a, #5a3d1a);
    border: 3px solid #f2c94c;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 3px 0 rgba(0,0,0,.4);
}
#screenDefeat #defeatLoot .loot-tile .ico img { width: 48px; height: 48px; object-fit: contain; }

#skillBtn.skill-dock.armed,
#bottomHud #skillBtn.armed {
    box-shadow: 0 0 0 3px #fde047, 0 0 18px rgba(253, 224, 71, 0.85);
    transform: translateY(-1px);
}
#skillBtn.skill-dock.armed .skill-name,
#bottomHud #skillBtn.armed #skillBtnLabel { color: #fde047; }


/* ---- Guilds coming soon ---- */
#screenGuilds .guild-soon-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 16px 16px 32px;
    min-height: 0;
    flex: 1;
}
#screenGuilds .guild-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    background: rgba(8, 12, 28, 0.72);
    border-radius: 18px;
    padding: 22px 18px 20px;
    box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.45), 0 8px 24px rgba(0,0,0,0.35);
}
#screenGuilds .guild-soon-icon {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.55));
}
#screenGuilds .guild-soon-kicker {
    margin: 0;
    color: #fde68a;
    font: 800 14px/1 'Fredoka', sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
#screenGuilds .guild-soon h3 {
    margin: 0;
    color: #fff7d6;
    font: 800 26px/1.15 'Fredoka', sans-serif;
    text-shadow: 0 2px 0 rgba(0,0,0,.45);
}
#screenGuilds .guild-soon p:not(.guild-soon-kicker) {
    margin: 0;
    color: #e2e8f0;
    font: 600 16px/1.45 'Fredoka', sans-serif;
    max-width: 32em;
}
#screenGuilds .guild-soon .art-btn {
    width: 100%;
    margin-top: 8px;
    min-height: 52px;
    font-size: 18px;
}


/* Readability: keep main menu type large and prevent sideways overflow */
#screenTitle, #screenMap, #screenSummon, #screenHeroes, #screenResult, #screenPvp, #screenGuilds {
    overflow-x: hidden;
}
#screenSummon .roster-title,
#screenHeroes .roster-title,
#screenPvp .pvp-title,
#screenResult #resultTitle { letter-spacing: 0.04em; }
#hud .shot-clock, #hud .hud-label, #hud button { font-weight: 700; }


/* Fortress / turf-race payoff: chunky gold (or threat-red) ribbon, flash. Pointer-events none, <1.2s. */
#arenaContainer { position: relative; }
#payoffFlash, .payoff-flash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 28;
    opacity: 0;
    background: radial-gradient(circle at 50% 22%, rgba(255, 230, 110, 0.42) 0%, rgba(255, 196, 50, 0.16) 32%, transparent 62%);
    transition: opacity 0.16s ease-out;
}
#payoffFlash.show, .payoff-flash.show { opacity: 1; }
#payoffFlash.threat, .payoff-flash.threat {
    background: radial-gradient(circle at 50% 58%, rgba(255, 70, 70, 0.58) 0%, rgba(180, 16, 24, 0.32) 40%, rgba(80, 0, 0, 0.1) 60%, transparent 76%);
}
#payoffRibbon, .payoff-ribbon {
    position: absolute;
    left: 50%;
    /* Top third of the screen, above the slingshot / aim line. */
    top: 11%;
    transform: translate(-50%, 0) scale(0.72);
    z-index: 32;
    pointer-events: none;
    opacity: 0;
    min-width: 210px;
    max-width: 88%;
    padding: 10px 28px 12px;
    text-align: center;
    background: linear-gradient(180deg, #fde68a, #f59e0b 42%, #b45309);
    border: 3px solid #7c2d12;
    border-radius: 8px;
    box-shadow: 0 5px 0 #7c2d12, 0 10px 22px rgba(0, 0, 0, 0.45);
    transition: opacity 0.14s ease-out, transform 0.18s cubic-bezier(0.2, 1.4, 0.4, 1);
}
#payoffRibbon::before, #payoffRibbon::after,
.payoff-ribbon::before, .payoff-ribbon::after {
    content: "";
    position: absolute;
    top: 10px;
    width: 18px;
    height: 68%;
    background: #b45309;
}
#payoffRibbon::before, .payoff-ribbon::before { left: -13px; clip-path: polygon(100% 0, 0 50%, 100% 100%); }
#payoffRibbon::after, .payoff-ribbon::after { right: -13px; clip-path: polygon(0 0, 100% 50%, 0 100%); }
#payoffRibbon.show, .payoff-ribbon.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}
#payoffRibbon.threat, .payoff-ribbon.threat {
    background: linear-gradient(180deg, #fecaca, #ef4444 42%, #7f1d1d);
    border-color: #450a0a;
    box-shadow: 0 5px 0 #450a0a, 0 10px 22px rgba(0, 0, 0, 0.5);
}
#payoffRibbon.threat::before, #payoffRibbon.threat::after,
.payoff-ribbon.threat::before, .payoff-ribbon.threat::after { background: #7f1d1d; }
#payoffRibbon .payoff-ribbon-inner,
.payoff-ribbon .payoff-ribbon-inner {
    font-family: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: #fff;
    -webkit-text-fill-color: #fff;
    text-shadow: 0 3px 0 #9a3412, 1px 1px 0 #451a03, -1px -1px 0 #451a03, 0 0 14px rgba(255, 220, 80, 0.55);
    white-space: nowrap;
}
#payoffRibbon.threat .payoff-ribbon-inner,
.payoff-ribbon.threat .payoff-ribbon-inner {
    text-shadow: 0 3px 0 #7f1d1d, 1px 1px 0 #450a0a, -1px -1px 0 #450a0a, 0 0 14px rgba(255, 80, 80, 0.55);
}
@media (max-width: 380px) {
    #payoffRibbon .payoff-ribbon-inner, .payoff-ribbon .payoff-ribbon-inner { font-size: 18px; }
    #payoffRibbon, .payoff-ribbon { padding: 8px 20px 10px; min-width: 180px; }
}


/* Quake chip lives inside the enemy HP column (over the HP track), 12px+, one word. */
.side-stat.enemy { position: relative; }
.side-stat.enemy .stat-col { position: relative; }
.side-stat.enemy .hp-track { overflow: visible; position: relative; }
#bossTellLabel, .boss-tell-label {
    position: absolute;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: none;
    z-index: 46;
    pointer-events: none;
    opacity: 0;
    padding: 0 4px;
    height: 15px;
    border-radius: 999px;
    border: 1.5px solid #7c2d12;
    font-family: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.06em;
    line-height: 13px;
    white-space: nowrap;
    text-align: center;
    color: #fff7ed;
    text-shadow: 0 1px 0 #431407, 0 0 4px rgba(0,0,0,0.45);
    box-shadow: 0 1px 0 rgba(0,0,0,0.35);
    transition: opacity 0.12s ease-out;
    max-width: 100%;
    width: auto;
    box-sizing: border-box;
    overflow: visible;
}
#bossTellLabel.show, .boss-tell-label.show {
    opacity: 1;
    transform: none;
}
#bossTellLabel.gorg, .boss-tell-label.gorg {
    background: linear-gradient(180deg, #fdba74, #c2410c 55%, #7c2d12);
    border-color: #431407;
}
#bossTellLabel.venoma, .boss-tell-label.venoma {
    background: linear-gradient(180deg, #86efac, #16a34a 55%, #14532d);
    border-color: #052e16;
    text-shadow: 0 2px 0 #052e16, 0 0 8px rgba(0,40,0,0.45);
}
#bossTellLabel.pyre, .boss-tell-label.pyre {
    background: linear-gradient(180deg, #fde047, #ea580c 55%, #9a3412);
    border-color: #7c2d12;
}
#bossTellLabel.dread, .boss-tell-label.dread {
    background: linear-gradient(180deg, #c4b5fd, #6d28d9 55%, #1e1b4b);
    border-color: #1e1b4b;
    text-shadow: 0 2px 0 #1e1b4b, 0 0 10px rgba(80,0,120,0.5);
}
#bossTellLabel.is-cast, .boss-tell-label.is-cast {
    font-size: 12px;
    padding: 0 4px;
}


/* Boss-quake tell on the enemy HP bar — readable when the boss is off-camera. */
.side-stat.enemy { position: relative; }
#enemyTell, .enemy-tell {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: auto;
    width: max-content;
    max-width: 168px;
    margin: 0;
    padding: 3px 8px 4px;
    z-index: 30;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1.5px solid #450a0a;
    font-family: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-align: center;
    color: #fff7ed;
    text-shadow: 0 1px 0 #450a0a;
    white-space: nowrap;
    overflow: visible;
    pointer-events: none;
    background: linear-gradient(180deg, #fca5a5, #dc2626 55%, #7f1d1d);
    box-shadow: 0 2px 0 rgba(0,0,0,0.45), 0 0 8px rgba(0,0,0,0.3);
    animation: enemyTellPulse 0.7s ease-in-out infinite;
}
/* Duplicate of the arena-top chip — never paint this, even if a class leftover remains. */
#enemyTell, .enemy-tell,
#enemyTell.show, .enemy-tell.show {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
}
#enemyTell.venoma, .enemy-tell.venoma {
    background: linear-gradient(180deg, #86efac, #16a34a 55%, #14532d);
    border-color: #052e16;
    text-shadow: 0 1px 0 #052e16;
}
#enemyTell.pyre, .enemy-tell.pyre {
    background: linear-gradient(180deg, #fde047, #ea580c 55%, #9a3412);
    border-color: #7c2d12;
}
#enemyTell.dread, .enemy-tell.dread {
    background: linear-gradient(180deg, #c4b5fd, #6d28d9 55%, #1e1b4b);
    border-color: #1e1b4b;
    text-shadow: 0 1px 0 #1e1b4b;
}
#enemyTell.gorg, .enemy-tell.gorg {
    background: linear-gradient(180deg, #fdba74, #c2410c 55%, #7c2d12);
    border-color: #431407;
}
@keyframes enemyTellPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.28); }
}


/* Large POWER % at the TOP of the battle area — never under the pulling thumb. */
#powerReadout, .power-readout {
    display: none;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 28;
    pointer-events: none;
    min-width: 210px;
    max-width: 78%;
    padding: 8px 16px 10px;
    border-radius: 14px;
    border: 2.5px solid #052e16;
    background: linear-gradient(180deg, rgba(6, 18, 28, 0.92), rgba(6, 18, 28, 0.82));
    box-shadow: 0 4px 0 rgba(0,0,0,0.45), 0 0 18px rgba(0,0,0,0.35);
    text-align: center;
}
#powerReadout.show, .power-readout.show { display: block; }
#powerReadout .power-readout-label, .power-readout-label {
    font-family: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
    font-weight: 800;
    font-size: 28px;
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: #f0fdf4;
    text-shadow: 0 2px 0 #052e16, 0 0 10px rgba(0,0,0,0.45);
}
#powerReadout.is-yellow .power-readout-label { color: #fef9c3; text-shadow: 0 2px 0 #713f12, 0 0 10px rgba(0,0,0,0.45); }
#powerReadout.is-red .power-readout-label, #powerReadout.is-full .power-readout-label { color: #fee2e2; text-shadow: 0 2px 0 #7f1d1d, 0 0 10px rgba(0,0,0,0.45); }
#powerReadout.is-yellow { border-color: #713f12; }
#powerReadout.is-red, #powerReadout.is-full { border-color: #7f1d1d; }
#powerReadout .power-readout-track, .power-readout-track {
    margin-top: 6px;
    height: 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    border: 2px solid #000;
    overflow: hidden;
}
#powerReadout .power-readout-fill, .power-readout-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.35);
    transition: width 0.04s linear;
}
#arenaContainer.onboard-active #powerReadout { z-index: 30; }


/* Styled model-load gate — shown only while team/stage GLBs are still decoding. */
#modelLoadOverlay, .model-load-overlay {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(12, 8, 6, 0.72);
    pointer-events: all;
}
#modelLoadOverlay.show, .model-load-overlay.show {
    display: flex;
}
#modelLoadOverlay.hidden, .model-load-overlay.hidden { display: none !important; }
.model-load-card {
    width: min(280px, calc(100% - 40px));
    padding: 18px 20px 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, #3b2414, #1c100a 70%);
    border: 3px solid #f5c04a;
    box-shadow: 0 6px 0 rgba(0,0,0,0.45), 0 0 24px rgba(0,0,0,0.4);
    text-align: center;
    color: #fff7ed;
    font-family: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
}
.model-load-title {
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 0 #1c100a;
    margin: 0 0 12px;
}
.model-load-bar {
    height: 14px;
    border-radius: 99px;
    background: rgba(0,0,0,0.55);
    border: 2px solid #f5c04a;
    overflow: hidden;
    box-shadow: inset 0 2px 0 rgba(0,0,0,0.35);
}
.model-load-bar > i, #modelLoadFill {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #facc15, #f97316);
    border-radius: 99px;
    transition: width 0.16s ease;
}
.model-load-pct {
    margin-top: 8px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.06em;
    color: #fde68a;
}

/* Wide / foldable (e.g. 820x1000): keep goal on one line and QUAKE on the HP track. */
@media (min-width: 600px) {
    .control-goal {
        white-space: nowrap !important;
        font-size: 12px !important;
        line-height: 1.15;
        overflow: visible;
        max-width: none;
    }
    #bossTellLabel, .boss-tell-label {
        max-width: 100%;
        left: 0;
        right: auto;
        width: auto;
        font-size: 12px;
        white-space: nowrap;
    }
    .side-stat.enemy .portrait { z-index: 2; }
    .side-stat.enemy .stat-col { z-index: 3; }
}


/* v77: event banners clear after 1.8s; a small badge stays while the effect lasts. */
#eventBadge, .event-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #422006;
    background: linear-gradient(180deg, #fde68a, #f59e0b);
    border: 1px solid #92400e;
    box-shadow: 0 1px 0 #78350f;
    pointer-events: none;
    z-index: 8;
}
#eventBadge.hidden, .event-badge.hidden { display: none !important; }

/* v77: leftover battle / result layers must never eat map or lobby taps. */
#battleScreen:not(.active) { pointer-events: none !important; }
#app .menu-screen:not(.active) { pointer-events: none !important; }
#btnMapHome { pointer-events: auto; z-index: 12; }
