:root {
  color-scheme: dark;
  --ink: #f1e9e9;
  --muted: #aaa0a3;
  --dim: #73696d;
  --line: rgba(255, 255, 255, 0.14);
  --page: #000;
  --profile: #171419;
  --terminal: #0d0e12;
  --sponsor: #171419;
  --accent: #d94a54;
  --success: #98c7ab;
  --warning: #f0bf73;
  --error: #f17d7d;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--page); }
button, input { font: inherit; }
.is-hidden { display: none !important; }
.app-shell { display: flex; flex-direction: column; width: min(1440px, 100%); height: 100dvh; min-height: 0; margin: 0 auto; overflow: hidden; padding: 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; text-align: left; }
.brand-title { margin: 0; color: var(--accent); font-size: 12px; letter-spacing: .16em; }
.release-label { color: var(--dim); font-size: 11px; letter-spacing: .12em; }
.game-grid { display: grid; flex: 1; grid-template-columns: minmax(190px, 230px) minmax(420px, 1fr) minmax(190px, 240px); gap: 14px; align-items: stretch; min-height: 0; }
.panel { min-width: 0; border: 1px solid var(--line); box-shadow: 0 18px 45px rgba(0, 0, 0, .2); }
.profile-panel { background: var(--profile); }
.sponsor-panel { display: flex; flex-direction: column; background: var(--profile); }
.panel-heading { display: flex; align-items: center; min-height: 49px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; color: var(--ink); font-size: 12px; letter-spacing: .14em; }
.profile-list { margin: 0; padding: 12px 18px 20px; }
.profile-list div { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); font-size: 12px; }
.profile-list div:first-child { border-top: 1px solid rgba(255, 255, 255, .1); }
.profile-list dt { color: var(--muted); }
.profile-list dd { margin: 0; color: var(--ink); }
.terminal-stack { display: grid; grid-template-rows: minmax(0, 1fr); min-height: 0; }
.terminal-panel { display: flex; flex-direction: column; min-height: 0; background: var(--terminal); }
.terminal-output { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 22px; font-size: 13px; line-height: 1.7; scrollbar-gutter: stable; }
.terminal-line { white-space: pre-wrap; word-break: break-word; }
.terminal-line.blank { min-height: 1.7em; }
.terminal-line.muted { color: var(--muted); }
.terminal-line.success { color: var(--success); }
.terminal-line.warning { color: var(--warning); }
.terminal-line.error { color: var(--error); }
.command-form { display: flex; align-items: center; gap: 10px; margin: 12px 22px 20px; padding: 0; border: 1px solid var(--accent); }
.command-form:not(:focus-within) { border-color: var(--accent); box-shadow: none; }
.command-form:focus-within { border: none; }
.prompt { flex: 0 0 auto; color: var(--accent); font-size: 13px; }
.command-form input { min-width: 0; width: 100%; padding: 0; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 13px; }
.command-form input::placeholder { color: var(--dim); }
.sponsor-list { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 12px 18px 20px; }
.sponsor-card { display: grid; width: 100%; flex: 0 0 235px; min-height: 235px; height: 235px; padding: 16px 18px; border: 1px solid var(--line); background: var(--terminal); place-items: center; }
.sponsor-card strong { color: var(--ink); font-size: 12px; letter-spacing: .1em; }
@media (max-aspect-ratio: 1/1) {
  html, body { overflow-y: auto; }
  .app-shell { height: auto; min-height: 100svh; overflow: visible; padding: 14px 12px 24px; }
  .topbar { 
    flex-direction: column; 
    gap: 8px; 
    text-align: left; 
    width: 100%; 
  }
  .brand-title { margin-bottom: 4px; }
  .release-label { margin-top: 4px; }
  .game-grid { display: flex; flex-direction: column; }
  .profile-panel { order: 1; }
  .terminal-panel { order: 2; }
  .sponsor-panel { order: 3; }
  .profile-panel { min-height: min(300px, calc(100svh - 160px)); }
  .terminal-panel { min-height: min(400px, calc(100svh - 120px)); }
  .sponsor-panel { min-height: min(150px, calc(100svh - 100px)); }
  .terminal-output { 
    overflow-x: hidden; 
    overflow-y: auto; 
    max-height: 280px; 
    min-height: 200px; 
  }
}
