/* Keep the board readable while character information stays compact. */
@media(max-width:760px){
  #game-screen{padding-left:6px;padding-right:6px}
  #game-screen .game-layout,#game-screen .game-layout.inspecting{gap:7px}
  #game-screen .battle-context{display:none}
  #game-screen:has(#unit-inspector:not(.hidden)) .commandbar{visibility:hidden;pointer-events:none}
  #game-screen .commandbar{position:sticky;bottom:0;z-index:16;padding-bottom:env(safe-area-inset-bottom);background:#eeedff}
  #game-screen #unit-inspector,#game-screen #unit-inspector.expanded{
    position:fixed;top:auto;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));
    width:auto;min-height:0;height:auto;max-height:min(212px,34dvh);border-radius:14px;
    display:flex;flex-direction:column;z-index:17;box-shadow:0 3px 0 #b4a0c8,0 6px 20px #49335426;
  }
  #game-screen #unit-inspector>header{min-height:40px;padding:5px 10px;gap:7px}
  #game-screen #unit-inspector>header small{display:none}
  #game-screen #unit-inspector h2{font-size:15px;line-height:1.25;margin:0}
  #game-screen #unit-inspector>header button{min-height:30px;height:30px;width:30px;min-width:30px;font-size:20px}
  #game-screen #unit-inspector>header #inspector-expand{width:auto;flex:none;font-size:12px;padding:0 8px}
  #game-screen #inspector-content{padding:6px 10px;flex:0 1 auto;min-height:0;overflow:auto}
  #game-screen .inspector-overview{grid-template-columns:42px minmax(0,1fr);gap:8px}
  #game-screen #unit-inspector .inspector-hero{border-radius:9px;min-height:0}
  #game-screen #unit-inspector .inspector-hero img{height:44px!important;padding:1px}
  #game-screen #unit-inspector .live-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
  #game-screen #unit-inspector .live-stats>span{font-size:11px;padding:4px;line-height:1.2}
  #game-screen #unit-inspector .live-stats b{font-size:15px;margin-top:3px;line-height:1.1}
  #game-screen #unit-inspector:not(.expanded) .live-stats>span:has([data-live-stat="crit"]),
  #game-screen #unit-inspector:not(.expanded) .live-stats>span:has([data-live-stat="dps"]),
  #game-screen #unit-inspector:not(.expanded) .live-stats>span:has([data-live-stat="upgrade"]){display:none}
  #game-screen #unit-inspector .combat-summary{margin:4px 0 0}
  #game-screen #unit-inspector:not(.expanded) .callout-preview,
  #game-screen #unit-inspector:not(.expanded) .combat-role,
  #game-screen #unit-inspector:not(.expanded) .proc-info>span,
  #game-screen #unit-inspector:not(.expanded) .proc-info>p{display:none}
  #game-screen #unit-inspector:not(.expanded) .proc-info{display:block;padding:0!important;background:transparent!important;border:0!important;border-radius:0}
  #game-screen #unit-inspector:not(.expanded) .proc-info>b{font-size:12px;line-height:1.4}
  #game-screen #inspector-actions{min-height:42px;padding:6px 10px!important;gap:7px}
  #game-screen #inspector-actions button{min-height:32px;padding:5px 8px;font-size:12px;border-radius:8px}
  #game-screen #unit-inspector.expanded{height:min(420px,55dvh);max-height:min(420px,55dvh)}
  #game-screen #unit-inspector.expanded #inspector-content{flex:1;min-height:0;padding:10px}
  #game-screen #unit-inspector.expanded .inspector-hero img{height:112px!important}
  #game-screen #unit-inspector.expanded .inspector-overview{grid-template-columns:70px minmax(0,1fr)}
  #game-screen #unit-inspector.expanded .combat-summary{margin-top:10px}
  #game-screen #unit-inspector.expanded .proc-info p{font-size:14px;line-height:1.6}
  #game-screen #unit-inspector.expanded .inspection-section p{font-size:14px}
  #summon-callout{top:62px;right:8px;width:250px;max-width:calc(100vw - 24px);min-height:0;padding:5px 9px 5px 5px;gap:7px;border-width:1px;border-radius:12px;box-shadow:0 3px 9px #4c325626;animation:none}
  #summon-callout img{width:42px;height:46px;animation:none;filter:none}
  #summon-callout div{gap:2px}
  #summon-callout small{font-size:10px;line-height:1.2;letter-spacing:0}
  #summon-callout b{font-size:14px;line-height:1.25;word-break:keep-all;overflow-wrap:anywhere}
  #summon-callout span{display:none}
  #summon-callout::before{font-size:60px;left:0;opacity:.2}
}

@media(max-width:760px) and (orientation:portrait){
  #game-screen .arena{min-height:calc((100vw - 16px) * 1.125 + 55px)}
  #game-screen #battlefield{min-height:calc((100vw - 16px) * 1.125)}
}

/* ONE store H5 Game SDK viewport, safeArea, boot overlay, and monetization UI */
:root{
  --os-safe-top: env(safe-area-inset-top, 0px);
  --os-safe-bottom: env(safe-area-inset-bottom, 0px);
  --os-safe-left: env(safe-area-inset-left, 0px);
  --os-safe-right: env(safe-area-inset-right, 0px);
}
html, body{
  overscroll-behavior: none;
  padding-top: var(--os-safe-top);
  padding-bottom: var(--os-safe-bottom);
  padding-left: var(--os-safe-left);
  padding-right: var(--os-safe-right);
}
#os-boot{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #16172f;
  color: #f4f3ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
#os-boot.done{display: none;}
#os-boot p{margin: 0; font-size: 14px; color: #c7c4e2;}
#os-boot .os-boot-track{width: 196px; height: 6px; border-radius: 3px; background: #2d2f52; overflow: hidden;}
#os-boot .os-boot-fill{height: 100%; width: 0%; background: #ff6b81; transition: width .15s ease;}
.starter-pack-btn{margin-top: 8px; border-color: #f2bd64 !important;}
.starter-pack-btn:disabled{opacity: .55; cursor: not-allowed;}
.revive-ad-btn{background: #3d6bee !important; color: #fff !important;}
.revive-ad-btn:disabled{opacity: .5; cursor: not-allowed;}
