/* Bubbly HUD (2026-09-14): round action triggers, window bubbles on the left, paperdoll hero sheet
   with a parchment detail card and a satchel, round perk-tree nodes. Casual-round shapes on the
   hardcore navy/brass palette. Loaded last, after simplified.css. */
:root {
  --bb-navy: #081a24; --bb-navy-2: #0e2a36; --bb-panel: rgba(8, 24, 33, .94);
  --bb-brass: #c9a75f; --bb-brass-hi: #f1d79a; --bb-cyan: #74d6d0; --bb-gold: #e7b84b;
  --bb-line: rgba(201, 167, 95, .55); --bb-glow: 0 0 0 2px rgba(116, 214, 208, .35), 0 8px 24px rgba(0, 0, 0, .45);
  --bb-radius: 22px;
  --parch: #efe2c3; --parch-2: #e2cfa4; --parch-ink: #2b2115; --parch-muted: #6a5a3f;
}
.hud-icon[data-icon="perks"] { background-image: url("hud-art/perks.svg"); }
.hud-icon[data-icon="hero"] { background-image: url("hud-art/hero.png"); background-size: 190%; background-position: 50% 12%; border-radius: 50%; }

/* ---- Top-left crest: round portrait, pill bars, pill timer ---- */
#hud { border-radius: 20px; padding: 8px 10px 8px 8px; gap: 9px; background: linear-gradient(120deg, rgba(6, 20, 29, .96), rgba(12, 36, 46, .9)); border: 1px solid var(--bb-line); box-shadow: 0 10px 26px rgba(0, 0, 0, .45); }
#hud .hero-crest { width: 66px; height: 74px; flex-basis: 66px; }
#hero-portrait { width: 62px; height: 62px; border-radius: 50%; border: 2px solid var(--bb-brass-hi); background-size: 180%; background-position: 50% 14%; box-shadow: 0 0 0 3px #12333f, 0 0 0 4px rgba(201, 167, 95, .5), 0 6px 16px rgba(0, 0, 0, .55); }
#hud .hero-level { left: 50%; right: auto; bottom: -2px; transform: translateX(-50%); padding: 2px 8px; border-radius: 10px; border: 1px solid var(--bb-brass); background: #0a1d2a; font-size: 9px; letter-spacing: .08em; clip-path: none; white-space: nowrap; }
.hero-badge { border-radius: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
#hud .bar, #hud .bar.energy, #hud .bar.xp { height: 8px; border-radius: 6px; border: 1px solid rgba(201, 167, 95, .35); background: rgba(2, 10, 14, .8); overflow: hidden; }
#hud .bar i { border-radius: 6px; }
#hud #match-timer-box { border-radius: 14px; width: 46px; min-width: 46px; padding: 5px 2px; border: 1px solid var(--bb-line); background: rgba(3, 13, 19, .85); }

/* ---- Window bubbles on the left ---- */
#hud-bubbles { position: fixed; left: 14px; top: 122px; z-index: 22; display: flex; flex-direction: column; gap: 10px; pointer-events: auto; }
.hud-bubble { position: relative; width: 52px; height: 52px; padding: 0; border-radius: 50%; border: 2px solid var(--bb-brass); background: radial-gradient(circle at 50% 30%, #1a5a6c, #071722 74%); box-shadow: 0 0 0 3px rgba(8, 26, 36, .9), 0 6px 16px rgba(0, 0, 0, .5); color: var(--bb-brass-hi); cursor: pointer; display: grid; place-items: center; transition: transform .15s, box-shadow .2s; }
.hud-bubble:hover, .hud-bubble:focus-visible { outline: none; transform: scale(1.06); box-shadow: 0 0 0 3px rgba(8, 26, 36, .9), var(--bb-glow); }
.hud-bubble:active { transform: scale(.96); }
.hud-bubble .hud-icon { width: 34px; height: 34px; }
.hud-bubble kbd { position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; border: 1px solid var(--bb-brass); background: #0a1d2a; color: var(--bb-cyan); font: 700 10px/16px ui-monospace, monospace; text-align: center; }
.hud-bubble .bubble-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--bb-gold); color: #1a1208; font: 800 11px/20px Manrope, sans-serif; text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.hud-bubble .bubble-badge[hidden] { display: none; }
.hud-bubble.attention { border-color: var(--bb-brass-hi); animation: bubble-pulse 1.6s ease-in-out infinite; }
@keyframes bubble-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(8, 26, 36, .9), 0 0 10px rgba(244, 216, 153, .45); } 50% { box-shadow: 0 0 0 3px rgba(8, 26, 36, .9), 0 0 24px rgba(244, 216, 153, .95); } }
body.window-open #hud-bubbles { z-index: 10; }

/* ---- Round action triggers (desktop skill bar) ---- */
#skillbar { display: flex; gap: 18px; padding: 0 6px 16px; background: transparent; border: 0; box-shadow: none; }
#skillbar .skill-slot { width: 64px; height: 64px; min-width: 64px; padding: 0; border-radius: 50%; border: 2px solid var(--bb-brass); background: radial-gradient(circle at 50% 30%, #17647f, #071722 74%); box-shadow: inset 0 0 0 3px #0a1d2a, 0 6px 16px rgba(0, 0, 0, .55); overflow: visible; display: grid; place-items: center; grid-template-rows: none; transition: transform .12s; }
#skillbar .skill-slot:active { transform: scale(.95); }
#skillbar .skill-slot.ready { border-color: var(--bb-brass-hi); box-shadow: inset 0 0 0 3px #0a1d2a, 0 0 16px rgba(116, 214, 208, .5); }
#skillbar .skill-slot .hud-icon { width: 36px; height: 36px; border-radius: 50%; }
#skillbar .skill-slot .skill-key { position: absolute; top: -6px; left: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; border: 1px solid var(--bb-brass); background: #0a1d2a; color: var(--bb-cyan); font: 800 11px/20px ui-monospace, monospace; text-align: center; }
#skillbar .skill-slot .skill-name { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); max-width: 84px; font: 700 10px/1.1 Manrope, sans-serif; letter-spacing: .04em; color: #e8e0cc; text-shadow: 0 1px 2px #000; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#skillbar .skill-slot .skill-cd { border-radius: 50%; background: rgba(2, 10, 14, .72); font: 800 18px Manrope, sans-serif; }
#skillbar .skill-slot.unlearned { opacity: .55; }

/* ---- Touch cluster: big STRIKE, the rest on an arc ---- */
@media (pointer: coarse) {
  #mobile { align-items: flex-end; bottom: 14px; }
  #stick { width: 92px; height: 92px; border-radius: 50%; border: 2px solid var(--bb-brass); background: radial-gradient(circle at 50% 40%, rgba(23, 100, 127, .55), rgba(6, 22, 31, .85) 72%); box-shadow: 0 0 0 4px rgba(8, 26, 36, .8), 0 8px 20px rgba(0, 0, 0, .5); font: 800 9px Manrope, sans-serif; letter-spacing: .12em; color: var(--bb-brass-hi); position: relative; }
  #stick::after { content: ""; position: absolute; inset: 24px; border-radius: 50%; border: 1px solid rgba(201, 167, 95, .35); pointer-events: none; }
  .touchactions { position: relative; display: block; width: 218px; height: 218px; max-width: none; }
  .touchactions button { position: absolute; width: 56px; height: 56px; padding: 0; border-radius: 50%; border: 2px solid var(--bb-brass); background: radial-gradient(circle at 50% 30%, #17536c, #071722 74%); box-shadow: 0 0 0 3px rgba(8, 26, 36, .85), 0 6px 14px rgba(0, 0, 0, .5); color: #e8e0cc; font: 800 7px/1 Manrope, sans-serif; letter-spacing: .08em; display: grid; grid-template-rows: auto auto; place-items: center; gap: 2px; padding-top: 0; }
  .touchactions button:active { transform: scale(.94); filter: brightness(1.2); }
  .touchactions .hud-icon { width: 26px; height: 26px; margin: 0; border-radius: 50%; }
  .touchactions .touch-strike { width: 84px; height: 84px; right: 0; bottom: 0; border-color: var(--bb-brass-hi); background: radial-gradient(circle at 50% 30%, #2a7f92, #0a2431 76%); box-shadow: 0 0 0 4px rgba(8, 26, 36, .9), 0 0 18px rgba(116, 214, 208, .35), 0 8px 18px rgba(0, 0, 0, .5); font-size: 9px; }
  .touchactions .touch-strike .hud-icon { width: 40px; height: 40px; }
  /* six circles: STRIKE in the corner, five on a 144 px arc (22.5° apart) so no two overlap */
  .touchactions .touch-dodge { right: 158px; bottom: 14px; }
  .touchactions .touch-jump { right: 147px; bottom: 69px; }
  .touchactions .touch-heavy { right: 116px; bottom: 116px; }
  .touchactions #touch-skill-0 { right: 69px; bottom: 147px; }
  .touchactions #touch-skill-1 { right: 14px; bottom: 158px; }
  .touchactions .touch-jump-glyph { font-size: 22px; line-height: 1; color: var(--bb-cyan); }
  .touchactions .touch-key { position: absolute; top: -5px; left: -5px; min-width: 18px; height: 18px; border-radius: 9px; border: 1px solid var(--bb-brass); background: #0a1d2a; color: var(--bb-cyan); font: 800 10px/16px ui-monospace, monospace; text-align: center; }
  .touchactions .touch-skill-label { max-width: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #skillbar { display: none; }
  #hud-bubbles { top: 108px; left: 10px; gap: 8px; }
  .hud-bubble { width: 46px; height: 46px; }
  .hud-bubble .hud-icon { width: 30px; height: 30px; }
}
@media (max-width: 700px) and (pointer: coarse) {
  #mobile { left: 8px; right: 8px; }
  .touchactions { width: 210px; height: 210px; }
  .touchactions button { width: 52px; height: 52px; }
  .touchactions .touch-strike { width: 80px; height: 80px; }
  .touchactions .touch-dodge { right: 148px; bottom: 14px; }
  .touchactions .touch-jump { right: 138px; bottom: 65px; }
  .touchactions .touch-heavy { right: 109px; bottom: 109px; }
  .touchactions #touch-skill-0 { right: 65px; bottom: 138px; }
  .touchactions #touch-skill-1 { right: 14px; bottom: 148px; }
  .touchactions .touch-jump-glyph { font-size: 18px; }
  #prototype-notice { bottom: 112px; left: 8px; }
}

/* ---- Right-side panels get the same rounding ---- */
#scoreboard { border-radius: 16px; }
#offer-panel { border-radius: 18px; border-color: var(--bb-line); }
#offer-panel .offer-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; align-items: center; }
#offer-panel .offer-header > span:first-child { grid-column: 1; grid-row: 1; }
#offer-panel .offer-time { grid-column: 1; grid-row: 2; color: #a8c9c4; font: 500 10px/1.5 Manrope, sans-serif; letter-spacing: 0; }
#offer-reroll { grid-column: 2; grid-row: 1 / 3; }
.offer-card { border-radius: 14px; }
#equip-toast { border-radius: 18px; flex-direction: row; align-items: center; gap: 10px; width: min(360px, calc(100vw - 24px)); padding: 10px 12px; }
#equip-toast .equip-toast { display: flex; align-items: center; gap: 10px; width: 100%; }
#equip-toast .equip-toast-copy { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 1px; }
#equip-toast .equip-toast-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#equip-toast .equip-toast-actions { margin: 0; flex: 0 0 auto; }
#equip-toast .equip-toast-actions button { min-width: 64px; border-radius: 999px; }
#equip-toast .slot-ring { width: 44px; height: 44px; flex: 0 0 44px; }

/* ---- Windows: rounded, round close ---- */
.rpg-panel, #sheet-panel, #talent-panel, #score-panel { border-radius: var(--bb-radius); padding: 18px 20px 20px; }
.rpg-panel .rpg-close { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--bb-brass); background: #0f2a35; color: var(--bb-brass-hi); font-weight: 700; box-shadow: 0 4px 10px rgba(0, 0, 0, .45); }
#sheet-panel { width: min(960px, calc(100vw - 32px)); }
#talent-panel { width: min(760px, calc(100vw - 32px)); }
#sheet-panel .sheet-header, #talent-panel .sheet-header { margin: 0 44px 12px 0; padding-bottom: 8px; }

/* Shared bits: rings, parchment, buttons */
.slot-ring { position: relative; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; border: 2px solid var(--bb-brass); background: radial-gradient(circle at 50% 30%, #123a49, #071722 76%); box-shadow: inset 0 0 0 3px #0a1d2a, 0 4px 10px rgba(0, 0, 0, .5); flex: 0 0 auto; }
.slot-ring .hud-icon { width: 34px; height: 34px; border-radius: 50%; }
.rarity-uncommon .slot-ring { border-color: #6fd58a; }
.rarity-rare .slot-ring { border-color: #5aa7e0; box-shadow: inset 0 0 0 3px #0a1d2a, 0 0 12px rgba(90, 167, 224, .45); }
.rarity-epic .slot-ring { border-color: #c583ef; box-shadow: inset 0 0 0 3px #0a1d2a, 0 0 12px rgba(197, 131, 239, .5); }
.rarity-legendary .slot-ring { border-color: #ff9f3d; box-shadow: inset 0 0 0 3px #0a1d2a, 0 0 16px rgba(255, 159, 61, .65); }
.empty .slot-ring { border-style: dashed; border-color: rgba(201, 167, 95, .45); }
.empty .slot-ring .hud-icon { opacity: .35; filter: grayscale(1); }

.parchment { position: relative; padding: 12px 14px 12px; border-radius: 14px; background: linear-gradient(160deg, var(--parch), var(--parch-2)); color: var(--parch-ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 250, 235, .5); font: 12px/1.45 Manrope, sans-serif; }
.parchment::before { content: ""; position: absolute; inset: 4px; border-radius: 11px; border: 1px solid rgba(90, 70, 40, .18); pointer-events: none; }
.parchment .item-tooltip { position: static; z-index: auto; max-width: none; padding: 0; margin: 0; background: transparent; border: 0; box-shadow: none; color: inherit; font: inherit; pointer-events: auto; }
.parchment .tooltip-name { font: 700 17px/1.15 'Cormorant Garamond', Georgia, serif; letter-spacing: .01em; padding-right: 30px; }
.parchment .tooltip-meta { margin-top: 2px; color: var(--parch-muted); font-size: 11px; }
.parchment .tooltip-line { margin-top: 6px; font-weight: 600; }
.parchment .tooltip-legendary { margin-top: 6px; color: #7a3d0e; font-style: italic; }
.parchment ul { list-style: none; margin: 6px 0 0; padding: 0; }
.parchment ul li { padding: 1px 0; }
.parchment .tooltip-compare { margin-top: 8px; padding-top: 6px; border-top: 1px solid rgba(90, 70, 40, .3); }
.parchment .delta-row { padding: 1px 0; }
.parchment .delta-up { color: #1d7a3a; }
.parchment .delta-down { color: #a32b2b; }
.parchment .rarity-common { color: #3b3327; }
.parchment .rarity-uncommon { color: #237a3c; }
.parchment .rarity-rare { color: #1f5f9c; }
.parchment .rarity-epic { color: #6e2fa8; }
.parchment .rarity-legendary { color: #b35a0c; text-shadow: none; }
.parchment .locked-badge { background: rgba(163, 43, 43, .15); color: #a32b2b; border-radius: 8px; }
.parchment .parchment-copy { margin: 6px 0 0; color: var(--parch-ink); }
.parchment .parchment-reason { margin: 6px 0 0; color: #a32b2b; font-size: 11px; }
.parchment.hint { background: rgba(239, 226, 195, .08); color: #a8c9c4; box-shadow: none; border: 1px dashed rgba(201, 167, 95, .35); }
.parchment.hint::before { display: none; }
.parchment.hint .parchment-copy { color: #a8c9c4; margin: 0; }
.parchment-close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(90, 70, 40, .35); background: rgba(255, 250, 235, .6); color: var(--parch-ink); font-size: 12px; cursor: pointer; }
.parchment.hint .parchment-close { display: none; }
.parchment-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-big { flex: 1; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: linear-gradient(180deg, #2d9a93, #1c6d69); color: #fff; font: 800 13px Manrope, sans-serif; letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 4px 12px rgba(28, 109, 105, .45); cursor: pointer; }
.btn-big:disabled { background: linear-gradient(180deg, #8a8a80, #5f5f58); box-shadow: none; cursor: default; opacity: .8; }
.btn-ghost { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 2px solid rgba(90, 70, 40, .45); background: transparent; color: inherit; font: 700 12px Manrope, sans-serif; cursor: pointer; }
.btn-ghost:disabled { opacity: .5; cursor: default; }
.btn-ghost.discard { border-color: rgba(163, 43, 43, .5); color: #a32b2b; }
.btn-ghost.small { min-height: 32px; padding: 0 12px; font-size: 11px; }
.rpg-panel .btn-ghost { border-color: var(--bb-line); color: var(--bb-brass-hi); }
.parchment .btn-ghost { border-color: rgba(90, 70, 40, .45); color: var(--parch-ink); }
.parchment .btn-ghost:hover, .parchment .btn-ghost:focus-visible { background: rgba(255, 250, 235, .65); color: var(--parch-ink); }
.parchment .btn-ghost.discard { color: #a32b2b; border-color: rgba(163, 43, 43, .5); }

/* ---- Hero sheet: paperdoll layout ---- */
.doll-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 236px; grid-template-areas: "left center right" "belt belt belt"; gap: 14px 18px; align-items: start; }
.doll-left { grid-area: left; display: flex; flex-direction: column; gap: 12px; }
.doll-center { grid-area: center; display: flex; flex-direction: column; align-items: center; }
.doll-right { grid-area: right; }
.doll-belt { grid-area: belt; }
.detail-host { min-height: 60px; }
.hero-identity { margin: 0 0 4px; }
.hero-identity strong { font-size: 22px; }

.paperdoll-v2 { position: relative; width: 100%; max-width: 380px; height: 420px; }
.doll-ring { position: absolute; left: 50%; top: 52%; width: 300px; height: 300px; transform: translate(-50%, -50%); border-radius: 50%; border: 1px dashed rgba(116, 214, 208, .35); box-shadow: inset 0 0 60px rgba(116, 214, 208, .12), 0 0 40px rgba(116, 214, 208, .08); background: radial-gradient(circle, rgba(116, 214, 208, .12), transparent 62%); pointer-events: none; }
.doll-ring::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 1px solid rgba(201, 167, 95, .22); }
.doll-body { position: absolute; left: 50%; bottom: 8px; width: 240px; height: 380px; transform: translateX(-50%); background: url('hud-art/body.png') center bottom / contain no-repeat; filter: brightness(.16) sepia(1) hue-rotate(150deg) saturate(2.2) drop-shadow(0 0 14px rgba(116, 214, 208, .45)); opacity: .95; pointer-events: none; }
.paperdoll-v2 .gear-tiles { display: contents; }
.paperdoll-v2 .doll-slot { position: absolute; width: 104px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 8px; border-radius: 16px; border: 1px solid transparent; background: transparent; color: #e6ebe6; text-align: center; cursor: pointer; transition: transform .12s, background .15s, border-color .15s; }
.paperdoll-v2 .doll-slot:hover, .paperdoll-v2 .doll-slot:focus-visible { outline: none; background: rgba(5, 17, 24, .55); border-color: rgba(201, 167, 95, .35); }
.paperdoll-v2 .doll-slot.selected { background: rgba(8, 36, 44, .8); border-color: var(--bb-cyan); box-shadow: var(--bb-glow); }
.paperdoll-v2 .doll-slot:active { transform: scale(.97); }
.paperdoll-v2 .doll-slot small { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: #a8c9c4; }
.paperdoll-v2 .doll-slot strong { display: block; max-width: 100%; font-size: 11px; line-height: 1.2; color: #e8d09a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paperdoll-v2 .doll-slot.empty strong { color: #88a29e; }
.paperdoll-v2 .doll-slot strong.blocked { color: #88a29e; font-style: italic; white-space: normal; }
.paperdoll-v2 .doll-slot.rarity-uncommon strong { color: #6fd58a; }
.paperdoll-v2 .doll-slot.rarity-rare strong { color: #7fbdf0; }
.paperdoll-v2 .doll-slot.rarity-epic strong { color: #d3a0f7; }
.paperdoll-v2 .doll-slot.rarity-legendary strong { color: #ffb066; }
.paperdoll-v2 .slot-mainHand { left: 0; top: 118px; }
.paperdoll-v2 .slot-offHand { right: 0; top: 118px; }
.paperdoll-v2 .slot-armor { left: 50%; top: 178px; transform: translateX(-50%); }
.paperdoll-v2 .slot-armor:active { transform: translateX(-50%) scale(.97); }
.paperdoll-v2 .slot-ring { width: 64px; height: 64px; }
.paperdoll-v2 .slot-ring .hud-icon { width: 38px; height: 38px; }

/* Stat bubbles */
.stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat-tile { flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; border: 1px solid rgba(201, 167, 95, .35); background: rgba(5, 17, 24, .7); }
.stat-tile .hud-icon { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 26px; }
.stat-tile small { flex: 1; text-align: left; font-size: 9px; }
.stat-tile b { font-size: 18px; }
.stat-details-toggle { border-radius: 999px; padding: 0 10px; min-height: 30px; border: 1px solid rgba(116, 214, 208, .35); }
.stat-details { border-radius: 12px; }

/* Satchel */
.bag-panel { padding: 12px 10px 10px; border-radius: 18px; border: 1px solid rgba(201, 167, 95, .35); background: rgba(5, 17, 24, .6); }
.bag-bubble { display: flex; align-items: center; gap: 8px; margin: -30px 0 8px; }
.bag-bubble .hud-icon { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--bb-brass); box-shadow: 0 0 0 3px rgba(8, 26, 36, .9), 0 4px 10px rgba(0, 0, 0, .5); background-color: #0a1d2a; }
.bag-bubble .bag-count { font: 800 11px Manrope, sans-serif; letter-spacing: .1em; color: var(--bb-brass-hi); }
.bag-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bag-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 96px; padding: 8px 4px 6px; border-radius: 16px; border: 1px solid rgba(201, 167, 95, .3); background: rgba(5, 17, 24, .8); color: #e6ebe6; cursor: pointer; transition: transform .12s, border-color .15s; }
.bag-tile:active { transform: scale(.97); }
.bag-tile.selected { border-color: var(--bb-cyan); box-shadow: var(--bb-glow); background: rgba(8, 36, 44, .85); }
.bag-tile.empty { cursor: default; color: #88a29e; justify-content: center; }
.bag-tile strong { max-width: 100%; font-size: 11px; line-height: 1.2; color: #e8d09a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bag-tile.empty strong { color: #6f8884; font-weight: 600; }
.bag-tile .delta { position: absolute; top: 4px; right: 6px; padding: 1px 6px; border-radius: 9px; background: rgba(2, 10, 14, .85); font-size: 10px; font-weight: 800; }
.bag-tile .lock-badge { position: absolute; top: 4px; left: 6px; padding: 1px 6px; border-radius: 9px; background: rgba(166, 52, 54, .8); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.bag-tile.locked .slot-ring { opacity: .7; }
.bag-tile.rarity-uncommon strong { color: #6fd58a; }
.bag-tile.rarity-rare strong { color: #7fbdf0; }
.bag-tile.rarity-epic strong { color: #d3a0f7; }
.bag-tile.rarity-legendary strong { color: #ffb066; }

/* Skill belt */
.skill-row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 0; padding: 10px 12px; border-radius: 18px; border: 1px solid rgba(201, 167, 95, .3); background: rgba(5, 17, 24, .55); }
.skill-row .belt-label { font: 800 10px Manrope, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #a8c9c4; margin-right: 4px; }
.skill-reset { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; flex: 1 1 145px; max-width: 230px; margin-left: auto; }
.skill-reset small { color: #a8c9c4; font: 500 10px/1.5 Manrope, sans-serif; }
.skill-row .skill-tile { position: relative; flex-direction: column; gap: 4px; min-height: 0; padding: 0; border: 0; background: transparent; width: 84px; }
.skill-row .skill-tile .slot-ring { width: 56px; height: 56px; }
.skill-row .skill-tile.selected { background: transparent; }
.skill-row .skill-tile.selected .slot-ring { border-color: var(--bb-cyan); box-shadow: inset 0 0 0 3px #0a1d2a, 0 0 14px rgba(116, 214, 208, .6); }
.skill-row .skill-tile kbd { position: absolute; top: -4px; left: 12px; z-index: 1; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; border: 1px solid var(--bb-brass); background: #0a1d2a; color: var(--bb-cyan); font: 800 10px/16px ui-monospace, monospace; text-align: center; }
.skill-row .skill-tile strong { max-width: 84px; font-size: 10px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-choices { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; align-items: center; padding-left: 8px; border-left: 1px solid rgba(201, 167, 95, .3); }
.skill-choices .skill-chip { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 4px; border-radius: 999px; border: 1px solid rgba(116, 214, 208, .5); background: #14343b; color: #d7ece8; font-size: 11px; cursor: pointer; }
.skill-choices .skill-chip .hud-icon { width: 30px; height: 30px; border-radius: 50%; }
.skill-choices .skill-chip i { font-style: normal; color: var(--bb-cyan); font-size: 10px; }
.skill-choices .skill-chip:disabled { opacity: .5; cursor: default; }
.skill-choices-empty { font-size: 11px; color: #a8c9c4; }

/* ---- Perk tree ---- */
.perk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; grid-template-areas: "head head" "tabs detail" "tree detail"; gap: 12px 18px; align-items: start; }
.perk-head { grid-area: head; display: flex; align-items: center; gap: 12px; }
.perk-points { display: flex; align-items: baseline; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(201, 167, 95, .35); background: rgba(5, 17, 24, .7); color: #a8c9c4; font-size: 11px; }
.perk-points b { font: 800 18px/1 Manrope, sans-serif; color: var(--bb-brass-hi); }
.perk-points.has-points { border-color: var(--bb-gold); box-shadow: 0 0 14px rgba(231, 184, 75, .35); }
.perk-points.has-points b { color: var(--bb-gold); }
.perk-next { color: #a8c9c4; font-size: 11px; flex: 1; }
.perk-tabs { grid-area: tabs; display: flex; gap: 10px; }
.perk-tab { flex: 1; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 999px; border: 1px solid rgba(201, 167, 95, .3); background: rgba(5, 17, 24, .6); color: #e6ebe6; text-align: left; cursor: pointer; }
.perk-tab .slot-ring { width: 40px; height: 40px; }
.perk-tab .slot-ring .hud-icon { width: 26px; height: 26px; }
.perk-tab strong { display: block; font-size: 12px; color: #e8d09a; }
.perk-tab small { display: block; font-size: 9px; color: #a8c9c4; }
.perk-tab.active { border-color: var(--bb-cyan); background: rgba(8, 36, 44, .85); box-shadow: var(--bb-glow); }
.perk-tree { grid-area: tree; display: flex; flex-direction: column; gap: 6px; padding: 6px 0 0; }
.perk-tier { position: relative; padding: 10px 0 6px; }
.perk-tier + .perk-tier::before { content: ""; position: absolute; left: 50%; top: -6px; width: 2px; height: 12px; background: rgba(116, 214, 208, .4); }
.tier-gate { display: block; width: max-content; margin: 0 auto 8px; padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(201, 167, 95, .3); background: rgba(5, 17, 24, .6); font: 700 9px Manrope, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #a8c9c4; }
.tier-gate.open { color: var(--bb-cyan); border-color: rgba(116, 214, 208, .4); }
.perk-nodes { display: flex; justify-content: center; gap: 18px; }
.perk-node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 96px; padding: 6px 2px; border-radius: 16px; border: 1px solid transparent; background: transparent; color: #e6ebe6; cursor: pointer; transition: transform .12s, background .15s; }
.perk-node:hover, .perk-node:focus-visible { outline: none; background: rgba(5, 17, 24, .55); }
.perk-node:active { transform: scale(.97); }
.perk-node .slot-ring { width: 58px; height: 58px; }
.perk-node .node-rank { position: absolute; right: -6px; bottom: -4px; padding: 1px 5px; border-radius: 8px; border: 1px solid var(--bb-brass); background: #0a1d2a; color: #e8e0cc; font: 800 9px/12px ui-monospace, monospace; }
.perk-node strong { max-width: 96px; font-size: 10px; line-height: 1.15; text-align: center; color: #e8d09a; }
.perk-node.locked .slot-ring { opacity: .45; filter: grayscale(.8); }
.perk-node.locked strong { color: #88a29e; }
.perk-node.available .slot-ring { border-color: var(--bb-cyan); box-shadow: inset 0 0 0 3px #0a1d2a, 0 0 14px rgba(116, 214, 208, .55); animation: bubble-pulse 1.8s ease-in-out infinite; }
.perk-node.owned .slot-ring, .perk-node.maxed .slot-ring { border-color: var(--bb-gold); background: radial-gradient(circle at 50% 30%, #6a4d15, #1a1208 76%); }
.perk-node.maxed .slot-ring { box-shadow: inset 0 0 0 3px #0a1d2a, 0 0 14px rgba(231, 184, 75, .6); }
.perk-node.selected { background: rgba(8, 36, 44, .85); border-color: var(--bb-cyan); }
.rank-pips { display: flex; gap: 3px; }
.rank-pips i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--bb-brass); background: transparent; }
.rank-pips i.on { background: var(--bb-gold); border-color: var(--bb-gold); }
.perk-layout .detail-host { grid-area: detail; }
.perk-card .parchment-actions .btn-big { flex: 1; }
.school-storm .tooltip-meta, .school-frost .tooltip-meta, .school-steel .tooltip-meta { color: var(--parch-muted); }

/* ---- Phone: bottom sheets, stacked layout, detail as an overlay card ---- */
@media (max-width: 720px) {
  #sheet-panel, #talent-panel { top: auto; bottom: 0; left: 0; right: 0; transform: none; width: 100vw; max-height: 88vh; border-radius: 22px 22px 0 0; padding: 14px 12px 16px; }
  #sheet-panel .sheet-header, #talent-panel .sheet-header { margin: 0 44px 8px 0; padding-bottom: 6px; }
  #sheet-panel .sheet-header h2, #talent-panel .sheet-header h2 { font-size: 18px; }
  .doll-layout { position: relative; grid-template-columns: 1fr; grid-template-areas: "center" "left" "right" "belt"; gap: 8px; }
  .doll-left { gap: 8px; }
  .doll-layout .detail-host { position: absolute; left: 0; right: 0; top: 0; z-index: 3; min-height: 0; display: none; }
  .doll-layout.has-detail .detail-host { display: block; }
  .doll-layout .parchment.hint { display: none; }
  .doll-layout.has-detail .paperdoll-v2 { opacity: .35; pointer-events: none; }
  .hero-identity { margin: 0 0 2px; align-self: flex-start; }
  .hero-identity strong { font-size: 18px; }
  .paperdoll-v2 { height: 264px; max-width: none; }
  .doll-ring { width: 220px; height: 220px; }
  .doll-body { width: 160px; height: 250px; }
  .paperdoll-v2 .doll-slot { width: 92px; padding: 4px 2px 6px; }
  .paperdoll-v2 .slot-ring { width: 56px; height: 56px; }
  .paperdoll-v2 .slot-ring .hud-icon { width: 34px; height: 34px; }
  .paperdoll-v2 .slot-mainHand { left: 0; top: 58px; }
  .paperdoll-v2 .slot-offHand { right: 0; top: 58px; }
  .paperdoll-v2 .slot-armor { top: 96px; }
  .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .stat-tile { flex-direction: column; gap: 1px; padding: 6px 2px; border-radius: 12px; }
  .stat-tile .hud-icon { width: 20px; height: 20px; flex-basis: 20px; }
  .stat-tile small { text-align: center; font-size: 8px; }
  .stat-tile b { font-size: 15px; }
  .stat-details-toggle { margin: 0; }
  .stat-details { grid-template-columns: 1fr 1fr 1fr 1fr; font-size: 11px; }
  .bag-panel { padding: 8px 8px 8px; }
  .bag-bubble { margin: 0 0 6px; }
  .bag-bubble .hud-icon { width: 30px; height: 30px; }
  .bag-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .bag-tile { min-height: 84px; padding: 6px 2px 4px; border-radius: 14px; }
  .bag-tile .slot-ring { width: 48px; height: 48px; }
  .bag-tile .slot-ring .hud-icon { width: 28px; height: 28px; }
  .bag-tile strong { font-size: 10px; }
  .skill-row { padding: 8px 10px; gap: 8px; }
  .skill-row .skill-tile { width: 64px; }
  .skill-row .skill-tile .slot-ring { width: 48px; height: 48px; }
  .skill-row .skill-tile strong { max-width: 64px; }
  .skill-choices { width: 100%; padding-left: 0; border-left: 0; padding-top: 6px; border-top: 1px solid rgba(201, 167, 95, .3); }
  .perk-layout { position: relative; grid-template-columns: 1fr; grid-template-areas: "head" "tabs" "tree" "detail"; gap: 8px; }
  .perk-layout .detail-host { position: static; display: none; }
  .perk-layout.has-detail .detail-host { display: block; }
  /* Keep nodes available for repeat one-click purchases while details are open. */
  .perk-tab { padding: 4px 6px 4px 4px; gap: 6px; }
  .perk-tab .slot-ring { width: 34px; height: 34px; }
  .perk-tab .slot-ring .hud-icon { width: 22px; height: 22px; }
  .perk-tab small { display: none; }
  .perk-nodes { gap: 6px; }
  .perk-node { width: 31%; padding: 4px 0; }
  .perk-node .slot-ring { width: 52px; height: 52px; }
  .perk-node strong { max-width: 100%; font-size: 9px; }
  .perk-tier { padding: 6px 0 2px; }
}
@media (prefers-reduced-motion: reduce) { .hud-bubble.attention, .perk-node.available .slot-ring { animation: none; } }

/* ---- Loot bubble (first come, first served; F or tap) ---- */
#loot-prompt { display: none; flex-direction: column; align-items: center; gap: 6px; left: 50%; bottom: 190px; transform: translateX(-50%); z-index: 22; pointer-events: none; }
#loot-prompt .loot-bubble { pointer-events: auto; position: relative; width: 68px; height: 68px; border-radius: 50%; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; background: radial-gradient(circle at 50% 30%, #2a4a52, #0d1c24 70%); border: 2px solid var(--bb-gold, #e6c37a); box-shadow: 0 0 0 4px #e6c37a33, 0 8px 22px #000a; color: #fff3d6; font: 800 11px/1 var(--bb-font, inherit); letter-spacing: .08em; text-transform: uppercase; animation: loot-pulse 1.4s ease-in-out infinite; cursor: pointer; touch-action: manipulation; }
#loot-prompt .loot-bubble .hud-icon { width: 26px; height: 26px; }
#loot-prompt .loot-bubble .loot-word { margin-top: 2px; }
#loot-prompt .loot-bubble kbd { position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 800 11px/1 var(--bb-font, inherit); background: var(--bb-gold, #e6c37a); color: #1b1408; border: 2px solid #0d1c24; }
#loot-prompt.full .loot-bubble { border-color: #f08a6a; box-shadow: 0 0 0 4px #f08a6a33, 0 8px 22px #000a; animation: none; }
#loot-prompt .loot-label { pointer-events: none; padding: 4px 12px; border-radius: 999px; background: #0b161de6; border: 1px solid var(--bb-line, #1e3a44); font-size: 11px; font-weight: 700; white-space: nowrap; max-width: min(320px, 80vw); overflow: hidden; text-overflow: ellipsis; }
@keyframes loot-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px #e6c37a33, 0 8px 22px #000a; } 50% { transform: scale(1.06); box-shadow: 0 0 0 8px #e6c37a22, 0 8px 22px #000a; } }
@media (pointer: coarse) { #loot-prompt { bottom: 150px; } #loot-prompt .loot-bubble kbd { display: none; } }
@media (max-width: 700px) and (pointer: coarse) { #loot-prompt { bottom: 236px; } }

/* ---- Level banner ---- */
#level-banner { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -50%) scale(.8); z-index: 24; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 26px; border-radius: 22px; background: radial-gradient(circle at 50% 0%, #2a4a52ee, #0b161df2 70%); border: 2px solid var(--bb-gold, #e6c37a); box-shadow: 0 0 0 5px #e6c37a22, 0 12px 30px #000c; opacity: 0; text-align: center; }
#level-banner.show { animation: level-pop 3.4s ease-out forwards; }
#level-banner strong { font-size: 24px; letter-spacing: .14em; color: var(--bb-gold, #e6c37a); text-shadow: 0 2px 0 #000; }
#level-banner span { font-size: 12px; font-weight: 700; color: #dff3ef; }
#level-banner em { font-style: normal; font-size: 11px; font-weight: 800; color: #9ff0e8; letter-spacing: .06em; text-transform: uppercase; }
#level-banner kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bb-gold, #e6c37a); color: #1b1408; font-size: 10px; }
@keyframes level-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.8); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } 20% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(.96); } }

/* ---- Touch skill cooldown ring (2026-09-14): the outline refills while the skill cools, then flashes once ---- */
@property --cd { syntax: '<number>'; inherits: true; initial-value: 1; } /* inherits: the ::after ring reads the button's value */
.touchactions .touch-skill { --cd: 1; overflow: visible; }
.touchactions .touch-skill::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none; opacity: 0;
  --cd-ring: #ffb347; --cd-ring: color-mix(in oklch, #9ff0e8 calc(var(--cd) * 100%), #f08a6a);
  background: conic-gradient(from 0deg, var(--cd-ring) calc(var(--cd) * 360deg), rgba(255, 255, 255, .10) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  transition: opacity .25s ease; } /* no transition on --cd: snapshots arrive at 15 Hz, and a transition would animate the ring emptying at cast start */
.touchactions .touch-skill.cooling::after { opacity: 1; }
.touchactions .touch-skill.cooling { border-color: #5a4a3a; box-shadow: 0 0 0 3px rgba(8, 26, 36, .85), 0 6px 14px rgba(0, 0, 0, .5); }
.touchactions .touch-skill.cooling .hud-icon { filter: grayscale(.7) brightness(.55); }
.touchactions .touch-skill.cooling .touch-skill-label { opacity: .55; }
.touchactions .touch-skill .touch-cd { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -58%); font: 800 15px/1 ui-monospace, monospace; font-style: normal; color: #fff6e0; text-shadow: 0 0 6px #000, 0 1px 2px #000; pointer-events: none; }
.touchactions .touch-skill.cooling .touch-cd { display: block; }
.touchactions .touch-skill.cd-ready { animation: cd-ready-flash .65s ease-out; }
.touchactions .touch-skill.cd-ready .hud-icon { animation: cd-ready-icon .65s ease-out; }
@keyframes cd-ready-flash { 0% { border-color: #ffffff; box-shadow: 0 0 0 5px #9ff0e8, 0 0 28px #9ff0e8, 0 6px 14px rgba(0, 0, 0, .5); } 100% { border-color: var(--bb-brass); box-shadow: 0 0 0 3px rgba(8, 26, 36, .85), 0 6px 14px rgba(0, 0, 0, .5); } }
@keyframes cd-ready-icon { 0% { filter: brightness(2.2); transform: scale(1.18); } 100% { filter: none; transform: none; } }
@media (prefers-reduced-motion: reduce) { .touchactions .touch-skill.cd-ready, .touchactions .touch-skill.cd-ready .hud-icon { animation-duration: .01s; } }
