/* Desktop/Web mode (769px+): split-background combat shell */

@media (min-width: 769px) {
  html[data-ui="web"],
  body[data-ui="web"] {
    background-image: url("data/ui/webui_background.webp");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
  }

  body[data-ui="web"] #uiMobileRoot {
    display: none;
  }

  body[data-ui="web"] #uiWebRoot {
    position: relative;
  }

  body[data-ui="web"] #uiWebRoot::before,
  body[data-ui="web"] #uiWebRoot::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 260ms ease;
  }

  body[data-ui="web"] #uiWebRoot::before {
    z-index: 12;
    background: #06090f url("./data/ui/shrine_backdrop.webp") center/cover no-repeat;
  }

  body[data-ui="web"] #uiWebRoot::after {
    z-index: 18;
    background:
      radial-gradient(120% 120% at 50% 50%, rgba(0,0,0,0.14), rgba(0,0,0,0.48)),
      linear-gradient(180deg, rgba(0,0,0,0.24), rgba(0,0,0,0.52));
  }

  body[data-ui="web"].mode-shrine #uiWebRoot::before,
  body[data-ui="web"].mode-shrine #uiWebRoot::after {
    opacity: 1;
  }

  body[data-ui="web"] .startScreen {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: transparent;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 700ms ease, visibility 0s linear 700ms;
  }

  body[data-ui="web"].is-started .startScreen {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  body[data-ui="web"] .startVideoWrap {
    display: none !important;
  }

  body[data-ui="web"] .startCard {
    position: relative;
    z-index: 4;
    width: min(820px, 92vw);
    border-radius: 0;
    border: 0;
    padding: 0;
    gap: 18px;
    background: transparent;
    box-shadow: none;
  }

  body[data-ui="web"] .webStartLogo {
    position: relative;
    z-index: 5;
    display: block;
    width: min(760px, 92vw);
    max-height: 260px;
    object-fit: contain;
    filter: none;
    opacity: 1;
  }

  body[data-ui="web"] .startScreenTitle,
  body[data-ui="web"] .startScreenSubtitle {
    display: none;
  }

  body[data-ui="web"] .startScreen::after {
    z-index: 1;
    background: linear-gradient(180deg, rgba(0,0,0,.34) 0%, rgba(0,0,0,.66) 58%, rgba(0,0,0,.84) 100%);
  }

  body[data-ui="web"] .gameScreen {
    display: block !important;
    opacity: 1;
    transition: opacity 600ms ease;
  }

  body[data-ui="web"]:not(.is-started) .gameScreen {
    opacity: 0.3;
    pointer-events: none;
  }

  body[data-ui="web"]:not(.is-started) .topbar,
  body[data-ui="web"]:not(.is-started) .grid,
  body[data-ui="web"]:not(.is-started) .handDrawerRoot,
  body[data-ui="web"]:not(.is-started) .compactCombatHUD,
  body[data-ui="web"]:not(.is-started) .webTalentOriginDock {
    display: none !important;
  }

  body[data-ui="web"]:not(.is-started) .webTalentProcDock {
    display: none !important;
  }

  body[data-ui="web"] #webAtmosphereLayer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 14;
    overflow: hidden;
  }

  body[data-ui="web"] #webAtmosphereLayer .webAtmosphereEmbers,
  body[data-ui="web"] #webAtmosphereLayer .webAtmosphereAsh {
    position: absolute;
    inset: 0;
    overflow: hidden;
  }

  body[data-ui="web"] .webAtmosphereParticle {
    position: absolute;
    left: var(--left, 50%);
    bottom: -10vh;
    width: var(--size, 4px);
    height: var(--size, 4px);
    border-radius: 999px;
    opacity: 0;
    animation: webParticleRise var(--dur, 12s) linear infinite;
    animation-delay: var(--delay, 0s);
    will-change: transform, opacity;
  }

  body[data-ui="web"] .webEdgeFlare {
    position: absolute;
    top: var(--flare-y, 50%);
    width: var(--flare-w, 180px);
    height: var(--flare-h, 240px);
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: screen;
    filter: blur(0.8px);
    animation: webEdgeFlarePulse var(--flare-dur, 1100ms) ease-out forwards;
  }

  body[data-ui="web"] .webEdgeFlare.side-left {
    left: -28px;
    background: radial-gradient(ellipse at 0% 50%, rgba(255,178,92,var(--flare-alpha, .2)) 0%, rgba(255,126,58,0) 72%);
    transform-origin: left center;
  }

  body[data-ui="web"] .webEdgeFlare.side-right {
    right: -28px;
    background: radial-gradient(ellipse at 100% 50%, rgba(255,178,92,var(--flare-alpha, .2)) 0%, rgba(255,126,58,0) 72%);
    transform-origin: right center;
  }

  body[data-ui="web"] .webAtmosphereParticle.ember {
    background: radial-gradient(circle, rgba(255,238,206,.95) 0%, rgba(255,166,78,.95) 38%, rgba(255,120,52,0) 72%);
    filter: drop-shadow(0 0 8px rgba(255,138,62,.4));
    opacity: var(--alpha, .7);
    mix-blend-mode: screen;
  }

  body[data-ui="web"] .webAtmosphereParticle.ash {
    background: radial-gradient(circle, rgba(228,232,238,.52) 0%, rgba(156,164,178,.34) 45%, rgba(120,128,140,0) 76%);
    filter: blur(0.7px);
    opacity: var(--alpha, .3);
  }

  body[data-ui="web"] #webAtmosphereLayer.is-mid .webAtmosphereParticle.ember {
    opacity: calc(var(--alpha, .7) * 0.62);
  }

  body[data-ui="web"] #webAtmosphereLayer.is-mid .webAtmosphereParticle.ash {
    opacity: calc(var(--alpha, .3) * 0.68);
  }

  body[data-ui="web"] #webAtmosphereLayer.is-mid .webAtmosphereParticle {
    animation-duration: calc(var(--dur, 12s) * 1.2);
  }

  body[data-ui="web"] #webAtmosphereLayer.is-load-full .webAtmosphereParticle.ember {
    opacity: min(1, calc(var(--alpha, .7) * 1.3));
    filter: drop-shadow(0 0 12px rgba(255,138,62,.58));
  }

  body[data-ui="web"] #webAtmosphereLayer.is-load-full .webAtmosphereParticle.ash {
    opacity: min(0.68, calc(var(--alpha, .3) * 1.35));
    filter: blur(0.5px);
  }

  body[data-ui="web"] #webAtmosphereLayer.is-load-full .webAtmosphereParticle {
    animation-duration: calc(var(--dur, 12s) * 0.82);
  }

  @keyframes webParticleRise {
    0% {
      transform: translate3d(0, 0, 0) scale(0.6);
      opacity: 0;
    }
    8% {
      opacity: var(--alpha, .6);
    }
    24% {
      transform: translate3d(var(--drift1, 0px), calc(var(--rise, 70vh) * -0.24), 0) scale(0.92);
    }
    52% {
      transform: translate3d(var(--drift2, 0px), calc(var(--rise, 70vh) * -0.52), 0) scale(1.05);
    }
    78% {
      transform: translate3d(var(--drift3, 0px), calc(var(--rise, 70vh) * -0.78), 0) scale(0.9);
    }
    100% {
      transform: translate3d(calc(var(--drift1, 0px) * -0.35), calc(var(--rise, 70vh) * -1), 0) scale(0.7);
      opacity: 0;
    }
  }

  @keyframes webEdgeFlarePulse {
    0% {
      opacity: 0;
      transform: scale(0.92);
    }
    18% {
      opacity: 1;
      transform: scale(1.03);
    }
    58% {
      opacity: 0.65;
      transform: scale(1.08);
    }
    100% {
      opacity: 0;
      transform: scale(1.14);
    }
  }

  body[data-ui="web"] .webTalentOriginDock {
    position: fixed;
    left: 16px;
    top: 84px;
    z-index: 140;
    width: 108px;
    height: 108px;
    pointer-events: auto;
  }

  body[data-ui="web"] .webTalentProcDock {
    position: fixed;
    left: 16px;
    top: 224px;
    z-index: 139;
    width: 108px;
    height: 108px;
    pointer-events: auto;
  }

  body[data-ui="web"] .webDockTooltipPanel {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    min-width: 248px;
    max-width: 320px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,205,130,.32);
    background:
      radial-gradient(160% 180% at 14% 0%, rgba(255,196,110,.16), transparent 58%),
      linear-gradient(180deg, rgba(20,24,35,.97), rgba(10,12,19,.98));
    box-shadow: 0 14px 30px rgba(0,0,0,.56), 0 0 0 1px rgba(0,0,0,.44) inset;
    color: rgba(236,228,214,.96);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 150ms ease, transform 150ms ease;
    z-index: 145;
  }

  body[data-ui="web"] .webTalentOriginDock:hover .webDockTooltipPanel,
  body[data-ui="web"] .webTalentOriginDock:focus-within .webDockTooltipPanel,
  body[data-ui="web"] .webTalentProcDock:hover .webDockTooltipPanel,
  body[data-ui="web"] .webTalentProcDock:focus-within .webDockTooltipPanel {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
  }

  body[data-ui="web"] .webDockTooltipTitle {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,219,156,.96);
    margin-bottom: 7px;
  }

  body[data-ui="web"] .webDockTooltipSub {
    margin-top: 7px;
    font-size: 11px;
    color: rgba(206,220,238,.9);
    line-height: 1.3;
  }

  body[data-ui="web"] .webDockTooltipList {
    margin: 0;
    padding: 0 0 0 16px;
    display: grid;
    gap: 3px;
    font-size: 12px;
    line-height: 1.3;
  }

  body[data-ui="web"] .webDockTooltipRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    line-height: 1.3;
    padding: 1px 0;
  }

  body[data-ui="web"] .webDockTooltipKey {
    color: rgba(212,224,242,.92);
  }

  body[data-ui="web"] .webDockTooltipVal {
    font-weight: 900;
    color: rgba(255,244,220,.98);
  }

  body[data-ui="web"]:not(.is-started) .webTalentOriginDock {
    display: none !important;
  }

  body[data-ui="web"] .webTalentOriginOrb {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background:
      radial-gradient(130% 130% at 20% 0%, rgba(255,255,255,.16), rgba(255,255,255,.01) 55%, rgba(0,0,0,.38) 100%),
      linear-gradient(180deg, rgba(20,24,36,.94), rgba(10,12,19,.96));
    box-shadow: 0 12px 24px rgba(0,0,0,.48);
    pointer-events: auto;
  }

  body[data-ui="web"] .webTalentProcOrb {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background:
      radial-gradient(130% 130% at 20% 0%, rgba(255,255,255,.14), rgba(255,255,255,.01) 55%, rgba(0,0,0,.4) 100%),
      linear-gradient(180deg, rgba(18,22,33,.94), rgba(10,12,19,.96));
    box-shadow: 0 12px 24px rgba(0,0,0,.48);
    color: rgba(188,200,214,.84);
    pointer-events: auto;
  }

  body[data-ui="web"] .webTalentProcOrb.is-aegis {
    color: rgba(186,232,255,.98);
    box-shadow: 0 12px 24px rgba(0,0,0,.48), 0 0 0 1px rgba(84,165,224,.36) inset;
  }

  body[data-ui="web"] .webTalentProcOrb.is-ruin {
    color: rgba(255,220,198,.98);
    box-shadow: 0 12px 24px rgba(0,0,0,.48), 0 0 0 1px rgba(196,96,68,.36) inset;
  }

  body[data-ui="web"] .webTalentProcOrb.is-inactive {
    opacity: .62;
    filter: saturate(0.82) brightness(0.88);
  }

  body[data-ui="web"] .webTalentProcOrb.is-active {
    opacity: 1;
    filter: saturate(1.1) brightness(1.06);
    animation: procIconPop 920ms ease-out 1;
  }

  body[data-ui="web"] .webTalentProcOrb.is-aegis.is-active {
    box-shadow: 0 12px 24px rgba(0,0,0,.48), 0 0 0 1px rgba(96,176,232,.5) inset, 0 0 22px rgba(110,188,244,.3);
  }

  body[data-ui="web"] .webTalentProcOrb.is-ruin.is-active {
    box-shadow: 0 12px 24px rgba(0,0,0,.48), 0 0 0 1px rgba(208,108,78,.5) inset, 0 0 22px rgba(236,120,90,.3);
  }

  body[data-ui="web"] .webTalentProcOrb .procGlyphSvg {
    width: 64px;
    height: 64px;
  }

  body[data-ui="web"] #menuInfoOverlay.overlay.is-open {
    padding: 20px;
  }

  body[data-ui="web"] #menuInfoOverlay .menuInfoCard {
    width: min(860px, calc(100vw - 40px));
    max-height: min(82vh, 820px);
    padding: 18px;
    border-color: rgba(132,186,240,.34);
    background:
      radial-gradient(170% 150% at 10% 0%, rgba(108,172,236,.20), rgba(255,255,255,.01) 52%, rgba(0,0,0,.28) 100%),
      linear-gradient(180deg, rgba(17,20,30,.99), rgba(8,10,16,.99));
    box-shadow: 0 26px 52px rgba(0,0,0,.62), 0 0 0 1px rgba(0,0,0,.42) inset, 0 0 28px rgba(102,168,232,.16);
  }

  body[data-ui="web"] .menuInfoBody {
    font-size: 14px;
    line-height: 1.55;
  }

  body[data-ui="web"] .menuInfoBody > h3 {
    margin-top: 6px;
    color: rgba(208,232,255,.98);
    text-shadow: 0 0 12px rgba(110,180,240,.18);
  }

  body[data-ui="web"] .menuInfoBody > p,
  body[data-ui="web"] .menuInfoBody > ul {
    background:
      linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
    border: 1px solid rgba(162,194,228,.12);
    border-radius: 10px;
    padding: 10px 12px;
  }

  body[data-ui="web"] .menuInfoBody > ul {
    padding-left: 28px;
  }

  body[data-ui="web"] .webTalentOriginOrb::before,
  body[data-ui="web"] .webTalentOriginOrb::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 188%;
    height: 188%;
    transform: translate(-50%, -50%);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
  }

  body[data-ui="web"] .webTalentOriginOrb::after {
    width: 202%;
    height: 202%;
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 0;
    animation: none;
    z-index: 1;
  }

  body[data-ui="web"] .webTalentOriginOrb.is-aegis::before {
    background-image: url("./data/ui/talent_ring_red.webp");
    opacity: .66;
    animation: talentRingSpinCW 5.8s linear infinite;
  }

  body[data-ui="web"] .webTalentOriginOrb.is-aegis::after {
    background-image: url("./data/ui/talent_ring_blue.webp");
    opacity: .9;
    animation: none;
  }

  body[data-ui="web"] .webTalentOriginOrb.is-ruin::before {
    background-image: url("./data/ui/talent_ring_blue.webp");
    opacity: .66;
    animation: talentRingSpinCW 5.8s linear infinite;
  }

  body[data-ui="web"] .webTalentOriginOrb.is-ruin::after {
    background-image: url("./data/ui/talent_ring_red.webp");
    opacity: .9;
    animation: none;
  }

  body[data-ui="web"] .webTalentOriginOrb.is-locked::before {
    background-image: url("./data/ui/talent_ring_blue.webp");
    opacity: .42;
  }

  body[data-ui="web"] .webTalentOriginOrb.is-locked::after {
    background-image: url("./data/ui/talent_ring_red.webp");
    opacity: .28;
    animation: none;
  }

  body[data-ui="web"] .webTalentOriginOrb img {
    position: relative;
    z-index: 1;
    width: 76px;
    height: 76px;
    object-fit: contain;
    display: block;
  }

  body[data-ui="web"] #uiWebRoot,
  body[data-ui="web"] #uiSharedRoot,
  body[data-ui="web"] #app {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
  }

  body[data-ui="web"] .debugGroup {
    display: none;
  }

  body[data-ui="web"].mode-debug .debugGroup,
  body[data-ui="web"].debug-start-unlocked .debugGroup {
    display: inline-flex;
  }

  body[data-ui="web"] .topbar {
    min-height: 72px;
    max-height: none;
    overflow: visible;
    z-index: 120;
  }

  body[data-ui="web"] .topbarButtonsRow button,
  body[data-ui="web"] .topbarButtonsRow .settingsGroup > button {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.10);
    background: linear-gradient(180deg, rgba(16,18,28,.98), rgba(10,11,18,.98));
    color: #f2e9df;
    font-size: 12px;
    letter-spacing: .06em;
    box-shadow:
      0 14px 28px rgba(0,0,0,.45),
      0 0 0 1px rgba(0,0,0,.40) inset;
  }

  body[data-ui="web"] .topbarButtonsRow button:hover,
  body[data-ui="web"] .topbarButtonsRow .settingsGroup > button:hover {
    background:
      radial-gradient(120% 140% at 18% 0%, rgba(255,184,77,.18), transparent 58%),
      linear-gradient(180deg, rgba(34,42,58,.98), rgba(18,23,34,.98));
    border-color: rgba(255,214,166,.24);
    color: #fff3df;
    box-shadow:
      0 16px 30px rgba(0,0,0,.5),
      0 0 0 1px rgba(255,184,77,.18) inset,
      0 0 18px rgba(255,184,77,.08);
  }

  body[data-ui="web"] .topbarButtonsRow button[aria-pressed="true"],
  body[data-ui="web"] .topbarButtonsRow .settingsGroup > button[aria-expanded="true"],
  body[data-ui="web"].inventory-open #btnInventory,
  body[data-ui="web"].profile-open #btnProfile {
    border-color: rgba(255,184,77,.42);
    box-shadow:
      0 16px 30px rgba(0,0,0,.52),
      0 0 0 1px rgba(255,184,77,.26) inset,
      0 0 22px rgba(255,184,77,.10);
  }

  body[data-ui="web"] .topbarButtonsRow .settingsMenu {
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.10);
    background: linear-gradient(180deg, rgba(16,18,28,.98), rgba(10,11,18,.98));
    box-shadow: 0 14px 28px rgba(0,0,0,.45);
  }

  body[data-ui="web"] .runStat.score[data-tooltip]::before,
  body[data-ui="web"] .runStat.score[data-tooltip]::after {
    display: none !important;
  }

  body[data-ui="web"] .runStat.score .scoreTooltipPanel {
    display: block;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    min-width: 240px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,210,132,.38);
    background:
      radial-gradient(160% 180% at 16% 0%, rgba(255,204,120,.18), transparent 58%),
      linear-gradient(180deg, rgba(22,26,38,.98), rgba(10,12,19,.98));
    box-shadow: 0 14px 30px rgba(0,0,0,.56), 0 0 0 1px rgba(0,0,0,.46) inset;
    color: rgba(245,236,224,.98);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 150ms ease, transform 150ms ease;
    z-index: 240;
  }

  body[data-ui="web"] .runStat.score:hover .scoreTooltipPanel,
  body[data-ui="web"] .runStat.score:focus .scoreTooltipPanel,
  body[data-ui="web"] .runStat.score:focus-within .scoreTooltipPanel,
  body[data-ui="web"] .runStat.score.tooltip-open .scoreTooltipPanel {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  body[data-ui="web"] .scoreTooltipTitle {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,219,156,.96);
    margin-bottom: 8px;
  }

  body[data-ui="web"] .scoreTooltipRow,
  body[data-ui="web"] .scoreTooltipTotal {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    line-height: 1.3;
    padding: 2px 0;
  }

  body[data-ui="web"] .scoreTooltipKey {
    color: rgba(220,230,245,.92);
  }

  body[data-ui="web"] .scoreTooltipVal {
    font-weight: 900;
    color: rgba(255,246,226,.98);
  }

  body[data-ui="web"] .scoreTooltipTotal {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid rgba(255,221,164,.24);
    color: rgba(255,226,168,.98);
  }

  body[data-ui="web"] .webTopStats {
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
  }

  body[data-ui="web"] .webTopStats .runStats {
    margin: 0;
    gap: 10px;
  }

  body[data-ui="web"] .webTopStats .runStat {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 800;
    border-radius: 999px;
  }

  body[data-ui="web"] .webTopStats .runStat .icon {
    font-size: 15px;
  }

  body[data-ui="web"] .logoPanel,
  body[data-ui="web"] .panel-run,
  body[data-ui="web"] .panel-story,
  body[data-ui="web"] .panel-info,
  body[data-ui="web"] .panel-log,
  body[data-ui="web"] #topbarCombatBars {
    display: none !important;
  }

  body[data-ui="web"].mode-shrine .panel-story {
    display: block !important;
    position: fixed;
    left: 50%;
    top: 82px;
    transform: translateX(-50%);
    width: min(450px, calc(100vw - 20px));
    max-width: 450px;
    max-height: calc(100dvh - 96px);
    overflow: auto;
    z-index: 90;
    border-radius: 16px;
  }

  body[data-ui="web"].mode-shrine .topbar,
  body[data-ui="web"].mode-shrine .panel-player,
  body[data-ui="web"].mode-shrine .panel-enemy,
  body[data-ui="web"].mode-shrine .handDrawerRoot,
  body[data-ui="web"].mode-shrine .webTalentOriginDock,
  body[data-ui="web"].mode-shrine .webTalentProcDock {
    display: none !important;
  }

  body[data-ui="web"] #playerStatuses,
  body[data-ui="web"] #playerPowers,
  body[data-ui="web"] #enemyStatuses,
  body[data-ui="web"] #enemyPowers {
    display: none !important;
  }

  body[data-ui="web"] .grid {
    display: block;
    padding: 0;
    gap: 0;
    min-height: 100dvh;
  }

  body[data-ui="web"] .panel-enemy,
  body[data-ui="web"] .panel-player {
    position: fixed;
    bottom: 118px;
    width: min(420px, calc(50vw - 34px));
    height: 448px;
    max-height: calc(100dvh - 214px);
    min-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 30;
    padding: 12px 12px 10px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 20px 40px rgba(0,0,0,0.56), 0 0 0 1px rgba(0,0,0,0.44) inset;
    transition: none !important;
    animation: none !important;
    opacity: 0;
    visibility: hidden;
    box-sizing: border-box;
  }

  body[data-ui="web"].web-panels-visible .panel-enemy,
  body[data-ui="web"].web-panels-visible .panel-player {
    opacity: 1;
    visibility: visible;
  }

  body[data-ui="web"] .panel-player {
    background:
      radial-gradient(140% 110% at 12% -6%, rgba(86,172,255,.16), transparent 60%),
      linear-gradient(180deg, rgba(10,16,26,.94), rgba(6,10,18,.96));
  }

  body[data-ui="web"] .panel-enemy {
    background:
      radial-gradient(140% 110% at 88% -6%, rgba(255,98,98,.16), transparent 60%),
      linear-gradient(180deg, rgba(20,11,16,.94), rgba(12,8,14,.96));
  }

  body[data-ui="web"] .panel-player::before,
  body[data-ui="web"] .panel-enemy::before {
    content: "";
    position: sticky;
    display: block;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 3;
    margin: -12px -12px 8px;
  }

  body[data-ui="web"] .panel-player::before {
    background: linear-gradient(90deg, rgba(77,171,247,.22), rgba(130,210,255,.78), rgba(77,171,247,.22));
  }

  body[data-ui="web"] .panel-enemy::before {
    background: linear-gradient(90deg, rgba(255,107,107,.22), rgba(255,150,150,.78), rgba(255,107,107,.22));
  }

  body[data-ui="web"] .panel-player {
    left: max(4px, calc(21vw - 208px));
  }

  body[data-ui="web"] .panel-enemy {
    right: max(4px, calc(21vw - 208px));
  }

  body[data-ui="web"] .panel-player .portrait,
  body[data-ui="web"] .panel-enemy .portrait {
    width: 98px;
    height: 114px;
  }

  body[data-ui="web"] .panel-player .portraitFrame.actorPortraitFrame,
  body[data-ui="web"] .panel-enemy .portraitFrame.actorPortraitFrame {
    width: 110px;
    height: 126px;
    padding: 6px;
    border-radius: 22px;
  }

  body[data-ui="web"] .panel-player .portraitFrame.actorPortraitFrame .portrait,
  body[data-ui="web"] .panel-enemy .portraitFrame.actorPortraitFrame .portrait {
    width: 98px;
    height: 114px;
    border-radius: 16px;
  }

  body[data-ui="web"] .panel-player .portraitMetaIcons {
    display: none;
    min-height: 0;
  }

  body[data-ui="web"] .panel-player .portraitStack {
    gap: 4px;
  }

  body[data-ui="web"] .panel-player .actorRow,
  body[data-ui="web"] .panel-enemy .actorRow {
    gap: 10px;
    margin: 4px 0 8px;
  }

  body[data-ui="web"] .panel-player .actorInfo,
  body[data-ui="web"] .panel-enemy .actorInfo {
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    padding: 9px 10px;
    background: linear-gradient(180deg, rgba(12,15,24,.86), rgba(8,10,18,.9));
    box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset;
  }

  body[data-ui="web"] .panel-player .actorHeader,
  body[data-ui="web"] .panel-enemy .actorHeader {
    margin-bottom: 4px;
    gap: 6px;
  }

  body[data-ui="web"] .panel-player .actorName,
  body[data-ui="web"] .panel-enemy .actorName {
    font-size: 17px;
  }

  body[data-ui="web"] .panel-player .playerNameStack {
    min-width: 0;
    width: 100%;
  }

  body[data-ui="web"] .panel-player .actorBadges,
  body[data-ui="web"] .panel-enemy .actorBadges,
  body[data-ui="web"] #enemyIntent {
    display: none;
  }

  body[data-ui="web"] .panel-player .effectsRow,
  body[data-ui="web"] .panel-enemy .effectsRow {
    margin: 6px 0 0;
  }

  body[data-ui="web"] .handDrawerRoot {
    position: fixed;
    left: 50%;
    bottom: 0;
    width: min(450px, calc(100vw - 20px));
    transform: translateX(-50%);
    z-index: 80;
  }

  body[data-ui="web"] .handDrawerBackdrop {
    display: none;
  }

  body[data-ui="web"] .handDrawerClose {
    display: inline-flex;
  }

  body[data-ui="web"] .handDrawerTab {
    top: auto;
    left: 0;
    right: 0;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    transform: translate3d(0, 0, 0);
    max-width: none;
    border-radius: 16px;
    border: 1px solid rgba(255,220,156,0.34);
    background:
      radial-gradient(120% 180% at 50% -20%, rgba(255,210,120,0.18), transparent 58%),
      linear-gradient(180deg, rgba(24,30,44,0.94), rgba(13,17,28,0.96));
    box-shadow:
      0 14px 30px rgba(0,0,0,0.50),
      0 0 0 1px rgba(0,0,0,0.34) inset,
      0 0 18px rgba(255,188,96,0.18);
    font-size: 12px;
    letter-spacing: 0.13em;
    text-shadow: 0 1px 0 rgba(0,0,0,.7);
    justify-content: center;
    gap: 14px;
    overflow: hidden;
    animation: webHandDrawerTabFloat 3.2s ease-in-out infinite;
  }

  body[data-ui="web"] .handDrawerTabLabel {
    min-width: 0;
  }

  body[data-ui="web"] .handDrawerTabArrow {
    flex: 0 0 auto;
    font-size: 20px;
    font-weight: 700;
    color: var(--ember);
    text-shadow: 0 0 8px rgba(255,184,77,0.6);
    animation: webDrawerArrowPulse 1.2s ease-in-out infinite;
  }

  body[data-ui="web"] .handDrawerTabArrowRight {
    animation-delay: 0.6s;
  }

  body[data-ui="web"] .handDrawerTab::before {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    top: 1px;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255,228,170,0.65), transparent);
    opacity: .9;
    pointer-events: none;
  }

  body[data-ui="web"] .handDrawerTab:not(:disabled):hover {
    transform: translate3d(0, -2px, 0);
    filter: brightness(1.08);
  }

  body[data-ui="web"] .handDrawerTab:disabled {
    animation: none;
  }

  body[data-ui="web"] .handDrawerTab:disabled .handDrawerTabArrow {
    display: none;
  }

  @keyframes webDrawerArrowPulse {
    0%, 100% {
      opacity: 0.4;
      transform: scale(0.95);
      text-shadow: 0 0 4px rgba(255,184,77,0.3);
    }
    50% {
      opacity: 1;
      transform: scale(1.1);
      text-shadow: 0 0 12px rgba(255,184,77,0.9);
    }
  }

  @keyframes webHandDrawerTabFloat {
    0% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -2px, 0); }
    100% { transform: translate3d(0, 0, 0); }
  }

  body[data-ui="web"].hand-drawer-open .handDrawerTab {
    display: none;
  }

  body[data-ui="web"] .handDrawerPanel {
    position: absolute;
    inset: auto 0 0 0;
    width: 100%;
    height: min(calc(100dvh - 92px), 760px);
    transform: translateY(105%);
    border-left: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 44px rgba(0,0,0,0.60);
    transition: transform 220ms ease;
  }

  body[data-ui="web"].hand-drawer-open .handDrawerPanel {
    transform: translateY(0);
  }

  body[data-ui="web"] .handDrawerHeaderActions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-ui="web"].web-triple-overlays .handDrawerHeaderActions {
    position: relative;
    gap: 10px;
    padding: 8px 6px 2px;
  }

  body[data-ui="web"].web-triple-overlays .handDrawerHeaderActions::before {
    content: "";
    position: absolute;
    left: 11%;
    right: 11%;
    top: 26px;
    height: 2px;
    border-radius: 999px;
    background:
      linear-gradient(90deg, rgba(255,196,96,0.18), rgba(120,188,255,0.5), rgba(255,196,96,0.18));
    box-shadow: 0 0 12px rgba(120,188,255,0.24);
    pointer-events: none;
  }

  body[data-ui="web"].web-triple-overlays .handDrawerInventory,
  body[data-ui="web"].web-triple-overlays .handDrawerTalents,
  body[data-ui="web"].web-triple-overlays .handDrawerGear {
    position: relative;
    z-index: 1;
    min-height: 44px;
    padding: 11px 10px 9px;
    border-radius: 14px;
    border-width: 1px;
    letter-spacing: 0.14em;
    font-size: 11px;
    box-shadow: 0 10px 18px rgba(0,0,0,0.34), 0 0 0 1px rgba(0,0,0,0.30) inset;
  }

  body[data-ui="web"].web-triple-overlays .handDrawerInventory::before,
  body[data-ui="web"].web-triple-overlays .handDrawerTalents::before,
  body[data-ui="web"].web-triple-overlays .handDrawerGear::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -8px;
    width: 10px;
    height: 10px;
    transform: translateX(-50%) rotate(45deg);
    border-radius: 2px;
    border: 1px solid rgba(168,206,255,0.44);
    background: rgba(20,30,48,0.96);
    box-shadow: 0 0 10px rgba(120,188,255,0.20);
  }

  body[data-ui="web"].web-triple-overlays .handDrawerInventory:hover,
  body[data-ui="web"].web-triple-overlays .handDrawerTalents:hover,
  body[data-ui="web"].web-triple-overlays .handDrawerGear:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
  }

  body[data-ui="web"].web-triple-overlays .handDrawerInventory[aria-pressed="true"],
  body[data-ui="web"].web-triple-overlays .handDrawerTalents[aria-pressed="true"],
  body[data-ui="web"].web-triple-overlays .handDrawerGear[aria-pressed="true"] {
    border-color: rgba(255,220,146,0.72);
    box-shadow:
      0 12px 20px rgba(0,0,0,.38),
      0 0 0 1px rgba(255,220,146,.26) inset,
      0 0 16px rgba(255,192,96,.28);
  }

  body[data-ui="web"] .handDrawerPanel #hand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0 calc(18px + env(safe-area-inset-bottom, 0px));
  }

  body[data-ui="web"] .handDrawerPanel #hand .card {
    width: 100%;
    max-width: 100%;
    min-height: 104px;
    padding-top: 10px;
    padding-bottom: 9px;
  }

  body[data-ui="web"] .compactCombatHUD {
    position: fixed !important;
    inset: 0 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: auto !important;
    transform: none !important;
    z-index: 82 !important;
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    pointer-events: none !important;
  }

  body[data-ui="web"] .compactCombatHUD .compactCombatToggle {
    display: none !important;
  }

  body[data-ui="web"] .compactCombatHUD .compactSectionDivider {
    display: none !important;
  }

  body[data-ui="web"] .compactCombatHUD .compactEnemy,
  body[data-ui="web"] .compactCombatHUD .compactPlayerPanel {
    position: fixed !important;
    top: calc(var(--safe-top) + 78px) !important;
    bottom: auto !important;
    width: min(338px, calc((50vw - 34px) * 0.75)) !important;
    min-width: 280px;
    max-width: min(338px, calc((50vw - 34px) * 0.75)) !important;
    pointer-events: none !important;
  }

  body[data-ui="web"] .compactCombatHUD .compactEnemy {
    display: flex !important;
    right: max(16px, calc(25vw - 225px)) !important;
  }

  body[data-ui="web"] .compactCombatHUD .compactPlayerPanel {
    display: block !important;
    left: max(16px, calc(25vw - 225px)) !important;
  }

  body[data-ui="web"] .compactCombatHUD .compactEnemyTop,
  body[data-ui="web"] .compactCombatHUD .compactPlayerTop {
    grid-template-columns: 20px minmax(0, 1fr) minmax(88px, 116px);
    gap: 5px;
  }

  body[data-ui="web"] .compactCombatHUD .compactEnemyBars .combatBar,
  body[data-ui="web"] .compactCombatHUD .compactPlayerPanel .compactCombatBars .combatBar {
    height: 14px;
  }

  body[data-ui="web"] .compactCombatHUD .compactEnemyBars .combatBarLabel,
  body[data-ui="web"] .compactCombatHUD .compactPlayerPanel .compactCombatBars .combatBarLabel {
    font-size: 9px;
  }

  body[data-ui="web"] .compactCombatHUD {
    display: none !important;
  }

  body[data-ui="web"] .webPanelCombatDock {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 -12px 8px;
    padding: 9px 10px 10px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.14);
    background: linear-gradient(180deg, rgba(8,11,18,.98), rgba(8,11,18,.92));
    backdrop-filter: blur(4px);
  }

  body[data-ui="web"] .webEnemyIntentPill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(7,10,16,0.72);
    color: rgba(236,244,255,.94);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  body[data-ui="web"] .webEnemyIntentLead {
    opacity: .72;
  }

  body[data-ui="web"] .webEnemyIntentMain {
    letter-spacing: .02em;
    font-size: 12px;
  }

  body[data-ui="web"] .webEnemyIntentPrompt {
    border-radius: 999px;
    border: 1px solid rgba(255,183,77,.4);
    background: rgba(255,183,77,.12);
    color: rgba(255,222,170,.96);
    padding: 2px 6px;
    font-size: 10px;
    letter-spacing: .07em;
  }

  body[data-ui="web"] .webEnemyIntentPill[data-intent="attack"],
  body[data-ui="web"] .webEnemyIntentPill[data-intent="coordinated_fury"] {
    border-color: rgba(255,107,107,.42);
    background: rgba(255,107,107,.12);
    color: rgba(255,226,226,.96);
  }

  body[data-ui="web"] .webEnemyIntentPill[data-intent="lifesteal"] {
    border-color: rgba(255,143,143,.44);
    background: rgba(255,120,120,.13);
    color: rgba(255,234,234,.98);
  }

  body[data-ui="web"] .webEnemyIntentPill[data-intent="block"] {
    border-color: rgba(77,171,247,.46);
    background: rgba(77,171,247,.13);
    color: rgba(222,242,255,.98);
  }

  body[data-ui="web"] .webEnemyIntentPill[data-intent="dodge"],
  body[data-ui="web"] .webEnemyIntentPill[data-intent="counter"] {
    border-color: rgba(255,212,59,.45);
    background: rgba(255,212,59,.12);
    color: rgba(255,245,198,.98);
  }

  body[data-ui="web"] .webPanelCombatDock[aria-hidden="true"] {
    display: none;
  }

  body[data-ui="web"] .webPanelCombatDock .webPanelCombatBars .combatBar {
    height: 24px;
  }

  body[data-ui="web"] .webPanelCombatDock .webPanelCombatBars .combatBarLabel {
    font-size: 11px;
  }

  body[data-ui="web"] .webPanelCombatDock .webPanelCombatBars .combatBarsRow {
    gap: 5px;
  }

  body[data-ui="web"] #enemyTurnOverlay.overlay {
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 3vh, 24px) 10px;
  }

  body[data-ui="web"] #enemyTurnOverlay .overlayBackdrop {
    background:
      radial-gradient(1200px 760px at 50% 38%, rgba(122,170,236,0.10), transparent 62%),
      linear-gradient(180deg, rgba(0,0,0,0.56), rgba(0,0,0,0.78));
    backdrop-filter: blur(3px);
  }

  body[data-ui="web"] #enemyTurnOverlay[data-tone="defense"] .overlayBackdrop {
    background:
      radial-gradient(1600px 920px at 50% 44%, rgba(96,188,255,0.34), rgba(96,188,255,0.08) 54%, transparent 78%),
      radial-gradient(1300px 760px at 50% 38%, rgba(72,136,255,0.22), transparent 68%),
      linear-gradient(180deg, rgba(4,16,34,0.56), rgba(2,8,20,0.80));
  }

  body[data-ui="web"] #enemyTurnOverlay[data-tone="brace"] .overlayBackdrop {
    background:
      radial-gradient(1700px 980px at 50% 44%, rgba(255,96,96,0.34), rgba(255,96,96,0.08) 54%, transparent 78%),
      radial-gradient(1300px 760px at 50% 38%, rgba(255,68,68,0.24), transparent 68%),
      linear-gradient(180deg, rgba(34,6,10,0.56), rgba(20,4,8,0.82));
  }

  body[data-ui="web"] #enemyTurnOverlay.is-enraged-turn .overlayBackdrop {
    background:
      radial-gradient(1100px 720px at 50% 36%, rgba(255,92,92,0.20), transparent 62%),
      linear-gradient(180deg, rgba(0,0,0,0.60), rgba(0,0,0,0.82));
    animation: webEnrageBackdropPulse 760ms ease-in-out infinite;
  }

  body[data-ui="web"] #enemyTurnOverlay[data-tone="enrage"] .overlayBackdrop {
    background:
      radial-gradient(1800px 1040px at 50% 44%, rgba(255,56,56,0.46), rgba(255,56,56,0.10) 54%, transparent 78%),
      radial-gradient(1400px 820px at 50% 32%, rgba(255,156,56,0.28), transparent 64%),
      linear-gradient(180deg, rgba(40,5,8,0.66), rgba(22,3,6,0.86));
    animation: webEnrageBackdropPulse 640ms cubic-bezier(.2,.66,.2,1) infinite;
  }

  @keyframes webEnrageBackdropPulse {
    0% {
      filter: saturate(1) brightness(1);
    }
    45% {
      filter: saturate(1.18) brightness(1.08);
    }
    100% {
      filter: saturate(1.04) brightness(1.02);
    }
  }

  @keyframes webEnrageLabelPulse {
    0% { filter: saturate(1) brightness(1); }
    45% { filter: saturate(1.18) brightness(1.12); }
    100% { filter: saturate(1.06) brightness(1.02); }
  }

  @keyframes webEnrageMovePulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.02); }
    100% { transform: scale(1); }
  }

  body[data-ui="web"] #enemyTurnOverlay .overlayCard {
    width: min(470px, 92vw);
    max-height: min(88vh, 860px);
    border-radius: 16px;
  }

  body[data-ui="web"] #enemyTurnOverlay .enemyTurnCard {
    padding: 12px 12px 10px;
    border-radius: 16px;
    border: 1px solid rgba(178,208,246,0.20);
    background:
      radial-gradient(140% 140% at 50% -10%, rgba(255,255,255,0.06), transparent 58%),
      linear-gradient(180deg, rgba(11,14,22,0.96), rgba(8,11,18,0.95));
    box-shadow: 0 22px 56px rgba(0,0,0,0.54), 0 0 0 1px rgba(0,0,0,0.42) inset;
  }

  body[data-ui="web"] #enemyTurnOverlay .enemyTurnLabel {
    font-size: 15px;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 7px;
    color: rgba(230,239,252,0.92);
  }

  body[data-ui="web"] #enemyTurnOverlay .enemyTurnMove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(165,201,246,0.26);
    background: rgba(20,30,48,0.52);
    font-size: 12px;
    letter-spacing: .02em;
    max-width: 100%;
  }

  body[data-ui="web"] #enemyTurnOverlay[data-tone="defense"] .enemyTurnLabel {
    color: rgba(194,230,255,0.98);
    text-shadow: 0 0 12px rgba(112,198,255,0.34);
  }

  body[data-ui="web"] #enemyTurnOverlay[data-tone="defense"] .enemyTurnMove {
    border-color: rgba(110,198,255,0.52);
    background: linear-gradient(180deg, rgba(24,74,126,0.50), rgba(14,44,82,0.58));
    color: rgba(224,242,255,0.98);
    box-shadow: 0 0 0 1px rgba(110,198,255,0.18) inset, 0 0 18px rgba(110,198,255,0.18);
  }

  body[data-ui="web"] #enemyTurnOverlay[data-tone="brace"] .enemyTurnLabel {
    color: rgba(255,210,210,0.98);
    text-shadow: 0 0 12px rgba(255,106,106,0.34);
  }

  body[data-ui="web"] #enemyTurnOverlay[data-tone="brace"] .enemyTurnMove {
    border-color: rgba(255,112,112,0.56);
    background: linear-gradient(180deg, rgba(124,34,38,0.52), rgba(82,20,24,0.60));
    color: rgba(255,234,234,0.99);
    box-shadow: 0 0 0 1px rgba(255,112,112,0.20) inset, 0 0 18px rgba(255,90,90,0.18);
  }

  body[data-ui="web"] #enemyTurnOverlay[data-tone="enrage"] .enemyTurnLabel {
    color: rgba(255,236,180,0.99);
    text-shadow: 0 0 14px rgba(255,122,72,0.44);
    animation: webEnrageLabelPulse 640ms cubic-bezier(.2,.66,.2,1) infinite;
  }

  body[data-ui="web"] #enemyTurnOverlay[data-tone="enrage"] .enemyTurnMove {
    border-color: rgba(255,144,84,0.62);
    background: linear-gradient(180deg, rgba(150,44,34,0.58), rgba(96,20,16,0.66));
    color: rgba(255,241,206,0.99);
    box-shadow: 0 0 0 1px rgba(255,156,96,0.24) inset, 0 0 22px rgba(255,108,62,0.24);
    animation: webEnrageMovePulse 640ms cubic-bezier(.2,.66,.2,1) infinite;
  }

  body[data-ui="web"] #enemyTurnOverlay .enemyTurnHint {
    margin-top: 7px;
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .8;
  }

  body[data-ui="web"] #enemyTurnOverlay .bracePrompt {
    margin-top: 9px;
  }

  body[data-ui="web"] #enemyTurnOverlay .braceArtFrame {
    width: min(410px, 86vw);
    height: auto;
    aspect-ratio: 9 / 16;
    max-height: min(56vh, 540px);
    margin: 0 auto;
    border-radius: 12px;
    border: 1px solid rgba(178,208,246,0.20);
    background: radial-gradient(120% 100% at 50% 50%, rgba(18,26,42,0.76), rgba(10,14,24,0.92));
    box-shadow: 0 12px 34px rgba(0,0,0,0.42);
  }

  body[data-ui="web"] #enemyTurnOverlay .braceUi {
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(6,10,16,0), rgba(6,10,16,0.72) 44%, rgba(6,10,16,0.92));
  }

  body[data-ui="web"] #enemyTurnOverlay .braceLead {
    font-size: 10px;
    letter-spacing: .07em;
    text-transform: uppercase;
  }

  body[data-ui="web"] #enemyTurnOverlay .braceButton {
    min-width: 188px;
    min-height: 56px;
    font-size: 15px;
    letter-spacing: .09em;
    border-color: rgba(255,255,255,0.24);
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
    transform-origin: 50% 50%;
    animation: webBraceButtonThrob 720ms cubic-bezier(.22,.7,.24,1) infinite;
  }

  @keyframes webBraceButtonThrob {
    0% {
      transform: scale(1);
      filter: brightness(1);
      box-shadow: 0 12px 24px rgba(0,0,0,0.4), 0 0 0 0 rgba(255,120,120,0.0);
    }
    48% {
      transform: scale(1.085);
      filter: brightness(1.1);
      box-shadow: 0 16px 28px rgba(0,0,0,0.46), 0 0 0 8px rgba(255,120,120,0.08);
    }
    100% {
      transform: scale(1);
      filter: brightness(1);
      box-shadow: 0 12px 24px rgba(0,0,0,0.4), 0 0 0 0 rgba(255,120,120,0.0);
    }
  }

  body[data-ui="web"] #enemyTurnOverlay .braceTimer {
    width: min(200px, 44vw);
  }

  body[data-ui="web"] #enemyTurnOverlay.brace-active .overlayCard {
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }

  body[data-ui="web"] #enemyTurnOverlay.brace-active.overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  body[data-ui="web"] #enemyTurnOverlay.brace-active .enemyTurnCard {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  body[data-ui="web"] #enemyTurnOverlay.brace-active .enemyTurnLabel,
  body[data-ui="web"] #enemyTurnOverlay.brace-active .enemyTurnMove,
  body[data-ui="web"] #enemyTurnOverlay.brace-active .enemyTurnHint {
    display: none;
  }

  body[data-ui="web"] #enemyTurnOverlay.brace-active .bracePrompt {
    display: block;
    margin-top: 0;
  }

  body[data-ui="web"] #enemyTurnOverlay.brace-active .braceArtFrame {
    width: 100vw;
    height: 100vh;
    max-height: none;
    aspect-ratio: auto;
    margin: 0 auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body[data-ui="web"] #enemyTurnOverlay.brace-active .braceArtFrame::before,
  body[data-ui="web"] #enemyTurnOverlay.brace-active .braceBarrier,
  body[data-ui="web"] #enemyTurnOverlay.brace-active .braceLead,
  body[data-ui="web"] #enemyTurnOverlay.brace-active .braceTimer {
    display: none;
  }

  body[data-ui="web"] #enemyTurnOverlay.brace-active .braceArt {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    filter: none;
  }

  body[data-ui="web"] #enemyTurnOverlay.brace-active .braceUi {
    position: absolute;
    inset: 0;
    display: block;
    padding: 0;
    background: transparent;
  }

  body[data-ui="web"] #enemyTurnOverlay.brace-active .braceButton {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(30vmin, 320px);
    height: min(30vmin, 320px);
    min-width: 180px;
    min-height: 180px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.20);
    background: radial-gradient(circle, rgba(255,255,255,0.08), rgba(255,255,255,0.01));
    color: transparent;
    text-shadow: none;
    box-shadow: 0 0 0 0 rgba(255,150,150,0.0);
    animation: webBraceHotspotPulse 760ms cubic-bezier(.22,.7,.24,1) infinite;
  }

  body[data-ui="web"] #enemyTurnOverlay.brace-active .braceButton.is-success,
  body[data-ui="web"] #enemyTurnOverlay.brace-active .braceButton.is-fail {
    color: transparent;
  }

  @keyframes webBraceHotspotPulse {
    0% {
      transform: translate(-50%, -50%) scale(1);
      border-color: rgba(255,255,255,0.20);
      box-shadow: 0 0 0 0 rgba(255,150,150,0.0);
    }
    48% {
      transform: translate(-50%, -50%) scale(1.07);
      border-color: rgba(255,210,210,0.52);
      box-shadow: 0 0 0 16px rgba(255,120,120,0.09);
    }
    100% {
      transform: translate(-50%, -50%) scale(1);
      border-color: rgba(255,255,255,0.20);
      box-shadow: 0 0 0 0 rgba(255,150,150,0.0);
    }
  }

  body[data-ui="web"] #postBattleRewards.overlay.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 14px;
  }

  body[data-ui="web"] #postBattleRewards .overlayBackdrop {
    background:
      radial-gradient(1200px 820px at 50% 18%, rgba(255,196,108,.18), transparent 58%),
      radial-gradient(900px 680px at 18% 24%, rgba(140,206,255,.10), transparent 56%),
      radial-gradient(960px 760px at 82% 22%, rgba(255,96,112,.10), transparent 58%),
      linear-gradient(180deg, rgba(0,0,0,.76), rgba(0,0,0,.92));
  }

  body[data-ui="web"] #postBattleRewards .overlayCard {
    width: min(1180px, calc(100vw - 32px));
    max-height: min(84dvh, 940px);
    margin: 0;
    padding: 18px 18px 16px;
    border-radius: 24px;
    border: 1px solid rgba(255,214,156,.18);
    background:
      linear-gradient(180deg, rgba(10,12,18,.42), rgba(6,8,14,.48)),
      url("./data/ui/reward_shop_bg.webp") center/cover no-repeat,
      radial-gradient(130% 120% at 50% 0%, rgba(255,196,108,.11), transparent 46%),
      radial-gradient(120% 100% at 50% 100%, rgba(0,0,0,.40), transparent 62%),
      linear-gradient(180deg, rgba(19,23,34,.96), rgba(7,9,15,.96));
    box-shadow:
      0 34px 80px rgba(0,0,0,.64),
      0 0 0 1px rgba(0,0,0,.36) inset,
      0 0 36px rgba(255,184,77,.10);
    backdrop-filter: blur(10px);
  }

  body[data-ui="web"] #postBattleRewards .overlayCard::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
      linear-gradient(180deg, rgba(255,255,255,.06), transparent 20%),
      radial-gradient(110% 110% at 50% -6%, rgba(255,224,168,.14), transparent 38%);
    opacity: .92;
  }

  body[data-ui="web"] #postBattleRewards .postBattleAtmosphere {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
  }

  body[data-ui="web"] #postBattleRewards .postBattleAtmosphere .webAtmosphereEmbers,
  body[data-ui="web"] #postBattleRewards .postBattleAtmosphere .webAtmosphereAsh {
    position: absolute;
    inset: 0;
    overflow: hidden;
  }

  body[data-ui="web"] #postBattleRewards .postBattleAtmosphere .webAtmosphereParticle.overlayParticle {
    bottom: -8%;
    animation-duration: calc(var(--dur, 12s) * 0.72);
    opacity: calc(var(--alpha, .55) * 0.82);
  }

  body[data-ui="web"] #postBattleRewards .postBattleAtmosphere.is-mid .webAtmosphereParticle.overlayParticle {
    animation-duration: calc(var(--dur, 12s) * 0.9);
    opacity: calc(var(--alpha, .55) * 0.62);
  }

  body[data-ui="web"] #postBattleRewards .postBattleAtmosphere .webAtmosphereParticle.ember.overlayParticle {
    filter: drop-shadow(0 0 10px rgba(255,148,68,.36));
  }

  body[data-ui="web"] #postBattleRewards .postBattleAtmosphere .webAtmosphereParticle.ash.overlayParticle {
    filter: blur(0.85px);
    opacity: calc(var(--alpha, .26) * 0.72);
  }

  body[data-ui="web"] #postBattleRewards.is-shop .overlayCard {
    background:
      linear-gradient(180deg, rgba(10,12,18,.38), rgba(6,8,14,.44)),
      url("./data/ui/reward_shop_bg.webp") center/cover no-repeat,
      radial-gradient(130% 120% at 50% 0%, rgba(255,196,108,.13), transparent 46%),
      radial-gradient(120% 100% at 16% 0%, rgba(120,180,240,.09), transparent 44%),
      linear-gradient(180deg, rgba(18,23,34,.97), rgba(8,10,16,.96));
  }

  body[data-ui="web"] #postBattleTitle {
    position: relative;
    z-index: 1;
    margin-bottom: 12px;
    padding-bottom: 10px;
    font-size: 22px;
    letter-spacing: .14em;
    text-align: center;
    color: rgba(248,235,216,.97);
    border-bottom-color: rgba(255,214,156,.18);
    text-shadow: 0 1px 0 rgba(0,0,0,.82), 0 0 18px rgba(255,184,77,.12);
  }

  body[data-ui="web"] #postBattleRewards.is-shop #postBattleTitle,
  body[data-ui="web"] #postBattleRewards.is-reward #postBattleTitle {
    min-height: 88px;
    padding-bottom: 0;
    border-bottom: 0;
    font-size: 0;
    line-height: 0;
    color: transparent;
    text-shadow: none;
    overflow: hidden;
  }

  body[data-ui="web"] #postBattleRewards.is-shop #postBattleTitle::before,
  body[data-ui="web"] #postBattleRewards.is-reward #postBattleTitle::before {
    content: "";
    display: block;
    width: min(760px, 96vw);
    height: clamp(112px, 16vw, 176px);
    margin: 0 auto;
    background: url("./data/ui/victory.webp") center/contain no-repeat;
    filter: drop-shadow(0 12px 18px rgba(0,0,0,.42)) drop-shadow(0 0 18px rgba(255,184,77,.14));
  }

  body[data-ui="web"] #postBattleText {
    position: relative;
    z-index: 1;
    margin: 0 auto 16px;
    max-width: 760px;
    text-align: center;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(223,228,238,.86);
  }

  body[data-ui="web"] #postBattleBody {
    position: relative;
    z-index: 1;
  }

  body[data-ui="web"] #postBattleRewards .progressionHint {
    margin: 0 auto 16px;
    max-width: 760px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,214,156,.16);
    background:
      radial-gradient(140% 160% at 50% 0%, rgba(255,196,108,.12), transparent 58%),
      linear-gradient(180deg, rgba(22,26,38,.92), rgba(12,14,20,.95));
    box-shadow: 0 16px 28px rgba(0,0,0,.34), 0 0 0 1px rgba(0,0,0,.28) inset;
    text-align: center;
  }

  body[data-ui="web"] #postBattleRewards .rewardCardsGrid {
    display: flex;
    flex-wrap: nowrap;
    gap: 18px;
    align-items: stretch;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 4px 8px;
  }

  body[data-ui="web"] #postBattleRewards .rewardCard {
    flex: 0 0 264px;
    width: 264px;
    padding: 12px;
    border-radius: 18px;
    box-shadow:
      0 22px 38px rgba(0,0,0,.42),
      0 0 0 1px rgba(0,0,0,.35) inset,
      0 0 26px rgba(255,184,77,.08);
  }

  body[data-ui="web"] #postBattleRewards .rewardCard .handCardArt {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
  }

  body[data-ui="web"] #postBattleRewards .rewardCard .name {
    font-size: 15px;
  }

  body[data-ui="web"] #postBattleRewards .rewardCard .text {
    font-size: 13px;
    line-height: 1.32;
  }

  body[data-ui="web"] #postBattleRewards .shopItemsGrid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    align-items: stretch;
  }

  body[data-ui="web"] #postBattleRewards .shopItemCard {
    padding: 16px 18px;
    border-radius: 20px;
    border-width: 1px;
    box-shadow:
      0 22px 40px rgba(0,0,0,.40),
      0 0 0 1px rgba(0,0,0,.32) inset,
      0 0 28px color-mix(in srgb, var(--slot-accent) 18%, transparent);
  }

  body[data-ui="web"] #postBattleRewards .shopItemCard .rewardLine {
    align-items: flex-start;
    gap: 14px;
  }

  body[data-ui="web"] #postBattleRewards .shopItemArt {
    width: 86px;
    height: 114px;
    flex: 0 0 86px;
    border-radius: 16px;
    box-shadow:
      0 14px 24px rgba(0,0,0,.34),
      0 0 24px color-mix(in srgb, var(--slot-accent) 34%, transparent),
      0 0 0 1px rgba(0,0,0,.38) inset;
  }

  body[data-ui="web"] #postBattleRewards .shopItemArt img {
    object-fit: cover;
  }

  body[data-ui="web"] #postBattleRewards .shopItemCard .rewardMain {
    gap: 7px;
  }

  body[data-ui="web"] #postBattleRewards .shopItemCard .rewardName {
    font-size: 18px;
    line-height: 1.15;
  }

  body[data-ui="web"] #postBattleRewards .shopItemCard .rewardText {
    font-size: 13px;
    line-height: 1.4;
    -webkit-line-clamp: 3;
  }

  body[data-ui="web"] #postBattleRewards .shopItemCard .abilityIcon {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }

  body[data-ui="web"] #postBattleRewards .shopItemCard .badge {
    font-size: 11px;
  }

  body[data-ui="web"] #postBattleRewards hr {
    margin: 18px 0 12px;
    border-color: rgba(255,214,156,.12);
  }

  body[data-ui="web"] #postBattleRewards .overlayCard > .choiceBtn:last-child {
    width: min(280px, 100%);
    margin: 4px auto 0;
    text-align: center;
    justify-content: center;
    border-radius: 14px;
    letter-spacing: .12em;
  }

  body[data-ui="web"].inventory-open .panel-info {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px !important;
    z-index: 5000 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  body[data-ui="web"].inventory-open #infoPanelTitle,
  body[data-ui="web"].inventory-open #infoArea {
    display: none !important;
  }

  body[data-ui="web"].inventory-open #inventoryArea {
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
  }

  body[data-ui="web"] #inventoryArea .inventoryContent {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(450px, calc(100vw - 20px));
    max-width: 450px;
    height: min(calc(100dvh - 20px), 900px);
    max-height: min(calc(100dvh - 20px), 900px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
  }

  body[data-ui="web"] #inventoryArea .inventoryHeader {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 2;
    background:
      radial-gradient(140% 120% at 18% 0%, rgba(255,184,77,.09) 0%, rgba(255,255,255,.02) 40%, rgba(0,0,0,.34) 100%),
      linear-gradient(180deg, rgba(15,18,28,.96), rgba(7,8,14,.96));
  }

  body[data-ui="web"] #inventoryArea .inventoryView {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
  }

  body[data-ui="web"] #inventoryArea .deckLibraryBody {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  body[data-ui="web"] #inventoryArea .inventoryHeader,
  body[data-ui="web"] #talentsOverlay .talentsTopBar,
  body[data-ui="web"] #gearOverlay .gearTopBar {
    cursor: move;
    user-select: none;
    touch-action: none;
  }

  body[data-ui="web"] #talentsOverlay.overlay,
  body[data-ui="web"] #gearOverlay.overlay {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  body[data-ui="web"] .gearSlotPickerCard {
    width: calc(100% - 14px) !important;
    max-width: calc(100% - 14px) !important;
  }

  body[data-ui="web"] #talentsOverlay .talentsCard,
  body[data-ui="web"] #gearOverlay .gearCard {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(450px, calc(100vw - 20px)) !important;
    max-width: 450px !important;
    height: min(calc(100dvh - 20px), 900px) !important;
    max-height: min(calc(100dvh - 20px), 900px) !important;
    margin: 0 !important;
    border-radius: 14px;
    transition: none !important;
  }

  body[data-ui="web"] #talentsOverlay.overlay.is-open .talentsCard,
  body[data-ui="web"] #gearOverlay.overlay.is-open .gearCard {
    transform: translate(-50%, -50%);
  }

  body[data-ui="web"] .panel-player .turnRecapWrap,
  body[data-ui="web"] .panel-enemy .turnRecapWrap {
    margin-top: 2px;
    padding-top: 4px;
  }

  body[data-ui="web"] .itemDrop.image-only.tone-levelup .itemDropCard {
    width: min(50vw, 760px);
    max-width: 50vw;
  }

  body[data-ui="web"] .itemDrop.image-only.tone-levelup .itemDropImage {
    width: 100%;
    max-width: 50vw;
    max-height: 50vh;
    object-fit: contain;
  }

  body[data-ui="web"].web-triple-overlays.triple-overlays-active {
    --triple-col-width: min(31.5vw, 420px);
    --triple-gap: 10px;
  }

  body[data-ui="web"].web-triple-overlays.triple-overlays-active::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 5090;
    pointer-events: none;
    background:
      radial-gradient(120% 120% at 50% 6%, rgba(255,184,77,0.08), transparent 60%),
      radial-gradient(100% 120% at 40% 100%, rgba(0,0,0,0.45), rgba(0,0,0,0.78));
  }

  body[data-ui="web"].web-triple-overlays.triple-overlays-active #inventoryArea,
  body[data-ui="web"].web-triple-overlays.triple-overlays-active #talentsOverlay.overlay,
  body[data-ui="web"].web-triple-overlays.triple-overlays-active #gearOverlay.overlay {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px !important;
    z-index: 5100 !important;
    background: transparent !important;
    pointer-events: none !important;
  }

  body[data-ui="web"].web-triple-overlays.triple-overlays-active #inventoryArea {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-ui="web"].web-triple-overlays.triple-overlays-active #infoArea {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    max-height: 0 !important;
  }

  body[data-ui="web"].web-triple-overlays.triple-overlays-active .inventoryBackdrop,
  body[data-ui="web"].web-triple-overlays.triple-overlays-active #talentsOverlay .overlayBackdrop,
  body[data-ui="web"].web-triple-overlays.triple-overlays-active #gearOverlay .overlayBackdrop {
    display: none !important;
  }

  body[data-ui="web"].web-triple-overlays.triple-overlays-active .panel-info {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 5100 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
  }

  body[data-ui="web"].web-triple-overlays.triple-overlays-active #inventoryArea .inventoryContent {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: var(--triple-col-width) !important;
    max-width: var(--triple-col-width) !important;
    height: min(92dvh, 980px) !important;
    max-height: min(92dvh, 980px) !important;
    pointer-events: auto !important;
    border-radius: 14px;
  }

  body[data-ui="web"].web-triple-overlays.triple-overlays-active #talentsOverlay .talentsCard {
    position: fixed !important;
    left: calc(50% - var(--triple-col-width) - var(--triple-gap)) !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: var(--triple-col-width) !important;
    max-width: var(--triple-col-width) !important;
    height: min(92dvh, 980px) !important;
    max-height: min(92dvh, 980px) !important;
    pointer-events: auto !important;
    border-radius: 14px;
  }

  body[data-ui="web"].web-triple-overlays.triple-overlays-active #gearOverlay .gearCard {
    position: fixed !important;
    left: calc(50% + var(--triple-col-width) + var(--triple-gap)) !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: var(--triple-col-width) !important;
    max-width: var(--triple-col-width) !important;
    height: min(92dvh, 980px) !important;
    max-height: min(92dvh, 980px) !important;
    pointer-events: auto !important;
    border-radius: 14px;
  }
}
