/* Console shell styling.
   Sized for a 1080p TV seen from a sofa: nothing below 20px, nothing important
   outside a 5% safe area, high contrast, no hairlines (they shimmer on a TV's
   scaler). */

:root {
  --cpg-bg: #06070b;
  --cpg-fg: #eef2f8;
  --cpg-dim: #8b95a8;
  --cpg-accent: #4ee1a0;
  --cpg-accent-dim: #1d6b4d;
  --cpg-warn: #ffb454;
  --cpg-panel: rgba(10, 13, 20, 0.94);
  --cpg-safe: 5vmin;
  --cpg-font: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --cpg-mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--cpg-bg);
  color: var(--cpg-fg);
  font-family: var(--cpg-font);
  font-size: 20px;
  -webkit-font-smoothing: antialiased;
}

body.cpg canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cpg-dim { color: var(--cpg-dim); }

/* ------------------------------------------------------------ title card -- */

.cpg-title {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  background:
    radial-gradient(120vmax 90vmax at 50% 42%, #131a28 0%, #06070b 68%);
}
.cpg-title.is-open { display: grid; }

.cpg-title-inner { text-align: center; padding: var(--cpg-safe); max-width: 46rem; }

.cpg-title h1 {
  margin: 0;
  font-size: clamp(3rem, 9vmin, 6rem);
  font-weight: 200;
  letter-spacing: 0.24em;
  text-indent: 0.24em;         /* balance the trailing letter-space */
  color: var(--cpg-fg);
}

.cpg-sub {
  margin: 0.4em 0 2.2em;
  color: var(--cpg-dim);
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
}

.cpg-controls {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.5em 1.4em;
  justify-content: center;
  margin: 0 0 2.4em;
  font-size: 1rem;
}
.cpg-controls dt {
  text-align: right;
  color: var(--cpg-accent);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.cpg-controls dd { margin: 0; text-align: left; color: var(--cpg-dim); }

.cpg-prompt {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: cpg-pulse 1.9s ease-in-out infinite;
}
.cpg-prompt b {
  display: inline-grid;
  place-items: center;
  width: 1.9em; height: 1.9em;
  margin-right: 0.5em;
  border-radius: 50%;
  background: var(--cpg-accent);
  color: #04120c;
  font-size: 0.82em;
}
@keyframes cpg-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.cpg-padstate {
  margin: 2.6em 0 0;
  font-size: 0.85rem;
  color: var(--cpg-dim);
  font-family: var(--cpg-mono);
}
.cpg-padstate.is-warn { color: var(--cpg-warn); }

/* -------------------------------------------------------------------- hud -- */

.cpg-hud {
  position: fixed;
  inset: var(--cpg-safe);
  z-index: 10;
  pointer-events: none;
}

.cpg-stats {
  position: fixed;
  top: var(--cpg-safe);
  right: var(--cpg-safe);
  z-index: 30;
  display: none;
  padding: 0.35em 0.7em;
  border-radius: 0.4em;
  background: rgba(0, 0, 0, 0.55);
  font-family: var(--cpg-mono);
  font-size: 0.8rem;
  color: var(--cpg-accent);
}
.cpg-stats.is-open { display: block; }

/* ------------------------------------------------------------ pause menu -- */

.cpg-pause {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(6px);
}
.cpg-pause.is-open { display: grid; }

.cpg-pause-panel {
  min-width: 22rem;
  padding: 2rem 2.4rem;
  border-radius: 0.9rem;
  background: var(--cpg-panel);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.7);
}
.cpg-pause-panel h2 {
  margin: 0 0 1.2rem;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cpg-dim);
}
.cpg-pause-panel ul { list-style: none; margin: 0; padding: 0; }
.cpg-pause-panel li {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.55em 0.8em;
  border-radius: 0.4em;
  font-size: 1.25rem;
  color: var(--cpg-dim);
}
.cpg-pause-panel li.is-sel {
  background: var(--cpg-accent);
  color: #04120c;
  font-weight: 600;
}
.cpg-menu-val { font-family: var(--cpg-mono); font-size: 0.85em; opacity: 0.8; }
.cpg-pause-panel footer {
  margin-top: 1.4rem;
  font-size: 0.8rem;
  color: var(--cpg-dim);
}
.cpg-pause-panel footer b { color: var(--cpg-fg); }

/* ----------------------------------------------------------------- tuner -- */

.cpg-tuner {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 45;
  display: none;
  width: min(30rem, 42vw);
  padding: var(--cpg-safe) var(--cpg-safe) var(--cpg-safe) 0;
  box-sizing: border-box;
}
.cpg-tuner.is-open { display: block; }

.cpg-tuner-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.2rem 1.4rem;
  box-sizing: border-box;
  border-radius: 0.8rem;
  background: var(--cpg-panel);
  box-shadow: 0 1rem 4rem rgba(0, 0, 0, 0.6);
}
.cpg-tuner-panel header {
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cpg-fg);
  margin-bottom: 0.9rem;
}
.cpg-tuner-rows { flex: 1; overflow-y: auto; scrollbar-width: none; }
.cpg-tuner-rows::-webkit-scrollbar { display: none; }

.cpg-tuner-group {
  margin: 1.1em 0 0.4em;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cpg-accent-dim);
}
.cpg-tuner-group:first-child { margin-top: 0; }

.cpg-tuner-row {
  display: grid;
  grid-template-columns: 1fr 5.5rem 4.2rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.3em 0.5em;
  border-radius: 0.35em;
  font-size: 0.92rem;
  color: var(--cpg-dim);
}
.cpg-tuner-row.is-changed .cpg-tuner-label { color: var(--cpg-fg); }
.cpg-tuner-row.is-changed .cpg-tuner-label::after {
  content: " *";
  color: var(--cpg-accent);
}
.cpg-tuner-row.is-sel {
  background: rgba(78, 225, 160, 0.14);
  color: var(--cpg-fg);
  box-shadow: inset 0 0 0 2px var(--cpg-accent-dim);
}

.cpg-tuner-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpg-tuner-bar {
  height: 0.5rem;
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}
.cpg-tuner-bar i { display: block; height: 100%; background: var(--cpg-accent); }
.cpg-tuner-val {
  text-align: right;
  font-family: var(--cpg-mono);
  font-size: 0.82rem;
  color: var(--cpg-fg);
}

.cpg-tuner-panel footer {
  margin-top: 1rem;
  font-size: 0.68rem;
  line-height: 1.7;
  color: var(--cpg-dim);
}
.cpg-tuner-panel footer b { color: var(--cpg-accent); }

/* An item the d-pad can change in place, rather than one that opens a submenu. */
.cpg-pause-panel li.is-adjustable .cpg-menu-val::before { content: "\2039  "; opacity: 0.55; }
.cpg-pause-panel li.is-adjustable .cpg-menu-val::after  { content: "  \203A"; opacity: 0.55; }
