:root {
  color-scheme: dark;
  --bg: #07111c;
  --bg-soft: #0b1725;
  --surface: #0f1f30;
  --surface-raised: #14283b;
  --surface-deep: #091725;
  --line: #24425a;
  --line-soft: #193248;
  --text: #e7f2ef;
  --muted: #88a5b0;
  --faint: #557183;
  --mint: #66efca;
  --mint-deep: #269d9b;
  --blue: #79b7ff;
  --yellow: #ffd166;
  --coral: #ff7180;
  --violet: #bea9ff;
  --shadow: rgba(0, 0, 0, .36);
  font-family: "IBM Plex Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(102, 239, 202, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 239, 202, .02) 1px, transparent 1px),
    radial-gradient(circle at 14% 0%, rgba(121, 183, 255, .14), transparent 30rem),
    radial-gradient(circle at 95% 82%, rgba(190, 169, 255, .09), transparent 32rem),
    var(--bg);
  background-size: 40px 40px, 40px 40px, auto, auto, auto;
  color: var(--text);
  line-height: 1.5;
}

body::before {
  position: fixed;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 45%, rgba(102, 239, 202, .025) 50%, transparent 55%);
  content: "";
}

body::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 17, 28, 0) 65%, rgba(7, 17, 28, .55));
  content: "";
}

button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.shell {
  position: relative;
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto;
}

.landing-screen {
  position: relative;
  width: min(1120px, calc(100% - 56px));
  min-height: 100vh;
  margin: 0 auto;
}
.landing-topbar { display: flex; min-height: 88px; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.landing-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.landing-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.landing-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: clamp(38px, 8vw, 110px); align-items: center; min-height: calc(100vh - 136px); padding: 70px 0 45px; }
.landing-copy h1 { max-width: 720px; margin: 12px 0 20px; font-size: clamp(48px, 7vw, 86px); line-height: .98; letter-spacing: -.06em; }
.landing-copy .lede { max-width: 620px; margin: 0; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.landing-actions .button { min-width: 128px; }
.landing-note { display: flex; align-items: center; gap: 9px; margin: 24px 0 0; color: var(--muted); font-size: 10px; }
.landing-note .pulse { width: 7px; height: 7px; margin: 0; }
.landing-preview { padding: 24px; }
.landing-preview h2 { margin: 6px 0 0; font-size: 22px; }
.landing-features { display: grid; gap: 0; margin-top: 24px; border-top: 1px solid var(--line-soft); }
.landing-features div { display: flex; align-items: center; gap: 15px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
.landing-features b { color: var(--mint); font-size: 11px; }
.landing-screen footer { padding-top: 0; }

.orb {
  position: fixed;
  width: 220px;
  height: 220px;
  border: 1px solid currentColor;
  border-radius: 50%;
  pointer-events: none;
  opacity: .08;
}

.orb-one { top: 12%; left: -145px; color: var(--mint); }
.orb-two { right: -145px; bottom: 8%; color: var(--violet); }

.topbar {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.topbar-actions { display: flex; align-items: center; gap: 18px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--mint);
  background: var(--mint);
  color: var(--bg);
  font-weight: 900;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .28);
  clip-path: polygon(0 0, 78% 0, 100% 22%, 100% 100%, 22% 100%, 0 78%);
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dot, .live-dot {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  background: transparent;
}

.connection.online { color: var(--mint); }
.connection.online .dot { background: var(--mint); box-shadow: 0 0 12px rgba(102, 239, 202, .8); }
.connection.connecting .dot { color: var(--yellow); animation: blink 1s steps(2, end) infinite; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 34px;
  padding: 74px 0 48px;
}

.eyebrow, .label {
  margin: 0;
  color: var(--mint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 800px;
  margin: 15px 0 14px;
  color: var(--text);
  font-size: clamp(38px, 7vw, 78px);
  line-height: .96;
  letter-spacing: -.08em;
  text-transform: uppercase;
}

h1 em { color: var(--mint); font-style: normal; }

h2 {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

.lede { max-width: 620px; margin: 0; color: var(--muted); font-size: 14px; }

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: rgba(15, 31, 48, .7);
  color: var(--mint);
  font-size: 10px;
  letter-spacing: .09em;
  white-space: nowrap;
  text-transform: uppercase;
}

.pulse {
  width: 9px;
  height: 9px;
  border: 2px solid var(--mint);
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(102, 239, 202, .1);
  animation: blink 1.4s steps(2, end) infinite;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(20, 40, 59, .96), rgba(10, 25, 39, .96));
  box-shadow: 0 16px 34px var(--shadow);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.status-card, .games-card { min-height: 294px; padding: 26px; }

.status-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 15px;
}

.status-icon.status-running { border-color: var(--mint); color: var(--mint); box-shadow: 0 0 18px rgba(102, 239, 202, .12); }
.status-icon.status-connecting, .status-icon.status-awaiting_qr { border-color: var(--yellow); color: var(--yellow); }

.status-title {
  margin-top: 35px;
  color: var(--mint);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -.09em;
  line-height: 1;
  text-transform: uppercase;
}

.muted { color: var(--muted); font-size: 12px; }

.rule { margin: 25px 0 19px; border-top: 1px solid var(--line-soft); }

.stats { display: flex; flex-wrap: wrap; gap: 22px 32px; }
.stats > div { display: grid; gap: 4px; }
.stat-label { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.stats strong { color: var(--yellow); font-size: 21px; }

.button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .12s, border-color .12s;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 7px 15px rgba(0, 0, 0, .2); }
.button:focus-visible, .icon-button:focus-visible, .text-input:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.button:disabled { cursor: not-allowed; opacity: .4; }
.button-primary { border-color: var(--mint); background: var(--mint); color: var(--bg); }
.button-primary:hover:not(:disabled) { background: #9af9df; }
.button-secondary { border-color: var(--blue); background: rgba(117, 200, 255, .06); color: var(--blue); }
.button-secondary:hover:not(:disabled) { background: rgba(117, 200, 255, .16); }
.button-warning { border-color: var(--yellow); background: rgba(255, 215, 94, .06); color: var(--yellow); }
.button-warning:hover:not(:disabled) { background: rgba(255, 215, 94, .16); }
.button-quiet { border-color: var(--line); background: var(--surface-deep); color: var(--muted); }
.button-danger { border-color: var(--coral); background: rgba(255, 113, 128, .04); color: var(--coral); }
.button-danger:hover:not(:disabled) { background: rgba(255, 113, 128, .14); }

.live-tag, .file-label {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .08em;
  white-space: nowrap;
  text-transform: uppercase;
}

.live-tag { border-color: var(--mint); color: var(--mint); }
.live-dot { display: inline-block; margin-right: 5px; border-color: var(--mint); background: var(--mint); }
.overview-copy { max-width: 620px; margin: 24px 0 20px; color: var(--muted); font-size: 13px; }
.overview-points { display: flex; flex-wrap: wrap; gap: 9px 20px; margin-bottom: 27px; color: var(--muted); font-size: 10px; }
.overview-points span { padding: 7px 9px; border: 1px solid var(--line-soft); background: rgba(7, 17, 28, .32); }
.overview-points b { margin-right: 5px; color: var(--yellow); }
.presence-note { display: flex; align-items: center; gap: 9px; padding-top: 18px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.presence-note strong { color: var(--mint); }
.presence-icon { color: var(--mint); font-size: 18px; }

.accounts-section { margin-top: 56px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.section-heading-actions .button { box-sizing: border-box; height: 36px; }
.section-heading h2 { margin-top: 8px; }
.account-list { display: grid; gap: 18px; }
.account-card { padding: 25px; }
.account-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.account-header-actions { display: flex; align-items: center; gap: 10px; }
.account-collapse-toggle { display: inline-grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line); padding: 0; background: var(--surface-raised); color: var(--mint); cursor: pointer; }
.account-collapse-toggle:hover { border-color: var(--mint); }
.account-collapse-toggle:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.account-collapse-toggle .collapse-caret { font-size: 16px; }
.account-collapsible-content[hidden] { display: none; }
.account-card.is-collapsed .account-subtitle,
.account-card.is-collapsed .account-id { display: none; }
.account-title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.account-title-line h2 { margin: 0; font-size: 22px; }
.account-status { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.account-status.status-running { border-color: var(--mint); color: var(--mint); }
.account-status.status-blocked { border-color: var(--yellow); color: var(--yellow); }
.account-status.status-awaiting_qr, .account-status.status-connecting { border-color: var(--violet); color: var(--violet); }
.account-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.account-id { color: var(--faint); font-size: 10px; }
.account-stats { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 20px 0 15px; padding: 13px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.account-stats b { color: var(--text); font-weight: 700; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.qr-inline { display: flex; align-items: center; gap: 18px; margin-top: 20px; padding: 15px; border: 1px solid var(--violet); border-radius: 7px; background: rgba(190, 169, 255, .06); }
.qr-inline img { width: 120px; height: 120px; padding: 4px; border-radius: 4px; background: white; image-rendering: pixelated; }
.qr-inline strong { font-size: 13px; }
.qr-inline p { margin: 7px 0; color: var(--muted); font-size: 11px; }
.qr-inline a { color: var(--mint); font-size: 11px; }
.pending-account-card { border-color: var(--violet); }
.pending-account-actions { margin-top: 18px; }

.account-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-top: 29px; }
.library-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.account-section-heading h3 { margin: 6px 0 0; color: var(--text); font-size: 14px; letter-spacing: -.025em; text-transform: uppercase; }
.library-actions { display: flex; align-items: center; gap: 8px; }
.sort-control { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.sort-control .custom-select { width: 160px; }
.sort-select { min-width: 132px; }
.sort-control .custom-select-trigger, .sort-direction-button { box-sizing: border-box; height: 36px; }
.sort-direction-button { border: 1px solid var(--line); padding: 0 8px; background: var(--surface-raised); color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.sort-direction-button:hover { border-color: var(--mint); color: var(--mint); }
.sort-direction-button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.library-error { margin: 14px 0 0; padding: 10px 12px; border: 1px solid var(--yellow); border-radius: 5px; background: rgba(255, 209, 102, .07); color: var(--yellow); font-size: 11px; }
.library-group { margin-top: 18px; }
.library-group-heading { display: flex; width: 100%; align-items: center; gap: 8px; border: 0; padding: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 9px; letter-spacing: .14em; text-align: left; text-transform: uppercase; }
.library-group-heading:hover { color: var(--text); }
.library-group-heading:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
.library-group-heading b { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 10px; line-height: 1; text-align: center; }
.collapse-caret { color: var(--mint); font-size: 14px; line-height: 1; }
.inactive-games-heading { display: flex; align-items: center; gap: 12px; }
.inactive-games-heading .library-group-heading { width: auto; flex: 1; }
.played-filter-toggle { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; color: var(--muted); cursor: pointer; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.played-filter-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toggle-track { position: relative; display: inline-block; width: 29px; height: 16px; border: 1px solid var(--line); background: var(--surface-deep); transition: background .12s, border-color .12s; }
.toggle-track::after { position: absolute; top: 3px; left: 3px; width: 8px; height: 8px; background: var(--muted); content: ''; transition: transform .12s, background .12s; }
.played-filter-toggle input:checked + .toggle-track { border-color: var(--mint); background: rgba(101, 255, 156, .12); }
.played-filter-toggle input:checked + .toggle-track::after { background: var(--mint); transform: translateX(13px); }
.played-filter-toggle input:focus-visible + .toggle-track { outline: 2px solid var(--mint); outline-offset: 2px; }
.owned-game-list { display: grid; gap: 8px; margin-top: 9px; }
.owned-game-list[hidden] { display: none; }
.inactive-games-content.is-collapsed,
.inactive-games-content[hidden] { display: none; }
.inactive-games-search { display: grid; gap: 6px; margin: 10px 0 9px; }
.inactive-games-search > span { color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.inactive-games-search .text-input { box-sizing: border-box; }
.owned-game-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 13px; border: 1px solid var(--line-soft); border-radius: 7px; background: rgba(9, 23, 37, .72); }
.owned-game-row[hidden] { display: none; }
.owned-game-row.is-active { border-color: var(--mint-deep); box-shadow: inset 3px 0 0 var(--mint); }
.owned-game-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.owned-game-identity > div { min-width: 0; }
.game-icon { width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-raised); opacity: 1; filter: none; object-fit: cover; image-rendering: pixelated; }
.game-icon-placeholder { display: grid; place-items: center; background: var(--surface-raised); color: var(--mint); font-weight: 700; }
.game-name { overflow: hidden; color: var(--text); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.game-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 3px; color: var(--muted); font-size: 9px; }
.owned-game-controls { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.owned-game-controls > * { flex: 0 0 auto; }
.timer-inline { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.timer-unit-label { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.row-timer, .icon-button {
  height: 32px;
  box-sizing: border-box;
}
.timer-stepper { display: flex; width: 88px; height: 32px; flex: 0 0 88px; }
.row-timer { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 5px 0 0 5px; padding: 0 6px; background: var(--bg); color: var(--text); font-size: 11px; appearance: textfield; }
.row-timer::-webkit-inner-spin-button,
.row-timer::-webkit-outer-spin-button { margin: 0; appearance: none; }
.timer-step-controls { display: flex; width: 20px; flex: 0 0 20px; flex-direction: column; border: 1px solid var(--line); border-left: 0; background: var(--surface-raised); }
.timer-step-button { display: block; min-height: 0; flex: 1; border: 0; padding: 0; background: transparent; color: var(--muted); cursor: pointer; font: 700 10px/1 Arial, sans-serif; }
.timer-step-button + .timer-step-button { border-top: 1px solid var(--line); }
.timer-step-button:hover { background: rgba(101, 255, 156, .12); color: var(--mint); }
.timer-step-button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--mint); outline-offset: -2px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 5px; padding: 0 9px; background: var(--surface-raised); color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.icon-button:hover:not(:disabled) { border-color: var(--mint); color: var(--text); }
.icon-button:disabled { cursor: not-allowed; opacity: .4; }
.start-control { border-color: var(--mint-deep); color: var(--mint); }
.pause-control, .stop-control { border-color: var(--yellow); color: var(--yellow); }
.save-control { border-color: var(--blue); color: var(--blue); }
.empty-state { color: var(--muted); font-size: 12px; }
.compact { padding: 10px 0; }

.account-settings { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.account-settings > .account-section-heading { align-items: flex-start; margin-top: 0; }
.settings-intro { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 9px; align-items: stretch; margin-top: 12px; }
.settings-panel-identity { grid-column: 1; grid-row: 1; }
.settings-panel-recovery { grid-column: 1; grid-row: 2; }
.settings-panel-presence { grid-column: 2; grid-row: 1 / span 2; }
.settings-panel { min-width: 0; padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 6px; background: rgba(7, 17, 28, .34); }
.settings-panel-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.settings-panel-heading strong { color: var(--text); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.settings-panel-kicker { color: var(--mint); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
.settings-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.settings-field { margin-top: 9px; }
.settings-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.settings-utility-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-actions .form-footer { margin-top: 0; padding: 0; }
.input-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.custom-select { position: relative; width: 100%; }
.custom-select-trigger { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 5px; padding: 10px; background: var(--bg); color: var(--text); cursor: pointer; font-size: 11px; text-align: left; }
.custom-select-trigger:hover:not(:disabled), .custom-select-trigger[aria-expanded="true"] { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(102, 239, 202, .08); }
.custom-select-trigger:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.custom-select-trigger:disabled { cursor: not-allowed; opacity: .55; }
.custom-select-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-caret { color: var(--mint); font-size: 15px; line-height: 1; }
.custom-select-menu { position: absolute; z-index: 8; top: calc(100% + 5px); right: 0; left: 0; max-height: 230px; overflow-y: auto; border: 1px solid var(--mint-deep); border-radius: 6px; padding: 4px; background: var(--surface-deep); box-shadow: 0 12px 24px var(--shadow); }
.custom-select-menu[hidden] { display: none; }
.custom-select-option { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); padding: 9px 8px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 10px; text-align: left; }
.custom-select-option:last-child { border-bottom: 0; }
.custom-select-option:hover, .custom-select-option:focus-visible, .custom-select-option[aria-selected="true"] { background: rgba(102, 239, 202, .1); color: var(--mint); outline: none; }
.text-input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 10px; outline: none; background: var(--bg); color: var(--text); font-size: 11px; }
.text-input:focus, textarea:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(102, 239, 202, .08); }
.text-input:disabled { cursor: not-allowed; opacity: .55; }
.account-current-game:disabled { opacity: .55; cursor: not-allowed; }
.setting-toggle { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; color: var(--muted); cursor: pointer; }
.setting-toggle input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--mint); }
.setting-toggle span { display: grid; gap: 2px; }
.setting-toggle strong { color: var(--text); font-size: 10px; text-transform: uppercase; }
.setting-toggle small { color: var(--muted); font-size: 10px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; }
.form-message { color: var(--mint); font-size: 10px; }
.form-hint { margin: 7px 0 0; color: var(--muted); font-size: 9px; }
.add-account-form { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 15px; margin-bottom: 18px; padding: 18px; }
.add-account-form > div { min-width: 0; }
.add-account-form > div { width: 100%; }
.add-account-form > .button { justify-self: center; }

.login-screen { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(7, 17, 28, .88); backdrop-filter: blur(8px); }
.login-screen.hidden, .hidden { display: none; }
.login-card { width: min(100%, 430px); padding: 30px; }
.login-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.login-card-header .brand-mark { margin-bottom: 24px; }
.auth-close { border: 1px solid var(--line); padding: 2px 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 22px; line-height: 1.1; }
.auth-close:hover { border-color: var(--mint); color: var(--mint); }
.login-card h2 { margin: 7px 0 10px; font-size: 24px; }
.login-card .muted { line-height: 1.7; }
.login-card form { display: grid; gap: 9px; margin-top: 22px; }
.login-card form.hidden { display: none; }
.login-card form .button { margin-top: 7px; }
.login-error { min-height: 18px; margin: 2px 0 0; color: var(--coral); font-size: 11px; }
.auth-tabs { display: flex; gap: 6px; margin-top: 22px; border-bottom: 1px solid var(--line); }
.auth-tab { border: 0; border-bottom: 2px solid transparent; padding: 9px 5px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 10px; text-transform: uppercase; }
.auth-tab:hover, .auth-tab.is-active { border-bottom-color: var(--mint); color: var(--mint); }

.modal-backdrop { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(7, 17, 28, .82); backdrop-filter: blur(8px); }
.modal-backdrop.hidden { display: none; }
.modal-card { width: min(100%, 520px); padding: 26px; border-color: var(--coral); box-shadow: 0 18px 50px var(--shadow); }
.modal-kicker { color: var(--coral); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.modal-card h2 { margin: 7px 0 10px; font-size: 22px; }
.modal-copy { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.modal-toggle { margin-top: 20px; padding: 12px; border: 1px solid var(--line-soft); background: rgba(7, 17, 28, .34); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

footer { padding: 34px 0 48px; color: var(--faint); font-size: 9px; text-align: center; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: 360px; padding: 12px 15px; border: 1px solid var(--coral); border-radius: 6px; background: var(--surface-deep); color: var(--coral); font-size: 10px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@keyframes blink { 50% { opacity: .35; } }

@media (max-width: 900px) {
  .shell { width: min(100% - 36px, 720px); }
  .landing-screen { width: min(100% - 36px, 720px); }
  .landing-hero { grid-template-columns: 1fr; gap: 35px; min-height: 0; padding: 65px 0 35px; }
  .intro { display: block; padding: 56px 0 36px; }
  .intro-badge { margin-top: 22px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .status-card, .games-card { min-height: 0; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-panel-identity, .settings-panel-recovery, .settings-panel-presence { grid-column: auto; grid-row: auto; }
  .owned-game-row { align-items: flex-start; flex-direction: column; }
  .owned-game-controls { width: 100%; justify-content: flex-start; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading-actions { justify-content: flex-start; }
  .account-header, .account-section-heading { align-items: flex-start; flex-direction: column; }
  .account-header-actions { width: 100%; justify-content: space-between; }
  .library-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 28px, 480px); }
  .landing-screen { width: min(100% - 28px, 480px); }
  .landing-topbar { min-height: 70px; }
  .landing-status { font-size: 8px; }
  .landing-hero { padding-top: 52px; }
  .landing-copy h1 { font-size: 48px; }
  .landing-note { align-items: flex-start; }
  .topbar { min-height: 70px; }
  .topbar-actions { align-items: flex-end; flex-direction: column; gap: 6px; }
  .brand { font-size: 10px; }
  .brand-mark { width: 30px; height: 30px; }
  .connection { font-size: 8px; }
  h1 { font-size: 43px; }
  .card, .status-card, .games-card, .account-card { padding: 18px; }
  .account-actions .button { flex: 1 1 42%; }
  .settings-field-row { grid-template-columns: 1fr; }
  .add-account-form { grid-template-columns: 1fr; }
  .add-account-form > .button { width: 100%; }
  .qr-inline { align-items: flex-start; flex-direction: column; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  .settings-actions { align-items: stretch; flex-direction: column-reverse; }
  .settings-utility-actions { width: 100%; }
  .settings-utility-actions .button { flex: 1 1 0; }
  .sort-control { width: 100%; justify-content: space-between; }
  .sort-control .custom-select { width: min(100%, 190px); }
  .toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* CRT terminal skin */
:root {
  --bg: #050806;
  --bg-soft: #09120b;
  --surface: #0b1710;
  --surface-raised: #12251a;
  --surface-deep: #050a07;
  --line: #28613e;
  --line-soft: #173a26;
  --text: #d7ffe3;
  --muted: #78a98a;
  --faint: #4e765c;
  --mint: #65ff9c;
  --mint-deep: #269052;
  --blue: #75c8ff;
  --yellow: #ffd75e;
  --coral: #ff7180;
  --violet: #c4a7ff;
  --shadow: rgba(0, 0, 0, .7);
}

body {
  background:
    repeating-linear-gradient(0deg, rgba(101, 255, 156, .035) 0 1px, transparent 1px 4px),
    linear-gradient(rgba(101, 255, 156, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 255, 156, .028) 1px, transparent 1px),
    radial-gradient(circle at 50% -20%, rgba(101, 255, 156, .12), transparent 34rem),
    var(--bg);
  background-size: auto, 32px 32px, 32px 32px, auto, auto;
}

body::before {
  z-index: 20;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .34) 100%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(101, 255, 156, .035) 3px 4px);
  mix-blend-mode: screen;
}

body::after {
  background: linear-gradient(180deg, rgba(5, 8, 6, 0) 55%, rgba(5, 8, 6, .7));
}

.topbar { border-bottom: 2px solid var(--mint-deep); }
.brand { text-shadow: 0 0 8px rgba(101, 255, 156, .35); }
.brand-mark {
  border: 2px solid var(--mint);
  border-radius: 0;
  box-shadow: 4px 4px 0 #000, 0 0 12px rgba(101, 255, 156, .3);
  clip-path: none;
}

h1, h2, h3, .status-title, .game-name {
  text-shadow: 0 0 7px rgba(101, 255, 156, .18);
}

.intro-badge {
  border: 2px solid var(--line);
  border-radius: 0;
  background: rgba(11, 23, 16, .9);
  box-shadow: 4px 4px 0 #000;
}

.card {
  border: 2px solid var(--line);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(15, 32, 21, .98), rgba(7, 16, 10, .98));
  box-shadow: 5px 5px 0 #000, inset 0 0 0 1px rgba(101, 255, 156, .05);
}

.status-icon,
.live-tag,
.file-label,
.account-status,
.overview-points span,
.owned-game-row,
.library-error,
.qr-inline,
.row-timer,
.icon-button,
.text-input,
textarea,
.custom-select-trigger,
.custom-select-menu,
.setting-toggle input {
  border-radius: 0;
}

.status-icon {
  border-width: 2px;
  box-shadow: 3px 3px 0 #000;
}

.button {
  border-radius: 0;
  box-shadow: 3px 3px 0 #000;
  transition: background .12s, color .12s, border-color .12s;
}

.button:hover:not(:disabled) {
  transform: none;
  box-shadow: 3px 3px 0 #000, 0 0 10px rgba(101, 255, 156, .25);
}

.button-primary { text-shadow: 0 0 5px rgba(5, 8, 6, .3); }
.live-tag { padding: 4px 8px; }
.presence-note { border-top-width: 2px; }
.account-card { box-shadow: 5px 5px 0 #000, inset 0 0 0 1px rgba(101, 255, 156, .04); }
.account-stats { border-top-width: 2px; border-bottom-width: 2px; }
.account-settings { border-top-width: 2px; }
.owned-game-row { background: rgba(4, 12, 7, .9); }
.owned-game-row.is-active {
  border-color: var(--mint);
  box-shadow: inset 4px 0 0 var(--mint), 3px 3px 0 #000;
}
.owned-game-row.is-active .game-name { color: var(--mint); }
.owned-game-row.is-paused {
  border-color: var(--yellow);
  box-shadow: inset 4px 0 0 var(--yellow), 3px 3px 0 #000;
}
.owned-game-row.is-paused .game-name { color: var(--yellow); }
.custom-select-menu { box-shadow: 4px 4px 0 #000; }
.custom-select-option:hover,
.custom-select-option:focus-visible,
.custom-select-option[aria-selected="true"] {
  background: rgba(101, 255, 156, .14);
  text-shadow: 0 0 6px rgba(101, 255, 156, .4);
}
.text-input:focus,
textarea:focus,
.row-timer:focus {
  box-shadow: 0 0 0 2px var(--mint), 3px 3px 0 #000;
}
.login-screen { background: rgba(2, 5, 3, .92); backdrop-filter: none; }
.login-card { box-shadow: 6px 6px 0 #000, 0 0 22px rgba(101, 255, 156, .14); }
.toast { border-radius: 0; box-shadow: 4px 4px 0 #000; }
