/* =====================================================================
   InazumArcade v380 · MID/DEEP SURFACE CONTRAST TRUTH
   Frost / Crystal / Retro DS: foreground follows the surface that is
   actually painted, not the outer light-theme tone.
   - pale surface  -> dark copy (v379)
   - blue/deep/mid -> light copy (this file)
   No layout, image, hitbox, animation or gameplay changes.
   ===================================================================== */

body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l){
  --ia-v380-mid-text:#f8fbff;
  --ia-v380-mid-muted:#d3e2eb;
  --ia-v380-mid-shadow:0 1px 2px rgba(0,0,0,.72);
}

/* CAREER · these compact cards are explicitly painted with --ia-ui-deep.
   Main dashboard is excluded so v376 team identity keeps full priority. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#screen-career #careerRoot:not(:has(.career-dashboard-grid)) :is(
  .career-stat,.career-attr,.career-plan,.career-trophy-group,.career-table,.career-offer,.career-matchbox
){color:var(--ia-ui-deep-text,var(--ia-v380-mid-text))!important;text-shadow:var(--ia-v380-mid-shadow)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#screen-career #careerRoot:not(:has(.career-dashboard-grid)) :is(
  .career-stat,.career-attr,.career-plan,.career-trophy-group,.career-table,.career-offer,.career-matchbox
) :is(h1,h2,h3,h4,h5,h6,b,strong,label,legend,td,th,em){color:var(--ia-ui-deep-text,var(--ia-v380-mid-text))!important;text-shadow:var(--ia-v380-mid-shadow)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#screen-career #careerRoot:not(:has(.career-dashboard-grid)) :is(
  .career-stat,.career-attr,.career-plan,.career-trophy-group,.career-table,.career-offer,.career-matchbox
) :is(p,small,span,.meta,.muted){color:var(--ia-ui-deep-muted,var(--ia-v380-mid-muted))!important;text-shadow:var(--ia-v380-mid-shadow)!important}

/* BUILDER / LOBBY · roster rows and compact controls stay blue/deep. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
:is(#screen-builder,#screen-lobby) :is(
  .code-box,.private-code-eye,.timer,.role-tab,.player-row,.roster-mini .slot,
  .intl-team-card,.intl-player-row,.intl-role-overall,.intl-selected-banner
){color:var(--ia-ui-deep-text,var(--ia-v380-mid-text))!important;text-shadow:var(--ia-v380-mid-shadow)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
:is(#screen-builder,#screen-lobby) :is(
  .code-box,.private-code-eye,.timer,.role-tab,.player-row,.roster-mini .slot,
  .intl-team-card,.intl-player-row,.intl-role-overall,.intl-selected-banner
) :is(h1,h2,h3,h4,h5,h6,b,strong,span,label,.name,.val,em){color:var(--ia-ui-deep-text,var(--ia-v380-mid-text))!important;text-shadow:var(--ia-v380-mid-shadow)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#screen-builder :is(.player-row .origin,.roster-mini .slot.empty,.slot-title,.intl-player-row small,.intl-role-overall small){color:var(--ia-ui-deep-muted,var(--ia-v380-mid-muted))!important}

/* INDOVINAZUMA · guess/suggestion cells are deliberately dark controls. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#screen-indovinazuma :is(.ig-mode-btn,.ig-suggestions,.ig-suggestion-item,.ig-cell:not(.correct):not(.wrong)){color:var(--ia-ui-deep-text,var(--ia-v380-mid-text))!important;text-shadow:var(--ia-v380-mid-shadow)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#screen-indovinazuma :is(.ig-mode-btn,.ig-suggestions,.ig-suggestion-item,.ig-cell:not(.correct):not(.wrong)) :is(h1,h2,h3,h4,b,strong,p,span,small,label,em){color:inherit!important;text-shadow:inherit!important}

/* BOSSRUSH · dense blue/deep inventory/build/shop cards keep light copy. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#bossRushShell :is(
  .bossrush-stat,.bossrush-teamplate,.bossrush-relic,.bossrush-event,
  .br-inv-item,.br-shop-item,.br-resource,.br-target,.br-trait,.br-match-card,.br-match-team,.br-stat,.br-v110-mutator,
  .br-v198-artifact-card,.br-v198-artifact-choice,.br-v199-contract-choice,.br-v4-build-card,.br-v4-build-item,
  .br-v5-mini-card,.br-v5-relic-set,.br-endless-history-row
){color:var(--ia-ui-deep-text,var(--ia-v380-mid-text))!important;text-shadow:var(--ia-v380-mid-shadow)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#bossRushShell :is(
  .bossrush-stat,.bossrush-teamplate,.bossrush-relic,.bossrush-event,
  .br-inv-item,.br-shop-item,.br-resource,.br-target,.br-trait,.br-match-card,.br-match-team,.br-stat,.br-v110-mutator,
  .br-v198-artifact-card,.br-v198-artifact-choice,.br-v199-contract-choice,.br-v4-build-card,.br-v4-build-item,
  .br-v5-mini-card,.br-v5-relic-set,.br-endless-history-row
) :is(h1,h2,h3,h4,h5,h6,b,strong,span,label,em){color:var(--ia-ui-deep-text,var(--ia-v380-mid-text))!important;text-shadow:var(--ia-v380-mid-shadow)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#bossRushShell :is(
  .bossrush-stat,.bossrush-teamplate,.bossrush-relic,.bossrush-event,
  .br-inv-item,.br-shop-item,.br-resource,.br-target,.br-trait,.br-match-card,.br-match-team,.br-stat,.br-v110-mutator,
  .br-v198-artifact-card,.br-v198-artifact-choice,.br-v199-contract-choice,.br-v4-build-card,.br-v4-build-item,
  .br-v5-mini-card,.br-v5-relic-set,.br-endless-history-row
) :is(p,small,.muted,.meta,.desc,.description){color:var(--ia-ui-deep-muted,var(--ia-v380-mid-muted))!important;text-shadow:var(--ia-v380-mid-shadow)!important}

/* GALAXY · medium-blue data cards.  This fixes the roster rows from the
   screenshot and Minaccia / Tipo / Stato, plus every sibling built from
   the same deep material. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#galaxyDominationOverlay :is(
  .gd-player-card,.gd-mini,.gd-stat-pill,.gd-reward,.gd-module,
  .gd-chrono-condition-grid>*,.gd-temporal-trait
){color:var(--ia-ui-deep-text,var(--ia-v380-mid-text))!important;text-shadow:var(--ia-v380-mid-shadow)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#galaxyDominationOverlay :is(
  .gd-player-card,.gd-mini,.gd-stat-pill,.gd-reward,.gd-module,
  .gd-chrono-condition-grid>*,.gd-temporal-trait
) :is(h1,h2,h3,h4,h5,h6,b,strong,span,label,em,.gd-player-name,.gd-player-ovr,.gd-role){color:var(--ia-ui-deep-text,var(--ia-v380-mid-text))!important;text-shadow:var(--ia-v380-mid-shadow)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#galaxyDominationOverlay :is(
  .gd-player-card,.gd-mini,.gd-stat-pill,.gd-reward,.gd-module,
  .gd-chrono-condition-grid>*,.gd-temporal-trait
) :is(p,small,.muted,.meta,.sub,.desc,.description,.gd-player-sub){color:var(--ia-ui-deep-muted,var(--ia-v380-mid-muted))!important;text-shadow:var(--ia-v380-mid-shadow)!important}

/* Galaxy Squad Manager has a pale shell but explicitly deep nested modules. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#galaxyDominationOverlay #gdSquadManager :is(
  .gd-squad-box,.gd-formation-btn,.gd-squad-summary,.gd-bench-card,.gd-lineup-slot,.gd-player-detail
){color:var(--ia-ui-deep-text,var(--ia-v380-mid-text))!important;text-shadow:var(--ia-v380-mid-shadow)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#galaxyDominationOverlay #gdSquadManager :is(
  .gd-squad-box,.gd-formation-btn,.gd-squad-summary,.gd-bench-card,.gd-lineup-slot,.gd-player-detail
) :is(h1,h2,h3,h4,h5,h6,b,strong,label,em,.gd-squad-box-head,.gd-lineup-chip b,.gd-lineup-chip em){color:var(--ia-ui-deep-text,var(--ia-v380-mid-text))!important;text-shadow:var(--ia-v380-mid-shadow)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#galaxyDominationOverlay #gdSquadManager :is(
  .gd-squad-box,.gd-formation-btn,.gd-squad-summary,.gd-bench-card,.gd-lineup-slot,.gd-player-detail
) :is(p,small,span,.muted,.meta,.gd-stat-row,.slot-label){color:var(--ia-ui-deep-muted,var(--ia-v380-mid-muted))!important;text-shadow:var(--ia-v380-mid-shadow)!important}

/* MATCHES · small stat blocks/visualizer use --ia-match-deep even inside a
   light match skin, so they must never inherit the dark outer foreground. */
body:is([data-ia-match-skin="frost"],[data-ia-match-skin="crystal"],[data-ia-match-skin="ds"],[data-ia-match-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
.match-modal :is(.mm-overall-stat,.ia-match-visual,.ia-match-visual-head){color:#f8fbff!important;text-shadow:0 1px 2px rgba(0,0,0,.72)!important}
body:is([data-ia-match-skin="frost"],[data-ia-match-skin="crystal"],[data-ia-match-skin="ds"],[data-ia-match-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
.match-modal :is(.mm-overall-stat,.ia-match-visual,.ia-match-visual-head) :is(h1,h2,h3,h4,b,strong,span,label,em){color:#f8fbff!important;text-shadow:0 1px 2px rgba(0,0,0,.72)!important}
body:is([data-ia-match-skin="frost"],[data-ia-match-skin="crystal"],[data-ia-match-skin="ds"],[data-ia-match-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
.match-modal :is(.mm-overall-stat,.ia-match-visual,.ia-match-visual-head) :is(p,small,.muted,.meta){color:#d3e2eb!important;text-shadow:0 1px 2px rgba(0,0,0,.72)!important}

/* Secondary labels on deep Galaxy chips stay softer, but still light. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"]):not(#ia380a#ia380b#ia380c#ia380d#ia380e#ia380f#ia380g#ia380h#ia380i#ia380j#ia380k#ia380l)
#galaxyDominationOverlay :is(.gd-mini,.gd-stat-pill) span{color:var(--ia-ui-deep-muted,var(--ia-v380-mid-muted))!important;text-shadow:var(--ia-v380-mid-shadow)!important}

/* IA V788 bundle separator: original stylesheet rules preserved */
/* =====================================================================
   InazumArcade v382 · TEXT-ONLY CONTRAST FIX
   Base: v380.  Deliberately changes ONLY foreground/readability.
   No background, background-image, gradient, border, shadow-box, layout,
   animation, hitbox or gameplay declarations live in this file.
   ===================================================================== */

/* Light interface skins: BossRush/Endless rail uses two materially different
   cards. Inactive cards are native deep-blue; current card is native pale. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-stage-item:not(.current) b{
  color:#edf8ff!important;
  text-shadow:0 1px 3px rgba(0,0,0,.78)!important;
}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-stage-item:not(.current) small{
  color:#b9d7e9!important;
  text-shadow:0 1px 3px rgba(0,0,0,.72)!important;
}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-stage-item.current b{
  color:#142a3b!important;
  text-shadow:none!important;
}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-stage-item.current small{
  color:#4d6576!important;
  text-shadow:none!important;
}

/* Cycle box stays a native deep-blue surface. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-phasebox .k{color:#9dd7ff!important;text-shadow:0 1px 3px rgba(0,0,0,.72)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-phasebox .n{color:#fff!important;text-shadow:0 1px 3px rgba(0,0,0,.78)!important}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-phasebox .s{color:#c7e0ef!important;text-shadow:0 1px 3px rgba(0,0,0,.72)!important}

/* Loose copy directly over the authored photographic hero must be light. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-hero > h2,
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-hero > p,
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-hero-kicker b,
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-hero-loc,
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-overlay-note{
  color:#f7fbff!important;
  text-shadow:0 2px 9px rgba(0,0,0,.92)!important;
}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-hero-loc small{
  color:#c7dfed!important;
  text-shadow:0 2px 8px rgba(0,0,0,.90)!important;
}

/* Team cards inside the hero are light under these UI skins: keep their copy
   dark. This intentionally overrides the photo-copy rule only inside them. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-hero .brx-team,
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-hero .brx-team :is(h1,h2,h3,h4,h5,h6,b,strong,p,span,small,label,em){
  color:#172b3b!important;
  text-shadow:none!important;
}

/* Contracts/shop are photographic cards, but Endless inserts a pale contract
   detail card inside the photo. Outer photo copy stays light; inner detail is
   dark. No surface declaration is changed here. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-action-card .brx-action-head :is(h1,h2,h3,h4,b,strong,p,span,small,label,em),
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-action-card > :is(h1,h2,h3,h4,p,small){
  color:#f7fbff!important;
  text-shadow:0 2px 9px rgba(0,0,0,.92)!important;
}
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .br-endless-contract-detail,
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .br-endless-contract-detail :is(h1,h2,h3,h4,h5,h6,b,strong,p,span,small,label,em){
  color:#172b3b!important;
  text-shadow:none!important;
}

/* Card CTA is authored as a dark strip even inside the photo card. */
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-card-btn,
body:is([data-ia-ui-skin="frost"],[data-ia-ui-skin="crystal"],[data-ia-ui-skin="ds"],[data-ia-ui-skin="retro"])
#bossRushShell.brx-shell .brx-card-btn :is(b,strong,span,small,em){
  color:#f7fbff!important;
  text-shadow:0 1px 3px rgba(0,0,0,.78)!important;
}

/* IA V788 bundle separator: original stylesheet rules preserved */
/* =====================================================================
   InazumArcade v383 · FROST DARKER SURFACES
   Goal: Frost stays readable in UI / Match / Profile / Bracket / Album.
   Scope: only Frost variables, no layout/gameplay changes.
   ===================================================================== */

body[data-ia-ui-skin="frost"]:not(#ia383a#ia383b#ia383c#ia383d){
  --ia-ui-surface:linear-gradient(150deg,#2f5870,#1b3f56)!important;
  --ia-ui-surface-2:linear-gradient(150deg,#3a6981,#234b62)!important;
  --ia-ui-border:#95bfd6!important;
  --ia-ui-text:#f4fbff!important;
  --ia-ui-muted:#d0e1eb!important;
  --ia-ui-accent:#a9e9ff!important;
  --ia-ui-btn:linear-gradient(160deg,#5b8aa5,#2b5873)!important;
  --ia-ui-btn-text:#f9fdff!important;
  --ia-ui-input:linear-gradient(160deg,#21475e,#17374a)!important;
  --ia-ui-input-text:#f4fbff!important;
  --ia-ui-deep:#143247!important;
  --ia-ui-deep-text:#f6fcff!important;
  --ia-ui-deep-muted:#cfe2ed!important;
}

body[data-ia-match-skin="frost"]:not(#ia383a#ia383b#ia383c#ia383d){
  --ia-match-bg:linear-gradient(150deg,#163247,#2d5770)!important;
  --ia-match-panel:rgba(24,58,79,.95)!important;
  --ia-match-border:#93bfd7!important;
  --ia-match-text:#f5fbff!important;
  --ia-match-muted:#d1e0ea!important;
  --ia-match-accent:#ace9ff!important;
  --ia-match-score:linear-gradient(90deg,#0c2234,#28556f,#0c2234)!important;
  --ia-match-column:rgba(16,42,58,.90)!important;
  --ia-match-deep:#112d41!important;
}

body[data-ia-profile-skin="frost"]:not(#ia383a#ia383b#ia383c#ia383d){
  --ia-profile-bg:linear-gradient(150deg,#163147,#2e5970)!important;
  --ia-profile-panel:rgba(20,54,75,.92)!important;
  --ia-profile-border:#92bdd5!important;
  --ia-profile-text:#f5fbff!important;
  --ia-profile-muted:#d0e0ea!important;
  --ia-profile-accent:#ace8ff!important;
  --ia-profile-chip:rgba(122,190,221,.16)!important;
}

body[data-ia-bracket-skin="frost"]:not(#ia383a#ia383b#ia383c#ia383d){
  --ia-br-bg:linear-gradient(150deg,#153146,#2a546c)!important;
  --ia-br-card:linear-gradient(180deg,#2a5873,#17394d)!important;
  --ia-br-border:#93bed6!important;
  --ia-br-text:#f5fbff!important;
  --ia-br-muted:#d0e0ea!important;
  --ia-br-accent:#a8e6ff!important;
  --ia-br-win:rgba(169,230,255,.16)!important;
}

body[data-ia-album-skin="frost"]:not(#ia383a#ia383b#ia383c#ia383d){
  --ia-album-card:linear-gradient(150deg,#2a5670,#17384b)!important;
  --ia-album-border:#92bdd5!important;
  --ia-album-text:#f5fbff!important;
  --ia-album-muted:#d0e0ea!important;
  --ia-album-accent:#aae7ff!important;
  --ia-album-sigil:linear-gradient(145deg,#5f92af,#234d67)!important;
}

/* IA V788 bundle separator: original stylesheet rules preserved */
/* =====================================================================
   InazumArcade v388 · FINAL SAFE PERFORMANCE + PHONE/THEME HARDENING
   - no gameplay/state/timer changes
   - no palette overrides
   - phone runtime wins over width-only desktop breakpoints
   - reduces expensive purely-cosmetic paint on touch phones
   ===================================================================== */

/* ---------- Safe rendering budget for long, static scroll collections ---------- */
@supports (content-visibility:auto){
  #iaModeEncyclopedia .ia-mode-ency-section,
  #careerEncyclopedia .career-ency-section,
  #bossRushEncyclopedia :is(.br-v4-ency-card,.br-v4-ency-section,.br-ency-section),
  #profileModalRoot :is(.achievement-card,.ia-hall-card,.ia-mastery-card,.ia99-mode-card),
  #gdPlayerAlbum .gd-album-card{
    content-visibility:auto;
    contain-intrinsic-size:auto 120px;
  }
}

/* ---------- Touch devices do not need hover-only transform/filter work ---------- */
@media (pointer:coarse){
  :is(#iaNavbarThemePicker .ia-theme-option,#ffMenuRoot .ff-hq-card,#ffMenuRoot .ffi-hub-card,
      #galaxyDominationOverlay .gd-player-card,#bossRushShell .bossrush-choice,
      #bossRushShell .br-shop-item,#bossRushShell .br-inv-item){
    transition-property:background-color,border-color,color,opacity!important;
  }
  :is(#iaNavbarThemePicker .ia-theme-option,#ffMenuRoot .ff-hq-card,#ffMenuRoot .ffi-hub-card,
      #galaxyDominationOverlay .gd-player-card,#bossRushShell .bossrush-choice):hover{
    transform:none!important;
    filter:none!important;
  }
}

/* ---------- Phone paint budget: remove blur only, keep the actual theme/background ---------- */
html.ia-real-phone-mode :is(
  #iaNavbarThemePicker,
  .br-match-overlay,.br-v5-mini-overlay,.br-v199-contract-overlay,.br-endless-history-overlay,
  .br-ency-overlay,#bossRushEncyclopedia,
  .ia266-report-overlay,.ia-fan-picker-overlay,.ia-power-lab-overlay,.ia-magic-debug-overlay,
  .ia-magic-debug-preview,.ia276-feature-lab,.ia276-feature-preview,.career-v275-debug-overlay,
  #iaSOSRecoveryModal,#iaMaterialLab,#iaOnboardingRoot,#iaPhoneSimulator,
  .ff95-leadership-overlay,.ffi95-plan-overlay,.career-v200-overlay,
  #iaErrorShield,#iaV289BossScoreDebug,.ia-custom-debug-lab,.ia-custom-debug-preview
){
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}

/* ---------- Real-phone customization hub ---------- */
html.ia-real-phone-mode #iaNavbarThemePicker{
  box-sizing:border-box!important;
  left:max(8px,env(safe-area-inset-left))!important;
  right:max(8px,env(safe-area-inset-right))!important;
  top:calc(var(--ia-phone-nav-end,61px) + 6px)!important;
  width:auto!important;
  max-width:none!important;
  max-height:calc(100dvh - var(--ia-phone-nav-end,61px) - 14px - env(safe-area-inset-bottom))!important;
  padding:12px!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
}
html.ia-real-phone-mode #iaNavbarThemePicker .ia-theme-head{
  top:-12px!important;margin:-12px -12px 10px!important;padding:12px!important;
}
html.ia-real-phone-mode #iaNavbarThemePicker :is(.ia-custom-category-nav,.ia-theme-grid){
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:7px!important;
}
html.ia-real-phone-mode #iaNavbarThemePicker :is(.ia-theme-option,.ia-custom-category-btn){min-width:0!important}
html.ia-real-phone-mode #iaNavbarThemePicker :is(strong,small,b,p,em){overflow-wrap:anywhere!important}
html.ia-real-phone-mode.ia-phone-portrait #iaNavbarThemePicker :is(.ia-custom-category-nav,.ia-theme-grid){grid-template-columns:1fr!important}
html.ia-real-phone-mode.ia-phone-landscape #iaNavbarThemePicker .ia-theme-option{min-height:72px!important}

/* Debug previews opened from Personalizzazione must also fit phones. */
html.ia-real-phone-mode :is(.ia-custom-debug-lab,.ia-custom-debug-preview){
  padding:calc(var(--ia-phone-nav-end,61px) + 6px) 8px max(8px,env(safe-area-inset-bottom))!important;
  align-items:flex-start!important;overflow:auto!important;
}
html.ia-real-phone-mode .ia-custom-debug-lab-card{width:100%!important;max-width:none!important;max-height:none!important;min-width:0!important}
html.ia-real-phone-mode :is(.ia-custom-debug-grid,.ia-custom-ui-demo,.ia-custom-fake-rounds){grid-template-columns:1fr!important}
html.ia-real-phone-mode .ia-custom-debug-album .gd-album-grid{grid-template-columns:1fr!important}

/* ---------- FF / FFI redesigned HQ: phone class beats width-only media queries ---------- */
html.ia-real-phone-mode #ffMenuRoot :is(.ff-hq-overlay,.ffi-hub-overlay){
  padding:calc(var(--ia-phone-nav-end,61px) + 8px) 8px max(12px,env(safe-area-inset-bottom))!important;
  align-items:flex-start!important;justify-content:center!important;
  overflow-x:hidden!important;overflow-y:auto!important;
}
html.ia-real-phone-mode #ffMenuRoot :is(.ff-hq-panel,.ffi-command-panel){
  box-sizing:border-box!important;width:100%!important;max-width:none!important;min-width:0!important;
  padding:14px!important;margin:0!important;
}
html.ia-real-phone-mode #ffMenuRoot :is(.ff-hq-header,.ffi-command-head){align-items:flex-start!important;flex-wrap:wrap!important;gap:8px!important}
html.ia-real-phone-mode #ffMenuRoot :is(.ff-hq-status,.ffi-command-live){display:none!important}
html.ia-real-phone-mode #ffMenuRoot .ff-hq-grid{grid-template-columns:1fr!important;grid-template-rows:auto!important;gap:9px!important}
html.ia-real-phone-mode #ffMenuRoot .ff-hq-solo{
  grid-row:auto!important;grid-template-columns:1fr!important;min-height:0!important;padding:18px!important;
  background-position:62% center!important;
}
html.ia-real-phone-mode #ffMenuRoot .ff-hq-card-copy{width:100%!important;min-width:0!important;max-width:100%!important}
html.ia-real-phone-mode #ffMenuRoot .ff-hq-solo h3{font-size:clamp(25px,7vw,31px)!important}
html.ia-real-phone-mode #ffMenuRoot .ff-hq-solo p{max-width:100%!important}
html.ia-real-phone-mode #ffMenuRoot .ff-hq-tournament-visual{display:none!important}
html.ia-real-phone-mode #ffMenuRoot .ff-hq-multi{min-height:104px!important;padding:15px!important;grid-template-columns:38px minmax(0,1fr) auto!important}
html.ia-real-phone-mode #ffMenuRoot .ff-hq-road{grid-template-columns:1fr 1fr!important;gap:7px!important;padding:9px!important}
html.ia-real-phone-mode #ffMenuRoot .ff-hq-road-link{display:none!important}
html.ia-real-phone-mode #ffMenuRoot .ff-hq-road-node b{white-space:normal!important;overflow-wrap:anywhere!important}

html.ia-real-phone-mode #ffMenuRoot .ffi-command-shell{grid-template-columns:1fr!important;gap:9px!important}
html.ia-real-phone-mode #ffMenuRoot :is(.ffi-command-team,.ffi-world-stage){min-width:0!important;min-height:0!important}
html.ia-real-phone-mode #ffMenuRoot .ffi-command-team{background-position:60% center!important}
html.ia-real-phone-mode #ffMenuRoot .ffi-world-stage{height:390px!important;background-position:center center!important}
html.ia-real-phone-mode #ffMenuRoot .ffi-command-intel{grid-column:auto!important;grid-template-columns:1fr!important;gap:8px!important}
html.ia-real-phone-mode #ffMenuRoot .ffi-command-phases{grid-template-columns:1fr!important;gap:7px!important}
html.ia-real-phone-mode #ffMenuRoot .ffi-command-head h2{font-size:23px!important}
html.ia-real-phone-mode #ffMenuRoot .ffi-world-nation{max-width:102px!important;font-size:6.4px!important;padding:4px 6px!important}
html.ia-real-phone-mode.ia-phone-landscape #ffMenuRoot .ffi-world-stage{height:330px!important}

/* ---------- Theme-safe phone geometry: themes may repaint, never widen ---------- */
html.ia-real-phone-mode body:is([data-ia-ui-skin],[data-ia-match-skin],[data-ia-profile-skin],[data-ia-bracket-skin],[data-ia-album-skin])
:is(
  #ffMenuRoot .ff-hq-card,#ffMenuRoot .ffi-hub-card,
  #bossRushShell .bossrush-cardpanel,#bossRushShell .bossrush-choice,#bossRushShell .brx-panel,#bossRushShell .brx-team,#bossRushShell .brx-action-card,
  #galaxyDominationOverlay .gd-panel,#galaxyDominationOverlay .gd-module,#galaxyDominationOverlay .gd-player-card,#galaxyDominationOverlay .gd-album-card,
  #profileModalRoot .profile-panel,#profileModalRoot .achievement-card,#profileModalRoot .ia-hall-card,
  #iaModeEncyclopedia .ia-mode-ency-card,#iaModeEncyclopedia .ia-mode-ency-section,
  #screen-career .career-panel,#screen-career .career-dashboard-card,
  #screen-indovinazuma .ig-mode-btn,#screen-indovinazuma .ig-cell
){
  box-sizing:border-box!important;min-width:0!important;max-width:100%!important;
}
html.ia-real-phone-mode body:is([data-ia-ui-skin],[data-ia-match-skin],[data-ia-profile-skin],[data-ia-bracket-skin],[data-ia-album-skin])
:is(#ffMenuRoot,#bossRushShell,#galaxyDominationOverlay,#profileModalRoot,#iaModeEncyclopedia,#screen-career,#screen-indovinazuma)
:is(h1,h2,h3,h4,h5,h6,p,small,b,strong,label,span){
  overflow-wrap:anywhere;
}

/* ---------- Profile / achievements / hall: one phone scroller, no horizontal escape ---------- */
html.ia-real-phone-mode #profileModalRoot .modal-overlay{
  box-sizing:border-box!important;overflow-x:hidden!important;overflow-y:auto!important;
  padding:calc(var(--ia-phone-nav-end,61px) + 7px) 8px max(10px,env(safe-area-inset-bottom))!important;
  align-items:flex-start!important;
}
html.ia-real-phone-mode #profileModalRoot :is(.profile-panel,.ia-achievements-modal,.ia-hall-modal,.ia-progression-modal){
  width:100%!important;max-width:none!important;min-width:0!important;max-height:none!important;margin:0 auto!important;
}
html.ia-real-phone-mode #profileModalRoot :is(.ia-hall-grid,.ia99-mode-grid,.ia-progress-grid){grid-template-columns:1fr!important}
html.ia-real-phone-mode.ia-phone-landscape #profileModalRoot :is(.ia-hall-grid,.ia99-mode-grid,.ia-progress-grid){grid-template-columns:repeat(2,minmax(0,1fr))!important}

/* ---------- BossRush / Endless final phone containment ---------- */
html.ia-real-phone-mode #bossRushShell{max-width:100vw!important;overflow-x:hidden!important}
html.ia-real-phone-mode #bossRushShell :is(.brx-shell,.brx15-unified,.bossrush-cardpanel,.br-choice-content){min-width:0!important;max-width:100%!important}
html.ia-real-phone-mode #bossRushShell :is(.brx-team,.brx-panel,.brx-action-card,.br-endless-contract-detail){overflow-wrap:anywhere!important}

/* ---------- Galaxy/Album final containment, existing native phone layout stays authoritative ---------- */
html.ia-real-phone-mode #galaxyDominationOverlay :is(.gd-panel,.gd-module,.gd-player-card,.gd-album-card,.gd-squad-box,.gd-bench-card){min-width:0!important;max-width:100%!important}
html.ia-real-phone-mode #galaxyDominationOverlay :is(.gd-player-name,.gd-player-sub,.gd-module b,.gd-module small){overflow-wrap:anywhere!important}

/* Short landscape phones need every modal to respect the real dynamic height. */
html.ia-real-phone-mode.ia-phone-landscape :is(#iaNavbarThemePicker,#profileModalRoot .profile-panel,#iaModeEncyclopedia .ia-mode-ency-card){
  max-height:calc(100dvh - var(--ia-phone-nav-end,61px) - 12px)!important;
}

/* IA V788 bundle separator: original stylesheet rules preserved */
/* =====================================================================
   InazumArcade v390 · PHONE NAV + GALAXY MATCH FIT/PERF
   Phone-only geometry/paint rules. No gameplay values, AI, timers or saves.
   ===================================================================== */

/* Personalizzazione lives beside the mode strip on real phones, never in the
   fullscreen/report cluster. The desktop position is untouched. */
html.ia-real-phone-mode.ia-phone-landscape .topbar .ia270-report-wrap > #iaNavbarThemeTrigger{
  position:fixed!important;
  top:10px!important;
  left:clamp(300px,44vw,404px)!important;
  right:auto!important;
  transform:none!important;
  width:34px!important;min-width:34px!important;max-width:34px!important;
  height:34px!important;min-height:34px!important;max-height:34px!important;
  margin:0!important;padding:0!important;
  z-index:2147482100!important;
}
html.ia-real-phone-mode.ia-phone-landscape .topbar .ia270-report-wrap > #iaNavbarThemeTrigger svg{
  width:18px!important;height:18px!important;
}
/* The fullscreen control keeps its own corner; explicitly isolate its box so
   no theme/palette positioning rule can steal that slot. */
html.ia-real-phone-mode #iaFullscreenBtn{
  z-index:2147482050!important;
}

/* Galaxy phone match: the five normal commands fit in one row on normal
   portrait phones. The runtime JS mirrors this and handles extra-narrow widths. */
html.ia-real-phone-mode #gdMatchWrap #iaGalaxyPhoneDock .ia-gd-phone-actions{
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  align-items:center!important;
}
html.ia-real-phone-mode #gdMatchWrap #iaGalaxyPhoneDock .ia-gd-phone-actions button{
  min-width:0!important;max-width:100%!important;
  overflow:hidden!important;text-overflow:ellipsis!important;
}
@media(max-width:349px){
  html.ia-real-phone-mode #gdMatchWrap #iaGalaxyPhoneDock .ia-gd-phone-actions{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
}

/* Runtime set-piece styles are injected late in Galaxy. Use the actual IDs and
   high specificity as a CSS fallback; v390 phone JS also writes these dimensions
   inline so kickoff/free-kick UI cannot become a tall desktop card again. */
html.ia-real-phone-mode body #galaxyDominationOverlay #gdMatchWrap #iaGalaxyPhoneDock #gd57SetPiecePanel{
  position:relative!important;inset:auto!important;
  display:grid!important;
  grid-template-columns:minmax(72px,.72fr) minmax(0,1.55fr) auto!important;
  align-items:center!important;gap:5px!important;
  width:100%!important;max-width:100%!important;
  height:44px!important;min-height:44px!important;max-height:44px!important;
  margin:0!important;padding:3px!important;
  overflow:hidden!important;transform:none!important;
  background:transparent!important;border:0!important;
}
html.ia-real-phone-mode body #galaxyDominationOverlay #gdMatchWrap #iaGalaxyPhoneDock #gd57SetPiecePanel > :is(p,small){display:none!important}
html.ia-real-phone-mode body #galaxyDominationOverlay #gdMatchWrap #iaGalaxyPhoneDock #gd57SetPiecePanel > b{
  font-size:9px!important;line-height:1.05!important;max-height:30px!important;
  overflow:hidden!important;white-space:normal!important;
}
html.ia-real-phone-mode body #galaxyDominationOverlay #gdMatchWrap #iaGalaxyPhoneDock #gd57SetPiecePanel > :is(#gd57ReadySetPiece,#gd335SetPieceSubs){
  position:relative!important;inset:auto!important;
  height:36px!important;min-height:36px!important;
  margin:0!important;padding:3px 5px!important;font-size:9px!important;
}

/* Safe phone paint containment: cuts repaint spill from the live canvas/HUD,
   without changing canvas resolution or the simulation. */
html.ia-real-phone-mode #galaxyDominationOverlay #gdMatchWrap > .gd-match-top,
html.ia-real-phone-mode #galaxyDominationOverlay #gdMatchWrap #gdPitchShell,
html.ia-real-phone-mode #galaxyDominationOverlay #gdMatchWrap #iaGalaxyPhoneDock{
  contain:layout paint!important;
}
html.ia-real-phone-mode #galaxyDominationOverlay #gdMatchWrap #gdPitchShell,
html.ia-real-phone-mode #galaxyDominationOverlay #gdMatchWrap #iaGalaxyPhoneDock{
  box-shadow:none!important;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
html.ia-real-phone-mode #galaxyDominationOverlay #gdMatchWrap :is(.gd-chrono-flash,.gd-shot-ready,.gd-match-message){
  will-change:auto!important;
}

/* IA V788 bundle separator: original stylesheet rules preserved */
/* =====================================================================
   InazumArcade v391 · PHONE UI / TOUCH / NAV FIX
   Phone-only geometry. No gameplay, AI, timer or save changes.
   ===================================================================== */

/* --- Personalizzazione: real slot immediately after Career. --- */
html.ia-real-phone-mode.ia-phone-landscape #modeNavBar .mode-nav-inner > #iaNavbarThemeTrigger.ia-phone-theme-in-modebar{
  position:relative!important;inset:auto!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
  transform:none!important;flex:0 0 50px!important;width:50px!important;min-width:50px!important;max-width:50px!important;
  height:49px!important;min-height:49px!important;max-height:49px!important;margin:0!important;padding:3px!important;
  display:grid!important;place-items:center!important;border-radius:11px!important;
  border:1px solid var(--ia-nav-btn-border,rgba(103,219,255,.34))!important;
  background:var(--ia-nav-btn-bg,rgba(8,25,48,.92))!important;
  color:var(--ia-nav-theme-icon,#8de8ff)!important;
  box-shadow:0 4px 11px rgba(0,0,0,.24),inset 0 1px rgba(255,255,255,.035)!important;
  z-index:auto!important;clip-path:none!important;
}
html.ia-real-phone-mode.ia-phone-landscape #modeNavBar .mode-nav-inner > #iaNavbarThemeTrigger.ia-phone-theme-in-modebar svg{
  width:24px!important;height:24px!important;display:block!important;
}
html.ia-real-phone-mode.ia-phone-landscape #modeNavBar .mode-nav-inner{
  overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:none!important;
}
html.ia-real-phone-mode.ia-phone-landscape #modeNavBar .mode-nav-inner::-webkit-scrollbar{display:none!important}

/* --- Galaxy portrait: scoreboard, resource strip, pitch are separate rows. --- */
html.ia-real-phone-mode.ia-phone-portrait #galaxyDominationOverlay #gdMatchWrap.gd-match-wrap > .gd-match-top{
  flex:0 0 58px!important;height:58px!important;min-height:58px!important;max-height:58px!important;
  grid-template-columns:minmax(0,1fr) 96px minmax(0,1fr)!important;
  padding:4px 8px!important;overflow:hidden!important;
}
html.ia-real-phone-mode.ia-phone-portrait #galaxyDominationOverlay #gdMatchWrap .gd-scorebox{
  width:96px!important;min-width:96px!important;max-width:96px!important;height:54px!important;min-height:54px!important;
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;
}
html.ia-real-phone-mode.ia-phone-portrait #galaxyDominationOverlay #gdMatchWrap .gd-score{font-size:23px!important;height:23px!important;min-height:23px!important;line-height:23px!important}
html.ia-real-phone-mode.ia-phone-portrait #galaxyDominationOverlay #gdMatchWrap .gd-clock{height:11px!important;min-height:11px!important;line-height:11px!important;font-size:10px!important}
html.ia-real-phone-mode.ia-phone-portrait #galaxyDominationOverlay #gdMatchWrap .gd335-half-label{margin-top:1px!important;font-size:8px!important;line-height:9px!important}
html.ia-real-phone-mode.ia-phone-portrait body > #iaGalaxyPhoneStatsBar.ia-gd-constant-stats{
  top:60px!important;height:21px!important;min-height:21px!important;max-height:21px!important;
}

/* Six commands are a balanced 3x2 grid, never 5 + 1. */
html.ia-real-phone-mode.ia-phone-portrait #gdMatchWrap #iaGalaxyPhoneDock .ia-gd-phone-actions{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
/* Set-piece has only instruction + start button; CAMBI already exists in the command grid. */
html.ia-real-phone-mode #gdMatchWrap #iaGalaxyPhoneDock #gd335SetPieceSubs{display:none!important}
html.ia-real-phone-mode #gdMatchWrap #iaGalaxyPhoneDock #gd57SetPiecePanel{
  grid-template-columns:minmax(112px,.82fr) minmax(0,1.65fr)!important;
}

/* --- Squad manager: one scroll owner on phone, no nested touch trap. --- */
html.ia-real-phone-mode #galaxyDominationOverlay #gdSquadManager{
  overflow-x:hidden!important;overflow-y:auto!important;touch-action:pan-y!important;
  -webkit-overflow-scrolling:touch!important;overscroll-behavior-y:contain!important;
}
html.ia-real-phone-mode #galaxyDominationOverlay #gdSquadManager :is(.gd-squad-shell,.gd-squad-main,.gd-roster-pane){
  max-height:none!important;overflow:visible!important;touch-action:pan-y!important;
}
html.ia-real-phone-mode #galaxyDominationOverlay #gdSquadManager .gd-bench-list{
  height:auto!important;min-height:0!important;max-height:none!important;
  overflow:visible!important;overscroll-behavior:auto!important;touch-action:pan-y!important;
  -webkit-overflow-scrolling:auto!important;
}
html.ia-real-phone-mode #galaxyDominationOverlay #gdSquadManager :is(.gd-bench-card,.gd-lineup-chip,.gd335-bench-toggle){
  touch-action:pan-y!important;
}
html.ia-real-phone-mode #galaxyDominationOverlay #gdSquadManager input{touch-action:auto!important}
html.ia-real-phone-mode.ia-phone-landscape .topbar .ia270-report-wrap > #iaNavbarThemeTrigger:not(.ia-phone-theme-in-modebar){visibility:hidden!important}
html.ia-real-phone-mode.ia-phone-landscape #modeNavBar .mode-nav-inner > #iaNavbarThemeTrigger.ia-phone-theme-in-modebar:hover,
html.ia-real-phone-mode.ia-phone-landscape #modeNavBar .mode-nav-inner > #iaNavbarThemeTrigger.ia-phone-theme-in-modebar[aria-expanded="true"]{
  background:var(--ia-nav-btn-hover,rgba(18,48,78,.96))!important;border-color:var(--ia-nav-accent1,#67ddff)!important;filter:none!important;
}

/* IA V788 bundle separator: original stylesheet rules preserved */
/* =====================================================================
   InazumArcade v393 · PHONE HOME PROFILE FRAME FIT — corrected
   Keep the original full framed-card geometry. On real phones only,
   pull the inner blue surface slightly farther inside the artwork.
   IMPORTANT: do not collapse the inner card to content height.
   ===================================================================== */

html.ia-real-phone-mode #screen-home .ia-profile-panel.ia99-frame-surface{
  box-sizing:border-box!important;
  overflow:visible!important;
}

/* Preserve the original absolute fill model; only increase the safe inset. */
html.ia-real-phone-mode #screen-home .ia-profile-panel.ia99-frame-surface > .ia-panel-inner{
  position:absolute!important;
  width:auto!important;
  max-width:none!important;
  height:auto!important;
  min-height:0!important;
  inset:30px 20px 26px!important;
  margin:0!important;
  padding:10px 16px 44px!important;
  border-radius:16px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}

html.ia-real-phone-mode #screen-home .ia-profile-panel .ia-profile-main{
  margin-top:8px!important;
}
html.ia-real-phone-mode #screen-home .ia-profile-panel .ia-profile-stats{
  margin-top:7px!important;
  padding-top:6px!important;
}

/* Restore the established bottom anchoring for the two actions. */
html.ia-real-phone-mode #screen-home .ia-profile-panel .ia-profile-actions{
  position:absolute!important;
  left:16px!important;
  right:16px!important;
  bottom:14px!important;
  width:auto!important;
  margin:0!important;
  padding:0!important;
  gap:8px!important;
}
html.ia-real-phone-mode #screen-home .ia-profile-panel .ia-profile-hall-btn{
  min-height:25px!important;
  height:25px!important;
  padding:3px 8px!important;
}

/* Landscape phones are the case shown in the report: a touch more side/bottom safety,
   but keep the panel filling the frame instead of shrinking to its content. */
@media (orientation:landscape) and (max-height:560px){
  html.ia-real-phone-mode #screen-home .ia-profile-panel.ia99-frame-surface > .ia-panel-inner{
    inset:30px 20px 28px!important;
    padding:9px 15px 42px!important;
  }
  html.ia-real-phone-mode #screen-home .ia-profile-panel .ia-profile-actions{
    left:15px!important;
    right:15px!important;
    bottom:13px!important;
  }
}

/* IA V788 bundle separator: original stylesheet rules preserved */
/* InazumArcade v398 · FF Online free Internet relay + lobby controls
   Additive UI only: no bracket/gameplay geometry changes. */

#screen-lobby .ia397-network-state{
  margin:12px 0 10px;
  padding:8px 11px;
  border:1px solid rgba(95,205,255,.22);
  border-radius:10px;
  background:rgba(3,20,35,.58);
  color:var(--text-dim,#b9d5e4);
  font:800 12px/1.25 'Baloo 2',system-ui,sans-serif;
  letter-spacing:.02em;
}

#screen-lobby .ia397-member-row{
  gap:10px;
}

#screen-lobby .ia397-member-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

#screen-lobby .ia397-kick-btn{
  appearance:none;
  border:1px solid rgba(255,105,105,.44);
  border-radius:999px;
  background:rgba(108,20,28,.34);
  color:#ffd7d7;
  min-height:28px;
  padding:4px 10px;
  font:900 11px/1 'Baloo 2',system-ui,sans-serif;
  letter-spacing:.08em;
  cursor:pointer;
  touch-action:manipulation;
  transition:transform .15s ease,border-color .15s ease,background .15s ease;
}
#screen-lobby .ia397-kick-btn:hover{
  transform:translateY(-1px);
  border-color:rgba(255,125,125,.72);
  background:rgba(135,27,36,.48);
}
#screen-lobby .ia397-kick-btn:active{transform:translateY(0) scale(.97)}

#screen-lobby .ia397-lobby-leave{
  margin-left:auto;
  border-color:rgba(255,115,115,.34)!important;
  color:#ffd3d3!important;
  background:rgba(90,18,28,.26)!important;
}
#screen-lobby .ia397-lobby-leave:hover{
  border-color:rgba(255,125,125,.62)!important;
  background:rgba(118,24,34,.38)!important;
}

html.ia-real-phone-mode #screen-lobby .ia397-member-row{
  align-items:flex-start;
}
html.ia-real-phone-mode #screen-lobby .ia397-member-actions{
  max-width:68%;
}
html.ia-real-phone-mode #screen-lobby .ia397-lobby-actions{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px!important;
}
html.ia-real-phone-mode #screen-lobby .ia397-lobby-actions>.btn{
  width:100%;
  min-width:0;
  margin:0!important;
  white-space:normal;
}

@media (max-width:560px){
  #screen-lobby .ia397-member-row{
    align-items:flex-start;
  }
  #screen-lobby .ia397-member-actions{
    max-width:70%;
  }
  #screen-lobby .ia397-lobby-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr;
    gap:8px!important;
  }
  #screen-lobby .ia397-lobby-actions>.btn{
    width:100%;
    min-width:0;
    margin:0!important;
  }
}

/* IA V788 bundle separator: original stylesheet rules preserved */
/* InazumArcade v401 · mobile FF Online host controls + themed selection/readability fixes.
   Additive visual patch only: no gameplay, save, network or bracket logic changes. */

/* =====================================================================
   1) FF ONLINE · PHONE LOBBY
   Keep HOST TRANSFER and KICK visibly reachable on real phones, including
   landscape layouts where the old action rail could be squeezed/clipped.
   ===================================================================== */
html.ia-real-phone-mode #screen-lobby #lobbyMembers{
  overflow:visible!important;
}
html.ia-real-phone-mode #screen-lobby .member-row.ia397-member-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  align-items:start!important;
  gap:7px!important;
  min-height:0!important;
  height:auto!important;
  overflow:visible!important;
  padding-top:10px!important;
  padding-bottom:10px!important;
}
html.ia-real-phone-mode #screen-lobby .member-row.ia397-member-row>span:first-child{
  min-width:0!important;
  max-width:100%!important;
  overflow-wrap:anywhere!important;
}
html.ia-real-phone-mode #screen-lobby .ia397-member-actions{
  display:flex!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-wrap:wrap!important;
  gap:5px!important;
  overflow:visible!important;
}
html.ia-real-phone-mode #screen-lobby .ia400-host-btn,
html.ia-real-phone-mode #screen-lobby .ia397-kick-btn{
  display:inline-flex!important;
  visibility:visible!important;
  align-items:center!important;
  justify-content:center!important;
  flex:1 1 92px!important;
  width:auto!important;
  max-width:150px!important;
  min-width:88px!important;
  min-height:32px!important;
  margin:0!important;
  white-space:nowrap!important;
  position:relative!important;
  inset:auto!important;
}
html.ia-real-phone-mode #screen-lobby .ia400-host-btn:disabled{
  display:inline-flex!important;
  visibility:visible!important;
  opacity:.48!important;
}
@media (orientation:landscape) and (max-height:560px){
  html.ia-real-phone-mode #screen-lobby .member-row.ia397-member-row{
    padding-top:7px!important;
    padding-bottom:7px!important;
    gap:5px!important;
  }
  html.ia-real-phone-mode #screen-lobby .ia397-member-actions{
    gap:4px!important;
  }
  html.ia-real-phone-mode #screen-lobby .ia400-host-btn,
  html.ia-real-phone-mode #screen-lobby .ia397-kick-btn{
    min-height:29px!important;
    min-width:82px!important;
    font-size:9px!important;
  }
}

/* =====================================================================
   2) CUSTOM INTERFACE THEMES · NATIVE SELECTS
   Windows/Chromium can open the native option popup on a white surface while
   inheriting the theme's light text. Force a dark native palette only while a
   non-classic Interface theme is active. Classic remains untouched.
   ===================================================================== */
body[data-ia-ui-skin] select{
  color-scheme:dark!important;
}
body[data-ia-ui-skin] select option,
body[data-ia-ui-skin] select optgroup{
  background:#0a1825!important;
  color:#f4fbff!important;
  text-shadow:none!important;
}
body[data-ia-ui-skin] select option:disabled{
  color:#7890a0!important;
}
body[data-ia-ui-skin] select option:checked{
  background:#173d5a!important;
  color:#ffffff!important;
}

/* =====================================================================
   3) CUSTOM INTERFACE THEMES · PERSISTENT SELECTED/ACTIVE FEEDBACK
   Every themed clickable selector keeps an unmistakable selected state:
   darker fill + accent border + inset highlight. This intentionally does not
   apply to the Classic interface, navbar buttons or the customization picker.
   ===================================================================== */
body[data-ia-ui-skin] :is(button,.btn,[role="button"],[role="tab"],[role="radio"]).active:not(.mode-nav-item):not(.mode-nav-home):not(.ia-navbar-theme-trigger):not(.ia-theme-option):not(.ia-custom-category-btn):not(.gd-node),
body[data-ia-ui-skin] :is(button,.btn,[role="button"],[role="tab"],[role="radio"]).selected:not(.mode-nav-item):not(.mode-nav-home):not(.ia-navbar-theme-trigger):not(.ia-theme-option):not(.ia-custom-category-btn):not(.gd-node),
body[data-ia-ui-skin] :is(button,.btn,[role="button"],[role="tab"],[role="radio"])[aria-pressed="true"]:not(.mode-nav-item):not(.mode-nav-home):not(.ia-navbar-theme-trigger):not(.ia-theme-option):not(.ia-custom-category-btn):not(.gd-node),
body[data-ia-ui-skin] :is(button,.btn,[role="button"],[role="tab"],[role="radio"])[aria-selected="true"]:not(.mode-nav-item):not(.mode-nav-home):not(.ia-navbar-theme-trigger):not(.ia-theme-option):not(.ia-custom-category-btn):not(.gd-node),
body[data-ia-ui-skin] :is(button,.btn,[role="button"],[role="tab"],[role="radio"])[aria-checked="true"]:not(.mode-nav-item):not(.mode-nav-home):not(.ia-navbar-theme-trigger):not(.ia-theme-option):not(.ia-custom-category-btn):not(.gd-node){
  background:linear-gradient(180deg,rgba(3,13,22,.86),rgba(1,8,15,.94))!important;
  border-color:var(--ia-ui-accent,#63dfff)!important;
  color:var(--ia-ui-deep-text,#f7fcff)!important;
  text-shadow:0 1px 2px rgba(0,0,0,.82)!important;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb,var(--ia-ui-accent,#63dfff) 38%,transparent),
    inset 0 10px 20px rgba(0,0,0,.28),
    0 0 0 1px color-mix(in srgb,var(--ia-ui-accent,#63dfff) 22%,transparent)!important;
  filter:none!important;
}
body[data-ia-ui-skin] :is(button,.btn,[role="button"],[role="tab"],[role="radio"]).active:not(.mode-nav-item):not(.mode-nav-home):not(.ia-navbar-theme-trigger):not(.ia-theme-option):not(.ia-custom-category-btn):not(.gd-node) :is(b,strong,span,small,em),
body[data-ia-ui-skin] :is(button,.btn,[role="button"],[role="tab"],[role="radio"]).selected:not(.mode-nav-item):not(.mode-nav-home):not(.ia-navbar-theme-trigger):not(.ia-theme-option):not(.ia-custom-category-btn):not(.gd-node) :is(b,strong,span,small,em),
body[data-ia-ui-skin] :is(button,.btn,[role="button"],[role="tab"],[role="radio"])[aria-pressed="true"]:not(.mode-nav-item):not(.mode-nav-home):not(.ia-navbar-theme-trigger):not(.ia-theme-option):not(.ia-custom-category-btn):not(.gd-node) :is(b,strong,span,small,em),
body[data-ia-ui-skin] :is(button,.btn,[role="button"],[role="tab"],[role="radio"])[aria-selected="true"]:not(.mode-nav-item):not(.mode-nav-home):not(.ia-navbar-theme-trigger):not(.ia-theme-option):not(.ia-custom-category-btn):not(.gd-node) :is(b,strong,span,small,em),
body[data-ia-ui-skin] :is(button,.btn,[role="button"],[role="tab"],[role="radio"])[aria-checked="true"]:not(.mode-nav-item):not(.mode-nav-home):not(.ia-navbar-theme-trigger):not(.ia-theme-option):not(.ia-custom-category-btn):not(.gd-node) :is(b,strong,span,small,em){
  color:inherit!important;
  text-shadow:inherit!important;
}

/* Explicitly reinforce the controls shown in IndovInazuma, even where older
   theme sheets carry higher selector specificity. */
body[data-ia-ui-skin] #screen-indovinazuma .ia99-quiz-btn.active,
body[data-ia-ui-skin] #screen-indovinazuma .ig-mode-btn.active,
body[data-ia-ui-skin] #screen-indovinazuma .ia279-segments>button.active,
body[data-ia-ui-skin] #screen-indovinazuma .ia279-sudden.active,
body[data-ia-ui-skin] #screen-indovinazuma .ia265-choice.active{
  background:linear-gradient(180deg,rgba(2,12,20,.90),rgba(0,7,13,.97))!important;
  border-color:var(--ia-ui-accent,#63dfff)!important;
  color:#fff!important;
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ia-ui-accent,#63dfff) 42%,transparent),inset 0 12px 22px rgba(0,0,0,.30),0 0 0 1px color-mix(in srgb,var(--ia-ui-accent,#63dfff) 25%,transparent)!important;
}

/* Also keep the immediate press visible when a control does not have a
   persistent .active/.selected state. */
body[data-ia-ui-skin] :is(button,.btn,[role="button"]):active:not(.mode-nav-item):not(.mode-nav-home):not(.ia-navbar-theme-trigger):not(.ia-theme-option):not(.ia-custom-category-btn):not(.gd-node){
  filter:brightness(.76)!important;
  border-color:var(--ia-ui-accent,#63dfff)!important;
}

/* =====================================================================
   4) TRAINING GROUND ENCYCLOPEDIA · FOLLOW INTERFACE THEME
   #iaV285IdleGuide is a separate overlay, so older customization coverage did
   not include it. Theme both its launcher card and the guide itself.
   ===================================================================== */
body[data-ia-ui-skin] #iaIdleHQOverlay .ia-v285-idle-guide-card{
  background:var(--ia-ui-surface)!important;
  border-color:var(--ia-ui-border)!important;
  color:var(--ia-ui-text)!important;
  box-shadow:0 12px 25px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.04)!important;
}
body[data-ia-ui-skin] #iaIdleHQOverlay .ia-v285-idle-guide-card b{
  color:var(--ia-ui-text)!important;
  text-shadow:var(--ia-ui-shadow,0 1px 2px rgba(0,0,0,.7))!important;
}
body[data-ia-ui-skin] #iaIdleHQOverlay .ia-v285-idle-guide-card small{
  color:var(--ia-ui-muted)!important;
  text-shadow:var(--ia-ui-shadow,0 1px 2px rgba(0,0,0,.7))!important;
}
body[data-ia-ui-skin] #iaIdleHQOverlay .ia-v285-idle-guide-card button{
  background:var(--ia-ui-btn)!important;
  border:1px solid var(--ia-ui-border)!important;
  color:var(--ia-ui-btn-text)!important;
  text-shadow:var(--ia-ui-shadow,0 1px 2px rgba(0,0,0,.7))!important;
}
body[data-ia-ui-skin] #iaV285IdleGuide .career-ency-card{
  background:var(--ia-ui-surface)!important;
  border-color:var(--ia-ui-border)!important;
  color:var(--ia-ui-text)!important;
  box-shadow:0 30px 100px rgba(0,0,0,.62),inset 0 1px 0 rgba(255,255,255,.035)!important;
}
body[data-ia-ui-skin] #iaV285IdleGuide .career-ency-head{
  color:var(--ia-ui-text)!important;
  border-color:var(--ia-ui-border)!important;
}
body[data-ia-ui-skin] #iaV285IdleGuide .career-ency-head :is(h2,.career-kicker){
  color:var(--ia-ui-text)!important;
  text-shadow:var(--ia-ui-shadow,0 1px 2px rgba(0,0,0,.72))!important;
}
body[data-ia-ui-skin] #iaV285IdleGuide .career-ency-head .career-note{
  color:var(--ia-ui-muted)!important;
  text-shadow:var(--ia-ui-shadow,0 1px 2px rgba(0,0,0,.72))!important;
}
body[data-ia-ui-skin] #iaV285IdleGuide .career-ency-section{
  background:var(--ia-ui-surface-2,var(--ia-ui-deep,#071a2b))!important;
  border-color:var(--ia-ui-border)!important;
  color:var(--ia-ui-text,var(--ia-ui-deep-text,#f5fbff))!important;
}
body[data-ia-ui-skin] #iaV285IdleGuide .career-ency-section h3{
  color:var(--ia-ui-accent,#63dfff)!important;
  text-shadow:0 1px 2px rgba(0,0,0,.78)!important;
}
body[data-ia-ui-skin] #iaV285IdleGuide .career-ency-section :is(p,li){
  color:var(--ia-ui-muted,var(--ia-ui-deep-muted,#a9c8d7))!important;
  text-shadow:0 1px 2px rgba(0,0,0,.72)!important;
}
body[data-ia-ui-skin] #iaV285IdleGuide .career-ency-section :is(b,strong){
  color:var(--ia-ui-text,var(--ia-ui-deep-text,#f5fbff))!important;
}
body[data-ia-ui-skin] #iaV285IdleGuide .career-ency-head .btn{
  background:var(--ia-ui-btn)!important;
  border-color:var(--ia-ui-border)!important;
  color:var(--ia-ui-btn-text)!important;
  text-shadow:var(--ia-ui-shadow,0 1px 2px rgba(0,0,0,.72))!important;
}
