/* A console-style trophy screen: deep blue backdrop with a soft spotlight,
   light type, rows separated by hairlines instead of boxed cards. */
:root {
  color-scheme: dark;
  --ink: #f1f3fb; --sub: #a4abc6; --line: rgba(255,255,255,.11); --panel: rgba(255,255,255,.045); --panel-strong: rgba(255,255,255,.09);
  --accent: #9dbcff; --danger: #ff8d8d; --ok: #6fe0a6; --gold: #f2c14b;
  --steam: #3f6a8c; --ra: #b64c0a; --psn: #1f63d6; --xbox: #169216;
  --theme: 74,70,214;
  --bronze: #b0703c; --silver: #8d96a3; --platinum: #5aa7d6;
}
* { box-sizing: border-box; }
html { background: #0a0b18; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 300 15px/1.45 "Segoe UI", "Helvetica Neue", Roboto, system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1100px 620px at 16% -12%, rgba(var(--theme),.62), rgba(var(--theme),0) 62%),
    linear-gradient(180deg, rgba(var(--theme),.2) 0%, rgba(var(--theme),.06) 55%, rgba(var(--theme),0) 100%) fixed;
}
body.wave { background: none; }
#wave { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; border: 0; padding: 0; margin: 0; }
.swatches label { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.swatches input { position: absolute; opacity: 0; }
.swatches i { width: 24px; height: 24px; border-radius: 50%; display: block; border: 1px solid rgba(255,255,255,.3); }
.swatches label:has(input:checked) { border-color: var(--ink); background: var(--panel-strong); }
.swatches label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer;
}
a { color: var(--accent); text-decoration: none; }
b, strong { font-weight: 600; }

header { display: flex; align-items: center; gap: 14px; padding: 12px 20px; position: sticky; top: 0; z-index: 2; flex-wrap: wrap;
  background: rgba(13,14,34,.72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
header .brand { font-weight: 600; font-size: 18px; color: var(--ink); letter-spacing: .2px; }
header .brand span { color: var(--accent); }

main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 130px; }
h1 { font-size: 30px; font-weight: 300; margin: 6px 0 16px; letter-spacing: .2px; }
h2 { font-size: 13px; font-weight: 600; margin: 28px 0 10px; color: var(--sub); text-transform: uppercase; letter-spacing: 1.4px; }
.muted { color: var(--sub); font-size: 13px; }
code { background: var(--panel-strong); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile .n { font-size: 30px; font-weight: 300; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--sub); font-size: 13px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 20px; }
.hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* Generic list rows */
.row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); color: inherit; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 400; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .d { color: var(--sub); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .side { color: var(--sub); font-size: 13px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row.locked .t { color: var(--sub); }
.row.locked img.icon { filter: grayscale(1); opacity: .5; }
a.row:hover, a.trow:hover { background: var(--panel); }
img.icon { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: rgba(255,255,255,.07); flex: none; }
img.big { width: 104px; height: 104px; border-radius: 10px; }

/* The trophy screen: summary strip, then one row per game */
.summary { display: flex; align-items: center; gap: 14px 40px; flex-wrap: wrap; margin: 8px 0 26px; }
.summary h1 { margin: 0; font-size: 40px; flex: 1 1 220px; }
.summary .lv { display: flex; align-items: center; gap: 10px; font-size: 42px; font-weight: 300; font-variant-numeric: tabular-nums; }
.summary .lv img { width: 58px; height: 58px; }
.summary .stat { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--sub); font-size: 15px; }
.summary .stat b { color: var(--ink); font-weight: 300; font-size: 20px; font-variant-numeric: tabular-nums; }
.summary .stat .bar { width: 96px; height: 3px; margin: 2px 0 0; }
.summary .cups { display: flex; gap: 26px; flex-wrap: wrap; }
.summary .cup { display: flex; align-items: flex-end; gap: 8px; font-size: 22px; font-variant-numeric: tabular-nums; }
.summary .cup img { width: 56px; height: 56px; object-fit: contain; }

.trophylist { border-top: 1px solid var(--line); }
.trow { display: grid; grid-template-columns: 188px minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 14px 10px; border-bottom: 1px solid var(--line); color: inherit; border-radius: 6px; }
/* Game art, always in the 460 x 215 capsule shape */
.art { position: relative; display: block; width: 188px; aspect-ratio: 460 / 215; border-radius: 4px; overflow: hidden; background: rgba(255,255,255,.07); flex: none; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.art .bg { object-fit: cover; filter: blur(14px) saturate(1.2); transform: scale(1.35); opacity: .6; }
.art .fg { object-fit: contain; }
.art.large { width: 300px; border-radius: 6px; }
.art.fill { width: 100%; }
.trow .name { font-size: 22px; font-weight: 300; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 5px; font-size: 11px; font-weight: 700; letter-spacing: .6px; background: #e9ebf5; color: #10122b; }
.trow .right { display: flex; align-items: center; gap: 30px; }
.trow .plat { width: 56px; height: 62px; object-fit: contain; }
.trow .plat.off { opacity: .16; filter: grayscale(1); }
.trow .pct { min-width: 108px; text-align: center; font-size: 36px; font-weight: 300; font-variant-numeric: tabular-nums; }
.trow .pct .bar { width: 100%; height: 3px; margin: 4px 0 0; }
.trow .cups { display: flex; gap: 22px; min-width: 300px; }
.trow .cup { display: flex; align-items: flex-end; gap: 6px; font-size: 24px; font-weight: 300; min-width: 84px; font-variant-numeric: tabular-nums; }
.trow .cup img { width: 36px; height: 36px; object-fit: contain; }
.trow .count { min-width: 300px; font-size: 24px; font-weight: 300; color: var(--sub); font-variant-numeric: tabular-nums; }
.trow .count b { color: var(--ink); font-weight: 300; }
@media (max-width: 980px) { .trow .cups, .trow .count { display: none; } .trow .right { gap: 14px; } }
@media (max-width: 620px) {
  .trow { grid-template-columns: 112px minmax(0, 1fr) auto; gap: 12px; padding: 10px 4px; }
  .trow .art { width: 112px; } .art.large { width: 100%; } .trow .name { font-size: 17px; }
  .trow .pct { min-width: 70px; font-size: 24px; } .trow .plat { width: 34px; height: 38px; }
  .summary h1 { font-size: 30px; } .summary .cup img { width: 38px; height: 38px; } .summary .cups { gap: 16px; }
}

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.5; color: #fff; vertical-align: middle; white-space: nowrap; }
.badge img { flex: none; }
.tile .badge { margin-bottom: 6px; }
.badge.steam { background: var(--steam); } .badge.ra { background: var(--ra); } .badge.psn { background: var(--psn); } .badge.xbox { background: var(--xbox); } .badge.emups3 { background: #6a55d8; }
.bar { height: 4px; border-radius: 999px; background: rgba(255,255,255,.16); overflow: hidden; width: 90px; margin-top: 4px; margin-left: auto; }
.bar i { display: block; height: 100%; background: var(--ink); }

/* Controls */
input, select, button, textarea { font: inherit; color: inherit; }
input, select, textarea { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.07); min-width: 0; }
select option { background: #1a1c3a; }
textarea { resize: vertical; width: 100%; }
input::placeholder, textarea::placeholder { color: var(--sub); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, textarea:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.07); font-weight: 400; cursor: pointer; }
button:hover:not(:disabled) { background: rgba(255,255,255,.14); }
button.primary { background: var(--ink); color: #10122b; border-color: transparent; font-weight: 600; }
button.primary:hover:not(:disabled) { background: #fff; }
button.danger { color: var(--danger); }
button:disabled { opacity: .55; cursor: default; }
button.star { border: 0; background: none; font-size: 22px; line-height: 1; padding: 6px 8px; color: var(--gold); flex: none; }
button[aria-pressed="true"]:not(.star) { border-color: var(--gold); color: var(--gold); }
form.stack { display: flex; flex-direction: column; gap: 10px; }
label { font-size: 13px; color: var(--sub); display: flex; flex-direction: column; gap: 4px; }
.login { max-width: 400px; margin: 9vh auto; padding: 26px; }
.msg { padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: 14px; }
.msg.err { background: rgba(255,141,141,.14); color: var(--danger); }
.msg.ok { background: rgba(111,224,166,.13); color: var(--ok); }

/* Sync indicator */
.sync { position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px 7px 10px; overflow: hidden; }
.sync .ring { width: 20px; height: 20px; flex: none; }
.sync.busy .ring { animation: spin 1s linear infinite; }
.sync .txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.sync .txt small { color: var(--sub); font-size: 11px; font-variant-numeric: tabular-nums; }
.sync .fill { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .5s ease; }
.sync.busy:disabled { opacity: 1; }
.sync.done .ring { color: var(--ok); }

/* Skeletons */
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,.07) 25%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.07) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Modal */
dialog.modal { border: 1px solid var(--line); border-radius: 20px; background: #1a1c3a; color: var(--ink); padding: 0; width: min(390px, calc(100vw - 32px)); box-shadow: 0 24px 70px rgba(0,0,0,.6); }
dialog.modal::backdrop { background: rgba(5,6,16,.7); }
.modal-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 24px 24px; }
.modal-body h2 { color: var(--ink); font-size: 19px; font-weight: 400; text-transform: none; letter-spacing: 0; margin: 10px 0 0; }
.modal-body p { margin: 0 0 12px; overflow-wrap: anywhere; }
.modal-body button { min-width: 120px; }
.modal-body label { text-align: left; }
.modal-body input[type=range] { width: 100%; padding: 0; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255,255,255,.14); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mark { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; font-weight: 800; color: #10122b; }
.mark.ok { background: var(--ok); } .mark.err { background: var(--danger); }
img.qr { background: #fff; padding: 10px; border-radius: 12px; margin: 6px 0; }
canvas.crop { border-radius: 12px; touch-action: none; cursor: grab; max-width: 100%; background: #000; }

/* Profiles, friends, levels */
.avatar { border-radius: 50%; object-fit: cover; background: rgba(255,255,255,.1); flex: none; display: inline-block; }
.avatar.initial { display: inline-grid; place-items: center; font-weight: 600; color: var(--sub); }
.who { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.favs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.card.fav { display: flex; flex-direction: column; gap: 4px; color: inherit; }
.card.fav .t { font-size: 16px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.fav .d { font-size: 13px; color: var(--sub); }
img.tier { vertical-align: -5px; object-fit: contain; }
.tiercount { display: inline-flex; align-items: center; gap: 4px; margin-right: 16px; font-variant-numeric: tabular-nums; }
.level { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; white-space: nowrap; }
.level b { font-size: .85em; font-weight: 400; font-variant-numeric: tabular-nums; }
h1 .level b { font-size: .7em; }
.levelbar { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; flex-wrap: wrap; }
.levelbar .bar { width: 160px; margin: 0; }
img.rarity { background: rgba(0,0,0,.35); border-radius: 5px; padding: 2px; vertical-align: -4px; }

@media (prefers-reduced-motion: reduce) { .sk { animation: none; } .spinner, .sync.busy .ring { animation-duration: 2.6s; } .sync .fill { transition: none; } }

/* Banner picker */
dialog.modal.wide { width: min(760px, calc(100vw - 32px)); }
.bannergrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; width: 100%; max-height: 52vh; overflow: auto; padding: 2px; }
button.pick { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 10px; min-width: 0; text-align: left; }
button.pick .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

/* Community: comparison with a friend, ranking */
a.button { display: inline-block; padding: 9px 18px; border-radius: 999px; border: 1px solid transparent; background: var(--ink); color: #10122b; text-decoration: none; font-weight: 600; }
a.button:hover { background: #fff; }
.versus { display: grid; gap: 6px; max-width: 460px; }
.versus > div { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.versus > div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sub); }
.versus .bar { margin: 0; width: 100%; }
.versus .you .bar i { background: #3fb97a; }
.versus b { font-variant-numeric: tabular-nums; }
.row .mine { flex: none; width: 96px; text-align: center; font-size: 13px; color: var(--sub); font-variant-numeric: tabular-nums; }
.row .mine span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.row .mine.ok { color: #3fb97a; }
.row .rank { flex: none; width: 28px; text-align: center; font-size: 20px; font-weight: 300; color: var(--sub); font-variant-numeric: tabular-nums; }
.row.you { background: rgba(255,255,255,.04); }
@media (max-width: 600px) { .row .mine { width: 64px; } .versus > div { grid-template-columns: 70px 1fr auto; } }
.swatches label, label.check { flex-direction: row; align-items: center; gap: 8px; }
label.check { font-size: 14px; color: var(--ink); }
label.check input { width: auto; margin: 0; }

/* Navigation icons: hidden on wide screens, where the labels are enough */
.glyph { display: none; line-height: 0; }
header .spacer { flex: 1; }
/* The dock: navigation floats at the bottom of the screen, within thumb or pointer reach on any device */
nav.dock { position: fixed; z-index: 3; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 6px 8px;
  background: rgba(16,17,40,.78); backdrop-filter: blur(18px) saturate(1.3); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
nav.dock a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 14px; min-width: 78px; border-radius: 14px; font-size: 11px; color: var(--sub); font-weight: 400; }
nav.dock a .glyph { display: block; padding: 3px 14px; border-radius: 999px; }
nav.dock a:hover { color: var(--ink); } nav.dock a:hover:not(.on) .glyph { background: rgba(255,255,255,.1); }
nav.dock a.on { color: var(--ink); font-weight: 600; } nav.dock a.on .glyph { background: var(--ink); color: #10122b; }
.card.account { display: flex; flex-direction: column; } .card.account .tools { margin: auto 0 0; padding-top: 14px; flex-wrap: wrap; }
.card.account .msg { margin: 8px 0 0; }
.chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* Phones: one compact top line, tabs at the bottom, rows that stack instead of squeezing */
@media (max-width: 760px) {
  header { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); backdrop-filter: none; background: rgba(13,14,34,.92); }
  .row .side .badge { display: none; } .tools input[type=search] { flex: 1 1 100% !important; } .tools select { flex: 1; }
  header .brand { flex: 1; min-width: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  header .sync { padding: 8px; } header .sync .txt { display: none; }
  header .who { flex: none; } header .who > span:not(.level):not(.avatar):not(.avatarwrap) { display: none; }
  header .logout { padding: 8px; flex: none; } header .logout span:not(.glyph) { display: none; } header .logout .glyph { display: block; }
  nav.dock { left: 0; right: 0; bottom: 0; transform: none; border-radius: 0; border-width: 1px 0 0; gap: 0; padding: 4px 4px max(4px, env(safe-area-inset-bottom)); box-shadow: none; }
  nav.dock a { flex: 1; min-width: 0; padding: 6px 2px; }
  main { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  h1 { overflow-wrap: anywhere; }

  .trow { grid-template-columns: 104px minmax(0, 1fr); grid-template-areas: "art info" "art right"; gap: 4px 12px; padding: 10px 2px; align-items: start; }
  .trow > :first-child { grid-area: art; align-self: center; } .trow .art { width: 104px; }
  .trow > div:not(.right) { grid-area: info; min-width: 0; }
  .trow .name { font-size: 16px; font-weight: 400; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
  .trow .meta { margin-top: 5px; gap: 6px; flex-wrap: nowrap; min-width: 0; } .trow .meta .chip { flex: 0 1 auto; min-width: 0; } .trow .meta .badge { flex: none; }
  .trow .right { grid-area: right; gap: 8px; min-width: 0; }
  .trow .plat { width: 22px; height: 24px; order: 2; flex: none; } 
  .trow .pct { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; text-align: left; }
  .trow .pct .bar { flex: 1; margin: 0; order: -1; }

  .summary { gap: 10px 18px; margin-bottom: 16px; } .summary h1 { flex-basis: 100%; font-size: 28px; }
  .summary .lv { font-size: 30px; } .summary .lv img { width: 40px; height: 40px; }
  .summary .cups { gap: 12px; flex-basis: 100%; justify-content: space-between; } .summary .cup { font-size: 18px; } .summary .cup img { width: 34px; height: 34px; }

  .hero { flex-direction: column; align-items: stretch; }
  .row { gap: 10px; } .row .side { font-size: 12px; white-space: normal; max-width: 92px; }
  .row .t, .row .d { white-space: normal; overflow-wrap: anywhere; }
  .tools { flex-wrap: wrap; } .tools > * { min-width: 0; }
  .card { padding-left: 12px; padding-right: 12px; }
}

/* Motion: pages fade in, lists arrive in a short cascade, controls answer to the press */
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
main[aria-busy] { animation: fade-in .18s ease both; }
main.enter > * > * { animation: page-in .34s cubic-bezier(.2,.7,.2,1) both; }
main.enter > * > *:nth-child(2) { animation-delay: .04s; } main.enter > * > *:nth-child(3) { animation-delay: .08s; }
main.enter > * > *:nth-child(4) { animation-delay: .12s; } main.enter > * > *:nth-child(n+5) { animation-delay: .16s; }
.trophylist > .trow { animation: page-in .3s ease both; }
button, a.button, nav.dock a, .trow, a.row, a.card, .swatches label { transition: transform .12s ease, background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease; }
button:active:not(:disabled), a.button:active, nav.dock a:active, .swatches label:active { transform: scale(.95); }
a.trow:active, a.row:active, a.card:active { transform: scale(.992); }
a.trow:hover, a.card.fav:hover { box-shadow: inset 3px 0 0 var(--accent); }
dialog.modal[open] { animation: page-in .22s ease both; } dialog.modal::backdrop { animation: fade-in .22s ease both; }
.bar i { transition: width .5s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) { main[aria-busy], main.enter > * > *, .trophylist > .trow, dialog.modal[open], dialog.modal::backdrop { animation: none; } button, a.button, nav.dock a, .trow, a.row, a.card { transition: none; } }

/* Games section: tabs, almost finished, to-do pins, collections, share card */
.tabs { display: flex; gap: 6px; margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs a { flex: none; padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line); color: var(--sub); font-size: 14px; transition: background-color .18s ease, color .18s ease; }
.tabs a:hover { color: var(--ink); background: var(--panel); }
.tabs a.on { background: var(--ink); color: #10122b; border-color: transparent; font-weight: 600; }
.almost { border-bottom: 1px solid var(--line); } .almost .trow { border-bottom: 0; }
.almost .missing { padding: 0 10px 14px; font-size: 13px; color: var(--sub); overflow-wrap: anywhere; } .almost .missing b { color: var(--ink); font-weight: 400; }
button.pin { border: 0; background: none; padding: 6px 8px; color: var(--sub); flex: none; line-height: 0; }
button.pin .glyph { display: block; }
button.pin[aria-pressed="true"] { color: var(--gold); border: 0; }
.mosaic { display: grid; gap: 2px; aspect-ratio: 460/215; border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
.mosaic > * { width: 100%; height: 100%; min-height: 0; border-radius: 0; aspect-ratio: auto; }
.mosaic.n2, .mosaic.n3, .mosaic.n4 { grid-template-columns: 1fr 1fr; } .mosaic.n3 > :first-child { grid-row: span 2; } .mosaic.n3, .mosaic.n4 { grid-template-rows: 1fr 1fr; }
canvas.sharecard { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); display: block; }
.listhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
label.inline { flex-direction: row; align-items: center; gap: 8px; margin-bottom: 8px; }
dialog.modal.picker { width: min(480px, calc(100vw - 32px)); }
.picklist { max-height: min(46vh, 380px); overflow-y: auto; margin: 0 -8px; padding: 0 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overscroll-behavior: contain; }
label.check.pick { padding: 9px 4px; border-bottom: 1px solid var(--line); gap: 10px; } label.check.pick:last-child { border-bottom: 0; }
label.check.pick:hover { background: var(--panel); } label.check.pick .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
label.check.pick .muted, label.check.pick .badge { flex: none; font-size: 12px; }
.pickcount { font-size: 12px; min-height: 16px; }
.trow .cups .of { align-self: flex-end; font-size: 20px; font-weight: 300; color: var(--sub); font-variant-numeric: tabular-nums; margin-left: -46px; }
.trow.catalog .right { gap: 18px; } .trow.catalog .right > .muted { font-size: 13px; }
.trow.catalog .meta .muted { font-size: 13px; }
@media (max-width: 760px) { .trow.catalog .right { flex-wrap: wrap; } .trow.catalog .right button { padding: 6px 12px; font-size: 13px; } }
@media (max-width: 760px) { .trow.catalog .meta { flex-wrap: wrap; } .trow.catalog .meta .muted { flex-basis: 100%; } }
a.button.ghost { background: rgba(255,255,255,.07); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; font-weight: 400; }
details.hashes { margin-top: 14px; } details.hashes summary { cursor: pointer; font-weight: 400; }
details.hashes[open] summary { margin-bottom: 8px; }
.row.hash code { font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--sub); overflow-wrap: anywhere; user-select: all; }
.row.hash .t { white-space: normal; } .row.hash .chip { font-size: 10px; margin-right: 4px; }
.row.hash button { padding: 6px 12px; font-size: 13px; flex: none; }
button.iconbtn { padding: 8px; line-height: 0; flex: none; } button.iconbtn .glyph { display: block; }
.picklist.tracks { max-height: min(34vh, 260px); }
.chip.machine { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 5px; background: rgba(255,255,255,.12); color: var(--ink); }
.chip.machine img { width: 20px; height: 20px; object-fit: contain; flex: none; }

/* Switches and radio buttons drawn to match the rest of the interface */
input[type=checkbox], input[type=radio] { appearance: none; -webkit-appearance: none; flex: none; margin: 0; padding: 0; cursor: pointer; position: relative;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.1); transition: background-color .18s ease, border-color .18s ease; }
input[type=checkbox] { width: 38px !important; height: 22px; border-radius: 999px; }
input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--sub);
  transition: transform .18s cubic-bezier(.2,.7,.2,1), background-color .18s ease; }
input[type=checkbox]:checked { background: var(--accent); border-color: transparent; }
input[type=checkbox]:checked::after { transform: translateX(16px); background: #10122b; }
input[type=radio] { width: 20px !important; height: 20px; border-radius: 50%; }
input[type=radio]::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .16s cubic-bezier(.2,.7,.2,1); }
input[type=radio]:checked { border-color: var(--accent); background: rgba(255,255,255,.06); }
input[type=radio]:checked::after { transform: scale(1); }
input[type=checkbox]:hover, input[type=radio]:hover { border-color: rgba(255,255,255,.5); }
input[type=checkbox]:disabled, input[type=radio]:disabled { opacity: .5; cursor: default; }
.swatches input[type=radio] { position: absolute; opacity: 0; width: 1px !important; height: 1px; }
label.check { gap: 10px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { input[type=checkbox], input[type=checkbox]::after, input[type=radio]::after { transition: none; } }
/* Switches stacked in a column need room between them */
.stack { display: flex; flex-direction: column; gap: 12px; }
label.check { min-height: 26px; }
label.check.pick { min-height: 0; }
.avatargrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 14px; align-content: start; max-height: min(52vh, 440px); overflow-y: auto; overflow-x: hidden; padding: 6px; overscroll-behavior: contain; }
/* min-width: 0 undoes the minimum width dialogs give their buttons, which made the pictures overlap */
.modal-body button.avatarpick { min-width: 0; width: 100%; padding: 0; border-radius: 50%; aspect-ratio: 1; overflow: hidden; border: 2px solid transparent; background: rgba(255,255,255,.07); display: block; }
button.avatarpick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-body button.avatarpick:hover:not(:disabled), .modal-body button.avatarpick:focus-visible { border-color: var(--ink); transform: scale(1.05); }
dialog .tabs { margin-bottom: 14px; }
@media (max-width: 760px) { .avatargrid { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 10px; } }
time[title] { cursor: help; }
pre.codes { margin: 0; padding: 12px 14px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid var(--line); font: 15px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; column-count: 2; user-select: all; }

/* Presence dots and toasts */
.avatarwrap { position: relative; display: inline-flex; flex: none; line-height: 0; }
.avatarwrap .dot { position: absolute; right: -1px; bottom: -1px; width: 28%; height: 28%; min-width: 10px; min-height: 10px; max-width: 18px; max-height: 18px; border-radius: 50%; border: 2px solid #14162e; background: #3fd17f; }
.avatarwrap .dot.away { background: #f2c14b; }
.live.online { color: #3fd17f; } .live.away { color: #f2c14b; }
#toasts { position: fixed; z-index: 20; top: 78px; right: 16px; display: flex; flex-direction: column; gap: 10px; width: min(340px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; color: var(--ink); cursor: pointer;
  background: rgba(22,24,52,.86); backdrop-filter: blur(18px) saturate(1.3); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0,0,0,.45);
  animation: toast-in .32s cubic-bezier(.2,.7,.2,1) both; transition: opacity .28s ease, transform .28s ease; }
.toast .grow { min-width: 0; } .toast .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .toast .d { color: var(--sub); font-size: 13px; }
.toast.out { opacity: 0; transform: translateX(24px); }
@keyframes toast-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) { #toasts { top: 64px; right: 12px; left: 12px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; transition: none; } }

/* Notification bell */
button.bell { position: relative; }
.bell .count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff4d6d; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #14162e; }
.bell .count[hidden] { display: none; }
.bellpanel { position: fixed; z-index: 15; top: 66px; right: 16px; width: min(380px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 160px)); display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: rgba(22,24,52,.92); backdrop-filter: blur(22px) saturate(1.3); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0,0,0,.55); animation: bell-in .2s cubic-bezier(.2,.7,.2,1) both; }
@keyframes bell-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.bellhead { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
button.linkish { background: none; border: 0; padding: 4px 6px; color: var(--sub); font-size: 13px; min-width: 0; box-shadow: none; } button.linkish:hover { color: var(--ink); }
.notiflist { overflow-y: auto; overscroll-behavior: contain; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.05); }
.notif:hover { background: rgba(255,255,255,.05); } .notif.new { background: rgba(120,150,255,.10); }
.notif .grow { min-width: 0; flex: 1; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; } .notif .d { color: var(--sub); font-size: 12px; margin-top: 2px; }
.notif .nimg { position: relative; flex: none; line-height: 0; } .notif .nimg .mini { position: absolute; right: -6px; bottom: -6px; width: 22px; height: 22px; border-radius: 6px; object-fit: cover; border: 2px solid #14162e; background: #14162e; }
@media (max-width: 760px) { .bellpanel { top: 58px; right: 12px; left: 12px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .bellpanel { animation: none; } }
