@font-face {
  font-family: Plex;
  src: url(fonts/IBMPlexMono-Regular.ttf);
  font-display: swap;
}
@font-face {
  font-family: Saira;
  src: url(fonts/SairaCondensed-SemiBold.ttf);
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #080c13;
  --gold: #eac28d;
  --ivory: #f0e5d6;
  --text: #eceef1;
  --caramel: #cb986c;
  --panel: #12161e;
  --muted: #aeb8c5;
  --blue: #88a8c9;
  --line: #344353;
  --focus: #f4d2a4;
  --sel: #211e1b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 15px;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: var(--gold);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.demo-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 12px 24px;
  background: #171b22;
  border-bottom: 1px solid var(--line);
  font:
    11px Plex,
    monospace;
  letter-spacing: 0.05em;
}
.demo-banner a {
  text-decoration: none;
}
.demo-banner > span {
  color: var(--muted);
}
.demo-banner i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9dcaae;
  margin-right: 7px;
}
.demo-banner button,
.demo-bottom button {
  background: none;
  color: var(--gold);
  border: 0;
  padding: 4px;
  font: inherit;
}
.demo-notice {
  text-align: center;
  font:
    10px Plex,
    monospace;
  color: var(--muted);
  padding: 9px 12px;
  background: #0b1017;
}
#console {
  background: radial-gradient(ellipse at 85% 10%, #1e273138, transparent 70%), var(--ink);
  position: relative;
  min-height: 720px;
  padding: 24px 30px 72px;
  isolation: isolate;
}
.console-header {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 16px 24px;
  background: linear-gradient(#171d28, #12161e);
  border: 1px solid #27313d;
  border-radius: 18px;
}
.console-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.console-brand img:first-child {
  width: 38px;
  height: 44px;
  object-fit: contain;
}
.console-brand img:nth-child(2) {
  width: 120px;
  height: 40px;
  object-fit: contain;
}
.console-brand small {
  font: 10px Plex;
  color: var(--muted);
}
.console-header nav {
  display: flex;
  gap: 14px;
}
.console-header nav button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 16px;
}
.console-header nav button[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
#clock {
  font: 12px Plex;
  color: var(--muted);
  margin-left: auto;
}
.hero-game {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 300px;
  margin: 24px 24px 0;
  border: 1px solid #293342;
  border-radius: 18px;
  overflow: hidden;
  padding: 30px;
  isolation: isolate;
}
.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 0.8;
}
.hero-game:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #10151df5 10%, #10151dbb 45%, #10151d11);
  z-index: -1;
}
.hero-info {
  max-width: 660px;
}
.eyebrow {
  font:
    11px Plex,
    monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.hero-game h1 {
  font-size: clamp(35px, 4.5vw, 68px);
  margin: 12px 0 22px;
  line-height: 1;
}
.hero-game p {
  font-size: 17px;
  color: var(--ivory);
  max-width: 540px;
}
.primary,
.secondary {
  padding: 12px 24px;
  border-radius: 9px;
  border: 1px solid #36414e;
  font-size: 16px;
  margin: 8px 8px 0 0;
}
.primary {
  background: linear-gradient(110deg, var(--gold), var(--caramel));
  color: var(--sel);
  border-color: var(--gold);
}
.secondary {
  background: #151b25;
  color: var(--text);
}
.shelf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 24px 12px;
}
.shelf-header h2 {
  font-size: 21px;
  margin: 0;
  color: var(--ivory);
}
.shelf-header span {
  font: 11px Plex;
  color: var(--muted);
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 24px;
}
.game-card {
  position: relative;
  padding: 6px;
  border: 1px solid #27313e;
  border-radius: 12px;
  background: linear-gradient(120deg, #171d28, #12161e);
  text-align: left;
  color: var(--text);
  transition:
    transform 0.18s,
    background 0.18s;
  min-width: 0;
}
.game-card.selected,
.game-card:focus-visible {
  background: linear-gradient(120deg, var(--gold), var(--caramel));
  color: var(--sel);
  border-color: var(--focus);
}
.game-card:hover {
  transform: translateY(-3px);
}
.game-card img,
.missing-art {
  display: block;
  width: 100%;
  aspect-ratio: 16/7;
  object-fit: cover;
  border-radius: 7px;
  background: #212c39;
}
.missing-art {
  display: grid;
  place-items: center;
  font: 24px Saira;
  color: var(--muted);
}
.game-card strong {
  display: block;
  padding: 9px 6px 3px;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-card small {
  display: block;
  padding: 0 6px 9px;
  font: 9px Plex;
  opacity: 0.75;
}
.favorite-star {
  position: absolute;
  right: 12px;
  top: 12px;
  background: #10151d;
  color: var(--gold);
  border-radius: 7px;
  padding: 2px 6px;
}
.console-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #263240;
  margin: 18px 24px 0;
  padding-top: 13px;
  color: var(--muted);
  font: 10px Plex;
  line-height: 1.8;
}
kbd {
  font: inherit;
  display: inline-block;
  border: 1px solid #3b4652;
  padding: 1px 4px;
  border-radius: 4px;
  margin-right: 3px;
  color: var(--ivory);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px;
  align-items: center;
}
.toolbar input,
.toolbar select {
  color: var(--text);
  background: #171d28;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  min-width: 0;
}
.toolbar label {
  font-size: 12px;
  color: var(--muted);
}
.toolbar input {
  max-width: 260px;
}
.toolbar h1 {
  font-size: 24px;
  margin: 0 auto 0 0;
}
.empty-state {
  margin: 40px 24px;
  color: var(--muted);
  text-align: center;
}
.preference-list {
  max-width: 700px;
  margin: 24px;
}
.preference-list h1 {
  color: var(--ivory);
}
.preference-list label {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  gap: 20px;
}
.preference-list p {
  color: var(--muted);
}
#system-button {
  position: absolute;
  bottom: 18px;
  right: 30px;
  border: 1px solid #526779;
  background: #1b2738;
  color: var(--ivory);
  padding: 10px 15px;
  border-radius: 9px;
  font-size: 13px;
  z-index: 3;
}
#system-button span {
  margin-right: 7px;
  color: var(--gold);
}
#system-button kbd {
  margin-left: 8px;
}
#menu-backdrop {
  position: absolute;
  inset: 0;
  background: #0007;
  z-index: 9;
  backdrop-filter: blur(3px);
}
#system-menu {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 480px;
  max-width: 100%;
  background: linear-gradient(150deg, #182230fa, #10151efc);
  border-right: 1px solid #405168;
  box-shadow: 20px 0 70px #0008;
  padding: 24px;
  display: flex;
  flex-direction: column;
  animation: slide-in 0.3s ease;
  max-height: 100%;
  overflow: hidden;
}
@keyframes slide-in {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: none;
  }
}
#system-menu header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.menu-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.menu-brand img {
  height: 50px;
  width: 42px;
  object-fit: contain;
}
.menu-brand h2 {
  font: 32px Saira;
  margin: 0;
  color: var(--ivory);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.menu-brand span {
  font: 10px Plex;
  color: var(--muted);
}
.icon-button {
  background: none;
  border: 1px solid var(--line);
  color: var(--ivory);
  border-radius: 8px;
  font-size: 25px;
  padding: 0 9px;
}
#menu-tabs {
  display: flex;
  gap: 6px;
  margin: 20px 0 12px;
}
#menu-tabs button {
  border: 1px solid transparent;
  background: #101822;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  flex: 1;
}
#menu-tabs button[aria-current="page"] {
  background: #2c394a;
  border-color: #5b6a7b;
  color: var(--gold);
}
#menu-content {
  overflow-y: auto;
  flex: 1;
  padding: 4px 5px 10px;
  scrollbar-width: thin;
}
#menu-content h3 {
  margin: 8px 0 12px;
  color: var(--ivory);
  font-size: 20px;
}
#menu-content p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.menu-row {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 4px;
  color: var(--text);
  min-height: 59px;
  transition:
    background 0.15s,
    transform 0.15s;
}
.row-icon {
  color: var(--gold);
  font-size: 23px;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}
.menu-row strong {
  display: block;
  font-weight: 500;
  font-size: 17px;
}
.menu-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
  line-height: 1.4;
}
.row-chevron {
  margin-left: auto;
  color: var(--muted);
}
.menu-row:focus,
.menu-row:hover {
  background: linear-gradient(110deg, var(--gold), var(--caramel));
  color: var(--sel);
  border-color: var(--focus);
  outline: 0;
}
.menu-row:focus .row-icon,
.menu-row:focus small,
.menu-row:hover .row-icon,
.menu-row:hover small,
.menu-row:focus .row-chevron,
.menu-row:hover .row-chevron {
  color: #473627;
}
#system-menu footer {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #354151;
  color: var(--muted);
  font: 9px Plex;
}
.menu-back {
  background: none;
  border: 0;
  color: var(--gold);
  padding: 8px 0;
  font-size: 12px;
  margin-bottom: 8px;
}
.setting-box {
  background: #172230;
  border: 1px solid #344455;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
}
.setting-box label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}
.setting-box input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  margin: 18px 0 3px;
}
.setting-box select,
.setting-box input[type="text"] {
  width: 100%;
  background: #101722;
  color: var(--text);
  border: 1px solid #54667a;
  padding: 10px;
  margin-top: 12px;
  border-radius: 7px;
}
.setting-box progress {
  width: 100%;
  height: 12px;
  accent-color: #77c6ba;
  margin-top: 15px;
}
.setting-box .primary,
.setting-box .secondary {
  font-size: 13px;
  padding: 10px 14px;
}
.sim-label {
  font: 9px Plex !important;
  text-transform: uppercase;
  color: var(--blue) !important;
  letter-spacing: 0.06em;
}
.device {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px;
  background: #172230;
  border-radius: 9px;
  margin-bottom: 12px;
}
.device span:first-child {
  font-size: 23px;
  color: var(--gold);
}
.device b {
  font-size: 14px;
}
.device small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
#toast {
  position: absolute;
  z-index: 20;
  top: 24px;
  right: 24px;
  max-width: 370px;
  padding: 16px 20px;
  border: 1px solid #466358;
  background: linear-gradient(110deg, #243d36, #182925);
  border-radius: 12px;
  color: #c8ead8;
  box-shadow: 0 8px 24px #0006;
  font-size: 13px;
  pointer-events: none;
}
dialog {
  background: #141e2a;
  color: var(--text);
  border: 1px solid #5f7082;
  border-radius: 16px;
  padding: 28px;
  width: 620px;
  max-width: calc(100vw - 32px);
  max-height: 85vh;
  overflow: auto;
}
dialog::backdrop {
  background: #000b;
}
dialog h2 {
  color: var(--ivory);
  margin: 0 0 16px;
}
dialog p {
  line-height: 1.7;
  color: var(--muted);
  font-size: 14px;
}
dialog .detail-art {
  width: 100%;
  aspect-ratio: 16/6;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 18px;
}
.controls-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 13px;
}
.controls-table div {
  padding: 9px;
  background: #202c3a;
  border-radius: 5px;
}
.tour-tasks {
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 14px;
}
.tour-tasks li.done {
  color: #a5d6b9;
}
.demo-bottom {
  padding: 18px 24px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font: 10px Plex;
  border-top: 1px solid #263240;
}
.demo-bottom a {
  text-decoration: none;
}
.demo-bottom button {
  margin-left: auto;
}
.game-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #151d27;
  border-radius: 10px 10px 0 0;
  font: 12px Plex;
}
.game-bar small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 5px;
}
#game {
  display: block;
  width: 100%;
  max-height: 65vh;
  aspect-ratio: 16/9;
  object-fit: contain;
  background: #111c29;
  border: 1px solid #344455;
}
.game-hint {
  font: 10px Plex;
  color: var(--muted);
  text-align: center;
}
.touch-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}
.touch-controls button {
  border: 1px solid #667483;
  background: #223246;
  color: var(--ivory);
  padding: 10px 25px;
  border-radius: 9px;
  touch-action: none;
  user-select: none;
}
.touch-controls button:last-child {
  margin-left: 35px;
}
.demo-bottom a:hover {
  text-decoration: underline;
}
body.reduced * {
  animation: none !important;
  transition: none !important;
}
@media (min-width: 1600px) {
  #console {
    max-width: 1800px;
    margin: auto;
  }
  .hero-game {
    min-height: 380px;
  }
  .games-grid {
    gap: 20px;
  }
  .game-card strong {
    font-size: 20px;
  }
  .console-header nav button {
    font-size: 20px;
  }
}
@media (max-width: 1000px) {
  .console-header {
    gap: 15px;
    padding: 12px;
  }
  .console-header nav {
    gap: 3px;
  }
  .console-header nav button {
    font-size: 13px;
    padding: 10px 8px;
  }
  .console-brand img:first-child {
    width: 28px;
  }
  .console-brand img:nth-child(2) {
    width: 95px;
  }
  .console-brand small {
    display: none;
  }
  #console {
    padding: 15px 15px 70px;
  }
  .hero-game,
  .shelf-header,
  .toolbar {
    margin-left: 5px;
    margin-right: 5px;
  }
  .games-grid {
    margin: 0 5px;
    gap: 10px;
  }
  .console-footer {
    margin-left: 5px;
    margin-right: 5px;
  }
  .game-card strong {
    font-size: 13px;
  }
  .hero-game {
    padding: 24px;
    min-height: 280px;
  }
  #system-button {
    right: 15px;
  }
  .hero-info {
    max-width: 70%;
  }
  .hero-info p {
    font-size: 14px;
  }
  .console-footer {
    font-size: 9px;
  }
}
@media (max-width: 650px) {
  body {
    font-size: 13px;
  }
  .demo-banner {
    padding: 12px;
    gap: 8px;
    font-size: 9px;
  }
  .demo-banner > span {
    display: none;
  }
  .demo-notice {
    font-size: 9px;
  }
  .console-header {
    flex-wrap: wrap;
    gap: 5px;
    border-radius: 12px;
  }
  .console-brand img:first-child {
    width: 26px;
    height: 30px;
  }
  .console-brand img:nth-child(2) {
    width: 95px;
    height: 30px;
  }
  .console-header nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .console-header nav button {
    font-size: 12px;
    padding: 10px 7px;
  }
  #clock {
    font-size: 10px;
  }
  .hero-game {
    margin-top: 14px;
    padding: 18px;
    min-height: 270px;
  }
  .hero-info {
    max-width: 100%;
  }
  .hero-game h1 {
    font-size: 35px;
  }
  .hero-game p {
    font-size: 13px;
  }
  .hero-game:after {
    background: linear-gradient(90deg, #10151df5, #10151d80);
  }
  .primary,
  .secondary {
    padding: 10px 16px;
    font-size: 13px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .shelf-header h2 {
    font-size: 17px;
  }
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .console-footer {
    flex-direction: column;
    font-size: 9px;
  }
  .console-footer > span:last-child {
    display: none;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar h1 {
    width: 100%;
    font-size: 22px;
  }
  .toolbar label {
    width: 100%;
  }
  .toolbar input {
    width: 100%;
    max-width: none;
  }
  .toolbar select {
    max-width: 100%;
  }
  #system-menu {
    width: 100%;
    padding: 20px 14px;
  }
  .menu-row {
    min-height: 57px;
  }
  .menu-row strong {
    font-size: 16px;
  }
  .demo-bottom {
    padding: 16px 12px;
    gap: 12px;
    font-size: 9px;
  }
  .demo-bottom > span {
    width: 100%;
  }
  .controls-table {
    grid-template-columns: 1fr;
  }
  .game-bar {
    font-size: 10px;
    padding: 10px;
    gap: 12px;
  }
  .game-bar > span:last-child {
    max-width: 130px;
    font-size: 9px;
  }
  #toast {
    right: 12px;
    left: 12px;
    top: 12px;
    max-width: none;
    font-size: 12px;
  }
  #console {
    min-height: 700px;
  }
  .game-hint {
    font-size: 9px;
  }
  .touch-controls button {
    padding: 15px 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}
@media (min-width: 651px) {
  .games-grid {
    grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  #system-menu {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    z-index: 30;
  }
  #menu-backdrop {
    position: fixed;
    z-index: 29;
  }
  #system-button {
    position: fixed;
    bottom: 14px;
    right: 14px;
    box-shadow: 0 4px 20px #0008;
  }
  .console-footer {
    padding-bottom: 45px;
  }
}
/* Focus is the highlight. A previously viewed game never retains selection paint. */
.game-card:focus {
  background: linear-gradient(120deg, var(--gold), var(--caramel));
  color: var(--sel);
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
body.keyboard-nav .game-card:hover:not(:focus) {
  transform: none;
}
#menu-content > .primary,
#menu-content > .secondary,
#menu-content .setting-box > .primary,
#menu-content .setting-box > .secondary {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  text-align: left;
}
#menu-content .setting-box label {
  min-height: 32px;
}
#menu-content button:focus-visible,
#menu-content input:focus-visible,
#menu-content select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
body.keyboard-nav .menu-row:hover:not(:focus) {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}
body.keyboard-nav .menu-row:hover:not(:focus) .row-icon {
  color: var(--gold);
}
body.keyboard-nav .menu-row:hover:not(:focus) small,
body.keyboard-nav .menu-row:hover:not(:focus) .row-chevron {
  color: var(--muted);
}
#menu-tabs button:focus {
  border-color: var(--focus);
  color: var(--gold);
}
