/* Shared UI tokens. Cricket artwork and semantic status colours stay component-owned. */
:root,
#game-frame {
  --ui-font: Manrope, Arial, sans-serif;
  --ui-heading: var(--type-title);
  --ui-section-heading: var(--type-section);
  --ui-body: var(--type-body);
  --ui-label: var(--type-caption);
  --ui-space: 8px;
  --ui-canvas: var(--colour-canvas);
  --ui-surface: var(--colour-surface);
  --ui-raised: var(--colour-raised);
  --ui-active: var(--colour-active);
  --ui-edge: var(--colour-edge);
  --ui-ink: var(--colour-ink);
  --ui-muted: var(--colour-muted);
  --ui-accent: var(--colour-gold);
  --night: var(--ui-canvas);
  --navy: var(--ui-surface);
  --panel: var(--ui-raised);
  --panel2: var(--ui-active);
  --edge: var(--ui-edge);
  --cream: var(--ui-ink);
  --dim: var(--ui-muted);
  --gold: var(--ui-accent);
  --display-font: var(--ui-font);
  color: var(--ui-ink);
  font-family: var(--ui-font);
  font-size: var(--ui-body);
  line-height: 1.45;
}
#game-frame :is(h1, h2, h3, h4, h5, h6, button, input, select, summary, table) {
  font-family: var(--ui-font);
}
#game-frame h2 {
  font-size: var(--ui-heading);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.025em;
}
#game-frame h3 {
  font-size: var(--ui-section-heading);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
}
#game-frame h4 {
  font-size: var(--ui-body);
  line-height: 1.3;
  font-weight: 700;
}
#game-frame p {
  font-size: var(--ui-body);
  line-height: 1.5;
}
#game-frame :is(button, select, summary, .page-tab-label) {
  min-height: 44px;
}
#game-frame button {
  min-width: 44px;
}
#game-frame .game-button {
  font-size: var(--ui-body);
  line-height: 1.3;
  border-radius: 3px;
}
#game-frame .game-topbar {
  height: 44px;
}
#game-frame :is(.scene-header, .scene-section-heading) {
  gap: 12px;
}
#game-frame .scene-header {
  margin-bottom: 16px;
}
#game-frame .scene-subtitle {
  margin-top: 5px;
  font-size: var(--ui-label);
  line-height: 1.4;
  color: var(--ui-muted);
}
#game-frame :is(.section-tabs, .squad-roster-tabs, .management-actions) {
  gap: var(--ui-space);
}
#game-frame :is(.section-tabs, .squad-roster-tabs) button {
  min-width: 0;
  padding: 8px;
  white-space: normal;
}
#game-frame :is(.section-tabs, .squad-roster-tabs) [aria-pressed='true'] {
  background: var(--ui-active);
  border-color: var(--ui-accent);
  color: var(--ui-accent);
}
#game-frame .game-screen > :is(.scene-header, .scene-section-heading) h2 {
  font-size: var(--ui-heading);
}
#game-frame :is(.management-copy, .management-status, .management-detail > summary) {
  font-size: var(--ui-body);
}
#game-frame .management-detail > summary {
  color: var(--ui-ink);
}
#game-frame :is(.scene-counter, .league-progress) {
  font-variant-numeric: tabular-nums;
}
#game-frame .scene-counter > span {
  font-size: var(--ui-label);
}
#game-frame .scene-counter > strong {
  font-size: var(--type-number);
  line-height: 1.1;
}

/* Wide is a workspace; short landscape and fullscreen always fit the viewport. */
@media (max-height: 500px) and (orientation: landscape) {
  #main:fullscreen {
    overflow: hidden;
  }
  #main:fullscreen #game-frame,
  :root[data-display-mode='phone'] #main:fullscreen #game-frame {
    width: 100%;
    height: 100svh;
    max-height: 100svh;
    min-height: 0;
  }
  #game-frame .game-topbar {
    height: 44px;
    padding-inline: 10px;
  }
  #game-frame .game-screen {
    padding-block: 12px;
  }
  #game-frame :is(.scene-header, .scene-section-heading) {
    margin-bottom: 12px;
  }
  /* A fixed footer would cover most of the short squad list viewport. */
  #game-frame .squad-footer {
    position: static;
  }
}
