:root {
  --bg: #0d0f13;
  --panel: #15181e;
  --panel-2: #1b1f27;
  --line: #262b35;
  --text: #e9ecf1;
  --muted: #8b93a1;
  --accent: #ff5a36;
  --accent-ink: #fff;
  --ok: #4fd18b;
  --err: #ff6b6b;
  --radius: 14px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100vh; background:
  radial-gradient(1200px 500px at 80% -10%, rgba(255, 90, 54, 0.12), transparent 60%),
  radial-gradient(900px 400px at -10% 10%, rgba(80, 120, 255, 0.08), transparent 60%),
  var(--bg); }

.top { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.brand strong { color: var(--text); }
.brand .sep { opacity: .5; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.tabs { display: inline-flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.tabs a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 8px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--text); color: #111; }

.search-opts { margin-top: 12px; }

/* ---------- Steam game search suggestions ---------- */
.ac { position: relative; flex: 1; min-width: 0; display: flex; }
.ac input { width: 100%; }
.suggestions { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: 6px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.45);
  max-height: 420px; overflow-y: auto; }
.suggestions li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.suggestions li.active, .suggestions li:hover { background: rgba(255,255,255,.07); }
.suggestions img { width: 92px; aspect-ratio: 231 / 87; object-fit: cover; border-radius: 4px; background: #000; display: block; }
.sugg-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg-price { font: 12px var(--mono); color: var(--muted); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.sugg-price b { background: #4c6b22; color: #beee11; padding: 1px 5px; border-radius: 3px; font-weight: 700; }
a.brand { text-decoration: none; }
a.brand:hover strong, a.brand:hover span { color: var(--text); }

/* ---------- Home screen ---------- */
.home { min-height: calc(100vh - 160px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 0; }
.home-greet { margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.home-title { margin: 0 0 48px; font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.02em; }
.apps { display: grid; grid-template-columns: repeat(4, 120px); gap: 34px 40px; justify-content: center; }
.app { display: flex; flex-direction: column; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.app-icon { width: 96px; height: 96px; border-radius: 26px; display: grid; place-items: center; position: relative; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .18s ease, box-shadow .18s ease; }
.app-icon::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 45%); pointer-events: none; }
.app-icon svg { width: 56px; height: 56px; position: relative; z-index: 1; }
.app:hover .app-icon, .app:focus-visible .app-icon { transform: translateY(-4px) scale(1.04); box-shadow: 0 16px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.25); }
.app:active .app-icon { transform: scale(.96); }
.app:focus-visible { outline: none; }
.app:focus-visible .app-name { text-decoration: underline; }
.app-name { font-size: 14px; font-weight: 600; }
.i-steam { background: linear-gradient(145deg, #5b8cff, #2a5bd7 55%, #1b3a8f); }
.i-clip { background: linear-gradient(145deg, #ffb347, #ff6a3d 55%, #e8366b); }
.i-audio { background: linear-gradient(145deg, #4ade80, #14b8a6 55%, #0e7490); }
.i-comments { background: linear-gradient(145deg, #c084fc, #8b5cf6 55%, #5b21b6); }

/* ---------- Comment cards ---------- */
.hero-tight { padding-bottom: 18px; }
.cm-layout { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.cm-form { gap: 16px; }
.cm-row { display: flex; gap: 12px; flex-wrap: wrap; }
.cm-row .field { flex: 1; min-width: 120px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field em { font-style: normal; opacity: .75; }
.field input[type=text], .field textarea { width: 100%; padding: 11px 12px; font: 14px var(--font); color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; outline: none; resize: vertical; }
.field input[type=text]:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 54, .15); }
.cm-avatar-row { display: flex; align-items: center; gap: 10px; }
.cm-avatar-row canvas { width: 40px; height: 40px; border-radius: 50%; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cm-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.cm-preview-card { position: sticky; top: 16px; }
.cm-preview { min-height: 260px; padding: 28px; }
.cm-preview canvas { max-width: 100%; height: auto; }
#cmPlatform button, #cmTheme button { padding: 8px 12px; }

/* ---------- Audio Finder ---------- */
.seg-lg { padding: 4px; border-radius: 12px; }
.seg-lg button { padding: 0 16px; font-size: 14px; border-radius: 9px; }
.note { margin: 14px 0 0; max-width: 860px; font-size: 13px; line-height: 1.5; color: #e9c46a; }
.audio-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.track { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.track:not(:has(.track-art)) { grid-template-columns: auto minmax(0, 1fr) auto; }
.track.playing { border-color: #3a4150; background: var(--panel-2); }
.play { width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--text); color: #111; flex: none; }
.play svg { width: 20px; height: 20px; }
.track.playing .play { background: var(--accent); color: #fff; }
.track-art { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #000; }
.track-main { min-width: 0; }
.track-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta { font: 12px var(--mono); color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-bar { position: relative; height: 26px; margin-top: 8px; border-radius: 6px; background: rgba(255,255,255,.05); overflow: hidden; cursor: pointer; }
.track-bar .wave { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; opacity: .7; filter: grayscale(1); mix-blend-mode: screen; }
.track-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255, 90, 54, .35); transition: width .2s linear; pointer-events: none; }
.track-actions { flex-wrap: nowrap; }
.audio-kind { margin-bottom: 14px; }

/* ---------- Playlists ---------- */
.pl-pane { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 18px; align-items: start; }
.pl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pl-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px; border-radius: 10px; padding: 4px; }
.pl-item.on { background: var(--panel-2); outline: 1px solid var(--line); }
.pl-open { display: flex; align-items: center; gap: 10px; min-width: 0; background: none; border: 0; color: var(--text); cursor: pointer; text-align: left; padding: 4px; border-radius: 8px; font: 600 14px var(--font); }
.pl-open:hover { background: rgba(255,255,255,.05); }
.pl-open img, .pl-thumb-ph { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; background: #1db95433; display: grid; place-items: center; color: #1db954; font-size: 18px; }
.pl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.icon-btn:hover { color: var(--text); border-color: var(--line); background: var(--panel-2); }
.pl-player header { flex-wrap: wrap; }
.pl-player h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-embed { min-height: 200px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); }
.pl-embed iframe { width: 100%; height: 560px; border: 0; display: block; }
.pl-tip { text-align: left; max-width: none; }
.pl-embed > div, .pl-embed iframe { width: 100%; }
.played { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.played > header { display: flex; justify-content: space-between; align-items: center; }
.played h3 { margin: 0; font-size: 15px; }
.played-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 520px; overflow-y: auto; }
.played-item { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px; border-radius: 10px; }
.played-item.now { background: var(--panel-2); outline: 1px solid var(--line); }
.played-item img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
.played-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.played-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.played-artist { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -2px; }
.played-now { font: 11px var(--mono); color: #1db954; text-transform: uppercase; letter-spacing: .05em; }
.played-links { display: flex; gap: 6px; }
.chip { font: 600 12px var(--font); text-decoration: none; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); background: var(--panel-2); }
.chip:hover { border-color: #3a4150; }
.chip-spotify::before { content: "● "; color: #1db954; }
.chip-yt::before { content: "▶ "; color: #ff3b3b; font-size: 10px; }
.chip[aria-disabled="true"] { opacity: .4; pointer-events: none; }

.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.clip { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.clip-img { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; display: grid; place-items: center; padding: 10px; border: 1px solid var(--line); }
.clip-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.clip-badge { position: absolute; top: 8px; left: 8px; font: 10px var(--mono); text-transform: uppercase; letter-spacing: .05em;
  background: rgba(13, 15, 19, .85); color: var(--ok); padding: 3px 7px; border-radius: 999px; }
.clip-meta { min-width: 0; }
.clip-tags { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-info { font: 12px var(--mono); color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip .actions .btn { flex: 1; justify-content: center; }
.clip-foot { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 22px; }
.credit { font-size: 12px; color: var(--muted); text-align: center; max-width: 640px; line-height: 1.5; margin: 0; }
.credit a { color: var(--text); }

main { max-width: 1180px; margin: 0 auto; padding: 0 24px 80px; }

.hero { padding: 56px 0 28px; }
.hero h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.02em; margin: 0 0 10px; }
.hero p { color: var(--muted); margin: 0 0 26px; max-width: 640px; line-height: 1.5; }

.lookup { display: flex; gap: 10px; max-width: 860px; }
.lookup input { flex: 1; min-width: 0; padding: 15px 16px; font: 15px var(--mono); color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; outline: none; }
.lookup input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 90, 54, .15); }
.lookup button { padding: 0 22px; font-weight: 700; font-size: 15px; border: 0; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.lookup button:disabled { opacity: .6; cursor: progress; }

.status { min-height: 22px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.status.err { color: var(--err); }

.game-title { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 8px 0 18px; }
.game-title h2 { margin: 0; font-size: 26px; }
.game-title a { color: var(--muted); font-size: 14px; text-decoration: none; }
.game-title a:hover { color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.card > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card h3 { margin: 0; font-size: 15px; }
.tag { font: 11px var(--mono); color: var(--muted); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; }

.preview { border-radius: 10px; overflow: hidden; display: grid; place-items: center; padding: 18px; min-height: 220px; border: 1px solid var(--line); }
.preview img, .preview canvas { max-width: 100%; max-height: 460px; height: auto; display: block; }
.preview img[hidden] { display: none; }
.preview.dark { background: #0a0c10; }
.checker { background-color: #1a1d23; background-image:
  linear-gradient(45deg, #23272f 25%, transparent 25%), linear-gradient(-45deg, #23272f 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #23272f 75%), linear-gradient(-45deg, transparent 75%, #23272f 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.preview .empty { color: var(--muted); font-size: 14px; }

.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.preview.short { min-height: 140px; }
.lookup select { padding: 0 12px; font: 14px var(--font); color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; outline: none; cursor: pointer; }
.lookup select:focus { border-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { appearance: none; border: 0; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px; font: 600 14px var(--font); background: var(--text); color: #111; }
.btn:hover { filter: brightness(.92); }
.btn.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn[aria-disabled="true"], .btn:disabled { opacity: .4; pointer-events: none; }

.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); font: 600 13px var(--font); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--text); color: #111; }

.trailers { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.trailers li { display: grid; grid-template-columns: 160px 1fr auto; align-items: center; gap: 14px; padding: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.trailers img { width: 160px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: #000; }
.trailers .t-name { font-weight: 600; }
.trailers .t-meta { font-size: 12px; color: var(--muted); margin-top: 4px; font-family: var(--mono); }
.trailers .t-meta.ok { color: var(--ok); }
.trailers .t-meta.err { color: var(--err); }
.badge { display: inline-block; font: 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-left: 8px; }
.empty-note { color: var(--muted); font-size: 14px; margin: 0; }

.extras { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.extra { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); }
.extra img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #000; }
.extra span { display: flex; justify-content: space-between; padding: 9px 12px; font-size: 13px; }
.extra span em { font-style: normal; color: var(--muted); }
.extra:hover { border-color: #3a4150; }

@media (max-width: 820px) {
  .grid, .pair { grid-template-columns: 1fr; }
  .lookup { flex-direction: column; }
  .lookup button, .lookup select { padding: 14px; }
  .trailers li { grid-template-columns: 110px 1fr; }
  .trailers img { width: 110px; }
  .trailers li .btn { grid-column: 1 / -1; justify-content: center; }
  .top { padding: 12px 16px; gap: 10px; }
  .brand > span:not(.dot) { display: none; }
  .tabs a { padding: 7px 10px; }
  .suggestions li { grid-template-columns: 72px minmax(0, 1fr); }
  .suggestions img { width: 72px; grid-row: span 2; }
  .suggestions li { row-gap: 2px; }
  .sugg-price { grid-column: 2; }
  .apps { grid-template-columns: repeat(4, 72px); gap: 26px 14px; }
  .cm-layout { grid-template-columns: 1fr; }
  .pl-pane { grid-template-columns: 1fr; }
  .pl-player { order: -1; }
  .pl-embed iframe { height: 460px; }
  .audio-kind { display: flex; }
  .cm-preview-card { position: static; order: -1; }
  .cm-preview { padding: 12px; min-height: 160px; }
  .app-icon { width: 66px; height: 66px; border-radius: 18px; }
  .app-name { font-size: 12px; }
  .app-icon svg { width: 38px; height: 38px; }
  .home { min-height: calc(100vh - 140px); }
  .seg-lg button { padding: 12px 16px; flex: 1; }
  .seg-lg { display: flex; }
  .track, .track:not(:has(.track-art)) { grid-template-columns: auto minmax(0, 1fr); }
  .track .track-art { display: none; }
  .track-actions { grid-column: 1 / -1; }
  .track-actions .btn { flex: 1; justify-content: center; }
  main { padding: 0 16px 60px; }
}
