/* Desktop command desk. Touch layout and cinematic framing remain owned by their existing styles. */
.pc-toolbar { display: none; }
body.pc .pc-toolbar { display: flex; gap: 6px; }
.pc-toolbar button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 10px; border: 1px solid #81705a; background: linear-gradient(150deg,#37352b,#171b17); color: #f0e6d3; font: 400 16px var(--display); white-space: nowrap; box-shadow: inset 0 1px #e3c68c22, 2px 2px 0 #050706; }
.pc-toolbar button:hover { border-color: #c8b18a; background-color: #444336; }
.pc-toolbar button:active { transform: translateY(1px); box-shadow: inset 0 1px 3px #0009; }
.pc-toolbar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.pc-toolbar kbd { font: 12px var(--body); padding: 1px 4px; border: 1px solid #8b806766; color: #c6bda9; }
body.pc :is(button, a, input, select):focus-visible { outline: 2px solid #ffdf8b; outline-offset: 4px; }
body.pc .topbar > .pc-toolbar { margin-left: auto; }
body.pc #pc-controls { position: absolute; left: 14px; top: calc(var(--safe-t) + 140px); flex-wrap: wrap; width: 275px; pointer-events: auto; }
body.pc-wide .hud-side { position:absolute; left:20px; top:calc(var(--safe-t) + 96px); display:flex; gap:8px; width:auto; padding:0; pointer-events:auto; }
body.pc-wide .hud-side > button { position:relative; flex:0 0 44px; width:44px; height:44px; min-width:44px; min-height:44px; margin:0; }
body.pc-wide #pc-controls { left:20px; top:calc(var(--safe-t) + 152px); gap:8px; }
#pc-controls p { width: 100%; margin: 1px 0; font-size: 12px; line-height: 1.6; color: #ded6c4; text-shadow: 0 1px 3px #000; pointer-events: none; }
body.pc:not(.pc-wide) .topbar > .pc-toolbar { display: none; }
body.pc:not(.pc-wide) #pc-controls { top: auto; bottom: calc(var(--dock,190px) + 12px); width: auto; }
body.pc:not(.pc-wide) #pc-controls p { display: none; }
body.filming .pc-toolbar, body.clipping .pc-toolbar { display: none; }
@media (min-width: 1000px) and (min-height: 600px) {
  body.pc-wide .dock { max-width: 1160px; width: calc(100% - 32px); display: grid; grid-template-columns: 220px minmax(0,1fr); column-gap: 24px; padding: 10px 16px 14px; border: 1px solid #9a85634d; border-bottom: none; background: linear-gradient(165deg,#38393bd4,#1b1d20cb); border-radius: 15px 15px 0 0; box-shadow: 0 -5px 25px #0007; }
  body.pc-wide .dock > .ops { grid-column: 1 / -1; max-height: 56px; }
  body.pc-wide .dock > .slider-row { grid-column: 1; grid-row: 2; align-self: center; }
  body.pc-wide .dock > .dock-row { grid-column: 2; grid-row: 2 / 4; gap: 7px; align-items: stretch; justify-content: flex-end; }
  body.pc-wide .dock-row > .grow { display: none; }
  body.pc-wide .tactics-row { align-items: stretch; gap: 7px; }
  body.pc-wide .dock .tbtn { width: 65px; height: 68px; flex: 0 0 65px; min-width: 52px; }
  body.pc-wide .dock .rally-btn { height: 68px; min-width: 72px; }
  body.pc-wide .dock .hold-btn { min-width: 80px; max-width: 124px; min-height: 68px; margin-left: auto; padding: 5px; }
  body.pc-wide .dock .hold-btn .hold-ic { display: none; }
  body.pc-wide .campaign-dock { grid-column: 1 / -1; }
  body.pc-wide .order { max-width: 520px; }
  body.pc-wide .hud-top { padding: 12px 20px 14px; }
  body.pc-wide .board { min-width: 200px; max-width: 240px; right: 20px; }
  body.pc-wide .hud-note { left: 16px; max-width: 380px; }
  body.pc-wide .topsheet { max-width: 540px; }
  body.pc-wide #hud .dock { width: min(1720px, calc(100% - 40px)); max-width: none; }
  body.pc-wide #hud .hud-top { width: min(1720px, calc(100% - 40px)); margin-inline: auto; }
}
@media (prefers-reduced-motion: reduce) { .pc-toolbar button { transition: none; } }
/* A mouse-capable phone or a narrow browser still uses the compact HUD; never cover confirmation controls. */
body.pc:not(.pc-wide) #pc-controls { display: none; }

body.pc-menu #home {
  --desk-gutter: clamp(14px, 2vw, 28px);
  --desk-width: 1440px;
  display: grid;
  grid-template: "menu header" auto "menu content" minmax(0, 1fr) "menu promo" auto
    / clamp(144px, 14vw, 216px) minmax(0, 1fr);
}
body.pc-menu #home .topbar {
  grid-area: header;
  width: 100%;
  max-width: none;
  padding: calc(var(--safe-t) + 5px) var(--desk-gutter) 5px;
  gap: 12px;
  background: linear-gradient(180deg, #211916, #0d0d0d);
  border-bottom: 1px solid #8a6d4c55;
}
body.pc-menu #home .topbar .logo-img { height: 54px; margin: 0; }
body.pc-menu #home .topbar .wallet { margin-inline-start: auto; }
body.pc.pc-menu #home .topbar > .pc-toolbar { display: flex; margin-left: 0; }
body.pc-menu #home .pages { grid-area: content; min-width: 0; margin-bottom: 0; padding: 12px var(--desk-gutter) 0; }
body.pc-menu #home.has-promo .pages { margin-bottom: 0; }
body.pc-menu #home .page { animation: none; width: 100%; max-width: var(--desk-width); padding: 0 0 16px; gap: 12px; }
body.pc-menu #home .tabbar {
  grid-area: menu;
  position: static;
  display: grid;
  grid-template-rows: repeat(5, minmax(76px, 1fr));
  justify-content: stretch;
  align-items: stretch;
  gap: 8px;
  min-height: 0;
  padding: calc(var(--safe-t) + 10px) 10px calc(var(--safe-b) + 10px);
  overflow-y: auto;
  border: 0;
  border-inline-end: 1px solid #80674b;
  background: linear-gradient(155deg, #30231e, #100f10 75%);
  box-shadow: inset -3px 0 #080808;
}
body.pc-menu #home .tabbar button {
  --tab-tint: 28%;
  position: relative;
  max-width: none;
  min-width: 0;
  min-height: 52px;
  flex-direction: column;
  justify-content: center;
  gap: clamp(3px, .8dvh, 8px);
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--tab-accent) 55%, #47392c);
  border-inline-start-width: 4px;
  background:
    repeating-linear-gradient(0deg, #0000 0 3px, #0002 3px 4px),
    linear-gradient(148deg, color-mix(in srgb, var(--tab-accent) var(--tab-tint), #211c1a), color-mix(in srgb, var(--tab-accent) 13%, #141113));
  color: #fff4df;
  font-size: clamp(18px, 1.75vw, 25px);
  text-align: center;
  box-shadow: inset 0 1px #ffe9be1f, inset 0 -3px #090809, 2px 2px #090809;
}
body.pc-menu #home .tabbar button:hover { border-color: var(--tab-accent); filter: brightness(1.15); }
body.pc-menu #home .tabbar button.on {
  --tab-tint: 48%;
  border-color: var(--tab-accent);
  border-inline-start-color: #fff4df;
  background:
    repeating-linear-gradient(0deg, #0000 0 3px, #0002 3px 4px),
    linear-gradient(148deg, color-mix(in srgb, var(--tab-accent) var(--tab-tint), #211c1a), color-mix(in srgb, var(--tab-accent) 25%, #141113));
  box-shadow: inset 0 1px #ffe9be55, inset 0 -3px #090809, 2px 2px #090809;
}
body.pc-menu #home .tabbar button :is(.wi, .tab-mark) {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(38px, 7dvh, 64px);
  height: clamp(38px, 7dvh, 64px);
  margin: 0;
  padding: 0;
  color: var(--tab-accent);
  filter: drop-shadow(0 2px 1px #000a);
}
body.pc-menu #home .tabbar button .wi svg { width: 100%; height: 100%; }
body.pc-menu #home .tabbar .tab-badge { top: 7px; right: 7px; left: auto; }
body.pc-menu #home .tabbar [data-tab="play"] { --tab-accent: #8fe06a; }
body.pc-menu #home .tabbar [data-tab="pass"] { --tab-accent: #ffd15f; }
body.pc-menu #home .tabbar [data-tab="armory"] { --tab-accent: #67c8ef; }
body.pc-menu #home .tabbar [data-tab="locker"] { --tab-accent: #c89aff; }
body.pc-menu #home .tabbar [data-tab="shop"] { --tab-accent: #ff9863; }
body.pc-menu #home #promo-dock { grid-area: promo; position: static; width: calc(100% - 2 * var(--desk-gutter)); max-width: var(--desk-width); margin: 0 auto max(8px, var(--safe-b)); }
body.pc-menu #home #promo-dock:empty { display: none; }
body.pc-menu #home #promo-dock .house-promo { margin: 0; }
body.pc-menu #home #tab-play.page, body.pc-menu #home #tab-shop.page { display: block; columns: auto; }
body.pc-menu #home #tab-play .home-switch { max-width: 520px; margin: 0 0 12px; }
body.pc-menu #home #tab-play .home-rib { gap: 10px; }
body.pc-menu #home #tab-play .ref-home .ref-badge { right: 0; }
body.pc-menu #home #tab-play .home-sides { grid-template-columns: minmax(0, 1fr); overflow: visible; }
body.pc-menu #home #tab-play .home-sides .home-side { grid-column: 1; transform: none; min-width: 0; }
body.pc-menu #home #tab-play .home-sides[data-side="battle"] .side-campaign,
body.pc-menu #home #tab-play .home-sides[data-side="campaign"] .side-battle { display: none; }
body.pc-menu #home #tab-play .side-battle { display: flex; flex-direction: column; align-items: stretch; gap: 12px; min-width: 0; }
body.pc-menu #home #tab-play .side-battle > * { width: 100%; min-width: 0; }
body.pc-menu #home #tab-play .side-battle > .save-chip { width: calc(100% - 6px); }
body.pc-menu #home #tab-play .mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
body.pc-menu #home #tab-play .mode-card { min-height: 150px; }
body.pc-menu #home #tab-play .mode-card .mc-art { height: 84px; }
body.pc-menu #home #tab-play .mode-events { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; gap: 12px; }
body.pc-menu #home #tab-play .mode-events .event-card { height: 100%; min-height: 96px; }
body.pc-menu #home #tab-play .today-panel { width: 100%; min-width: 0; }
body.pc-menu #home :is(#arm-car, #tab-pass .wb-track) { margin-inline: 0; }
body.pc-menu #home #so-items > .tl-ribbon { width: calc(100% - 6px); }
@media (min-width: 920px) {
  body.pc-menu #home #tab-play.page {
    display: grid;
    grid-template-columns: minmax(270px, 2fr) minmax(0, 3fr);
    align-items: start;
  }
  body.pc-menu #home #tab-play :is(.home-switch, .home-rib) { margin: 0; }
  body.pc-menu #home #tab-play :is(.home-sides, #welcome-home) { grid-column: 1 / -1; }
}
@media (min-width: 1280px) and (min-height: 600px) {
  body.pc-wide #so-featured { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  body.pc-wide #so-featured > .so-featured-h { grid-column: 1 / -1; }
  body.pc-wide #so-featured > .so-shelf > .kit-h { margin-top: 0; }
  body.pc-wide #so-purchases { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  body.pc-wide #so-purchases > :is(#so-offers, .so-footer) { grid-column: 1 / -1; }
}
/* Keep the desktop action text above the button face in WebKit and Electron. */
body.pc-menu #home #play-go {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 14px;
  min-height: 66px;
  padding: 10px 16px;
  animation: none;
}
body.pc-menu #home #play-stack { margin: 0; }
body.pc-menu #home #play-go > :is(b, small) { position: relative; z-index: 1; margin: 0; }
body.pc-menu #home #play-go > b {
  color: #fff7e6;
  font: 400 clamp(29px, 2.8vw, 40px)/1 var(--display);
  filter: none;
}
@media (max-height: 700px) {
  body.pc-menu #home .pages { padding-top: 8px; }
  body.pc-menu #home #tab-play .side-battle { gap: 8px; }
  body.pc-menu #home #tab-play .mode-card { min-height: 126px; }
  body.pc-menu #home #tab-play .mode-card .mc-art { height: 62px; }
  body.pc-menu #home #play-go { min-height: 51px; padding-block: 6px; }
}

/* Build 183 command and replay surfaces. Keep the shared cards, art and actions. */
@media (min-width: 1000px) and (min-height: 600px) {
  body.pc-wide.normal-ui #hud .dock {
    width: min(880px, calc(100% - 48px)); padding: 10px 12px 12px;
    border-radius: 4px 4px 0 0; border-color: #8a72546e;
    background: linear-gradient(165deg, #2a2620f5, #151411f5);
  }
  body.pc-wide.normal-ui .normal-top { max-width: 720px; }
  body.pc-wide.normal-ui .normal-top .nt-cell { min-height: 48px; }
  body.pc-wide.normal-ui .normal-top .nt-cell b { font-size: 20px; }
  body.pc-wide.normal-ui .normal-top .nt-cell small { font-size: 12px; }
  body.pc-wide.normal-ui .normal-top .nt-eco { gap: 16px; }
  body.pc-wide.normal-ui .normal-cmd { gap: 8px; }
  body.pc-wide.normal-ui .normal-cmd .ncmd { height: 66px; padding-inline: 8px; font-size: 16px; }
  body.pc-wide.normal-ui .normal-cmd .ncmd .wi { width: 32px; height: 32px; }
  body.pc-wide.normal-ui .normal-unitbar .ncmd > span { font-size: 14px; }
  body.pc-wide.normal-ui .normal-unitbar .nu-kind b { font-size: 13px; }
  body.pc-wide.normal-ui .normal-unitbar .nu-acts .ncmd-line { font-size: 11px; }
  body.pc-wide.normal-ui .normal-guide { left: 20px; top: calc(var(--safe-t) + 242px); transform: none; width: 280px; }
  body.pc-wide #modal .normal-sheet { max-width: 770px; padding-inline: 18px; }
  body.pc-wide #modal .normal-sheet .normal-head h2 { font-size: 26px; }
  body.pc-wide #modal .normal-sheet :is(#normal-body,.normal-rows,.normal-scroll) { scrollbar-width: thin; }
  body.pc-wide #modal .normal-sheet .normal-row { min-width: 0; }
  body.pc-wide #modal .normal-sheet .normal-actions { flex-wrap: wrap; }
  body.pc-wide #modal .normal-sheet .normal-actions .btn { min-width: 0; white-space: normal; }
  body.pc-wide .sheet-box.finish { width: min(940px, 100%); max-width: none; min-height: 0; }
  body.pc-wide .finish .fin-scroll { scrollbar-gutter: stable; }
  body.pc-wide .fin-replay-feature { grid-template-columns: 94px minmax(0,1fr); margin: 0; gap: 18px; }
  body.pc-wide .fin-replay-feature canvas { width: 94px; height: auto; aspect-ratio: 9/16; object-fit: contain; }
  body.pc-wide .fin-replay-feature .frf-video { max-width: 440px; }
  body.pc-wide .sheet-box.film-library { width: min(100%, 1040px); max-width: none; }
  body.pc-wide .film-library .fl-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  body.pc-wide .film-library .fl-card { min-width: 0; }
  body.pc-wide .film-library .fl-info b { white-space: normal; overflow-wrap: anywhere; }
  body.pc-wide .film-library .fl-btn { min-height: 44px; white-space: normal; }
  body.pc-wide .sheet-box.film-options { max-width: 570px; }
  body.pc-wide .sheet-box.film-options .actions { flex-wrap: wrap; }
  body.pc-wide .sheet-box.film-options .actions .btn { white-space: normal; }
}
