:root {
  --bg: #0d0f14;
  --panel: #151922;
  --panel-2: #1c2230;
  --panel-3: #242c3d;
  --line: #262d3d;
  --line-soft: rgba(255, 255, 255, .07);
  --text: #e8ebf2;
  --muted: #8b93a7;
  --accent: #f5a524;
  --accent-hi: #ffc35a;
  --accent-ink: #1a1203;
  --accent-glow: rgba(245, 165, 36, .26);
  --danger: #ff6b6b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .3);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 40px rgba(0, 0, 0, .5);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #2e3649 transparent; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  /* a faint warm glow behind the top of the page */
  background: radial-gradient(1100px 420px at 50% -180px, rgba(245, 165, 36, .075), transparent 70%) no-repeat var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, select, input { font: inherit; color: inherit; }
svg { display: block; }
::selection { background: rgba(245, 165, 36, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2e3649; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3b4560; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------- Library ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 22px;
  min-height: 60px;
  padding: max(10px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  background: rgba(13, 15, 20, .76);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.brand {
  display: flex; align-items: center; gap: 11px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.01em;
  flex: none; border-radius: var(--radius-sm);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(150deg, var(--accent-hi), var(--accent) 60%);
  box-shadow: 0 2px 12px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .35);
  display: grid; place-items: center;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.brand:hover .brand-mark { transform: scale(1.06); box-shadow: 0 4px 18px rgba(245, 165, 36, .4), inset 0 1px 0 rgba(255, 255, 255, .35); }
.brand-mark svg { width: 16px; height: 16px; fill: var(--accent-ink); margin-left: 1px; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .045); }
.tabs a {
  padding: 6px 15px; border-radius: 999px; color: var(--muted); text-decoration: none;
  font-size: 14px; font-weight: 600; transition: background .15s, color .15s;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--panel-3); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; color: var(--muted); font-size: 14px; margin: -8px 0 12px -8px; }
.crumbs:empty, .crumbs:has(a:only-child) { display: none; }
.crumbs a {
  color: var(--muted); text-decoration: none; padding: 4px 8px; border-radius: 7px; white-space: nowrap;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; transition: background .15s, color .15s;
}
.crumbs a:hover { background: var(--panel-2); color: var(--text); }
.crumbs a:last-child { color: var(--text); font-weight: 500; }
.crumbs .sep { opacity: .45; }

.library-main { max-width: 1180px; margin: 0 auto; padding: 34px 20px 80px; }
.library-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.library-title { flex: 1; min-width: 0; }
.library-head h1 {
  margin: 0; font-size: 30px; font-weight: 750; line-height: 1.15; letter-spacing: -.022em;
  overflow-wrap: anywhere; text-wrap: balance;
}
.lib-count { margin: 6px 0 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.lib-count:empty { display: none; }
#filter {
  width: min(280px, 100%); padding: 10px 12px 10px 38px; border-radius: 999px;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93a7' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E") no-repeat 13px 50% / 16px;
  border: 1px solid var(--line); outline: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
#filter::placeholder { color: var(--muted); }
#filter:hover { border-color: #343d52; }
#filter:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background-color: var(--panel-2); }
.lib-status { color: var(--muted); padding: 56px 0; text-align: center; }
.lib-status.err { color: var(--danger); }

.drives { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.drive {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow);
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.drive:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.drive .ic { width: 42px; height: 42px; border-radius: 11px; background: rgba(245, 165, 36, .12); display: grid; place-items: center; flex: none; }
.drive .ic svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; }
.drive b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive small { color: var(--muted); text-transform: capitalize; }
.drive > div { min-width: 0; }

.entries { list-style: none; margin: 0; padding: 0; border-radius: var(--radius); overflow: hidden; }
.entries:not(:empty) { border: 1px solid var(--line); box-shadow: var(--shadow); }
.entries li + li { border-top: 1px solid var(--line); }
.entry {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  background: var(--panel); color: var(--text); text-decoration: none; position: relative;
  transition: background .15s;
}
.entry:hover { background: var(--panel-2); }
.entry:focus-visible { outline-offset: -2px; }
.entry .ic { width: 22px; height: 22px; flex: none; fill: none; stroke-width: 1.8; }
.entry.dir .ic { stroke: var(--accent); opacity: .9; }
.entry.file .ic { stroke: var(--accent); }
.entry .name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.entry .meta { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry .progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); opacity: .8; }
.entry.dir::after { /* chevron */
  content: ""; width: 7px; height: 7px; margin-right: 5px; flex: none;
  border-top: 2px solid var(--muted); border-right: 2px solid var(--muted);
  transform: rotate(45deg); opacity: .55; transition: transform .18s var(--ease), opacity .18s, border-color .18s;
}
.entry.dir:hover::after { transform: translateX(3px) rotate(45deg); opacity: 1; border-color: var(--accent); }

/* Video cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px 18px; }
.entries:not(:empty) + .cards:not(:empty) { margin-top: 28px; }
.card { display: block; min-width: 0; color: inherit; text-decoration: none; border-radius: var(--radius); }
.card:focus-visible { outline: none; }
.cards.enter .card { animation: rise .42s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.card .thumb {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius); background: var(--panel);
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.card:hover .thumb { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(245, 165, 36, .65), var(--shadow-lift); }
.card:focus-visible .thumb { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--accent), var(--shadow-lift); }
.card:active .thumb { transform: translateY(-1px) scale(.992); }
/* shimmer while the still is being made or downloaded */
.card .thumb::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, .055) 50%, transparent 75%) 0 0 / 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
.card .thumb:has(img.ready)::before, .card .thumb:not(:has(img))::before { display: none; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -100% 0; } }
/* darkens the picture a little under the play button and progress bar */
.card .thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 10, 14, .18), rgba(8, 10, 14, .1) 45%, rgba(8, 10, 14, .6));
  opacity: 0; transition: opacity .22s var(--ease);
}
.card:hover .thumb::after, .card:focus-visible .thumb::after { opacity: 1; }
.card .ph svg { width: 34px; height: 34px; fill: none; stroke: #323b50; stroke-width: 1.6; }
.card img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .35s ease, transform .5s var(--ease);
}
.card img.ready { opacity: 1; }
.card:hover img, .card:focus-visible img { transform: scale(1.045); }
.card .play {
  position: absolute; z-index: 1; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent-hi), var(--accent) 65%);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .35);
  opacity: 0; transform: scale(.82); transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.card .play svg { width: 22px; height: 22px; fill: var(--accent-ink); margin-left: 3px; }
.card:hover .play, .card:focus-visible .play { opacity: 1; transform: none; }
.card .progress-track {
  position: absolute; z-index: 1; left: 10px; right: 10px; bottom: 9px; height: 4px; overflow: hidden;
  border-radius: 4px; background: rgba(255, 255, 255, .3); box-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}
.card .progress { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.card-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  margin-top: 11px; font-weight: 600; font-size: 14.5px; line-height: 1.32; letter-spacing: -.005em;
  overflow-wrap: anywhere; transition: color .15s;
}
.card:hover .card-title { color: #fff; }
.card-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* Game cards: the cover is artwork, so show all of it */
.card.game .thumb { background: #0b0d12; }
.card.game img { object-fit: cover; }
.card.game .ph svg { width: 40px; height: 40px; }

/* ---------------- Game page ---------------- */
.game-page {
  position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background: #000; overscroll-behavior: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.game-bar {
  flex: none; display: flex; align-items: center; gap: 8px; min-height: 48px;
  padding: max(3px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 3px max(8px, env(safe-area-inset-left));
  background: var(--bg); border-bottom: 1px solid var(--line-soft);
}
.game-bar .title { text-shadow: none; }
.game-bar .icon-btn { color: var(--text); text-decoration: none; }
.game-bar .icon-btn svg { filter: none; }
.game-page #g-mute .i-mute, .game-page.muted #g-mute .i-vol { display: none; }
.game-page.muted #g-mute .i-mute { display: block; }
.game-stage { position: relative; flex: 1; min-height: 0; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; outline: none; }
.game-msg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: min(520px, 90vw);
  color: var(--muted); text-align: center;
}
.game-msg.err {
  color: var(--text); background: var(--panel); border: 1px solid rgba(255, 107, 107, .55);
  border-radius: 14px; padding: 20px 24px; box-shadow: var(--shadow-lift);
}

/* ---------------- Player ---------------- */
.player { position: fixed; inset: 0; background: #000; }
.stage { position: absolute; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
#screen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage.idle { cursor: none; }
.stage.idle .chrome { opacity: 0; pointer-events: none; }

.chrome { position: absolute; left: 0; right: 0; transition: opacity .3s ease; z-index: 3; }
.chrome.top {
  top: 0; display: flex; align-items: center; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 48px max(12px, env(safe-area-inset-left));
  background: linear-gradient(rgba(0, 0, 0, .72), rgba(0, 0, 0, .35) 45%, transparent);
}
.title {
  font-weight: 600; font-size: 16px; letter-spacing: -.005em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}
.chrome.bottom {
  bottom: 0; padding: 56px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(transparent, rgba(0, 0, 0, .4) 40%, rgba(0, 0, 0, .85));
}

.icon-btn {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  transition: background .15s, transform .12s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, .14); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.icon-btn text { fill: currentColor; font-family: system-ui, sans-serif; }

#play .i-pause, .playing #play .i-play { display: none; }
.playing #play .i-pause { display: block; }
#mute .i-mute, .muted #mute .i-vol { display: none; }
.muted #mute .i-mute { display: block; }

.controls { display: flex; align-items: center; gap: 4px; }
.spacer { flex: 1; }
.time { font-size: 13px; font-variant-numeric: tabular-nums; color: #e6e9f1; margin-left: 10px; white-space: nowrap; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.volume { display: flex; align-items: center; }
#vol { width: 92px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.pill {
  -webkit-appearance: none; appearance: none;
  background: rgba(255, 255, 255, .1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='.8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 13px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px;
  padding: 6px 28px 6px 12px; margin-left: 6px; font-size: 13px; font-weight: 500; cursor: pointer; max-width: 190px;
  text-overflow: ellipsis; transition: background-color .15s, border-color .15s;
}
.pill:hover { background-color: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .3); }
.pill option { background: var(--panel); color: var(--text); }

.seek { position: relative; height: 24px; display: flex; align-items: center; cursor: pointer; touch-action: none; margin-bottom: 4px; }
.seek-track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .24); transition: height .14s var(--ease); }
.seek:hover .seek-track, .seek.dragging .seek-track { height: 6px; }
.seek-buffer, .seek-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: inherit; }
.seek-buffer { background: rgba(255, 255, 255, .34); }
.seek-fill { background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }
.seek-thumb {
  position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(245, 165, 36, .35), 0 2px 6px rgba(0, 0, 0, .5);
  transform: scale(0); transition: transform .14s var(--ease);
}
.seek:hover .seek-thumb, .seek.dragging .seek-thumb { transform: scale(1); }
.seek-tip {
  position: absolute; bottom: 28px; transform: translateX(-50%); padding: 4px 8px; border-radius: 7px;
  background: rgba(13, 15, 20, .92); border: 1px solid var(--line-soft); box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none;
}

.bigplay {
  position: absolute; left: 50%; top: 50%; width: 86px; height: 86px; margin: -43px 0 0 -43px; z-index: 2;
  border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent-hi), var(--accent) 65%);
  box-shadow: 0 0 0 10px rgba(245, 165, 36, .16), 0 12px 44px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  animation: pop .22s var(--ease);
}
.bigplay:hover { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(245, 165, 36, .2), 0 14px 48px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .4); }
.bigplay:active { transform: scale(.97); }
.bigplay svg { width: 38px; height: 38px; fill: var(--accent-ink); margin-left: 5px; }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }

.spinner { position: absolute; left: 50%; top: 50%; margin: -23px 0 0 -23px; z-index: 2; pointer-events: none; }
.spinner div {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .18); border-top-color: var(--accent);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .5));
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: absolute; left: 50%; top: 74px; transform: translateX(-50%); z-index: 4;
  background: rgba(21, 25, 34, .86); border: 1px solid var(--line-soft); border-radius: 999px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--shadow);
  padding: 7px 8px 7px 16px; display: flex; align-items: center; gap: 12px; font-size: 14px; white-space: nowrap;
  animation: toast-in .28s var(--ease);
}
.toast:not(:has(button)) { padding-right: 16px; }
.toast.wrap { white-space: normal; text-align: center; width: max-content; max-width: min(92vw, 440px); border-radius: 16px; padding: 10px 16px; line-height: 1.4; }
.toast button {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px;
  padding: 5px 12px; font-weight: 650; cursor: pointer; transition: background .15s;
}
.toast button:hover { background: var(--accent-hi); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } }
.error {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; max-width: min(520px, 90vw);
  background: var(--panel); border: 1px solid rgba(255, 107, 107, .55); color: var(--text); border-radius: 14px;
  box-shadow: var(--shadow-lift); padding: 20px 24px; text-align: center;
}

/* ---------------- Login ---------------- */
.login-page {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(700px 420px at 50% 38%, rgba(245, 165, 36, .09), transparent 70%) no-repeat var(--bg);
}
.login-card {
  width: min(372px, 100%); display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel) 55%);
  border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px 28px;
  box-shadow: var(--shadow-lift);
  animation: rise .45s var(--ease) both;
}
.login-card .brand { font-size: 21px; }
.login-card .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
.login-card .brand-mark svg { width: 19px; height: 19px; }
.login-sub { margin: 2px 0 14px; color: var(--muted); font-size: 14px; }
.login-card label { color: var(--muted); font-size: 13px; font-weight: 500; }
.login-card input {
  padding: 12px 14px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:hover { border-color: #343d52; }
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.login-card button {
  margin-top: 8px; padding: 12px; border: 0; border-radius: 11px; cursor: pointer;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--accent-ink); font-weight: 700;
  box-shadow: 0 6px 18px rgba(245, 165, 36, .22), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: filter .15s, transform .1s var(--ease), box-shadow .15s;
}
.login-card button:hover { filter: brightness(1.06); box-shadow: 0 8px 24px rgba(245, 165, 36, .3), inset 0 1px 0 rgba(255, 255, 255, .35); }
.login-card button:active { transform: translateY(1px); }
.login-err {
  margin: 2px 0 0; padding: 9px 12px; border-radius: 10px; font-size: 14px;
  color: #ffb3b3; background: rgba(255, 107, 107, .1); border: 1px solid rgba(255, 107, 107, .3);
}

.logout { margin-left: auto; flex: none; }
.logout button {
  background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
  color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.logout button:hover { color: var(--text); border-color: #3b4560; background: var(--panel-2); }

@media (max-width: 600px) {
  .topbar { gap: 12px; min-height: 54px; padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .brand { font-size: 0; gap: 0; }
  .tabs a { padding: 6px 12px; }
  .library-main { padding: 22px 14px 64px; }
  .library-head { margin-bottom: 18px; }
  .library-head h1 { font-size: 24px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .card-title { font-size: 13.5px; }
  .card .play { width: 42px; height: 42px; }
  #vol, .time.hide-sm { display: none; }
  #rew, #fwd { display: none; }
  .pill { max-width: 104px; margin-left: 4px; }
  .entry .meta { display: none; }
}
@media (hover: none) {
  /* touch screens have no hover: don't leave cards looking "stuck" after a tap */
  .card:hover .thumb { transform: none; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
  .card:hover .thumb::after, .card:hover .play { opacity: 0; }
  .card:hover img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .spinner div { animation-duration: .75s !important; animation-iteration-count: infinite !important; }
}
