/* C64 Dungeon Carnage V10.42 R95 — RPG gameplay HUD presentation owner.
 * Presentation only: no runtime observers, timers or DOM replacement. */
:root{
  --r95-rpg-font:"Palatino Linotype","Book Antiqua",Palatino,Georgia,serif;
  --r95-data-font:Consolas,"Lucida Console","Courier New",monospace;
  --r95-gold:#e6c46f;
  --r95-gold-soft:#9f7d3f;
  --r95-bronze:#9b6235;
  --r95-stone:#100c13;
  --r95-stone-deep:#070509;
  --r95-panel:#17111b;
  --r95-line:#5f4a69;
  --r95-line-soft:#302638;
  --r95-ink:#f2edf4;
  --r95-muted:#a99dae;
  --r95-health:#6ee39a;
  --r95-armour:#7db8ef;
  --r95-ammo:#63dce8;
  --r95-weapon:#f0a667;
}

body[data-run-active="true"] .ccg-game{
  background:
    linear-gradient(180deg,rgba(22,15,26,.98),rgba(7,5,9,.995));
  border-color:#5f476c;
  box-shadow:0 0 0 2px #211727,0 18px 52px rgba(0,0,0,.72);
}

/* System bar: quiet metal frame, not another gameplay panel. */
body[data-run-active="true"] .v102-topbar{
  min-height:38px!important;
  padding:4px 8px!important;
  border-bottom:1px solid #6f563d!important;
  background:
    linear-gradient(180deg,#17121a 0%,#0b080d 100%)!important;
  box-shadow:inset 0 -1px 0 #251b29!important;
}
body[data-run-active="true"] .v102-brand h1{
  color:var(--r95-gold)!important;
  font-family:var(--r95-rpg-font)!important;
  font-size:17px!important;
  font-weight:700!important;
  letter-spacing:.45px!important;
  text-transform:none!important;
}
body[data-run-active="true"] .v102-brand p{
  color:#807487!important;
  font-family:var(--r95-data-font)!important;
  font-size:7px!important;
  letter-spacing:.7px!important;
}
body[data-run-active="true"] .system-buttons{
  gap:6px!important;
}
body[data-run-active="true"] .system-buttons>*{
  min-height:25px!important;
  padding:4px 8px!important;
  border:1px solid #46394d!important;
  background:linear-gradient(#151019,#0b080e)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025)!important;
  color:#b8acbd!important;
  font:700 8px/1 var(--r95-data-font)!important;
}
body[data-run-active="true"] .system-buttons .build-badge{
  color:#82788a!important;
}
body[data-run-active="true"] .system-buttons .status{
  color:#c9b774!important;
}
body[data-run-active="true"] .system-buttons .danger-toggle{
  border-color:#69404a!important;
  color:#da8d9c!important;
}

/* Critical strip: compact adventurer hotbar. */
body[data-run-active="true"] .critical-strip{
  gap:6px!important;
  padding:5px 8px!important;
  border-bottom:1px solid #4f3c43!important;
  background:linear-gradient(180deg,#100c12,#09070b)!important;
}
body[data-run-active="true"] .critical-card{
  min-height:43px!important;
  padding:5px 8px!important;
  border:1px solid #3f3347!important;
  border-left:3px solid #6a536f!important;
  background:linear-gradient(135deg,#17111a,#0b080d)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025)!important;
}
body[data-run-active="true"] .critical-card b{
  color:#9b8ba2!important;
  font:700 7px/1 var(--r95-data-font)!important;
  letter-spacing:.8px!important;
}
body[data-run-active="true"] .critical-card strong{
  margin-top:3px!important;
  color:var(--r95-ink)!important;
  font:700 12px/1.05 var(--r95-data-font)!important;
}
body[data-run-active="true"] .critical-card span{
  color:#766c7d!important;
  font:700 6.5px/1.1 var(--r95-data-font)!important;
}
body[data-run-active="true"] .critical-card kbd{
  min-width:30px!important;
  border-color:#7e663c!important;
  background:#0b080c!important;
  color:var(--r95-gold)!important;
  box-shadow:inset 0 -2px 0 #3a2c18!important;
}
body[data-run-active="true"] .potion-card{border-left-color:var(--r95-health)!important}
body[data-run-active="true"] .torch-card{border-left-color:var(--r95-gold)!important}
body[data-run-active="true"] .keys-card{border-left-color:#c88b48!important}
body[data-run-active="true"] .inventory-card{border-left-color:#8d79b8!important}

/* Mission becomes the current quest banner. */
body[data-run-active="true"] .v102-mission{
  min-height:34px!important;
  padding:5px 10px!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  border-top:1px solid #211823!important;
  border-bottom:1px solid #6a5137!important;
  background:
    linear-gradient(90deg,rgba(98,68,34,.28),rgba(21,15,20,.96) 17%,rgba(8,6,10,.98))!important;
  box-shadow:inset 0 1px 0 rgba(229,196,111,.06)!important;
}
body[data-run-active="true"] .v102-mission>strong{
  color:var(--r95-gold)!important;
  font:700 13px/1 var(--r95-rpg-font)!important;
  letter-spacing:1px!important;
}
body[data-run-active="true"] .v102-mission #mission-text{
  color:#ddd4df!important;
  font:700 10px/1.25 var(--r95-data-font)!important;
}

/* Main battlefield frame. */
body[data-run-active="true"] .v102-game-area{
  background:#050406!important;
  border-top:1px solid #2f2633!important;
}
body[data-run-active="true"] .canvas-wrap{
  position:relative!important;
  border-right:1px solid #4a394f!important;
  box-shadow:inset 0 0 0 1px rgba(230,196,111,.025)!important;
}
body[data-run-active="true"] .canvas-wrap::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  box-shadow:inset 0 0 30px rgba(0,0,0,.42);
}

/* Tactical intelligence column. */
body[data-run-active="true"] .tactical-zone{
  padding:7px!important;
  gap:7px!important;
  border-left:1px solid #4e3d53!important;
  background:
    linear-gradient(180deg,#120d15,#08060a)!important;
}
body[data-run-active="true"] .tactical-zone .radar-card,
body[data-run-active="true"] .tactical-zone .shortcut-dock{
  border:1px solid #54435d!important;
  border-top:2px solid #8d7043!important;
  background:
    linear-gradient(180deg,rgba(25,18,28,.97),rgba(9,7,11,.98))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025),0 4px 12px rgba(0,0,0,.22)!important;
}
body[data-run-active="true"] .tactical-zone .radar-card h3,
body[data-run-active="true"] .shortcut-dock-head h3{
  margin:0 0 6px!important;
  color:var(--r95-gold)!important;
  font:700 12px/1.05 var(--r95-rpg-font)!important;
  letter-spacing:.5px!important;
  text-transform:none!important;
}
body[data-run-active="true"] .shortcut-dock-head span{
  color:#7e7385!important;
  font:700 6.5px/1 var(--r95-data-font)!important;
  letter-spacing:.8px!important;
}
body[data-run-active="true"] .v102-radar-card canvas{
  border:1px solid #3f3345!important;
  background:#040305!important;
  box-shadow:inset 0 0 18px #000!important;
}
body[data-run-active="true"] .radar-legend,
body[data-run-active="true"] .radar-room-legend{
  color:#918594!important;
  font:700 6.5px/1.2 var(--r95-data-font)!important;
}
body[data-run-active="true"] .command-grid{
  gap:5px!important;
}
body[data-run-active="true"] .command-grid>span,
body[data-run-active="true"] .item-command{
  min-height:32px!important;
  border:1px solid #3d3144!important;
  background:linear-gradient(180deg,#110d14,#09070b)!important;
}
body[data-run-active="true"] .command-grid kbd,
body[data-run-active="true"] .item-command kbd{
  border-color:#6b5b76!important;
  background:#08060a!important;
  color:#d8c8e0!important;
  font:700 8px/1 var(--r95-data-font)!important;
}
body[data-run-active="true"] .command-grid b,
body[data-run-active="true"] .item-command b{
  color:#d8d0db!important;
  font:700 7.5px/1.1 var(--r95-data-font)!important;
}
body[data-run-active="true"] .item-command{
  border-left:3px solid #6f5c7b!important;
}
body[data-run-active="true"] .item-command-potion{border-left-color:var(--r95-health)!important}
body[data-run-active="true"] .item-command-torch{border-left-color:var(--r95-gold)!important}
body[data-run-active="true"] .item-command-teleport,
body[data-run-active="true"] .item-command-banishment{border-left-color:#b287df!important}

/* Event rail: parchment-like dungeon journal rather than a debug panel. */
body[data-run-active="true"] .game-message-rail{
  padding:7px!important;
  gap:6px!important;
  border-left:1px solid #49384e!important;
  background:linear-gradient(180deg,#100c12,#070609)!important;
}
body[data-run-active="true"] .game-message-context{
  border:1px solid #3f3344!important;
  border-left:3px solid #806646!important;
  background:#0c090e!important;
}
body[data-run-active="true"] .game-message-context b{
  color:var(--r95-gold)!important;
  font:700 8px/1 var(--r95-rpg-font)!important;
}
body[data-run-active="true"] .game-message-context span{
  color:#a99cae!important;
  font:700 7.5px/1.25 var(--r95-data-font)!important;
}
body[data-run-active="true"] .game-message-rail .pickup-toast{
  border:1px solid #6b5434!important;
  border-left:3px solid var(--r95-gold)!important;
  background:linear-gradient(135deg,#1b141a,#0b080c)!important;
  box-shadow:inset 0 0 18px rgba(229,196,111,.035)!important;
}
body[data-run-active="true"] .game-message-rail .pickup-toast b{
  color:var(--r95-gold)!important;
  font:700 13px/1.05 var(--r95-rpg-font)!important;
  letter-spacing:.2px!important;
  text-transform:none!important;
}
body[data-run-active="true"] .game-message-rail .pickup-toast span,
body[data-run-active="true"] .game-message-line,
body[data-run-active="true"] .game-quest-list{
  font-family:var(--r95-data-font)!important;
}

/* Player HUD: three strong RPG blocks rather than a row of equal telemetry boxes. */
body[data-run-active="true"] .ccg-game>.player-hub{
  height:128px!important;
  min-height:128px!important;
  max-height:128px!important;
  padding:8px 9px!important;
  gap:8px!important;
  grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr) minmax(500px,1.3fr)!important;
  border-top:2px solid #8a6a3e!important;
  background:
    linear-gradient(180deg,#171119 0%,#0b080d 58%,#070509 100%)!important;
  box-shadow:inset 0 1px 0 rgba(230,196,111,.08),0 -8px 20px rgba(0,0,0,.32)!important;
  overflow:hidden!important;
  align-items:stretch!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .core-stats{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-auto-rows:minmax(0,1fr)!important;
  gap:6px!important;
  min-width:0!important;
  min-height:0!important;
  width:100%!important;
  height:100%!important;
  overflow:hidden!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .hub-stat{
  position:relative!important;
  min-height:0!important;
  padding:8px 8px 18px!important;
  border:1px solid #493b50!important;
  border-top:2px solid #76617f!important;
  background:
    linear-gradient(180deg,#19131d,#0d0a10)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025)!important;
  text-align:left!important;
  overflow:hidden!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .hub-stat span{
  margin:0!important;
  color:#94889a!important;
  font:700 7px/1 var(--r95-data-font)!important;
  letter-spacing:.8px!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .hub-stat b{
  display:block!important;
  margin-top:7px!important;
  overflow:hidden!important;
  color:var(--r95-ink)!important;
  font:700 clamp(15px,1.45vw,21px)/1 var(--r95-data-font)!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .hub-stat::after{
  content:""!important;
  position:absolute!important;
  left:8px!important;
  right:8px!important;
  bottom:7px!important;
  width:auto!important;
  height:6px!important;
  border:1px solid #2e2633!important;
  border-radius:0!important;
  background:#050407!important;
  box-shadow:inset 0 1px 2px #000!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .hub-stat::before{
  content:""!important;
  position:absolute!important;
  left:9px!important;
  bottom:8px!important;
  z-index:2!important;
  height:4px!important;
  max-width:calc(100% - 18px)!important;
  border-radius:0!important;
  box-shadow:0 0 9px currentColor!important;
}
body[data-run-active="true"] .health-stat{border-top-color:#4d8d63!important}
body[data-run-active="true"] .health-stat b{color:var(--r95-health)!important}
body[data-run-active="true"] .health-stat::before{width:var(--health-pct,100%)!important;background:var(--r95-health)!important;color:var(--r95-health)!important}
body[data-run-active="true"] .armour-stat{border-top-color:#507699!important}
body[data-run-active="true"] .armour-stat b{color:var(--r95-armour)!important}
body[data-run-active="true"] .armour-stat::before{width:var(--armour-pct,0%)!important;background:var(--r95-armour)!important;color:var(--r95-armour)!important}
body[data-run-active="true"] .ammo-stat{border-top-color:#40808a!important}
body[data-run-active="true"] .ammo-stat b{color:var(--r95-ammo)!important}
body[data-run-active="true"] .ammo-stat::before{width:var(--ammo-pct,0%)!important;background:var(--r95-ammo)!important;color:var(--r95-ammo)!important}
body[data-run-active="true"] .weapon-stat{border-top-color:#9a6843!important}
body[data-run-active="true"] .weapon-stat b{color:var(--r95-weapon)!important;font-size:clamp(11px,1.08vw,16px)!important;line-height:1.08!important}
body[data-run-active="true"] .weapon-stat::before,
body[data-run-active="true"] .weapon-stat::after{display:none!important}

/* Quick item belt. */
body[data-run-active="true"] .ccg-game>.player-hub .hub-inventory{
  min-width:0!important;
  min-height:0!important;
  width:100%!important;
  height:100%!important;
  overflow:hidden!important;
  padding:7px!important;
  border:1px solid #4f3d55!important;
  border-top:2px solid #8a6a3e!important;
  background:linear-gradient(180deg,#151018,#0b080d)!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .hub-inventory-head{
  flex-wrap:wrap!important;
  gap:2px!important;
  min-height:14px!important;
  margin:0 0 3px!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .hub-inventory-head>b{
  color:var(--r95-gold)!important;
  font:700 10px/1 var(--r95-rpg-font)!important;
  letter-spacing:.45px!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .hub-inventory-flags{
  color:#8f8395!important;
  font:700 6.5px/1 var(--r95-data-font)!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .hub-bronze-key{
  border-color:#765333!important;
  background:#1b110b!important;
  color:#d59852!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .quick-slots{
  gap:5px!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .quick-slot{
  height:35px!important;
  border:1px solid #4c3e52!important;
  border-bottom:2px solid #6e5876!important;
  background:
    radial-gradient(circle at 50% 42%,rgba(116,87,130,.10),transparent 58%),
    linear-gradient(180deg,#110d14,#070509)!important;
  box-shadow:inset 0 0 10px rgba(0,0,0,.55)!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .quick-slot.filled{
  border-color:#806b88!important;
  box-shadow:inset 0 0 12px rgba(196,163,214,.06),0 0 0 1px rgba(230,196,111,.03)!important;
}
body[data-run-active="true"] .quick-slot>b{
  color:#675b6d!important;
  font:700 7px/1 var(--r95-data-font)!important;
}
body[data-run-active="true"] .quick-slot-key{
  border-color:#806646!important;
  background:#0b080c!important;
  color:var(--r95-gold)!important;
}
body[data-run-active="true"] .quick-slot .stack-name{
  background:rgba(5,4,7,.92)!important;
  color:#c1b0c7!important;
  font:700 6.5px/1.1 var(--r95-data-font)!important;
}
body[data-run-active="true"] .stack-count{
  border-color:#816b42!important;
  background:#0a070a!important;
  color:var(--r95-gold)!important;
  font-family:var(--r95-data-font)!important;
}

/* Progression / objective block. */
body[data-run-active="true"] .ccg-game>.player-hub .hub-progress{
  display:grid!important;
  /* XP plus Objective, Score, dynamically-owned Gold and Floor. */
  grid-template-columns:minmax(190px,1.45fr) repeat(4,minmax(78px,.62fr))!important;
  grid-template-rows:minmax(0,1fr)!important;
  grid-auto-rows:minmax(0,1fr)!important;
  gap:6px!important;
  min-width:0!important;
  min-height:0!important;
  width:100%!important;
  height:100%!important;
  overflow:hidden!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .priority-xp{
  /* Retire game.css's full-row XP span; keep stats beside the upgrade action. */
  grid-column:auto!important;
  position:relative!important;
  z-index:3!important;
  min-width:0!important;
  min-height:0!important;
  overflow:visible!important;
  padding:8px!important;
  border:1px solid #57445e!important;
  border-top:2px solid #8d7043!important;
  background:linear-gradient(180deg,#18121b,#0b080e)!important;
}
body[data-run-active="true"] .priority-xp-head b{
  color:var(--r95-gold)!important;
  font:700 13px/1 var(--r95-rpg-font)!important;
}
body[data-run-active="true"] .priority-xp-head strong{
  color:#c2b4c8!important;
  font:700 7px/1 var(--r95-data-font)!important;
}
body[data-run-active="true"] .xp-track{
  height:9px!important;
  margin:8px 0 5px!important;
  border:1px solid #392d3d!important;
  background:#050407!important;
}
body[data-run-active="true"] .xp-track i{
  background:linear-gradient(90deg,#8161a2,#c39bd5,#e0bf72)!important;
  box-shadow:0 0 8px rgba(195,155,213,.32)!important;
}
body[data-run-active="true"] .priority-xp small{
  color:#857a8b!important;
  font:700 6.5px/1.2 var(--r95-data-font)!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .run-stat{
  position:relative!important;
  z-index:1!important;
  min-width:0!important;
  min-height:0!important;
  padding:7px 5px!important;
  border:1px solid #433648!important;
  background:linear-gradient(180deg,#141017,#0b080d)!important;
  text-align:center!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .run-stat span{
  color:#817686!important;
  font:700 6.5px/1 var(--r95-data-font)!important;
  letter-spacing:.6px!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .run-stat b{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  margin-top:8px!important;
  color:#e2d5e5!important;
  font:700 clamp(10px,.78vw,13px)/1 var(--r95-data-font)!important;
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
}
body[data-run-active="true"] .ccg-game>.player-hub .run-stat:nth-child(3) b{color:var(--r95-gold)!important}
body[data-run-active="true"] .pending-level-up{
  position:relative!important;
  z-index:4!important;
  pointer-events:auto!important;
  max-width:100%!important;
  margin-top:4px!important;
  border-color:#a17f48!important;
  background:#20170c!important;
  color:#f1ce79!important;
  font-family:var(--r95-data-font)!important;
}

/* Existing secondary telemetry remains deliberately demoted. */
body[data-run-active="true"] .hub-telemetry{display:none!important}

/* Panels opened during play should belong to the same RPG visual family. */
body[data-run-active="true"] .overlay .panel:not(#menu .panel){
  border-color:#6d566f!important;
  background:
    linear-gradient(180deg,rgba(25,18,29,.985),rgba(8,6,10,.99))!important;
  box-shadow:0 18px 70px #000,0 0 0 1px rgba(230,196,111,.05) inset!important;
}
body[data-run-active="true"] .overlay .panel h2{
  color:var(--r95-gold)!important;
  font-family:var(--r95-rpg-font)!important;
  letter-spacing:.6px!important;
  text-transform:none!important;
}
body[data-run-active="true"] .overlay .panel h3{
  font-family:var(--r95-rpg-font)!important;
}

/* Short/wide desktop fit: preserve every HUD block without horizontal clipping. */
@media(max-height:900px) and (min-width:1181px){
  body[data-run-active="true"] .ccg-game>.player-hub{
    height:100px!important;
    min-height:100px!important;
    max-height:100px!important;
    padding:6px 7px!important;
    gap:6px!important;
    grid-template-columns:minmax(0,1.04fr) minmax(0,.9fr) minmax(0,1.16fr)!important;
  }
  body[data-run-active="true"] .ccg-game>.player-hub .hub-stat{padding:6px 6px 15px!important}
  body[data-run-active="true"] .ccg-game>.player-hub .hub-stat b{margin-top:5px!important;font-size:clamp(12px,1.18vw,17px)!important}
  body[data-run-active="true"] .ccg-game>.player-hub .hub-inventory{padding:5px!important}
  body[data-run-active="true"] .ccg-game>.player-hub .hub-inventory-head{min-height:15px!important;margin-bottom:3px!important;flex-wrap:nowrap!important}
  body[data-run-active="true"] .ccg-game>.player-hub #quick-specials{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  /* Short desktops already expose keys in the live KEYS & ITEMS sidebar. Hide the
   * duplicate bottom keyring so the quick belt never clips below the viewport. */
  body[data-run-active="true"] .ccg-game>.player-hub #quick-keyring-icons{display:none!important}
  body[data-run-active="true"] .ccg-game>.player-hub .quick-slot{height:32px!important}
  body[data-run-active="true"] .ccg-game>.player-hub .hub-progress{gap:4px!important;grid-template-columns:minmax(170px,1.35fr) repeat(4,minmax(72px,.62fr))!important}
  body[data-run-active="true"] .ccg-game>.player-hub .priority-xp{padding:6px!important}
  body[data-run-active="true"] .xp-track{margin:5px 0 3px!important}
  body[data-run-active="true"] .ccg-game>.player-hub .run-stat{padding:5px 3px!important}
  body[data-run-active="true"] .ccg-game>.player-hub .run-stat b{margin-top:5px!important;font-size:11px!important}
}

/* Desktop compression without returning to unreadable micro-text. */
@media(max-width:1180px) and (min-width:821px){
  body[data-run-active="true"] .ccg-game>.player-hub{
    height:150px!important;
    min-height:150px!important;
    max-height:150px!important;
    grid-template-columns:1fr 1fr!important;
    grid-template-rows:72px 62px!important;
  }
  body[data-run-active="true"] .ccg-game>.player-hub .hub-progress{
    grid-column:1/-1!important;
  }
  body[data-run-active="true"] .ccg-game>.player-hub .quick-slot{height:48px!important}
}

/* Mobile keeps combat essentials large and discards secondary ornament. */
@media(max-width:820px){
  body[data-run-active="true"] .critical-strip{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    padding:4px!important;
  }
  body[data-run-active="true"] .v102-mission{
    min-height:30px!important;
    padding:4px 7px!important;
  }
  body[data-run-active="true"] .v102-mission>strong{font-size:11px!important}
  body[data-run-active="true"] .v102-mission #mission-text{font-size:8.5px!important}
  body[data-run-active="true"] .ccg-game>.player-hub{
    height:84px!important;
    min-height:84px!important;
    max-height:84px!important;
    grid-template-columns:1fr!important;
    padding:5px!important;
  }
  body[data-run-active="true"] .ccg-game>.player-hub .core-stats{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  body[data-run-active="true"] .ccg-game>.player-hub .hub-stat{
    padding:6px 5px 14px!important;
  }
  body[data-run-active="true"] .ccg-game>.player-hub .hub-stat b{
    margin-top:5px!important;
    font-size:12px!important;
  }
  body[data-run-active="true"] .ccg-game>.player-hub .hub-stat span{font-size:5.8px!important}
  body[data-run-active="true"] .ccg-game>.player-hub .hub-inventory,
  body[data-run-active="true"] .ccg-game>.player-hub .hub-progress{display:none!important}
  body[data-run-active="true"] .tactical-zone{
    padding:4px!important;
    background:rgba(7,5,9,.94)!important;
  }
}

@media(max-width:620px){
  body[data-run-active="true"] .ccg-game{
    grid-template-rows:28px minmax(0,1fr) 84px!important;
  }
  body[data-run-active="true"] .ccg-game:fullscreen{
    grid-template-rows:28px minmax(0,1fr) 84px!important;
  }
  body[data-run-active="true"] .ccg-game>.player-hub{
    grid-row:3!important;
    align-self:stretch!important;
    block-size:84px!important;
    height:84px!important;
    min-height:84px!important;
    max-height:84px!important;
  }
}

@media(max-height:760px) and (min-width:821px){
  body[data-run-active="true"] .ccg-game>.player-hub{
    height:98px!important;
    min-height:98px!important;
    max-height:98px!important;
    padding:6px 7px!important;
  }
  body[data-run-active="true"] .ccg-game>.player-hub .hub-stat{padding:6px 6px 15px!important}
  body[data-run-active="true"] .ccg-game>.player-hub .quick-slot{height:50px!important}
}


/* R95 — authoritative portrait shell and touch controls. */
.v104-touch-controls{
  position:absolute!important;
  left:0!important;
  right:0!important;
  bottom:0!important;
  z-index:32!important;
  display:none!important;
  grid-template-columns:136px minmax(0,1fr)!important;
  align-items:end!important;
  gap:8px!important;
  padding:8px max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important;
  pointer-events:none!important;
  background:linear-gradient(180deg,transparent 0%,rgba(5,3,8,.42) 24%,rgba(5,3,8,.90) 100%)!important;
  user-select:none!important;
  -webkit-user-select:none!important;
}
body.v104-touch-device[data-run-active="true"] .v104-touch-controls.active{display:grid!important}
.v104-touch-pad,.v104-touch-actions{pointer-events:auto!important}
.v104-touch-pad{
  display:grid!important;
  grid-template-columns:repeat(3,44px)!important;
  grid-template-rows:repeat(3,44px)!important;
  gap:2px!important;
  width:136px!important;
  height:136px!important;
}
.v104-touch-actions{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:5px!important;
  height:142px!important;
  align-content:end!important;
}
.v104-touch-btn{
  min-width:0!important;
  min-height:44px!important;
  padding:4px 3px!important;
  border:1px solid #745b80!important;
  border-bottom:2px solid #9a7a4c!important;
  border-radius:7px!important;
  background:linear-gradient(180deg,rgba(32,24,37,.94),rgba(10,7,13,.96))!important;
  color:#f1e7f3!important;
  box-shadow:inset 0 0 12px rgba(0,0,0,.48),0 2px 8px rgba(0,0,0,.42)!important;
  font:700 9px/1.05 var(--r95-data-font)!important;
  letter-spacing:.3px!important;
  text-shadow:none!important;
  touch-action:none!important;
}
.v104-touch-btn small{display:block;margin-top:3px;color:#9d91a4;font-size:6px!important;line-height:1!important}
.v104-touch-btn.held,.v104-touch-btn:active{border-color:var(--r95-gold)!important;background:linear-gradient(180deg,#4a3651,#211524)!important;transform:translateY(1px)!important}
.v104-touch-fire{border-color:#a85b42!important;color:#ffd0b2!important;font-size:11px!important}
.v104-touch-banish{border-color:#75558d!important;color:#d7b9e8!important}
.v104-touch-btn.touch-item-unavailable{opacity:.58!important}
.v104-touch-pad [data-dir="up"]{grid-column:2;grid-row:1}
.v104-touch-pad [data-dir="left"]{grid-column:1;grid-row:2}
.v104-touch-pad [data-dir="right"]{grid-column:3;grid-row:2}
.v104-touch-pad [data-dir="down"]{grid-column:2;grid-row:3}

@media (orientation:portrait) and (max-width:900px), (orientation:portrait) and (pointer:coarse){
  body[data-run-active="true"] .ccg-game,
  body[data-run-active="true"] .ccg-game:fullscreen,
  body[data-run-active="true"] .ccg-game:-webkit-full-screen{
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:28px minmax(0,1fr) 84px!important;
  }
  body[data-run-active="true"] .ccg-game>.v102-topbar,
  body[data-run-active="true"] .ccg-game>.critical-strip,
  body[data-run-active="true"] .ccg-game>.fullscreen-hint,
  body[data-run-active="true"] .ccg-game>.tactical-zone{display:none!important}
  body[data-run-active="true"] .ccg-game>.mission{
    grid-row:1!important;
    height:28px!important;
    min-height:28px!important;
    padding:3px 7px!important;
  }
  body[data-run-active="true"] .ccg-game>.game-area{
    grid-row:2!important;
    position:relative!important;
    min-height:0!important;
    height:100%!important;
  }
  body[data-run-active="true"] .ccg-game>.player-hub{
    grid-row:3!important;
    align-self:stretch!important;
    block-size:84px!important;
    height:84px!important;
    min-height:84px!important;
    max-height:84px!important;
  }
}

/* R95 — fixed-geometry RPG loading console. */
.ccg-release-loading{
  padding:clamp(12px,3vw,30px)!important;
  background:
    radial-gradient(circle at 18% 16%,rgba(185,120,255,.12),transparent 34%),
    radial-gradient(circle at 82% 70%,rgba(108,236,255,.08),transparent 38%),
    linear-gradient(180deg,#050308,#0b0710 58%,#030205)!important;
}
.ccg-release-loading::before{
  content:""!important;
  position:absolute!important;
  inset:0!important;
  pointer-events:none!important;
  background:repeating-linear-gradient(180deg,rgba(255,255,255,.018) 0,rgba(255,255,255,.018) 1px,transparent 1px,transparent 4px)!important;
  opacity:.34!important;
}
.ccg-release-loading-card{
  position:relative!important;
  width:min(940px,96vw)!important;
  height:min(520px,calc(100dvh - 40px))!important;
  min-height:min(500px,calc(100dvh - 40px))!important;
  max-height:520px!important;
  contain:layout paint!important;
  display:grid!important;
  grid-template-columns:minmax(300px,.95fr) minmax(360px,1.05fr)!important;
  gap:0!important;
  padding:0!important;
  overflow:hidden!important;
  border:1px solid #6e5878!important;
  border-top:2px solid #b28a4f!important;
  border-radius:8px!important;
  background:#09060c!important;
  box-shadow:0 24px 80px rgba(0,0,0,.68),0 0 0 1px rgba(230,196,111,.045) inset!important;
}
.ccg-release-loading-art-frame{
  position:relative!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  border-right:1px solid #4d3d54!important;
  background:#060407!important;
}
.ccg-release-loading-art{
  width:100%!important;
  height:100%!important;
  max-height:none!important;
  margin:0!important;
  border-radius:0!important;
  object-fit:cover!important;
  opacity:.78!important;
  filter:saturate(.84) contrast(1.08) brightness(.72)!important;
  box-shadow:none!important;
}
.ccg-release-loading-art-frame::after{
  content:""!important;
  position:absolute!important;
  inset:0!important;
  background:linear-gradient(180deg,rgba(5,3,8,.06),rgba(5,3,8,.12) 48%,rgba(5,3,8,.78))!important;
  pointer-events:none!important;
}
.ccg-release-loading-art-copy{
  position:absolute!important;
  left:20px!important;
  right:20px!important;
  bottom:20px!important;
  z-index:2!important;
  display:grid!important;
  gap:5px!important;
}
.ccg-release-loading-art-copy b{color:#e0bf72!important;font:700 17px/1.1 var(--r95-rpg-font)!important}
.ccg-release-loading-art-copy span{color:#c9bdce!important;font:700 8px/1.4 var(--r95-data-font)!important;letter-spacing:.5px!important}
.ccg-release-loading-console{
  min-width:0!important;
  display:grid!important;
  grid-template-rows:auto auto 82px auto auto auto!important;
  align-content:center!important;
  gap:12px!important;
  padding:34px 34px 30px!important;
  background:
    radial-gradient(circle at 85% 8%,rgba(185,120,255,.08),transparent 30%),
    linear-gradient(180deg,#171019,#0b080d 58%,#070509)!important;
}
.ccg-release-loading-kicker{margin:0!important;color:#c7a4da!important;font:700 8px/1 var(--r95-data-font)!important;letter-spacing:1.8px!important}
.ccg-release-loading h2{margin:0!important;color:#e4c477!important;font:700 clamp(24px,3.6vw,38px)/1 var(--r95-rpg-font)!important;letter-spacing:.4px!important;text-transform:none!important}
.ccg-release-loading-status-frame{
  box-sizing:border-box!important;
  block-size:82px!important;
  min-height:82px!important;
  max-height:82px!important;
  overflow:hidden!important;
  padding:12px 14px!important;
  border:1px solid #4d3d54!important;
  border-left:3px solid #8d7043!important;
  background:#08060a!important;
}
.ccg-release-loading-stage{display:block!important;margin-bottom:7px!important;color:#8adfed!important;font:700 7px/1 var(--r95-data-font)!important;letter-spacing:1px!important}
.ccg-release-loading p{
  display:block!important;
  height:36px!important;
  min-height:36px!important;
  max-height:36px!important;
  margin:0!important;
  overflow:hidden!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  color:#d3c6d8!important;
  font:700 10px/1.45 var(--r95-data-font)!important;
}
.ccg-release-loading progress{
  height:14px!important;
  border:1px solid #4d3d54!important;
  border-radius:0!important;
  background:#050407!important;
}
.ccg-release-loading progress::-webkit-progress-bar{border-radius:0!important;background:#050407!important}
.ccg-release-loading progress::-webkit-progress-value{border-radius:0!important;background:linear-gradient(90deg,#6c4f87,#9e76ad,#d8b566)!important;box-shadow:0 0 14px rgba(216,181,102,.22)!important}
.ccg-release-loading progress::-moz-progress-bar{border-radius:0!important;background:linear-gradient(90deg,#6c4f87,#9e76ad,#d8b566)!important}
.ccg-release-loading-meta{margin:0!important;color:#817787!important;font:700 7px/1.3 var(--r95-data-font)!important}
.ccg-release-loading-percent{color:#e0bf72!important;font-size:11px!important}
.ccg-release-loading-stages{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important}
.ccg-release-loading-stages span{
  padding:7px 5px!important;
  border:1px solid #352b3a!important;
  background:#070509!important;
  color:#655d6a!important;
  font:700 6.5px/1 var(--r95-data-font)!important;
  text-align:center!important;
  letter-spacing:.45px!important;
}
.ccg-release-loading-stages span.is-active{border-color:#806649!important;color:#e0bf72!important;background:#171009!important}
.ccg-release-loading-stages span.is-complete{border-color:#3d6f61!important;color:#91c9b6!important;background:#07110e!important}

@media(max-width:720px){
  .ccg-release-loading-card{
    height:min(690px,94dvh)!important;
    min-height:min(690px,94dvh)!important;
    max-height:min(690px,94dvh)!important;
    grid-template-columns:1fr!important;
    grid-template-rows:minmax(190px,34dvh) minmax(0,1fr)!important;
  }
  .ccg-release-loading-art-frame{min-height:190px!important;border-right:0!important;border-bottom:1px solid #4d3d54!important}
  .ccg-release-loading-art-copy{left:14px!important;right:14px!important;bottom:12px!important}
  .ccg-release-loading-console{grid-template-rows:auto auto 76px auto auto auto!important;padding:20px 18px 18px!important;gap:9px!important}
  .ccg-release-loading-status-frame{block-size:76px!important;min-height:76px!important;max-height:76px!important;padding:10px 11px!important}
  .ccg-release-loading p{height:34px!important;min-height:34px!important;max-height:34px!important;font-size:9px!important}
  .ccg-release-loading-stages span{padding:6px 2px!important;font-size:5.6px!important}
}


/* R95 — migrated mobile inventory ergonomics; V10.24 CSS is retired. */
@media(max-width:900px),(pointer:coarse){
  body.v104-touch-device .ccg-game .panel p,
  body.v104-touch-device .ccg-game .panel li,
  body.v104-touch-device .ccg-game .panel label,
  body.v104-touch-device .ccg-game .panel small{
    font-size:clamp(12px,3.2vw,15px)!important;
    line-height:1.42!important;
  }
  body.v104-touch-device .ccg-game .panel button,
  body.v104-touch-device .ccg-game .panel input,
  body.v104-touch-device .ccg-game .panel select{
    font-size:clamp(12px,3.2vw,15px)!important;
    line-height:1.15!important;
  }
  body.v104-touch-device .ccg-game .panel button{
    min-height:46px!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  body[data-run-active="false"].v104-touch-device .ccg-game #menu .field span,
  body[data-run-active="false"].v104-touch-device .ccg-game #menu .note,
  body[data-run-active="false"].v104-touch-device .ccg-game #menu .collection-summary{
    font-size:11px!important;
    line-height:1.35!important;
  }

  body.v104-touch-device #inventory-panel{
    padding:8px 8px calc(76px + env(safe-area-inset-bottom))!important;
    align-items:stretch!important;
    overflow:hidden!important;
  }
  body.v104-touch-device #inventory-panel>.inventory-panel{
    width:100%!important;
    max-width:760px!important;
    max-height:100%!important;
    margin:0 auto!important;
    padding:14px 12px 92px!important;
    overflow:auto!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
  }
  body.v104-touch-device #inventory-panel .mobile-panel-head{
    position:sticky!important;
    top:-14px!important;
    z-index:12!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:8px!important;
    margin:-14px -12px 12px!important;
    padding:12px!important;
    background:rgba(12,6,18,.98)!important;
    border-bottom:1px solid rgba(185,120,255,.45)!important;
  }
  body.v104-touch-device #inventory-panel .mobile-panel-head h2{
    margin:0!important;
    font-size:clamp(20px,5.4vw,28px)!important;
    line-height:1.12!important;
    text-align:left!important;
  }
  body.v104-touch-device #inventory-close-top{
    min-width:132px!important;
    min-height:48px!important;
    padding:9px 12px!important;
    font-size:13px!important;
  }
  body.v104-touch-device #ccg-mobile-inventory-return{
    position:fixed!important;
    left:50%!important;
    bottom:max(10px,env(safe-area-inset-bottom))!important;
    z-index:10110!important;
    display:block!important;
    width:min(92vw,440px)!important;
    min-height:54px!important;
    padding:11px 18px!important;
    transform:translateX(-50%)!important;
    border:2px solid #ffd85a!important;
    border-radius:12px!important;
    background:#ffd85a!important;
    color:#160b1e!important;
    box-shadow:0 8px 28px rgba(0,0,0,.74),0 0 22px rgba(255,216,90,.2)!important;
    font:900 clamp(14px,3.8vw,17px)/1.1 var(--r95-data-font)!important;
    letter-spacing:.03em!important;
    text-align:center!important;
    touch-action:manipulation!important;
  }
  body.v104-touch-device #ccg-mobile-inventory-return.hidden{display:none!important}
  body.v104-touch-device #inventory-panel .inventory-mobile-notice{
    padding:9px 10px!important;
    font-size:12px!important;
    line-height:1.35!important;
  }
  body.v104-touch-device #inventory-panel .inventory-objective{
    padding:12px!important;
    margin:10px 0 13px!important;
  }
  body.v104-touch-device #inventory-panel .inventory-objective b{font-size:15px!important}
  body.v104-touch-device #inventory-panel .inventory-objective span{font-size:13px!important;line-height:1.38!important}
  body.v104-touch-device #inventory-panel .inventory-objective small{font-size:11px!important}
  body.v104-touch-device #inventory-panel .inventory-list{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;
  }
  body.v104-touch-device #inventory-panel .inventory-slot{
    min-width:0!important;
    min-height:126px!important;
    padding:11px!important;
    overflow:hidden!important;
  }
  body.v104-touch-device #inventory-panel .inventory-slot b{font-size:13px!important;line-height:1.15!important}
  body.v104-touch-device #inventory-panel .inventory-slot span{
    font-size:11px!important;
    line-height:1.28!important;
    overflow-wrap:anywhere!important;
  }
  body.v104-touch-device #inventory-panel .inventory-slot small{font-size:10px!important;line-height:1.3!important}
  body.v104-touch-device #inventory-panel h3{font-size:14px!important;line-height:1.25!important}
  body.v104-touch-device #inventory-panel .inventory-guide{
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  body.v104-touch-device #inventory-panel .inventory-guide b{font-size:12px!important}
  body.v104-touch-device #inventory-panel .inventory-guide span{font-size:10.5px!important;line-height:1.35!important}
  body.v104-touch-device #inventory-panel .inventory-footer-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  body[data-run-active="true"].v104-touch-device .ccg-mobile-minimap-head b{font-size:10px!important}
  body[data-run-active="true"].v104-touch-device .ccg-mobile-minimap-head span,
  body[data-run-active="true"].v104-touch-device .ccg-mobile-minimap>small{
    font-size:8px!important;
    line-height:1.25!important;
  }
  body[data-run-active="true"].v104-touch-device .ccg-game #ccg-rating-panel h2{font-size:14px!important}
  body[data-run-active="true"].v104-touch-device .ccg-game #ccg-rating-panel p,
  body[data-run-active="true"].v104-touch-device .ccg-game #ccg-rating-panel .menu-buttons button{
    font-size:9px!important;
    line-height:1.2!important;
  }
}
@media(max-width:380px){
  body.v104-touch-device #inventory-panel .inventory-list{grid-template-columns:1fr!important}
  body.v104-touch-device #inventory-close-top{min-width:112px!important;font-size:11.5px!important}
}

@media(min-width:901px) and (pointer:fine){
 body[data-run-active="true"] .inventory-live-dock .item-shortcuts{gap:3px!important}
 body[data-run-active="true"] .carried-item{min-height:32px!important;padding:3px!important;grid-template-columns:24px minmax(0,1fr) auto!important;gap:4px!important}
 body[data-run-active="true"] .carried-item>.item-svg-wrap,body[data-run-active="true"] .carried-item .item-art-wrap{width:24px!important;height:24px!important}
 body[data-run-active="true"] .carried-copy b{font-size:10px!important;white-space:normal!important}
 body[data-run-active="true"] .carried-copy span{font-size:9px!important;line-height:1.15!important}
 body[data-run-active="true"] .carried-meta{min-width:40px!important}
 body[data-run-active="true"] .carried-meta strong{font-size:10px!important}
 body[data-run-active="true"] .carried-section-label{position:static!important;font-size:9px!important;padding:3px!important}
}

/* R154 — restore the mobile tactical radar as a readable row above live play.
   R95 hid this parent in portrait mode, collapsing its canvas to 0×0; the
   gameplay test must exercise the actual fullscreen layout rather than a
   standalone CSS canvas. */
@media (orientation:portrait) and (max-width:900px), (orientation:portrait) and (pointer:coarse){
  body[data-run-active="true"] .ccg-game,
  body[data-run-active="true"] .ccg-game:fullscreen,
  body[data-run-active="true"] .ccg-game:-webkit-full-screen{
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:28px auto minmax(0,1fr) 84px!important;
  }
  body[data-run-active="true"] .ccg-game>.tactical-zone{
    display:grid!important;
    grid-column:1!important;
    grid-row:2!important;
    position:relative!important;
    inset:auto!important;
    width:100%!important;
    height:auto!important;
    min-height:120px!important;
    max-height:none!important;
    padding:4px 7px!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:none!important;
    z-index:6!important;
    overflow:hidden!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto!important;
    gap:4px!important;
  }
  body[data-run-active="true"] .ccg-game>.tactical-zone>.v102-radar-card{
    display:grid!important;
    grid-column:1!important;
    grid-row:1!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto minmax(0,1fr) auto!important;
    align-self:stretch!important;
  }
  body[data-run-active="true"] .ccg-game #radar-canvas{
    display:block!important;
    width:auto!important;
    max-width:100%!important;
    height:auto!important;
    min-height:100px!important;
    max-height:min(20vh,180px)!important;
    aspect-ratio:2/1!important;
    object-fit:contain!important;
    margin-inline:auto!important;
  }
  body[data-run-active="true"] .ccg-game>.game-area{grid-column:1!important;grid-row:3!important;min-height:0!important;}
  body[data-run-active="true"] .ccg-game>.player-hub{grid-column:1!important;grid-row:4!important;}
  body[data-run-active="true"] .ccg-game>.tactical-zone>.shortcut-dock{display:none!important;}
}
/* R154 portrait radar: at taller phone sizes the previous 20vh canvas cap
   combined with intrinsic sizing can shrink the map below 300x150. Limit
   this override to tall, >=380px portrait screens; compact 320px devices
   retain their shorter radar budget and flexible playfield. */
@media (orientation:portrait) and (min-width:380px) and (min-height:700px) and (max-width:900px){
  body[data-run-active="true"] .ccg-game #radar-canvas{
    width:min(100%,340px)!important;
    height:auto!important;
    max-height:170px!important;
    min-height:0!important;
    aspect-ratio:2/1!important;
  }
}
