/* app.css — the shared components (ui.js) and the first screens: install gate, sign-in, startup,
 * "Who's watching?" and the profile editor. Sizes are the Android app's dp values in CSS pixels. */

/* ======================= components ======================= */
.app-logo { display: block; object-fit: contain; flex: none; }
.spokes { display: inline-block; color: var(--text-2); flex: none; animation: spokes 1s steps(12) infinite; }
.spokes svg { display: block; }
@keyframes spokes { to { transform: rotate(360deg); } }
.pline { position: relative; display: block; width: 100%; height: 3px; border-radius: 99px; background: rgba(255,255,255,0.25); overflow: hidden; }
.pline .pl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--accent); transition: width 260ms var(--ease); }
.btn .btn-label { overflow: hidden; text-overflow: ellipsis; }
.ibtn.spinning .mi { animation: spin 0.9s linear infinite; }
.ibtn .dot { top: -1px; right: -1px; width: 11px; height: 11px; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }

/* placeholders and images */
.ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, hsl(var(--ph-h) 35% 24%), hsla(var(--ph-h), 35%, 24%, 0.6)); color: var(--text-2); }
:root[data-theme="light"] .ph { background: linear-gradient(135deg, hsl(var(--ph-h) 35% 82%), hsla(var(--ph-h), 35%, 82%, 0.6)); }
.ph-ini { font: 600 18px/24px var(--font); color: var(--text); opacity: 0.85; letter-spacing: -0.2px; }
.rimg { position: relative; overflow: hidden; background: var(--surface-high); }
.rimg-i { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 220ms; }
.rimg-i.fit { object-fit: contain; }
.rimg-i.loaded { opacity: 1; }
.rimg.inset .rimg-i { inset: 18px; width: calc(100% - 36px); height: calc(100% - 36px); }
.chart { position: relative; overflow: hidden; background: var(--surface-high); }
.chart-refl { position: absolute; inset: -30%; width: 160%; height: 160%; object-fit: cover; filter: blur(18px) saturate(1.3); opacity: 0; transition: opacity 260ms; transform: translateZ(0); }
.chart-refl.loaded { opacity: 1; }
.chart-dim { position: absolute; inset: 0; background: rgba(0,0,0,0.3); }
.chart-logo { position: absolute; inset: var(--inset); width: calc(100% - 2 * var(--inset)); height: calc(100% - 2 * var(--inset)); object-fit: contain; opacity: 0; transition: opacity 220ms; }
.chart-logo.loaded { opacity: 1; }
.chlogo { position: relative; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex: none; background: rgba(255,255,255,0.06); }
:root[data-theme="light"] .chlogo { background: rgba(0,0,0,0.04); }
.chlogo-i { position: absolute; inset: var(--pad); width: calc(100% - 2 * var(--pad)); height: calc(100% - 2 * var(--pad)); object-fit: contain; }
.chlogo-ini { font-weight: 600; color: var(--text-2); }
.itile { display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; position: relative; overflow: hidden; }
.itile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent 55%); pointer-events: none; }

/* badges on art */
.badge.rating .mi { color: #FFD60A; }
.badge.rank { font-weight: 700; }

/* posters (PosterCard) */
.poster { display: flex; flex-direction: column; width: var(--poster-w); flex: none; text-align: left; }
.poster-art { position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--surface-high); transition: transform 160ms var(--ease), box-shadow 160ms; }
.poster-art > .rimg { position: absolute; inset: 0; }
.poster.hot .poster-art { transform: scale(0.97); }
.poster-locked { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-2); background: var(--surface-high); }
.poster-tl { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; flex-wrap: wrap; right: 28px; }
.poster-fav { position: absolute; right: 7px; top: 7px; color: #FF375F; display: inline-flex; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.poster-prog { position: absolute; left: 8px; right: 8px; bottom: 8px; width: auto; }
.poster-prog.above { bottom: 30px; }
.poster-banner { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 0; background: var(--accent); color: var(--on-accent); font: 700 10px/14px var(--font); letter-spacing: 0.8px; text-align: center; white-space: nowrap; }
.poster-title { margin-top: 7px; font: 500 13px/18px var(--font); color: var(--text); }
.poster-sub { font: 400 12px/16px var(--font); color: var(--text-2); }

/* wide cards (WideCard) */
.wide { display: flex; flex-direction: column; width: 232px; flex: none; text-align: left; }
.wide-art { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--surface-high); transition: transform 160ms var(--ease); }
.wide-art > .rimg, .wide-art > .chart { position: absolute; inset: 0; }
.wide.hot .wide-art { transform: scale(0.97); }
.wide-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,0.65)); pointer-events: none; }
.wide-play { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(0,0,0,0.5); color: #fff; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 160ms; }
.wide.hot .wide-play { opacity: 1; }
@media (hover: hover) { .wide:hover .wide-play { opacity: 1; } }
.wide-badge { position: absolute; left: 7px; top: 7px; display: flex; gap: 4px; }
.wide-prog { position: absolute; left: 10px; right: 10px; bottom: 8px; width: auto; }
.wide-title { margin-top: 7px; font: 500 13px/18px var(--font); color: var(--text); }
.wide-sub { font: 400 12px/16px var(--font); color: var(--text-2); }

/* section headers and shelves */
.sec-head { display: flex; align-items: flex-end; gap: 10px; padding-bottom: 10px; }
.sec-title { flex: 1; min-width: 0; font: 600 18px/24px var(--font); letter-spacing: -0.2px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-trail { font: 400 13px/18px var(--font); color: var(--text-2); white-space: nowrap; }
.shelf { margin-bottom: 24px; }
.shelf-row { display: flex; gap: 14px; padding-top: 2px; padding-bottom: 4px; scroll-padding-left: calc(var(--pad-h) + var(--safe-left)); }
.state.loading { gap: 14px; }
.state .state-action { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.kv { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.kv-k { flex: 1; font: 400 14px/19px var(--font); color: var(--text-2); }
.kv-v { font: 500 14px/19px var(--font); color: var(--text); text-align: right; }
.glass-panel { border-color: rgba(255,255,255,0.10); }
:root[data-theme="light"] .glass-panel { border-color: rgba(0,0,0,0.08); }

/* top bar (TopBar): 56 tall; back 38 */
.topbar { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: calc(var(--safe-top) + 10px) calc(var(--pad-h) + var(--safe-right)) 10px calc(var(--pad-h) + var(--safe-left)); flex: none; }
.topbar-back { width: 38px !important; height: 38px !important; border-radius: 50% !important; }
.topbar-titles { flex: 1; min-width: 0; }
.topbar-title { font: 600 28px/34px var(--font); letter-spacing: -0.4px; }
.compact .topbar-title { font-size: 24px; line-height: 30px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-clock { margin-left: 4px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; }
.clock-date { opacity: 0.7; color: var(--text); }
.portrait.compact .topbar-clock { display: none; }

/* dialogs as USheet: glass, radius 20, padding 22 */
.dialog { background: rgba(36,36,40,0.95); border: 0.6px solid rgba(255,255,255,0.10); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); max-width: 440px; }
:root[data-theme="light"] .dialog { background: rgba(255,255,255,0.97); border-color: rgba(0,0,0,0.08); }
.dialog .d-icon { width: 46px; height: 46px; border-radius: 12px; margin-bottom: 14px; }
.dialog h3 { font: 600 18px/24px var(--font); }
.dialog p { font: 400 14px/19px var(--font); margin-top: 6px; }
.dialog .d-btns { margin-top: 16px; }
.dialog.pin-dialog { max-width: 340px; }
.pin-body { display: flex; flex-direction: column; align-items: center; margin-top: 16px; }
.pin-dots { display: flex; gap: 14px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface-highest); transition: background-color 120ms; }
.pin-dot.on { background: var(--accent); }
.pin-dot.err { background: rgba(255,69,58,0.5); }
.pin-dots.shake { animation: shake 360ms; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-msg { margin: 8px 0 !important; font: 400 12px/16px var(--font) !important; color: var(--danger) !important; min-height: 16px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 64px); gap: 10px; }
.pin-key { width: 64px; height: 48px; border-radius: 12px; background: var(--surface-high); color: var(--text); font: 500 18px/24px var(--font); display: inline-flex; align-items: center; justify-content: center; transition: transform 120ms var(--ease), background-color 120ms; }
.pin-key.hot { transform: scale(0.94); background: var(--accent); color: var(--on-accent); }
.pin-links { display: flex; gap: 6px; margin-top: 14px; }
/* a phone on its side (about 400 tall): the keypad beside the text instead of under it */
:root.lh-short .dialog.pin-dialog { max-width: 580px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 28px; align-items: start; padding: 18px 22px; }
:root.lh-short .dialog.pin-dialog > * { grid-column: 1; }
:root.lh-short .pin-dialog .pin-body { display: contents; }
:root.lh-short .pin-dialog .pin-pad { grid-column: 2; grid-row: 1 / span 8; align-self: center; }
:root.lh-short .pin-dialog .pin-dots { justify-self: start; margin-top: 14px; }
:root.lh-short .pin-dialog .pin-msg { justify-self: start; }
:root.lh-short .pin-dialog .pin-links { justify-self: start; margin: 4px 0 0 -12px; }
.dialog.pw-dialog { max-width: 420px; }
.pw-body { margin-top: 16px; }
.pw-err { margin: 6px 0 0 !important; font-size: 12px !important; color: var(--danger) !important; min-height: 16px; }

/* the intro video */
.intro { position: absolute; inset: 0; z-index: 95; background: #000; display: flex; align-items: center; justify-content: center; transition: opacity 240ms; }
.intro.out { opacity: 0; }
.intro-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.intro-skip { position: absolute; right: calc(var(--safe-right) + 28px); bottom: calc(var(--safe-bottom) + 28px); padding: 8px 16px; border-radius: 99px; background: rgba(0,0,0,0.55); color: #fff; font: 600 15px/20px var(--font); pointer-events: none; }
.intro-sound { position: absolute; right: calc(var(--safe-right) + 24px); top: calc(var(--safe-top) + 20px); width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

/* ======================= install gate ======================= */
.gate { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 24px); overflow: auto; }
.gate-card { width: 100%; max-width: 480px; background: var(--glass); border: 0.6px solid var(--separator); border-radius: 24px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px;
  -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
.gate-brand { display: flex; align-items: center; gap: 12px; }
.gate-logo { width: 56px; height: 56px; border-radius: 13px; object-fit: contain; }
.gate-name { font: 600 22px/28px var(--font); letter-spacing: -0.3px; }
.gate h1 { margin: 6px 0 0; font: 600 22px/28px var(--font); letter-spacing: -0.3px; }
.gate p { margin: 0; font: 400 15px/21px var(--font); }
.gate-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gate-steps li { display: flex; align-items: center; gap: 12px; background: var(--surface-high); border-radius: 14px; padding: 12px 14px; font: 400 14px/20px var(--font); }
.gate-step { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.gate-warn { display: flex; align-items: center; gap: 6px; color: var(--warning); font: 400 13px/18px var(--font) !important; }

/* ======================= sign-in (PlaylistFormScreen) ======================= */
.login-narrow { min-height: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--safe-top) + 14px) calc(var(--safe-right) + 20px) calc(var(--safe-bottom) + 14px) calc(var(--safe-left) + 20px); }
.login-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login-head h1 { margin: 0; }
.login-wide { min-height: 100%; display: flex; align-items: center; gap: 36px; padding: calc(var(--safe-top) + 24px) calc(var(--safe-right) + 40px) calc(var(--safe-bottom) + 24px) calc(var(--safe-left) + 40px); }
.login-welcome { flex: 1; min-width: 0; }
.login-welcome h1 { margin: 22px 0 0; }
.login-card { width: 420px; flex: none; padding: 24px; border: 0.6px solid var(--separator); }
.login-lead { margin: 4px 0 18px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-chosen { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 10px; background: var(--surface); }
.login-choice { width: 100%; height: 58px; display: flex; align-items: center; gap: 14px; padding: 0 16px; border-radius: 12px; background: var(--surface); text-align: left; }
.login-choice.hot { background: var(--accent); color: var(--on-accent); }
.login-choice.hot .ca, .login-choice.hot .c2, .login-choice.hot .c3 { color: var(--on-accent); }
.login-tip { margin: -4px 0 0; }
.plain-ib { width: 34px !important; height: 34px !important; background: transparent !important; color: var(--text-2) !important; }
.login-error { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px; background: rgba(255,69,58,0.14); color: var(--danger); }
.login-error .mi { margin-top: 1px; }
.login-error .t-subhead { color: var(--danger); }
.login-buttons { display: flex; gap: 10px; margin-top: 2px; flex-wrap: wrap; }
.login-submit { min-width: 140px; }
.compact .login-submit { flex: 1; }
.login-busy { position: absolute; inset: 0; z-index: 40; background: var(--scrim); display: flex; align-items: center; justify-content: center; }
.login-busy-box { padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* ======================= startup ======================= */
.startup { display: flex; align-items: center; justify-content: center; }
.startup-center { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.sync-wrap { display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-top) + 20px) 16px calc(var(--safe-bottom) + 20px); width: 100%; height: 100%; overflow: auto; }
.sync-wrap .glass-panel { width: 90%; max-width: 540px; }
.sync-panel { padding: 30px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.compact .sync-panel { padding: 24px 18px; }
.sync-title { margin-top: 14px; }
.sync-text { margin: 6px 0 22px; }
.sync-rows { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.sync-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface-high); text-align: left; }
.sync-rows + .sync-row { margin-top: 10px; }
.sync-state { display: flex; align-items: center; gap: 8px; }
.sync-bar { margin-top: 16px; }
.sync-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }

/* ======================= who's watching ======================= */
.pf-body { position: absolute; inset: 0; display: flex; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: none; }
.pf-body::-webkit-scrollbar { display: none; }
.pf-inner { margin: auto; width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: calc(var(--safe-top) + 14px) calc(var(--safe-right) + 20px) calc(var(--safe-bottom) + 14px) calc(var(--safe-left) + 20px); }
.pf-title { margin: 26px 0 0; font: 700 34px/40px var(--font); letter-spacing: -0.6px; }
.compact .pf-title { margin-top: 18px; font: 600 28px/34px var(--font); letter-spacing: -0.4px; }
.pf-sub { margin: 8px 0 0; max-width: 520px; }
.pf-rowwrap { position: relative; width: 100%; margin-top: 40px; }
.compact .pf-rowwrap { margin-top: 26px; }
.pf-row { display: flex; gap: 30px; padding: 16px 24px; justify-content: safe center; }
.compact .pf-row { gap: 18px; }
.pf-loading { padding: 30px; }
.pf-tile { display: flex; flex-direction: column; align-items: center; flex: none; }
.pf-picwrap { position: relative; }
.pf-pic { position: relative; display: block; overflow: hidden; transition: transform 160ms var(--ease), box-shadow 160ms; }
.pf-pic .avatar { width: 100% !important; height: 100% !important; border-radius: 0 !important; }
.pf-pic.hot { transform: scale(1.06); box-shadow: 0 0 0 3px var(--accent), 0 0 24px rgba(var(--accent-rgb),0.5); }
.pf-pic.moving { transform: scale(1.12); box-shadow: 0 0 0 3px var(--accent); }
.pf-add { background: var(--surface); color: var(--text-2); display: flex; align-items: center; justify-content: center; }
.pf-edit { position: absolute; inset: 0; background: rgba(0,0,0,0.45); color: #fff; display: flex; align-items: center; justify-content: center; }
.pf-name { margin-top: 10px; max-width: 100%; font: 600 15px/20px var(--font); }
.pf-lock { margin-top: 4px; display: inline-flex; }
.pf-move { position: absolute; top: 50%; margin-top: -15px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; z-index: 2; }
.pf-move.left { left: -14px; } .pf-move.right { right: -14px; }
.pf-hint { position: absolute; top: 0; bottom: 0; width: 120px; display: flex; align-items: center; opacity: 0; pointer-events: none; transition: opacity 220ms; color: #fff;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent); mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent); }
.pf-hint.left { left: 0; justify-content: flex-start; padding-left: 10px; background: linear-gradient(90deg, rgba(0,0,0,0.8), transparent); }
.pf-hint.right { right: 0; justify-content: flex-end; padding-right: 10px; background: linear-gradient(270deg, rgba(0,0,0,0.8), transparent); }
.pf-hint .mi { width: 44px; height: 44px; padding: 7px; border-radius: 50%; background: rgba(0,0,0,0.55); box-sizing: border-box; }
.pf-hint.show { opacity: 1; pointer-events: auto; }
.pf-hint.left.show .mi { animation: nudge-l 1.3s ease-in-out infinite; } .pf-hint.right.show .mi { animation: nudge-r 1.3s ease-in-out infinite; }
@keyframes nudge-l { 50% { transform: translateX(-8px); } } @keyframes nudge-r { 50% { transform: translateX(8px); } }
.pf-error { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.pf-buttons { display: flex; gap: 12px; margin-top: 40px; flex-wrap: wrap; justify-content: center; }
.compact .pf-buttons { margin-top: 26px; }
/* a phone on its side (about 400 tall): Android would scroll here; tighter spacing keeps it all on screen */
.lh-short .pf-title { margin-top: 12px; font: 600 28px/34px var(--font); letter-spacing: -0.4px; }
.lh-short .pf-rowwrap { margin-top: 14px; } .lh-short .pf-buttons { margin-top: 14px; }
.lh-short .pf-inner { padding-top: calc(var(--safe-top) + 8px); padding-bottom: calc(var(--safe-bottom) + 8px); }
.pf-busy { position: absolute; inset: 0; background: rgba(20,20,22,0.6); display: flex; align-items: center; justify-content: center; z-index: 5; }
.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; flex: none; }
.avatar::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,0.22), transparent 50%); pointer-events: none; }

/* ======================= profile editor ======================= */
.pe-inner { min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: calc(var(--safe-top) + 14px) calc(var(--safe-right) + 20px) calc(var(--safe-bottom) + 24px) calc(var(--safe-left) + 20px); }
.pe-title { margin: 8px 0 18px; }
.pe-content { width: 100%; max-width: 560px; display: flex; flex-direction: column; }
.pe-content.wide { max-width: 880px; flex-direction: row; align-items: flex-start; gap: 40px; margin: auto 0; }
.pe-top { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.pe-top .pe-name { flex: 1; min-width: 0; }
.pe-left { width: 196px; flex: none; padding-top: 6px; }
.pe-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pe-pname { max-width: 100%; text-align: center; }
.pe-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pe-right .pe-name { margin-bottom: 16px; }
.pe-label { font: 700 11px/14px var(--font); letter-spacing: 0.9px; color: var(--text-2); margin: 0 0 8px 2px; }
.pe-pictures { display: grid; grid-template-columns: repeat(var(--per-row, 5), max-content); gap: 10px; margin-bottom: 18px; }
.pe-pic { position: relative; display: block; transition: transform 140ms var(--ease); }
.pe-pic.sel { box-shadow: 0 0 0 2.5px #fff; }
.pe-pic.hot { transform: scale(1.1); }
.pe-colours { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.pe-swatch { border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; transition: transform 140ms var(--ease); }
.pe-swatch.sel { box-shadow: inset 0 0 0 2.5px #fff; }
.pe-swatch.hot { transform: scale(1.15); }
.pe-pin { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pe-error { margin: 10px 0 0; color: var(--warning); }
.pe-buttons { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; justify-content: center; }

/* ======================= a screen with a top bar ======================= */
/* <div class="screen std"> topBar(...) <div class="screen-body scroll pad">…</div> </div> */
.screen.std { display: flex; flex-direction: column; }
.screen-body { flex: 1; min-height: 0; padding-top: 6px; padding-bottom: calc(var(--safe-bottom) + 28px); }
.screen-body.no-pad-top { padding-top: 0; }
.page-card { background: var(--surface); border-radius: 16px; border: 0.6px solid var(--separator); padding: 18px; }
.page-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }

/* ======================= "Turn your phone sideways" (upright, outside the turned #app) ======================= */
#rotate-notice { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: max(env(safe-area-inset-top, 0px), 32px) 24px max(env(safe-area-inset-bottom, 0px), 32px); text-align: center; color: var(--text); }
#rotate-notice.show { display: flex; }
.rn-phone { width: 62px; height: 108px; border-radius: 14px; border: 3px solid var(--accent); position: relative; animation: rn-turn 2.6s ease-in-out infinite; box-shadow: 0 0 28px rgba(var(--accent-rgb),0.35); margin-bottom: 12px; }
.rn-phone::before { content: ""; position: absolute; left: 50%; bottom: 5px; width: 20px; height: 3px; border-radius: 2px; background: var(--accent); transform: translateX(-50%); }
.rn-phone::after { content: ""; position: absolute; inset: 10px 7px 14px; border-radius: 6px; background: linear-gradient(135deg, rgba(var(--accent-rgb),0.4), rgba(var(--accent-rgb),0.08)); }
@keyframes rn-turn { 0%, 18% { transform: rotate(0deg); } 48%, 72% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }
.rn-title { font: 700 22px/28px var(--font); letter-spacing: -0.3px; }
.rn-sub { font: 400 14px/20px var(--font); color: var(--text-2); max-width: 300px; }
.rn-hint { font: 400 12px/17px var(--font); color: var(--text-3); max-width: 300px; }
.rn-playing { display: none; align-items: center; gap: 8px; font: 600 12.5px var(--font); color: var(--success); }
.rn-playing i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); animation: vpn-pulse 1.2s ease-in-out infinite alternate; }
#rotate-notice.playing .rn-playing { display: inline-flex; }
.rn-link { margin-top: 10px; padding: 10px 16px; border-radius: 99px; border: 0.6px solid var(--separator); background: var(--surface); font: 600 13px var(--font); color: var(--accent); }
.rn-link.hot { background: var(--accent-soft); }
.gate-glow { position: absolute; left: 0; right: 0; top: 0; height: 220px; background: linear-gradient(rgba(var(--accent-rgb),0.09), transparent); pointer-events: none; }
.gate-card { position: relative; }
.gate-btn { align-self: flex-start; text-decoration: none; }
.gate-foot { margin: 0; font: 400 12px/17px var(--font) !important; color: var(--text-3); }
