/* Portrait battlefield. The original board nodes and game handlers remain shared. */
#phone-tutorial-setup-note,#phone-tutorial-step,#phone-tutorial-log-help { display:none; }
html.sukdulan-phone-construction #preparation-screen[data-phone-tutorial='true'] { padding-top:100px; }
html.sukdulan-phone-construction #preparation-screen[data-phone-tutorial='true'] #phone-prep-panels { display:none; }
html.sukdulan-phone-construction #preparation-screen[data-phone-tutorial='true'] .prep-layout > :not(#panel-player) { display:none!important; }
html.sukdulan-phone-construction #preparation-screen[data-phone-tutorial='true'] .prep-layout > #panel-player { display:flex!important; }
html.sukdulan-phone-construction #preparation-screen[data-phone-tutorial='true'] .prep-start-actions { position:static!important; inset:auto!important; width:100%!important; transform:none!important; margin:0; }
html.sukdulan-phone-construction #preparation-screen[data-phone-tutorial='true'] #phone-tutorial-setup-note { display:block; flex:none; margin:0; color:#bcd9e8; font:13px/1.35 'Segoe UI',sans-serif; }
html.sukdulan-phone-construction #preparation-screen[data-phone-tutorial='true'] .prep-deck-footer { display:none; }
html[data-sukdulan-view='phone'] #evo-preview-modal {
  width:min(calc(100cqw - 16px),414px)!important; max-width:calc(100cqw - 16px)!important;
  box-sizing:border-box; padding:12px 8px 60px!important; border-radius:8px;
}
html[data-sukdulan-view='phone'] #evo-tree-container {
  width:100%; min-width:0; gap:5px!important; flex-wrap:nowrap; align-items:center;
}
html[data-sukdulan-view='phone'] #evo-tree-container .evo-large-card {
  flex:1 1 0; width:0; min-width:0; max-width:min(128px,23cqh); height:auto;
  aspect-ratio:5/7; border-width:1px; border-radius:4px;
}
html[data-sukdulan-view='phone'] #evo-tree-container .evo-large-card > div {
  top:calc(100% + 7px)!important; bottom:auto!important; left:0; width:100%!important;
  font:700 11px/1.2 Rajdhani,sans-serif!important; white-space:normal!important; overflow-wrap:anywhere;
}
html[data-sukdulan-view='phone'] #evo-tree-container .evo-arrow { flex:0 0 16px; width:16px; font-size:20px; text-align:center; }
html.sukdulan-phone-battle body {
  width:min(100vw,430px); height:100dvh; min-height:0; inset:0; margin:0 auto;
  --pb-inset:max(16px,env(safe-area-inset-top)); --pb-stage:38px;
  --pb-nav-top:calc(var(--pb-inset) + var(--pb-stage) + 4px);
  --pb-field-top:calc(var(--pb-nav-top) + 142px);
  --pb-lower:clamp(196px,23cqh,216px); --pb-act:clamp(76px,10cqh,96px); --pb-hero-extra:36px;
  --pb-act-card-h:calc(var(--pb-act) - 12px); --pb-act-card-w:calc(var(--pb-act-card-h)*5/7);
  --pb-half-field:calc((100cqh - var(--pb-lower) - env(safe-area-inset-bottom) - var(--pb-field-top) - var(--pb-act) - 26px)/2);
  --pb-tactic-boost:clamp(0px,calc((100cqh - 680px)/16),5px);
  --pb-tactic:max(36px,calc((var(--pb-half-field) - var(--pb-hero-extra) + 4px)/2 + var(--pb-tactic-boost)));
  --pb-zone-w:calc((100cqw - 20px)/3);
  --pb-hero-h:calc((100cqh - var(--pb-lower) - env(safe-area-inset-bottom) - var(--pb-field-top) - var(--pb-act) - var(--pb-tactic)*2 - 26px)/2);
  --pb-e-hero:calc(var(--pb-field-top) + var(--pb-tactic) + 4px);
  --pb-act-top:calc(var(--pb-e-hero) + var(--pb-hero-h) + 6px);
  --pb-p-hero:calc(var(--pb-act-top) + var(--pb-act) + 6px);
  --pb-p-tactic:calc(var(--pb-p-hero) + var(--pb-hero-h) + 4px);
  --pb-card-top:5px;
  --pb-stats-w:40px; --pb-stats-left:calc(var(--pb-zone-w) - var(--pb-stats-w) - 12px);
  --pb-stats-top:11px; --pb-stat-gap:3px; --pb-hp-height:13px;
  --pb-stat-row:clamp(13px,calc((var(--pb-hero-h) - 30px)/4),18px);
  --pb-power-row:calc(var(--pb-stat-row) + 4px);
  --pb-hp-top:calc(var(--pb-stats-top) + var(--pb-stat-row) + var(--pb-stat-gap) + var(--pb-power-row) + 2px);
  --pb-bar-top:calc(var(--pb-hero-h) - var(--pb-card-top) - 11px); --pb-bar-h:7px;
  --pb-card-h:min(calc(var(--pb-hero-h) - var(--pb-hero-extra) + 12px),calc(var(--pb-hero-h) - 22px),calc((var(--pb-zone-w) - var(--pb-stats-w) - 20px)/1.1*1.4));
  --pb-card-w:calc(var(--pb-card-h)*5/7);
  --pb-tactic-card-h:calc(var(--pb-tactic) - 4px);
  --pb-coach:0px; --pb-pile-w:48px; --pb-pile-h:67px;
  --pb-panel-h:calc(var(--pb-pile-h)*2 + 4px);
  --pb-panel-top:calc(var(--pb-p-tactic) + var(--pb-tactic) + 4px);
  --pb-work-inset:calc(var(--pb-pile-w) + 10px);
  --pb-modal-room:24px;
  --pb-modal-card-w:min(82px,calc((var(--pb-work-width) - 48px)/3),calc((var(--pb-panel-h) - var(--pb-modal-room))*5/7));
  --pb-hand-card-w:var(--pb-modal-card-w);
  --pb-work-width:calc(100cqw - var(--pb-work-inset)*2);
  --pb-work-left:calc(50vw - 50cqw + var(--pb-work-inset));
  --pb-bottom:calc(6px + env(safe-area-inset-bottom));
  --card-width:52px; --card-height:73px;
  --ui-caption:11px; --ui-body:12px; --ui-subtitle:13px; --ui-heading:15px; --ui-title:18px;
  --font-size-base:11px; --font-size-title:12px;
  font-size:12px;
}
html.sukdulan-phone-battle #playmat {
  position:absolute; inset:0; width:100%; height:100%; min-height:0; padding:0;
  background-size:28px 28px; overflow:hidden; box-sizing:border-box;
}
html.sukdulan-phone-battle #playmat > :is(.top-player,.bottom-player) {
  display:contents; position:static; transform:none; filter:none;
}
html.sukdulan-phone-battle #playmat .deck-row { display:contents; position:static; }
html.sukdulan-phone-battle #playmat .hero-row {
  position:absolute; left:6px; right:6px; width:auto; height:var(--pb-hero-h);
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px;
}
html.sukdulan-phone-battle #playmat .top-player .hero-row { top:var(--pb-e-hero); transform:rotate(180deg); }
html.sukdulan-phone-battle #playmat .bottom-player .hero-row { top:var(--pb-p-hero); }
html.sukdulan-phone-battle #playmat .zone {
  height:100%; min-height:0; box-sizing:border-box; border-width:1px; border-radius:4px;
  font-size:11px; letter-spacing:0; text-shadow:none; box-shadow:inset 0 0 10px #06b6d41a;
}
html.sukdulan-phone-battle #playmat .hero-zone { overflow:visible; transform:none; filter:none; }
html.sukdulan-phone-battle #playmat .z-tactic {
  position:absolute; width:var(--pb-zone-w); height:var(--pb-tactic); min-height:0;
  display:flex; align-items:center; justify-content:center;
}
html.sukdulan-phone-battle #playmat .top-player .z-tactic { top:var(--pb-field-top); }
html.sukdulan-phone-battle #playmat .bottom-player .z-tactic { top:var(--pb-p-tactic); }
html.sukdulan-phone-battle #playmat .z-tactic:nth-child(3) { left:6px; }
html.sukdulan-phone-battle #playmat .z-tactic:nth-child(4) { left:calc(10px + var(--pb-zone-w)); }
html.sukdulan-phone-battle #playmat .z-tactic:nth-child(5) { left:calc(14px + var(--pb-zone-w)*2); }
html.sukdulan-phone-battle #playmat .z-tactic :is(.card-in-playmat,.skip-card) {
  box-sizing:border-box; width:calc(var(--pb-tactic-card-h)*5/7); height:var(--pb-tactic-card-h); min-height:0; margin:0!important; border-width:1px; transform:none!important;
}
html.sukdulan-phone-battle #playmat .deck-row > :is(.z-hand,.z-history,.z-main-deck,.z-hero-deck) {
  position:absolute; width:48px; height:67px; min-height:0; border-radius:3px;
}
html.sukdulan-phone-battle #playmat .bottom-player .deck-row > :is(.z-hand,.z-history,.z-main-deck,.z-hero-deck) { width:var(--pb-pile-w); height:var(--pb-pile-h); }
html.sukdulan-phone-battle #playmat :is(.z-hand,.z-history) { left:6px; }
html.sukdulan-phone-battle #playmat :is(.z-main-deck,.z-hero-deck) { right:6px; }
html.sukdulan-phone-battle #playmat .top-player :is(.z-hand,.z-main-deck) { top:var(--pb-nav-top); }
html.sukdulan-phone-battle #playmat .top-player :is(.z-history,.z-hero-deck) { top:calc(var(--pb-nav-top) + 71px); }
html.sukdulan-phone-battle #playmat .bottom-player :is(.z-hand,.z-main-deck) { top:var(--pb-panel-top); bottom:auto; }
html.sukdulan-phone-battle #playmat .bottom-player :is(.z-history,.z-hero-deck) { top:calc(var(--pb-panel-top) + var(--pb-pile-h) + 4px); bottom:auto; }
html.sukdulan-phone-battle #playmat .stack-container { display:flex!important; width:100%; height:100%; position:absolute; inset:0; transform:none; }
html.sukdulan-phone-battle #playmat .stack-visual { width:100%; height:100%; position:absolute; inset:0; transform:none!important; opacity:.4; border:0; }
html.sukdulan-phone-battle #playmat .stack-visual::before,
html.sukdulan-phone-battle #playmat .stack-visual::after { display:none; }
html.sukdulan-phone-battle #playmat .stack-count { position:absolute; top:auto; bottom:9px; left:0; right:0; width:auto; height:19px; background:#071421e8; border:0; border-radius:0; transform:none; font:700 15px/19px Rajdhani,sans-serif; box-shadow:none; }
html.sukdulan-phone-battle #playmat .zone-label { position:absolute; top:10px; bottom:auto; left:0; right:0; width:auto; transform:none; font:700 10px/12px Rajdhani,sans-serif; letter-spacing:0; }
html.sukdulan-phone-battle #playmat .hero-zone > .card-hero:not(.attached-tool):not(.dummy-hero-overlay) {
  position:absolute!important; top:var(--pb-card-top)!important; left:5px!important; right:auto!important;
  box-sizing:border-box; width:var(--pb-card-w); height:var(--pb-card-h); min-height:0; margin:0!important;
  transform:none!important; filter:none!important; border-width:1px; border-radius:3px;
}
html.sukdulan-phone-battle .phone-hero-name { display:none!important; }
html.sukdulan-phone-battle #playmat .hero-zone .card-hero > :is(.tc-badge,.lv-badge,.PWR-badge) { position:absolute; left:var(--pb-stats-left); right:auto; bottom:auto; display:flex; align-items:center; justify-content:center; width:var(--pb-stats-w); height:var(--pb-stat-row); min-height:13px; box-sizing:border-box; padding:0; border-width:1px; font-size:11px; line-height:1; border-radius:3px; letter-spacing:0; box-shadow:none; text-shadow:none; }
html.sukdulan-phone-battle #playmat .hero-zone .card-hero > :is(.lv-badge,.tc-badge) { top:var(--pb-stats-top); width:calc((var(--pb-stats-w) - 3px)/2); }
html.sukdulan-phone-battle #playmat .hero-zone .card-hero > .tc-badge { left:calc(var(--pb-stats-left) + (var(--pb-stats-w) + 3px)/2); }
html.sukdulan-phone-battle #playmat .hero-zone .card-hero > .PWR-badge { top:calc(var(--pb-stats-top) + var(--pb-stat-row) + var(--pb-stat-gap)); height:var(--pb-power-row); font-size:15px; }
html.sukdulan-phone-battle #playmat .hero-zone .card-hero > :is(.lv-badge,.tc-badge,.PWR-badge)::before { content:none!important; }
html.sukdulan-phone-battle #playmat .hero-zone .card-hero > .hp-text { top:var(--pb-hp-top); bottom:auto; left:var(--pb-stats-left); right:auto; width:var(--pb-stats-w); height:var(--pb-hp-height); display:flex; align-items:center; justify-content:center; font:700 11px/var(--pb-hp-height) Rajdhani,sans-serif; white-space:nowrap; text-shadow:none; }
html.sukdulan-phone-battle #playmat .hero-zone .hp-bar-container { top:var(--pb-bar-top); bottom:auto; left:-1px; right:auto; width:calc(var(--pb-zone-w) - 12px); height:var(--pb-bar-h); box-sizing:border-box; border:1px solid #315b3e; border-radius:2px; background:#081b12; }
html.sukdulan-phone-battle #playmat .hero-zone .hp-fill { box-shadow:none!important; }
html.sukdulan-phone-battle #playmat .top-player .card-hero:not(.concealed-face-down):not(.online-facedown):not(.ai-facedown) { background-image:none!important; }
html.sukdulan-phone-battle .phone-enemy-art { position:absolute; inset:0; border-radius:inherit; background-image:var(--pb-face); background-size:cover; background-position:center; transform:none; pointer-events:none; z-index:-1; }
html.sukdulan-phone-battle #playmat .attached-tool { box-sizing:border-box; border-width:1px; width:var(--pb-card-w); height:var(--pb-card-h); top:var(--pb-card-top)!important; left:calc(5px + var(--pb-card-w)/2)!important; transform:translateX(-40%)!important; }
html.sukdulan-phone-battle #playmat .hero-zone > :is(.attached-token,.attached-decoy) { box-sizing:border-box; width:calc(var(--pb-card-w)*.9)!important; height:calc(var(--pb-card-h)*.9)!important; max-width:none; max-height:none; top:calc(var(--pb-card-top) + var(--pb-token-index,0)*2px)!important; left:calc(5px + min(16px,calc(10px + var(--pb-token-index,0)*3px),calc(var(--pb-zone-w) - var(--pb-stats-w) - var(--pb-card-w) - 18px)))!important; right:auto!important; transform:none!important; border-width:1px!important; border-radius:3px!important; animation:none!important; z-index:calc(8 - var(--pb-token-index,0))!important; }
html.sukdulan-phone-battle #playmat .hero-zone > :is(.attached-token,.attached-decoy).peek-active { top:var(--pb-card-top)!important; left:5px!important; width:var(--pb-card-w)!important; height:var(--pb-card-h)!important; transform:none!important; z-index:40!important; }
html.sukdulan-phone-battle #playmat .hero-zone > .dummy-hero-overlay { position:absolute!important; top:var(--pb-card-top)!important; left:5px!important; right:auto!important; width:var(--pb-card-w)!important; height:var(--pb-card-h)!important; margin:0!important; transform:none!important; box-sizing:border-box; border-width:1px; }
html.sukdulan-phone-battle #playmat .card-dummy > .dummy-PWR-badge { top:2px; right:2px; width:25px; height:17px; padding:0; box-sizing:border-box; border-width:1px; font:700 12px/1 Rajdhani,sans-serif; box-shadow:none; }
html.sukdulan-phone-battle #playmat .card-dummy > .dummy-hp-text { top:auto; bottom:1px; left:0; right:0; width:auto; text-align:center; font:700 11px/1 Rajdhani,sans-serif; background:#071421d9; text-shadow:none; }
html.sukdulan-phone-battle #playmat #act-zone { --card-width:var(--pb-act-card-w); --card-height:var(--pb-act-card-h); position:absolute; top:var(--pb-act-top); left:6px; right:6px; width:auto; height:var(--pb-act); min-height:0; margin:0; padding:4px; box-sizing:border-box; border-width:1px; border-radius:5px; gap:4px; }
html.sukdulan-phone-battle #playmat #act-zone:is(.concealed-spawning,.concealed-active) { position:absolute!important; }
html.sukdulan-phone-battle #act-zone::before { font-size:30px; letter-spacing:2px; }
html.sukdulan-phone-battle #playmat #act-zone .card-in-playmat { box-sizing:border-box; width:var(--pb-act-card-w)!important; height:var(--pb-act-card-h)!important; min-height:0!important; margin:0!important; border-width:1px; }
html.sukdulan-phone-battle #playmat #act-zone > .card-in-playmat[style*='position: absolute'] { position:absolute!important; top:50%!important; margin-top:calc(var(--pb-act-card-h)/-2)!important; }
html.sukdulan-phone-battle #playmat #act-zone > .concealed-strike-target { margin-top:0!important; }
html.sukdulan-phone-battle #act-zone :is(.concealed-spawn-group,.concealed-choice-group) { gap:6px; }
html.sukdulan-phone-battle #act-zone .concealed-choice-group { padding:4px; box-sizing:border-box; }
html.sukdulan-phone-battle #act-zone .concealed-choice-label { left:6px; right:6px; top:3px; width:auto; max-width:none; transform:none; text-align:center; font:700 11px/1.15 Rajdhani,sans-serif; letter-spacing:0; background:#071421ed; border-radius:3px; }
html.sukdulan-phone-battle #act-zone .concealed-strike-label { top:0!important; left:50%; right:auto; width:max-content; max-width:calc(100cqw - 28px); transform:translateX(-50%); font-size:11px!important; background:#071421ed; padding:2px 4px; box-sizing:border-box; }
html.sukdulan-phone-battle #playmat .stage-indicator { position:absolute; top:var(--pb-inset); left:6px; right:6px; height:var(--pb-stage); width:auto; transform:none; flex-direction:row; align-items:center; justify-content:center; gap:6px; }
html.sukdulan-phone-battle .stage-circle { flex:none; width:24px; height:24px; border-width:1px; font-size:12px; box-shadow:none; }
html.sukdulan-phone-battle .stage-circle.active { transform:none; box-shadow:0 0 8px #facc1533; }
html.sukdulan-phone-battle #stage-0 { position:absolute; left:0; width:auto; height:auto; gap:4px; border:0; border-radius:0; background:transparent; color:#c6e6f3; font-size:16px; white-space:nowrap; box-shadow:none; }
html.sukdulan-phone-battle #stage-0::before { content:'STAGE'; font-size:12px; }
html.sukdulan-phone-battle #match-menu-button { top:var(--pb-inset)!important; right:6px!important; left:auto!important; width:52px!important; height:38px!important; min-height:38px!important; padding:4px!important; font:700 12px/1 Rajdhani,sans-serif!important; transform:none!important; }
html.sukdulan-phone-battle #turn-log { display:none!important; }
#phone-battle-log,#phone-battle-workspace,#phone-battle-hint,#phone-preview-close,.phone-hero-name,.phone-enemy-art,.phone-starter-pages,[data-phone-preview] { display:none; }
.phone-starter-pages[hidden] { display:none!important; }
html.sukdulan-phone-battle :is(#phone-preview-close,.phone-enemy-art) { display:block; }
html.sukdulan-phone-battle :is(.phone-starter-pages:not([hidden]),[data-phone-preview]) { display:flex; }
html.sukdulan-phone-battle #phone-battle-log { display:flex; position:absolute; top:var(--pb-nav-top); left:58px; right:58px; height:26px; align-items:center; gap:5px; padding:3px 6px; border:1px solid #36576c; border-radius:4px; background:#0d2031; color:#c6e6f3; font:600 11px/1.2 Rajdhani,sans-serif; z-index:110; }
html.sukdulan-phone-battle #phone-battle-log strong { color:var(--neon-cyan); }
html.sukdulan-phone-battle #phone-battle-log span { min-width:0; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:left; }
html.sukdulan-phone-battle .battle-side-status { display:contents!important; position:static!important; transform:none!important; }
html.sukdulan-phone-battle .battle-hud-row { position:absolute!important; left:58px!important; right:58px!important; width:auto!important; height:35px!important; gap:5px!important; transform:none!important; margin:0!important; }
html.sukdulan-phone-battle #e-hud-row { top:calc(var(--pb-nav-top) + 30px)!important; }
html.sukdulan-phone-battle #p-hud-row { top:calc(var(--pb-nav-top) + 100px)!important; }
html.sukdulan-phone-battle .battle-hud-row[hidden] { display:none!important; }
html.sukdulan-phone-battle .hud-container { position:static!important; display:contents!important; transform:none!important; }
html.sukdulan-phone-battle .battle-hud-row { display:grid!important; grid-template-columns:repeat(4,minmax(0,1fr)); }
html.sukdulan-phone-battle .hud-box { width:auto!important; height:35px!important; min-width:0!important; min-height:0!important; box-sizing:border-box!important; padding:1px!important; gap:0!important; border-width:1px!important; border-radius:4px!important; box-shadow:none!important; }
html.sukdulan-phone-battle .hud-val { font-size:15px!important; line-height:16px!important; }
html.sukdulan-phone-battle .hud-label { font-size:10px!important; line-height:12px!important; letter-spacing:0!important; }
html.sukdulan-phone-battle #match-turn-status { position:absolute!important; top:calc(var(--pb-nav-top) + 69px)!important; left:58px!important; right:58px!important; width:auto!important; max-width:none!important; height:27px!important; transform:none!important; }
html.sukdulan-phone-battle #turn-indicator-box { position:static!important; width:100%!important; height:27px!important; min-height:0!important; box-sizing:border-box; padding:2px 5px!important; border-width:1px!important; border-radius:4px!important; gap:8px!important; flex-wrap:nowrap!important; transform:none!important; font-size:13px!important; line-height:1!important; letter-spacing:.5px!important; box-shadow:none!important; }
html.sukdulan-phone-battle #turn-indicator-label { font-size:13px!important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
html.sukdulan-phone-battle #match-move-clock { width:auto!important; min-width:0!important; padding:0 0 0 8px!important; }
html.sukdulan-phone-battle #match-move-clock strong { font-size:16px!important; }
html.sukdulan-phone-battle #turn-indicator-box[data-ai-thinking]::after { display:none; }
html.sukdulan-phone-battle body.match-menu-open :is(.battle-hud-row,.battle-hud-row *,#match-turn-status) { visibility:hidden!important; }
html.sukdulan-phone-battle .hero-move-badge { min-width:14px; width:14px; height:14px; box-sizing:border-box; top:1px; bottom:auto; left:auto; right:1px; padding:0; font-size:11px; border-width:1px; box-shadow:none!important; animation:none!important; }
html.sukdulan-phone-battle .battle-side-status > .action-btn { position:absolute!important; top:calc(var(--pb-panel-top) + var(--pb-panel-h) + 4px)!important; bottom:auto!important; left:var(--pb-work-inset)!important; right:var(--pb-work-inset)!important; width:var(--pb-work-width)!important; height:36px!important; min-height:36px!important; padding:4px!important; transform:none!important; font-size:12px!important; z-index:2200; }
html.sukdulan-phone-battle :is(#confirm-player-btn,#confirm-enemy-btn) { left:6px!important; right:6px!important; width:calc(100cqw - 12px)!important; border-radius:4px; letter-spacing:.4px; }
html.sukdulan-phone-battle .phone-action-back { visibility:hidden!important; pointer-events:none!important; }
html.sukdulan-phone-battle #phone-battle-workspace { display:block; position:absolute; left:var(--pb-work-inset); right:var(--pb-work-inset); top:var(--pb-panel-top); height:var(--pb-panel-h); box-sizing:border-box; border-top:1px solid #36576c; padding-top:5px; color:#8faabf; font:600 11px/1.3 Rajdhani,sans-serif; pointer-events:none; }
html.sukdulan-phone-battle #phone-battle-hint { display:block; position:absolute; left:0; right:0; bottom:38px; margin:0; color:#c6e6f3; }
html.sukdulan-phone-battle .expanded-box:not(#mstack-modal),
html.sukdulan-phone-battle #mstack-modal,
html.sukdulan-phone-battle #card-preview-container {
  position:absolute!important; top:var(--pb-panel-top)!important; bottom:auto!important;
  left:var(--pb-work-inset)!important; right:var(--pb-work-inset)!important; width:var(--pb-work-width)!important; min-width:0!important; max-width:none!important;
  height:var(--pb-panel-h)!important; max-height:var(--pb-panel-h)!important;
  box-sizing:border-box!important; margin:0!important; padding:5px!important; gap:5px!important;
  transform:none!important; animation:none!important; border-width:1px!important; border-radius:5px!important;
  background:#0b1829!important; backdrop-filter:none; overflow:visible;
}
html.sukdulan-phone-battle .expanded-box:not(#mstack-modal) { flex-direction:column!important; flex-wrap:nowrap!important; align-items:center!important; justify-content:center!important; }
html.sukdulan-phone-battle .expanded-box.phone-panel-back { visibility:hidden!important; pointer-events:none!important; }
html.sukdulan-phone-battle .expanded-box > [id^='content-'] { position:absolute; top:12px; bottom:8px; left:18px; right:18px; min-width:0!important; width:auto!important; min-height:0!important; flex-wrap:nowrap!important; flex:1; align-items:center; justify-content:center!important; align-content:center; gap:5px!important; }
html.sukdulan-phone-battle .card-in-modal { flex:none; width:min(52px,calc((var(--pb-work-width) - 26px)/3),calc((var(--pb-panel-h) - 47px)*5/7)); height:calc(min(52px,calc((var(--pb-work-width) - 26px)/3),calc((var(--pb-panel-h) - 47px)*5/7))*1.4); min-height:0; border-width:1px; border-radius:3px; transform:none!important; }
html.sukdulan-phone-battle .expanded-box .card-in-modal[hidden] { display:none!important; }
html.sukdulan-phone-battle .expanded-box .close-btn { top:2px!important; bottom:auto!important; right:0!important; width:18px!important; height:18px!important; min-height:18px!important; padding:0!important; border-width:1px!important; font-size:11px!important; border-radius:4px!important; z-index:40; }
html.sukdulan-phone-battle .expanded-box .modal-title { position:absolute; top:-5px; left:50%; width:max-content; max-width:calc(100% - 52px); transform:translateX(-50%); margin:0; padding:0 6px!important; background:#0b1829; color:#bed8e9; font-size:11px!important; line-height:15px!important; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; z-index:35; pointer-events:none; }
html.sukdulan-phone-battle :is(#modal-hand-player,#modal-hand-enemy).expanded-box.hand-green { height:var(--pb-panel-h)!important; min-height:0!important; }
html.sukdulan-phone-battle :is(#modal-hand-player,#modal-hand-enemy) > [id^='content-hand-'] { flex:0 0 auto!important; }
html.sukdulan-phone-battle :is(#modal-hand-player,#modal-hand-enemy) .card-in-modal { width:var(--pb-hand-card-w); height:calc(var(--pb-hand-card-w)*1.4); }
html.sukdulan-phone-battle :is(#modal-hand-player,#modal-hand-enemy) > .close-btn { top:2px!important; bottom:auto!important; }
html.sukdulan-phone-battle :is(#modal-hand-player,#modal-hand-enemy) .modal-title { font-size:12px!important; }
html.sukdulan-phone-battle :is(#modal-player,#modal-enemy) > .modal-title { flex:none!important; flex-basis:auto!important; order:-1; }
html.sukdulan-phone-battle :is(#modal-player,#modal-enemy) > [id^='content-'] { flex:1 1 0; min-height:0; }
html.sukdulan-phone-battle .expanded-box:not(#mstack-modal) .card-in-modal { box-sizing:border-box; width:var(--pb-modal-card-w); height:calc(var(--pb-modal-card-w)*1.4); }
html.sukdulan-phone-battle :is(#modal-player,#modal-enemy):has(.phone-starter-pages:not([hidden])) { --pb-modal-room:32px; }
html.sukdulan-phone-battle :is(#modal-player,#modal-enemy):has(.phone-starter-pages:not([hidden])) > [id^='content-'] { bottom:18px; }
html.sukdulan-phone-battle .hero-yellow { --pb-modal-room:42px; }
html.sukdulan-phone-battle .hero-yellow > [id^='content-'] { bottom:26px; }
html.sukdulan-phone-battle .choose-starters-prompt { width:calc(100cqw - 24px); box-sizing:border-box; padding:6px; font-size:clamp(18px,5cqw,24px)!important; line-height:1.2; text-align:center; white-space:normal; }
html.sukdulan-phone-battle .stage-announcement { top:calc(var(--pb-act-top) + var(--pb-act)/2)!important; width:calc(100cqw - 24px); box-sizing:border-box; font-size:clamp(16px,4.5cqw,20px)!important; line-height:1.2; letter-spacing:1px; text-align:center; white-space:nowrap; text-shadow:0 0 8px #facc1566!important; }
html.sukdulan-phone-battle .side-modal-footer { flex:none; width:100%; gap:4px; min-height:30px; }
html.sukdulan-phone-battle .page-btn { min-width:28px!important; min-height:30px!important; padding:3px!important; font-size:12px!important; }
html.sukdulan-phone-battle .hero-modal-controls { display:flex; width:100%; gap:3px!important; flex-wrap:wrap; justify-content:center; }
html.sukdulan-phone-battle .hero-modal-controls .modal-title { flex-basis:100%; order:-1; }
html.sukdulan-phone-battle .expanded-box :is(.side-modal-footer,.hero-modal-controls) { position:absolute; inset:0; width:100%; min-height:0; margin:0; padding:0!important; display:block; box-sizing:border-box; pointer-events:none; }
html.sukdulan-phone-battle .expanded-box :is(.side-modal-footer,.hero-modal-controls) > .page-btn { position:absolute; top:50%; bottom:auto; left:-1px; right:auto; width:18px; min-width:18px!important; max-width:18px; height:36px; min-height:36px!important; padding:2px!important; transform:translateY(-50%); pointer-events:auto; z-index:30; }
html.sukdulan-phone-battle .expanded-box .side-modal-footer > .page-btn:last-child,html.sukdulan-phone-battle .expanded-box .hero-modal-controls > [id^='next-hero-btn'] { left:auto; right:-1px; }
html.sukdulan-phone-battle .phone-starter-pages > span { position:absolute; bottom:2px; left:50%; transform:translateX(-50%); font-size:10px; line-height:12px; }
html.sukdulan-phone-battle .hero-modal-controls > :is([id^='tab-base-'],[id^='tab-evo-']) { top:auto!important; bottom:2px!important; left:calc(50% - 51px)!important; right:auto!important; width:48px!important; min-width:48px!important; max-width:48px!important; height:20px!important; min-height:20px!important; transform:none!important; font-size:10px!important; }
html.sukdulan-phone-battle .hero-modal-controls > [id^='tab-evo-'] { left:calc(50% + 3px)!important; }
html.sukdulan-phone-battle #modal-overlay { display:none!important; }
html.sukdulan-phone-battle #playmat :is(.hero-zone,.z-tactic,#act-zone):has(.action-menu) { z-index:6500!important; }
html.sukdulan-phone-battle .action-menu { position:fixed!important; top:var(--pb-panel-top)!important; bottom:auto!important; left:var(--pb-work-left)!important; right:auto!important; width:var(--pb-work-width)!important; height:var(--pb-panel-h); max-height:var(--pb-panel-h); overflow-y:auto; box-sizing:border-box; display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr)); align-content:center; gap:5px; padding:5px; border-width:1px; background:#0b1829; transform:none!important; animation:none!important; z-index:6000!important; }
html.sukdulan-phone-battle .action-menu:has(> button:nth-child(7)) { grid-template-columns:repeat(3,minmax(0,1fr)); }
html.sukdulan-phone-battle .action-menu:not(:has(> button:nth-child(7))) > button:last-child:nth-child(odd) { grid-column:1/-1; }
html.sukdulan-phone-battle .action-menu-btn { min-width:0; min-height:36px; padding:4px; white-space:normal; font:700 12px/1.15 Rajdhani,sans-serif; }
html.sukdulan-phone-battle .action-menu[popover]:not(:popover-open) { display:none!important; }
html.sukdulan-phone-battle .action-menu[popover] { margin:0!important; pointer-events:auto!important; }
html.sukdulan-phone-battle body:has(.action-menu:popover-open) :is(.expanded-box,#mstack-modal):not(:has(.action-menu:popover-open)) { visibility:hidden!important; pointer-events:none!important; }
html.sukdulan-phone-battle .action-menu:popover-open { visibility:visible!important; }
html.sukdulan-phone-battle body:is(.effect-resolving,.war-turn-transition,.match-menu-open) .action-menu { display:none!important; pointer-events:none!important; }
html.sukdulan-phone-battle .phone-tap-selected { outline:2px solid var(--neon-gold)!important; outline-offset:2px; }
html.sukdulan-phone-battle .phone-tap-target { outline:2px dashed var(--neon-cyan); outline-offset:-3px; }
html.sukdulan-phone-battle #mstack-modal { z-index:1900; display:none; align-items:center; }
html.sukdulan-phone-battle #mstack-modal.active { display:flex; }
html.sukdulan-phone-battle .mstack-left { flex:none; width:64px; height:100%; justify-content:center; gap:3px; }
html.sukdulan-phone-battle #mstack-event-name { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
html.sukdulan-phone-battle .mstack-right { flex:1; width:auto; height:auto; padding:0; gap:4px; }
html.sukdulan-phone-battle :is(.mstack-title,#mstack-event-name,#mstack-reactor-name,#mstack-stack-count) { font-size:11px!important; line-height:1.15!important; min-height:0!important; margin:0!important; }
html.sukdulan-phone-battle .mstack-origin-card { width:48px; height:67px; font-size:11px; }
html.sukdulan-phone-battle .mstack-origin-card .card-in-modal { width:48px; height:67px; }
html.sukdulan-phone-battle :is(.mstack-player-controls,.mstack-opponent-controls) { flex-wrap:wrap; gap:4px!important; width:100%; }
html.sukdulan-phone-battle .mstack-btn { flex:1; min-width:0; min-height:32px; padding:3px!important; font-size:11px!important; }
html.sukdulan-phone-battle #card-preview-container { z-index:7000; align-items:center; }
html.sukdulan-phone-battle #preview-card { width:65px; height:91px; }
html.sukdulan-phone-battle .preview-details { min-width:0; height:100%; gap:3px; }
html.sukdulan-phone-battle :is(.preview-title,.preview-type,.preview-effect) { font-size:11px; line-height:1.25; letter-spacing:0; }
html.sukdulan-phone-battle .preview-title { padding-right:24px; }
html.sukdulan-phone-battle #phone-preview-close { position:absolute; top:2px; right:2px; width:26px; height:26px; padding:0; border:1px solid #36576c; border-radius:4px; background:#10283b; color:#d8edf7; z-index:2; }
html.sukdulan-phone-battle #turn-selection-overlay { position:absolute; inset:0; width:100%; height:100%; }
html.sukdulan-phone-battle #turn-selection-overlay .turn-panel { position:absolute; left:6px; right:6px; width:auto; transform:none; }
html.sukdulan-phone-battle #turn-selection-overlay .top-player { top:20%; }
html.sukdulan-phone-battle #turn-selection-overlay .bottom-player { bottom:20%; }
html.sukdulan-phone-battle #turn-selection-overlay .turn-btn { width:62px; height:62px; font-size:17px; }
html.sukdulan-phone-battle #turn-selection-overlay .turn-btn-group { gap:16px; }
html.sukdulan-phone-battle #coin { width:70px; height:70px; }
html.sukdulan-phone-battle #coin-status { font-size:18px!important; }
html.sukdulan-phone-battle .turn-title { font-size:17px; }
html.sukdulan-phone-battle :is(.match-menu-panel,#match-surrender-dialog) { width:calc(100% - 24px)!important; max-width:350px; max-height:90cqh; padding:14px!important; box-sizing:border-box; }
html.sukdulan-phone-battle .match-menu-control { min-height:38px; font-size:13px; }
html.sukdulan-phone-battle #full-game-log-modal { position:absolute!important; inset:0; width:100%; height:100%; padding:12px 6px; box-sizing:border-box; background:#030b15eb; }
html.sukdulan-phone-battle #full-game-log-modal .full-game-log-panel { width:100%!important; max-width:none; height:100%!important; max-height:none; padding:12px; gap:8px; border-width:1px; border-radius:8px; background:#0b1829; box-shadow:0 8px 24px #0008; }
html.sukdulan-phone-battle #full-game-log-modal .full-game-log-head { flex:none; flex-direction:column; align-items:stretch; gap:8px; padding:0 0 10px; border-bottom:1px solid #36576c; }
html.sukdulan-phone-battle .full-game-log-title { font:700 18px/1.25 'Segoe UI',sans-serif!important; letter-spacing:.5px; color:#bfeafa; }
html.sukdulan-phone-battle .full-game-log-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; gap:8px; margin:0; }
html.sukdulan-phone-battle #full-game-log-modal .full-game-log-close { width:100%; min-width:0; min-height:38px; box-sizing:border-box; padding:6px!important; border:1px solid #4a7187; border-radius:5px; background:#10283b; color:#d6edf8; font:600 12px/1.2 'Segoe UI',sans-serif!important; }
html.sukdulan-phone-battle #full-game-log-modal .full-game-log-close:hover { background:#21465c; }
html.sukdulan-phone-battle #full-game-log-download-status { margin:0; font:12px/1.35 'Segoe UI',sans-serif; color:#b6d4e4; }
html.sukdulan-phone-battle #full-game-log-modal #full-game-log-content { min-width:0; min-height:0; margin:0; padding:0; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#597e92 transparent; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-stage-group { margin:0 0 8px; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-round { margin:0; padding:9px 10px; border:1px solid #365c74; border-radius:5px; background:#142f43; color:#d4effa; font:700 13px/1.3 'Segoe UI',sans-serif; text-align:left; list-style-position:inside; cursor:pointer; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-round::marker { color:#9cdcf5; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-stage-group[open] > .full-log-round { position:sticky; top:0; z-index:2; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-stage-events { padding:3px 0; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-stage { margin:6px 0 4px; padding:6px 8px; border:0; border-left:2px solid #72b7d2; border-radius:2px; background:#142537; color:#c9e6f3; font:700 12px/1.3 'Segoe UI',sans-serif; text-align:left; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-entry { width:100%; margin:3px 0; padding:7px 8px; border-radius:4px; font:13px/1.4 'Segoe UI',sans-serif; text-align:left; overflow-wrap:anywhere; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-entry.turn-log-player { background:#173a32; color:#d3f0df; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-entry.turn-log-enemy { background:#19334e; color:#d5eaff; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-entry.turn-log-neutral { width:calc(100% - 10px); margin-left:10px; border:0; border-left:2px solid #58758b; background:#122335; color:#bfd1e0; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-entry.full-log-mstack-entry { width:calc(100% - 8px); margin-left:8px; border-left:2px solid #b6a560; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-entry.full-log-mstack-result { width:calc(100% - 18px); margin-left:18px; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-entry-line { align-items:flex-start; gap:6px; }
html.sukdulan-phone-battle #full-game-log-modal .full-log-move-indicator { max-width:86px; margin:0; padding:2px 4px; border-radius:3px; background:#081723; color:#d9ebf4; font:600 11px/1.3 'Segoe UI',sans-serif; letter-spacing:0; white-space:normal; text-align:center; }
html.sukdulan-phone-battle #trigger-prompt-modal { top:var(--pb-panel-top)!important; bottom:auto!important; left:var(--pb-work-inset)!important; right:var(--pb-work-inset)!important; width:var(--pb-work-width); height:var(--pb-panel-h); max-width:none; box-sizing:border-box; transform:none!important; padding:8px!important; }
html.sukdulan-phone-battle #trigger-prompt-modal > div { font-size:13px!important; margin-bottom:6px!important; }
html.sukdulan-phone-battle #trigger-prompt-modal button { min-height:36px; font-size:12px!important; padding:4px!important; }
html.sukdulan-phone-battle :is(#tool-replace-modal,#value-range-modal,#token-burn-modal,#variable-cost-modal) {
  position:fixed!important; top:var(--pb-panel-top)!important; bottom:auto!important;
  left:var(--pb-work-left)!important; right:auto!important; width:var(--pb-work-width)!important;
  height:var(--pb-panel-h)!important; transform:none!important; box-sizing:border-box;
}
html.sukdulan-phone-battle :is(#value-range-modal,#token-burn-modal,#variable-cost-modal) > div { width:100%!important; height:100%!important; padding:6px!important; border-width:1px!important; overflow-y:auto; }
html.sukdulan-phone-battle :is(#value-range-modal,#token-burn-modal,#variable-cost-modal) > div > div { font-size:12px!important; line-height:1.2!important; white-space:normal!important; margin-bottom:4px!important; }
html.sukdulan-phone-battle :is(#value-range-modal,#token-burn-modal,#variable-cost-modal) button { height:32px!important; min-height:32px!important; padding:3px!important; font-size:12px!important; }
html.sukdulan-phone-battle :is(#value-range-modal,#token-burn-modal,#variable-cost-modal) input[type='range'] { height:24px!important; margin:2px 0!important; }
html.sukdulan-phone-battle #tool-replace-modal .modal-content { padding:5px; border-width:1px; gap:5px; }
html.sukdulan-phone-battle .tool-modal-head { width:100%; min-width:0; height:32px; padding-inline:28px; box-sizing:border-box; flex:none; }
html.sukdulan-phone-battle #tool-modal-title { font-size:11px; line-height:1.2; }
html.sukdulan-phone-battle #tool-select-container { padding:0!important; gap:4px!important; }
html.sukdulan-phone-battle #tool-select-container > .card-in-modal { box-sizing:border-box; flex:none; width:calc((var(--pb-panel-h) - 48px)*5/7); height:calc(var(--pb-panel-h) - 48px); border-width:1px; }
html.sukdulan-phone-battle #cancel-tool-replace { position:absolute; top:2px; right:2px; min-width:26px; min-height:26px; padding:2px!important; }
html.sukdulan-phone-battle body.tutorial-running { --pb-coach:0px; }
html.sukdulan-phone-battle .turn-order-announcement { left:6px!important; right:6px; top:calc(var(--pb-act-top) + var(--pb-act)/2)!important; transform:translateY(-50%)!important; padding:14px 6px!important; font-size:20px!important; text-align:center; box-sizing:border-box; }
html.sukdulan-phone-battle #phone-tutorial-step:not([hidden]) { position:absolute; top:calc(var(--pb-act-top) + var(--pb-act)/2 - 14px); left:calc(50% - 32px); width:64px; height:28px; display:flex; align-items:center; justify-content:center; box-sizing:border-box; padding:3px 5px; border:1px solid #4b8294; border-radius:4px; background:#122c3e; color:#ccebf7; z-index:3000; text-align:left; }
html.sukdulan-phone-battle #phone-tutorial-step > span { display:none; }
html.sukdulan-phone-battle #phone-tutorial-step > span { min-width:0; flex:1; }
html.sukdulan-phone-battle #phone-tutorial-step strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:600 12px/1.2 'Segoe UI',sans-serif; }
html.sukdulan-phone-battle #phone-tutorial-step small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:3px; font:11px/1.25 'Segoe UI',sans-serif; }
html.sukdulan-phone-battle #phone-tutorial-step b { flex:none; font:700 11px/1 'Segoe UI',sans-serif; color:#9ee2f3; }
html.sukdulan-phone-battle #tutorial-guide { position:absolute; top:50%; left:6px; right:6px; bottom:auto; width:auto; max-width:none; max-height:calc(100cqh - 24px); box-sizing:border-box; transform:translateY(-50%); padding:12px; border:1px solid #5c9ab2; border-radius:8px; z-index:22000; background:#0b1829; box-shadow:0 10px 40px #000a; font:13px/1.4 'Segoe UI',sans-serif; }
html.sukdulan-phone-battle #tutorial-guide.collapsed { display:none!important; }
html.sukdulan-phone-battle .tutorial-guide-head { min-height:38px; gap:8px; padding-bottom:7px; border-bottom:1px solid #36576c; font-size:12px; }
html.sukdulan-phone-battle .tutorial-guide-body { max-height:calc(100cqh - 100px); overflow-y:auto; padding-top:5px; }
html.sukdulan-phone-battle #tutorial-context { font-size:11px; margin:4px 0; }
html.sukdulan-phone-battle #tutorial-title { font-size:16px; line-height:1.25; margin:7px 0; }
html.sukdulan-phone-battle :is(#tutorial-instruction,#tutorial-explanation) { margin:6px 0; font-size:13px; }
html.sukdulan-phone-battle .tutorial-button { min-height:34px; font-size:12px; padding:5px; }
html.sukdulan-phone-battle .tutorial-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
html.sukdulan-phone-battle .tutorial-voice-controls { display:flex; flex-wrap:wrap; gap:6px; }
html.sukdulan-phone-battle body.tutorial-reading-log #tutorial-guide { display:none!important; }
html.sukdulan-phone-battle body:is(.match-menu-open,:has(#tutorial-lessons:not([hidden])),:has(#final-result-modal.active)) #tutorial-guide { display:none!important; }
html.sukdulan-phone-battle body.tutorial-reading-log #phone-tutorial-log-help { display:block; flex:none; margin:0; font:12px/1.35 'Segoe UI',sans-serif; color:#bcdce9; }
html.sukdulan-phone-battle #tutorial-visual-cues .tutorial-cue-cursor,html[data-sukdulan-view='phone'] #tutorial-visual-cues .tutorial-cue-cursor svg { width:24px; height:32px; }
html[data-sukdulan-view='phone'] #tutorial-visual-cues .tutorial-cue-label { left:17px; top:25px; padding:3px 5px; font-size:10px; letter-spacing:0; }
html[data-sukdulan-view='phone'] #tutorial-visual-cues .tutorial-cue-click-ring { width:16px; height:16px; }
html.sukdulan-phone-battle .tutorial-lesson-panel { width:calc(100% - 16px); max-width:none; max-height:90cqh; padding:12px; font-size:13px; }
html.sukdulan-phone-battle #tutorial-lesson-select { font-size:16px; }
#phone-tutorial-help { display:none; }
html.sukdulan-phone-battle #phone-tutorial-help:not([hidden]) { display:block; }
.phone-match-result,.phone-result-victory-rank { display:none; }
html.sukdulan-phone-battle #final-result-modal { position:absolute!important; inset:0!important; width:100%!important; height:100%!important; padding:12px 6px; box-sizing:border-box; background:#030b15eb; }
html.sukdulan-phone-battle #final-result-modal .result-panel { display:flex; flex-direction:column; gap:8px; width:100%!important; height:min(760px,calc(100cqh - 24px))!important; max-height:none; padding:12px; box-sizing:border-box; overflow:hidden; border:1px solid #4c839a; border-radius:8px; background:#0b1829; box-shadow:0 10px 30px #0008; animation:none!important; transform:none!important; filter:none!important; opacity:1!important; }
html.sukdulan-phone-battle .result-head { flex:none; display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:'outcome rank' 'duration stages'; align-items:center; gap:5px 8px; margin:0; padding-bottom:8px; border-bottom:1px solid #36576c; font:12px/1.3 'Segoe UI',sans-serif; text-align:left; }
html.sukdulan-phone-battle .result-rank { grid-area:outcome; font:700 23px/1.1 'Segoe UI',sans-serif; text-shadow:none; }
html.sukdulan-phone-battle #final-result-modal[data-phone-outcome='victory'] .result-rank { color:#98edb3; }
html.sukdulan-phone-battle #final-result-modal[data-phone-outcome='defeat'] .result-rank { color:#ffabb0; }
html.sukdulan-phone-battle .result-head > :nth-child(2) { grid-area:duration; }
html.sukdulan-phone-battle .result-head > :nth-child(3) { grid-area:stages; text-align:right; }
html.sukdulan-phone-battle .phone-result-victory-rank { display:block; grid-area:rank; color:#badfec; font:700 12px/1.2 'Segoe UI',sans-serif; text-align:right; }
html.sukdulan-phone-battle #final-result-modal .result-columns { display:none!important; }
html.sukdulan-phone-battle .phone-match-result { display:flex; flex-direction:column; flex:1; min-height:0; gap:8px; }
html.sukdulan-phone-battle .phone-match-result [hidden] { display:none!important; }
html.sukdulan-phone-battle :is(.phone-result-honors,.phone-result-statistics) { width:100%; border-collapse:collapse; table-layout:fixed; font-family:'Segoe UI',sans-serif; }
html.sukdulan-phone-battle .phone-result-honors { flex:none; font-size:12px; line-height:1.25; }
html.sukdulan-phone-battle .phone-result-honors th { width:20%; padding:4px; color:#a8c7da; font-size:11px; font-weight:600; text-align:left; }
html.sukdulan-phone-battle .phone-result-honors th:not(:first-child) { width:40%; text-align:center; }
html.sukdulan-phone-battle .phone-result-honors td { padding:5px 4px; text-align:center; overflow-wrap:anywhere; }
html.sukdulan-phone-battle .phone-result-honors tr { border-bottom:1px solid #294257; }
html.sukdulan-phone-battle .phone-result-honors small { display:block; margin-top:2px; color:#a7c4d4; font-size:11px; }
html.sukdulan-phone-battle .phone-result-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; flex:none; }
html.sukdulan-phone-battle .phone-result-tabs button { min-width:0; min-height:36px; padding:5px; border:1px solid #4a7187; border-radius:5px; background:#10283b; color:#c6e4f1; font:600 12px/1.2 'Segoe UI',sans-serif; }
html.sukdulan-phone-battle .phone-result-tabs button[aria-pressed='true'] { background:#23516a; border-color:#8bd4ed; color:#effaff; }
html.sukdulan-phone-battle .phone-result-content { flex:1; min-height:0; }
html.sukdulan-phone-battle .phone-result-stats-view { height:100%; }
html.sukdulan-phone-battle .phone-result-statistics { height:100%; font-size:13px; line-height:1.25; }
html.sukdulan-phone-battle .phone-result-statistics th { width:48%; padding:4px 5px; font-weight:500; color:#bdd2e1; text-align:left; }
html.sukdulan-phone-battle .phone-result-statistics th:not(:first-child) { width:26%; text-align:center; }
html.sukdulan-phone-battle .phone-result-statistics thead { background:#142f43; font-size:11px; }
html.sukdulan-phone-battle .phone-result-statistics tbody tr { border-bottom:1px solid #294257; }
html.sukdulan-phone-battle .phone-result-statistics td { padding:4px 5px; color:#e1f2fa; font-weight:600; text-align:center; font-variant-numeric:tabular-nums; }
html.sukdulan-phone-battle .phone-result-roster-view { display:grid; grid-template-rows:repeat(2,minmax(0,1fr)); gap:12px; height:100%; }
html.sukdulan-phone-battle .phone-result-roster-side { display:flex; flex-direction:column; min-width:0; min-height:0; gap:6px; }
html.sukdulan-phone-battle .phone-result-roster-side h3 { flex:none; margin:0; color:#bddcea; font:600 11px/1.3 'Segoe UI',sans-serif; text-align:center; }
html.sukdulan-phone-battle .phone-result-hero-grid { flex:1; min-height:0; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); grid-template-rows:minmax(0,1fr); gap:6px; }
html.sukdulan-phone-battle .phone-result-lineage { display:flex; flex-direction:column; justify-content:center; min-width:0; min-height:0; container-type:size; }
html.sukdulan-phone-battle .phone-result-lineage-art { position:relative; flex:none; width:100%; height:min(calc(100cqh - 44px),calc(90cqw*7/5 + var(--phone-evo-offset))); min-height:0; container-type:size; }
html.sukdulan-phone-battle .phone-result-form { position:absolute; left:50%; width:min(90cqw,calc((100cqh - var(--phone-evo-offset))*5/7)); aspect-ratio:5/7; transform:translateX(-50%); border:1px solid #99b876; border-radius:3px; box-sizing:border-box; background:#152537 center/cover no-repeat; }
html.sukdulan-phone-battle .phone-result-lineage.is-defeated .phone-result-form { filter:grayscale(1); border-color:#6b8499; }
html.sukdulan-phone-battle .phone-result-hero-label { margin-top:3px; font:11px/1.2 'Segoe UI',sans-serif; color:#c8dce8; text-align:center; overflow-wrap:anywhere; }
html.sukdulan-phone-battle .result-controls { flex:none; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:0; }
html.sukdulan-phone-battle .result-control-btn { min-width:0; min-height:40px; padding:5px; font:600 12px/1.2 'Segoe UI',sans-serif; }
html.sukdulan-phone-battle #sukdulan-result-save-status { margin:0!important; font:11px/1.25 'Segoe UI',sans-serif!important; }
@media (max-height:700px) { html.sukdulan-phone-battle #final-result-modal .result-panel { padding:8px; gap:6px; } html.sukdulan-phone-battle .phone-match-result { gap:6px; } html.sukdulan-phone-battle .phone-result-statistics { font-size:12px; } html.sukdulan-phone-battle .phone-result-statistics :is(td,th) { padding:3px 4px; } html.sukdulan-phone-battle .phone-result-honors { font-size:11px; } html.sukdulan-phone-battle .phone-result-honors td { padding:3px; } }
@media (max-height:760px) {
  html.sukdulan-phone-battle #phone-tutorial-step small { display:none; }
  html.sukdulan-phone-battle body { --pb-lower:clamp(184px,25cqh,190px); --pb-act:56px; --pb-hero-extra:32px; }
  html.sukdulan-phone-battle body { --pb-stats-top:8px; --pb-stat-row:13px; --pb-stat-gap:2px; --pb-power-row:14px; --pb-hp-height:11px; --pb-bar-top:calc(var(--pb-hero-h) - var(--pb-card-top) - 8px); --pb-bar-h:6px; }
  html.sukdulan-phone-battle .hero-move-badge { min-width:12px; width:12px; height:12px; top:0; font-size:10px; }
  html.sukdulan-phone-battle #playmat .hero-zone .card-hero > :is(.tc-badge,.lv-badge,.PWR-badge) { min-height:11px; }
  html.sukdulan-phone-battle #preview-card { width:50px; height:70px; }
}
@media (max-height:700px) {
  html.sukdulan-phone-battle body { --pb-lower:clamp(152px,23cqh,164px); --pb-pile-w:37px; --pb-pile-h:52px; }
  html.sukdulan-phone-battle .action-menu:has(> button:nth-child(5)) { grid-template-columns:repeat(3,minmax(0,1fr)); }
  html.sukdulan-phone-battle .action-menu:has(> button:nth-child(5)) > button:last-child { grid-column:auto; }
  html.sukdulan-phone-battle .action-menu-btn { min-height:28px; padding:3px; font-size:11px; }
  html.sukdulan-phone-battle .mstack-origin-card,html.sukdulan-phone-battle .mstack-origin-card .card-in-modal { width:38px; height:53px; }
  html.sukdulan-phone-battle .mstack-btn { min-height:28px; }
  html.sukdulan-phone-battle :is(#value-range-modal,#token-burn-modal,#variable-cost-modal) > div { display:grid!important; grid-template-columns:auto minmax(0,1fr); grid-template-areas:'title title' 'info info' 'value range' 'actions actions'; align-content:center; align-items:center; gap:3px; }
  html.sukdulan-phone-battle :is(#value-range-modal,#token-burn-modal,#variable-cost-modal) > div > div { margin:0!important; }
  html.sukdulan-phone-battle :is(#value-range-modal,#token-burn-modal,#variable-cost-modal) > div > div:nth-child(1) { grid-area:title; }
  html.sukdulan-phone-battle :is(#value-range-modal,#token-burn-modal,#variable-cost-modal) > div > div:nth-child(2) { grid-area:info; }
  html.sukdulan-phone-battle :is(#value-range-modal,#token-burn-modal,#variable-cost-modal) > div > div:nth-child(3) { grid-area:value; }
  html.sukdulan-phone-battle :is(#value-range-modal,#token-burn-modal,#variable-cost-modal) input[type=range] { grid-area:range; height:20px!important; margin:0!important; }
  html.sukdulan-phone-battle :is(#value-range-modal,#token-burn-modal,#variable-cost-modal) > div > div:last-child { grid-area:actions; }
  html.sukdulan-phone-battle :is(#value-range-modal,#token-burn-modal,#variable-cost-modal) button { height:28px!important; min-height:28px!important; }
}
@media (pointer:coarse) { html.sukdulan-phone-battle body { --pb-stage:44px; } html.sukdulan-phone-battle #match-menu-button { height:44px!important; min-height:44px!important; } }

/* The playfield already accounts for the OS bar; full-screen result/log sheets also need room. */
html.sukdulan-phone-battle :is(#full-game-log-modal,#final-result-modal) {
 padding-bottom:calc(12px + env(safe-area-inset-bottom,0px));
}
html.sukdulan-phone-battle #final-result-modal .result-panel {
 height:min(760px,calc(100cqh - 24px - env(safe-area-inset-bottom,0px)))!important;
}
