:root {
  color-scheme: dark;
  --bg: #03040a;
  --panel: rgba(10, 11, 23, 0.86);
  --panel-solid: #0d0e1b;
  --panel-light: #191a2d;
  --line: rgba(213, 211, 255, 0.12);
  --line-strong: rgba(213, 211, 255, 0.23);
  --text: #f4f2ff;
  --muted: #a9a7bd;
  --green: #c6ff72;
  --green-deep: #8ed14d;
  --blue: #61e7ff;
  --violet: #9287ff;
  --danger: #ff6b7d;
  --shadow: 0 32px 100px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse 65% 52% at 82% -5%, rgba(146,135,255,.2), transparent 68%),
    radial-gradient(ellipse 50% 46% at -5% 78%, rgba(97,231,255,.1), transparent 70%),
    linear-gradient(rgba(3,4,10,.77), rgba(3,4,10,.92)),
    url("../assets/pokemon-forest.png") center / cover fixed,
    var(--bg);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .3;
  background:
    radial-gradient(circle, rgba(244,242,255,.8) 0 1px, transparent 1.4px) 17px 29px / 137px 137px,
    radial-gradient(circle, rgba(97,231,255,.65) 0 .8px, transparent 1.2px) 48px 67px / 211px 211px;
}
.hub-return {
  position: fixed;
  z-index: 100;
  top: 28px;
  right: 34px;
  display: none;
  min-height: 38px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(3,4,10,.58);
  backdrop-filter: blur(14px);
  font: 700 .65rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color .2s, border-color .2s, transform .2s;
}
body:has(.auth-page) .hub-return { display: inline-flex; }
.hub-return:hover { color: var(--blue); border-color: rgba(97,231,255,.45); transform: translateX(-2px); }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
.ambient { position: fixed; width: 34rem; height: 34rem; border-radius: 50%; filter: blur(130px); opacity: .09; pointer-events: none; }
.ambient-one { top: -12rem; left: -10rem; background: var(--green); }
.ambient-two { bottom: -16rem; right: -8rem; background: var(--violet); }
.app-shell { position: relative; z-index: 1; width: min(1180px, calc(100% - 40px)); min-height: 100vh; margin: 0 auto; }
.muted { color: var(--muted); }
.eyebrow, .section-label { margin: 0; color: var(--green); font-size: .7rem; line-height: 1.3; letter-spacing: .18em; font-weight: 800; }
.brand-line { display: flex; align-items: center; gap: 11px; font-size: .78rem; letter-spacing: .14em; font-weight: 800; }
.brand-mark { position: relative; display: grid; place-items: center; width: 29px; height: 29px; border: 2px solid var(--green); border-radius: 50%; }
.brand-mark::before { content: ""; position: absolute; width: 100%; height: 2px; background: var(--green); }
.brand-mark span:first-child { width: 9px; height: 9px; border: 2px solid var(--green); border-radius: 50%; background: var(--panel-solid); z-index: 1; }
.brand-mark span:last-child { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--green); z-index: 2; }
.boot-card, .error-card { position: absolute; top: 50%; left: 50%; width: min(440px, 90vw); padding: 36px; transform: translate(-50%, -50%); text-align: center; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.boot-card .brand-mark { margin: 0 auto 20px; }
.boot-card h1 { margin: 8px 0; font-size: 2rem; }
.loading-line { height: 3px; margin-top: 24px; overflow: hidden; border-radius: 9px; background: rgba(255,255,255,.06); }
.loading-line span { display: block; width: 35%; height: 100%; background: var(--green); box-shadow: 0 0 16px var(--green); animation: loading 1.2s infinite ease-in-out; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(390%); } }

.auth-page { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .7fr); align-items: center; gap: clamp(40px, 8vw, 120px); }
.auth-intro h1 { max-width: 720px; margin: 18px 0 20px; font-size: clamp(3rem, 6vw, 5.8rem); line-height: .99; letter-spacing: -.055em; }
.auth-intro > p:not(.eyebrow) { max-width: 650px; color: #abb0bd; font-size: 1.08rem; line-height: 1.75; }
.auth-intro .brand-line { position: absolute; top: 38px; }
.feature-row { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 38px; color: #c9cdd6; font-size: .8rem; }
.feature-row span::first-letter { color: var(--green); }
.auth-card { padding: 28px; border: 1px solid var(--line-strong); border-radius: 26px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(26px); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.25); }
.auth-tabs button { padding: 10px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: .83rem; font-weight: 700; }
.auth-tabs button.active { color: var(--text); background: var(--panel-light); box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.auth-copy { margin: 30px 0 24px; }
.auth-copy h2 { margin: 0 0 7px; font-size: 1.6rem; }
.auth-copy p { margin: 0; color: var(--muted); }
.field { display: grid; gap: 8px; margin: 16px 0; color: #d6d9e1; font-size: .78rem; font-weight: 700; }
.field input, .field select { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; color: var(--text); background: rgba(3,5,10,.42); }
.field input:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(124,245,154,.1); }
.primary, .play-button, .refresh-button, .quiet-button, .icon-button, .control-grid button, .state-actions button, .danger-quiet, .slot-row { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-light); transition: transform .16s, border-color .16s, background .16s; }
button:not(:disabled):hover { border-color: rgba(124,245,154,.48); transform: translateY(-1px); }
.primary { border-color: transparent; color: #071009; background: var(--green); font-weight: 800; }
.primary:hover { background: #91f7a9; }
.auth-submit { width: 100%; min-height: 48px; margin-top: 8px; }
.form-error { min-height: 20px; margin: 6px 0; color: #ff8e9a; font-size: .8rem; line-height: 1.45; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px 0 0; color: #777e8e; font-size: .72rem; }
.privacy-note i, .save-note i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(124,245,154,.7); }

.library-page { padding: 32px 0 60px; }
.library-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.account-actions { display: flex; align-items: center; gap: 8px; }
.quiet-button, .refresh-button { min-height: 38px; padding: 0 13px; color: #c4c8d2; background: transparent; font-size: .78rem; }
.user-chip { padding: 8px 13px; border: 1px solid rgba(124,245,154,.18); border-radius: 999px; color: var(--green); background: rgba(124,245,154,.06); font-size: .78rem; font-weight: 700; }
.library-hero { display: flex; justify-content: space-between; align-items: end; padding: 64px 0 30px; }
.library-hero h1 { margin: 10px 0 7px; font-size: clamp(2.5rem, 5vw, 4.5rem); letter-spacing: -.045em; }
.library-hero p:last-child { margin: 0; }
.refresh-button { min-height: 42px; padding: 0 16px; background: var(--panel); }
.library-tabs { display: inline-flex; gap: 5px; margin: 0 0 24px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.22); }
.library-tabs button { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: .78rem; font-weight: 750; }
.library-tabs button.active { color: var(--text); background: var(--panel-light); box-shadow: 0 5px 18px rgba(0,0,0,.22); }
.library-tabs small { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px; color: #aeb5c5; background: rgba(255,255,255,.07); font-size: .62rem; }
.library-tabs button.active small { color: #071009; background: var(--green); }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.game-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: rgba(17,20,30,.82); box-shadow: 0 12px 38px rgba(0,0,0,.18); transition: transform .2s, border-color .2s; }
.game-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.game-art { position: relative; display: grid; place-items: center; height: 190px; overflow: hidden; background: linear-gradient(145deg, #263831, #111a18); }
.game-art.gba { background: linear-gradient(145deg, #27314b, #151724); }
.game-art.nds { background: linear-gradient(145deg, #422d4d, #171420); }
.game-art.\33 ds { background: linear-gradient(145deg, #264267, #141a2a); }
.game-art::before, .game-art::after { content: ""; position: absolute; width: 210px; height: 210px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; }
.game-art::after { width: 135px; height: 135px; border-style: dashed; transform: rotate(23deg); }
.game-art strong { z-index: 1; font-size: 3.4rem; letter-spacing: -.08em; text-shadow: 0 8px 28px rgba(0,0,0,.38); }
.game-art i { position: absolute; width: 14px; height: 14px; border: 3px solid var(--green); border-radius: 50%; box-shadow: 0 0 22px var(--green); }
.game-art.has-cover::before { inset: 0; width: auto; height: auto; border: 0; border-radius: 0; background: linear-gradient(90deg, rgba(4,8,12,.72), transparent 36%, transparent 64%, rgba(4,8,12,.72)); }
.game-art.has-cover::after { display: none; }
.game-cover { position: relative; z-index: 1; width: 100%; height: 100%; padding: 10px 26px; object-fit: contain; filter: drop-shadow(0 12px 15px rgba(0,0,0,.44)); }
.system-tag { position: absolute; z-index: 2; top: 14px; left: 14px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 7px; color: rgba(255,255,255,.68); background: rgba(0,0,0,.42); font-size: .62rem; font-weight: 800; letter-spacing: .08em; }
.game-card-body { padding: 20px; }
.game-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.game-heading h2 { min-width: 0; margin: 0; overflow: hidden; font-size: 1.08rem; white-space: nowrap; text-overflow: ellipsis; }
.game-heading > span { flex: none; color: #737989; font-size: .68rem; }
.save-status { display: flex; align-items: center; gap: 7px; min-height: 20px; margin: 12px 0 18px; color: var(--muted); font-size: .73rem; }
.save-status i { width: 6px; height: 6px; border-radius: 50%; background: #697080; }
.save-status.has-save i { background: var(--green); box-shadow: 0 0 8px rgba(124,245,154,.55); }
.game-actions { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 9px; }
.play-button, .preview-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 42px; color: #e6e9ee; background: rgba(255,255,255,.04); font-weight: 750; }
.preview-button { color: #cbd3df; border-color: rgba(255,255,255,.11); }
.preview-button:hover { color: var(--text); background: rgba(255,255,255,.09); }
.play-button b { color: var(--green); font-size: .68rem; }
.preview-button b { color: #88bfff; font-size: 1rem; line-height: 0; }
.game-preview { width: min(940px, calc(100vw - 28px)); max-width: none; padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; color: var(--text); background: #10151d; box-shadow: 0 30px 100px rgba(0,0,0,.7); }
.game-preview::backdrop { background: rgba(3,7,11,.82); backdrop-filter: blur(5px); }
.game-preview-panel { display: grid; }
.game-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 21px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.025); }
.game-preview-header .eyebrow { margin: 0 0 4px; font-size: .61rem; }
.game-preview-header h2 { margin: 0; font-size: 1.1rem; }
.preview-close { min-height: 34px; padding: 0 13px; color: var(--muted); background: rgba(255,255,255,.05); font-size: .72rem; font-weight: 750; }
.preview-close:hover { color: var(--text); background: rgba(255,255,255,.1); }
.game-preview-image { display: block; width: 100%; max-height: min(72vh, 660px); object-fit: contain; background: #07090e; }
.empty-library { grid-column: 1 / -1; padding: 70px 30px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 24px; background: rgba(15,18,27,.48); }
.empty-library h2 { margin: 20px 0 8px; }
.empty-library p { max-width: 650px; margin: 0 auto; color: var(--muted); line-height: 1.7; }
code { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: #cdd2dd; background: rgba(0,0,0,.28); }
.empty-cartridge { position: relative; width: 52px; height: 60px; margin: auto; border: 2px solid #72798a; border-radius: 5px 5px 9px 9px; }
.empty-cartridge::before { content: ""; position: absolute; top: 9px; left: 8px; width: 32px; height: 28px; border: 1px solid #555c6d; }
.empty-cartridge span { position: absolute; right: 7px; bottom: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.library-footer { margin-top: 46px; color: #606777; text-align: center; font-size: .7rem; }
.firmware-banner { display: flex; align-items: center; gap: 18px; margin: 0 0 24px; padding: 18px 20px; border: 1px solid rgba(255,204,103,.22); border-radius: 16px; background: rgba(255,204,103,.055); }
.firmware-banner h2 { margin: 5px 0 4px; font-size: 1rem; }
.firmware-banner .muted { margin: 0; font-size: .75rem; line-height: 1.5; }
.firmware-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 1px solid rgba(255,204,103,.38); border-radius: 13px; color: #ffcc67; background: rgba(255,204,103,.07); font-size: .72rem; font-weight: 900; letter-spacing: .08em; }
.firmware-files { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.firmware-files code { color: #ffda8e; }
.beta-banner { display: flex; align-items: center; gap: 15px; margin: 0 0 24px; padding: 17px 19px; border: 1px solid rgba(128,168,255,.25); border-radius: 16px; background: rgba(128,168,255,.06); }
.beta-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 1px solid rgba(128,168,255,.4); border-radius: 13px; color: var(--blue); background: rgba(128,168,255,.08); font-size: .7rem; font-weight: 900; }
.beta-banner div:last-child { display: grid; gap: 4px; }
.beta-banner span, .beta-details p:last-child { color: var(--muted); font-size: .73rem; line-height: 1.55; }
.beta-details p:last-child { margin: 12px 0 0; }

.player-page { position: relative; z-index: 1; width: min(1440px, calc(100% - 36px)); min-height: 100vh; margin: 0 auto; padding: 22px 0 36px; }
.player-topbar { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; padding-bottom: 20px; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; background: var(--panel); font-size: 1.25rem; }
.player-title span { color: var(--green); font-size: .62rem; font-weight: 800; letter-spacing: .14em; }
.player-title h1 { margin: 3px 0 0; font-size: 1.05rem; }
.sync-pill { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: #aeb3c0; background: rgba(15,18,27,.8); font-size: .7rem; }
.sync-pill i { width: 7px; height: 7px; border-radius: 50%; background: #7b8393; }
.sync-pill.synced i { background: var(--green); box-shadow: 0 0 9px var(--green); }
.sync-pill.syncing i { background: #ffcc67; animation: pulse 1s infinite; }
.sync-pill.conflict i, .sync-pill.offline i { background: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }
.console-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.ds-player .console-layout { grid-template-columns: minmax(420px, 740px) 310px; justify-content: center; }
.three-ds-player .console-layout { grid-template-columns: minmax(560px, 900px) 310px; justify-content: center; }
.screen-card, .control-deck { border: 1px solid var(--line); border-radius: 22px; background: rgba(15,18,27,.82); box-shadow: var(--shadow); }
.screen-card { padding: 15px; }
.keyboard-map { margin: 12px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.55; }
.screen-bezel { position: relative; display: grid; height: min(72vh, 820px); min-height: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.06); border-radius: 15px; background: #020304; box-shadow: inset 0 0 70px rgba(0,0,0,.8); }
.emulator-mount { width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.emulator-mount > div { width: 100% !important; height: 100% !important; min-height: 0 !important; max-height: 100% !important; }
.ds-player .screen-bezel { height: min(79vh, 860px); }
.screen-hint { margin: 12px 8px 0; color: #777e8e; text-align: center; font-size: .7rem; }
.control-deck { overflow: hidden; }
.deck-section { padding: 20px; border-bottom: 1px solid var(--line); }
.deck-section:last-child { border: 0; }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.control-grid button, .state-actions button { min-height: 39px; color: #cdd1da; background: rgba(255,255,255,.035); font-size: .74rem; font-weight: 700; }
.danger-quiet { color: #ff9ca7 !important; background: rgba(255,107,125,.045) !important; }
.volume-row { display: grid; grid-template-columns: 60px 1fr; align-items: center; gap: 10px; margin-top: 16px; color: var(--muted); font-size: .7rem; }
input[type="range"] { accent-color: var(--green); }
.section-heading { display: flex; justify-content: space-between; align-items: center; }
.section-heading > span { color: #697080; font-size: .65rem; }
.compact-field { margin: 14px 0 10px; }
.compact-field select { min-height: 40px; }
.state-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.state-actions .primary { color: #071009; background: var(--green); }
.slot-list { display: grid; gap: 6px; margin-top: 14px; }
.slot-row { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 7px 10px; text-align: left; background: rgba(0,0,0,.12); }
.slot-row.active { border-color: rgba(124,245,154,.35); background: rgba(124,245,154,.045); }
.slot-row > span { display: grid; grid-template-columns: 24px 1fr; align-items: center; column-gap: 7px; }
.slot-row b { grid-row: 1 / 3; color: var(--green); font-size: .66rem; }
.slot-row em { color: #d7dae1; font-size: .7rem; font-style: normal; }
.slot-row small { color: #666d7d; font-size: .57rem; }
.save-note { display: flex; align-items: flex-start; gap: 10px; color: #878e9e; font-size: .68rem; line-height: 1.5; }
.save-note i { flex: none; margin-top: 5px; }
.save-note p { margin: 0; }
.save-note strong { color: #bfc3cd; }

.modal-backdrop { position: fixed; z-index: 9999; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(1,2,5,.76); backdrop-filter: blur(14px); }
.modal { width: min(650px, 100%); max-height: min(760px, 90vh); overflow: auto; border: 1px solid var(--line-strong); border-radius: 22px; background: #11141e; box-shadow: var(--shadow); }
.modal-top { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 24px; border-bottom: 1px solid var(--line); }
.modal-top h2 { margin: 7px 0; }
.modal-top .muted { display: block; max-width: 480px; font-size: .73rem; line-height: 1.5; }
.save-manager-list { padding: 12px; }
.save-manager-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 12px; border-bottom: 1px solid var(--line); }
.save-manager-row:last-child { border: 0; }
.save-manager-row > div { display: grid; gap: 4px; }
.save-manager-row span, .save-manager-row small { color: var(--muted); font-size: .68rem; }
.save-manager-row .danger-quiet { min-height: 34px; padding: 0 12px; border: 1px solid rgba(255,107,125,.16); border-radius: 9px; }
.empty-mini { padding: 45px 20px; color: var(--muted); text-align: center; line-height: 1.6; }
.toast-region { position: fixed; z-index: 20000; right: 20px; bottom: 20px; display: grid; gap: 9px; width: min(390px, calc(100% - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 12px; color: #daddE4; background: #191d29; box-shadow: 0 14px 40px rgba(0,0,0,.38); font-size: .78rem; line-height: 1.45; animation: toast-in .22s ease-out; }
.toast i { flex: none; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--blue); }
.toast.success i { background: var(--green); }.toast.error i { background: var(--danger); }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; align-content: center; padding: 100px 0 50px; }
  .auth-intro h1 { font-size: clamp(2.8rem, 12vw, 5rem); }
  .auth-intro .brand-line { top: 28px; }
  .auth-card { max-width: 560px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .console-layout { grid-template-columns: 1fr; }
  .ds-player .console-layout { grid-template-columns: 1fr; }
  .three-ds-player .console-layout { grid-template-columns: 1fr; }
  .screen-bezel, .ds-player .screen-bezel { height: min(70svh, 760px); }
  .control-deck { display: grid; grid-template-columns: 1fr 1fr; }
  .deck-section:last-child { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .hub-return { top: 20px; right: 12px; min-height: 34px; padding: 0 10px; font-size: .58rem; }
  .app-shell { width: min(100% - 24px, 1180px); }
  .auth-page { gap: 34px; }
  .auth-intro > p:not(.eyebrow), .feature-row { display: none; }
  .auth-card { padding: 20px; }
  .library-header { align-items: flex-start; }
  .account-actions { flex-wrap: wrap; justify-content: end; }
  .user-chip { order: -1; width: 100%; text-align: right; border: 0; background: transparent; }
  .library-hero { align-items: start; flex-direction: column; gap: 22px; padding-top: 45px; }
  .game-grid { grid-template-columns: 1fr; }
  .player-page { width: calc(100% - 16px); padding-top: 8px; }
  .player-topbar { grid-template-columns: 44px 1fr; }
  .sync-pill { grid-column: 1 / -1; justify-self: stretch; }
  .screen-card { padding: 7px; border-radius: 15px; }
  .screen-bezel, .ds-player .screen-bezel { height: min(68svh, 680px); }
  .control-deck { grid-template-columns: 1fr; }
  .deck-section:last-child { grid-column: auto; }
}
