/* jerholum: console-dashboard look. No external assets. */
:root {
  --bg: #07090d;
  --bg-2: #0c1016;
  --panel: #11161e;
  --panel-2: #171e29;
  --panel-3: #1f2835;
  --line: #222c3a;
  --line-2: #2e3a4d;
  --text: #eaf0f8;
  --muted: #8e9cb1;
  --faint: #5f6d82;
  --brand: #3ddc84;
  --brand-hi: #6ff0a6;
  --brand-ink: #03200e;
  --accent: #38bdf8;
  --danger: #f43f5e;
  --warn: #f59e0b;
  --online: #3ddc84;
  --playing: #38bdf8;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .45);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(56, 189, 248, .07), transparent 60%),
    radial-gradient(900px 480px at -8% 6%, rgba(61, 220, 132, .06), transparent 60%),
    var(--bg);
  color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 750; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(61, 220, 132, .35); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(7, 9, 13, .78); backdrop-filter: saturate(150%) blur(14px); -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1320px; margin: 0 auto; padding: 0 var(--s5); height: 62px; display: flex; align-items: center; gap: var(--s5); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 850; font-size: 20px; letter-spacing: -.035em; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px;
  background: conic-gradient(from 210deg, var(--brand), #0ea5e9, var(--brand));
  -webkit-mask: radial-gradient(circle, transparent 7px, #000 8px); mask: radial-gradient(circle, transparent 7px, #000 8px);
  box-shadow: 0 0 18px rgba(61, 220, 132, .5);
}
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; }
.nav a { color: var(--muted); padding: 8px 14px; border-radius: 999px; font-weight: 650; font-size: 14px; position: relative; white-space: nowrap; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav a.active { color: var(--text); }
.nav a.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -12px; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); box-shadow: 0 0 12px var(--brand); }
.account { display: flex; align-items: center; gap: var(--s2); flex: 0 0 auto; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel);
  display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: background .15s, color .15s, border-color .15s; padding: 0;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--panel-2); color: var(--text); border-color: var(--line-2); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .badge { position: absolute; top: -3px; right: -3px; }
.avatar-btn { border: 0; background: none; padding: 2px; border-radius: 999px; cursor: pointer; display: flex; align-items: center; gap: var(--s2); color: var(--text); }
.avatar-btn .name { font-weight: 650; font-size: 14px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-btn .chev { color: var(--faint); font-size: 11px; margin-right: 6px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
.nav .badge { margin-left: 6px; }

/* dropdown menus */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; z-index: 40;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px;
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none; transition: opacity .14s var(--ease), transform .14s var(--ease);
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu a, .menu button.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text); background: none; border: 0; text-align: left; font-size: 14px; font-weight: 550; cursor: pointer; }
.menu a:hover, .menu button.item:hover { background: var(--panel-3); text-decoration: none; }
.menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu .head { padding: 10px 12px 8px; display: flex; align-items: center; gap: 10px; }
.menu .head .who { min-width: 0; }
.menu .head .dn { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu.notif { width: 340px; max-width: calc(100vw - 24px); }
.menu.notif .title { padding: 8px 10px 6px; font-weight: 750; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.menu.notif .req { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); }
.menu.notif .req:hover { background: var(--panel-3); }
.menu.notif .req .who { flex: 1; min-width: 0; }
.menu.notif .req .dn { font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.menu.notif .none { padding: 18px 10px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- layout ---------- */
.page { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); outline: none; }
.footer { color: var(--faint); font-size: 13px; text-align: center; padding: var(--s5) var(--s4) var(--s6); display: flex; gap: 8px; justify-content: center; }
.view { animation: fade-in .25s var(--ease); }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s6); align-items: start; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin: 0 0 var(--s4); flex-wrap: wrap; }
.section-head .muted { font-size: 13px; }
.section-title { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.panel + .panel { margin-top: var(--s4); }
.panel h2 { margin-bottom: var(--s3); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.grid-2 .panel + .panel { margin-top: 0; }

/* ---------- skeletons ---------- */
.sk { background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 40%, var(--panel) 80%); background-size: 300% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.sk-hero { height: 300px; border-radius: var(--r-xl); margin-bottom: var(--s6); }
.sk-line { height: 14px; margin: 10px 0; border-radius: 6px; }
.sk-tile { aspect-ratio: 16 / 13; }
.sk-row { height: 56px; margin-bottom: 6px; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.btn:hover { background: var(--panel-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hi); box-shadow: 0 0 22px rgba(61, 220, 132, .35); }
.btn.danger { background: transparent; border-color: rgba(244, 63, 94, .5); color: #fda4af; }
.btn.danger:hover { background: rgba(244, 63, 94, .12); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.glass { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #fff; backdrop-filter: blur(8px); }
.btn.glass:hover { background: rgba(255, 255, 255, .2); }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn.lg { height: 50px; padding: 0 28px; font-size: 16px; }
.btn.block { width: 100%; }
.btn .play-ico { width: 0; height: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.field .ferr { font-size: 12.5px; color: #fda4af; display: none; }
.field.bad .ferr { display: block; animation: fade-in .2s var(--ease); }
.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56, 189, 248, .18); }
.field.bad .input, .input.bad { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(244, 63, 94, .12); }
.form-error { color: #fda4af; font-size: 13px; min-height: 0; margin: 0 0 var(--s3); }
.form-error:empty { display: none; }
.search { position: relative; }
.search .input { padding-left: 40px; }
.search::before { content: ""; position: absolute; left: 15px; top: 50%; width: 12px; height: 12px; border: 2px solid var(--faint); border-radius: 50%; transform: translateY(-60%); }
.search::after { content: ""; position: absolute; left: 27px; top: 58%; width: 6px; height: 2px; background: var(--faint); transform: rotate(45deg); }

/* ---------- avatars & presence ---------- */
.avatar {
  --size: 40px; width: var(--size); height: var(--size); flex: 0 0 var(--size); border-radius: 50%;
  display: inline-grid; place-items: center; position: relative; color: #fff; font-weight: 800;
  font-size: calc(var(--size) * .4); letter-spacing: -.02em; user-select: none;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .25), transparent 60%), var(--av, #64748b);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
}
.avatar.emoji { font-size: calc(var(--size) * .55); }
.avatar.s24 { --size: 24px; } .avatar.s28 { --size: 28px; } .avatar.s32 { --size: 32px; } .avatar.s36 { --size: 36px; }
.avatar.s48 { --size: 48px; } .avatar.s96 { --size: 96px; } .avatar.s132 { --size: 132px; }
.avatar .pdot { position: absolute; right: 0; bottom: 0; width: 30%; height: 30%; min-width: 10px; min-height: 10px; border-radius: 50%; border: 2px solid var(--panel); background: var(--faint); }
.pdot.online { background: var(--online); }
.pdot.playing { background: var(--playing); }
.status { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status.online { color: var(--online); }
.status.playing { color: var(--playing); }
.admin-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fde68a; background: rgba(245, 158, 11, .14); border: 1px solid rgba(245, 158, 11, .4); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }

/* ---------- landing ---------- */
.hero-land {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 64px 56px; margin-bottom: 40px;
  background:
    radial-gradient(600px 300px at 90% 20%, rgba(56, 189, 248, .25), transparent 70%),
    radial-gradient(500px 300px at 10% 100%, rgba(61, 220, 132, .22), transparent 70%),
    linear-gradient(135deg, #0f1823, #0a0f15);
  border: 1px solid var(--line);
}
.hero-land h1 { font-size: clamp(34px, 5.4vw, 58px); font-weight: 900; letter-spacing: -.045em; max-width: 760px; }
.hero-land h1 em { font-style: normal; background: linear-gradient(90deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-land p { color: var(--muted); font-size: 17px; max-width: 560px; margin: var(--s4) 0 var(--s6); }
.hero-land .perks { display: flex; gap: var(--s5); flex-wrap: wrap; margin-top: var(--s6); color: var(--muted); font-size: 14px; }
.hero-land .perks span::before { content: "✓"; color: var(--brand); font-weight: 900; margin-right: 8px; }
.hero-land .emblems { position: absolute; right: -30px; bottom: -30px; display: grid; grid-template-columns: repeat(3, 90px); gap: 14px; opacity: .14; transform: rotate(-12deg); pointer-events: none; }
.hero-land .emblems img { width: 90px; height: 90px; }

/* ---------- featured / continue hero ---------- */
.feature {
  --accent: #3b82f6; position: relative; overflow: hidden; border-radius: var(--r-xl); min-height: 320px; margin-bottom: var(--s6);
  display: flex; align-items: flex-end; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); isolation: isolate;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, #000), #07090d 75%);
}
.feature .art { position: absolute; inset: 0; z-index: -2; }
.feature .art img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.03); transition: transform 6s var(--ease); }
.feature:hover .art img { transform: scale(1.08); }
.feature .art.gen { display: grid; place-items: center end; padding-right: 6%; }
.feature .art.gen img { width: min(320px, 42%); height: auto; opacity: .22; transform: rotate(-8deg); }
.feature::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(5, 7, 10, .92) 0%, rgba(5, 7, 10, .65) 45%, rgba(5, 7, 10, .1) 100%), linear-gradient(0deg, rgba(5, 7, 10, .7), transparent 50%); }
.feature .body { padding: 40px; max-width: 620px; }
.feature .eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 55%, #fff); display: flex; align-items: center; gap: 8px; }
.feature .eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: currentColor; }
.feature h2 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 900; letter-spacing: -.045em; margin: 10px 0 10px; text-shadow: 0 4px 30px rgba(0, 0, 0, .5); }
.feature p { color: #cdd6e3; font-size: 16px; max-width: 520px; }
.feature .meta { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin: var(--s4) 0 var(--s5); }
.feature .actions { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #d5dde8; border: 1px solid rgba(255, 255, 255, .08); white-space: nowrap; }
.chip.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--online); box-shadow: 0 0 8px var(--online); }
.chip.down::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.chip.dev { background: rgba(245, 158, 11, .18); border-color: rgba(245, 158, 11, .5); color: #fde68a; letter-spacing: .06em; }
.chip.arcade { background: rgba(168, 85, 247, .2); border-color: rgba(168, 85, 247, .55); color: #e9d5ff; letter-spacing: .06em; }
.chip.idle::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }

/* ---------- game library ---------- */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s5); }
.tile {
  --accent: #3b82f6; position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg);
  overflow: hidden; background: var(--panel); border: 1px solid var(--line);
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
}
.tile:hover, .tile:focus-within { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 65%, var(--line)); box-shadow: 0 18px 40px rgba(0, 0, 0, .5), 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 40px color-mix(in srgb, var(--accent) 22%, transparent); }
.capsule { position: relative; aspect-ratio: 16 / 9; overflow: hidden; display: block; color: #fff; isolation: isolate; }
.capsule:hover { text-decoration: none; }
.capsule .bg { position: absolute; inset: 0; z-index: -2; background: radial-gradient(circle at 75% 30%, color-mix(in srgb, var(--accent) 80%, #fff 10%), transparent 60%), linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 20%, #05070a) 75%); }
.capsule .bg::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .045) 0 2px, transparent 2px 16px); }
.capsule .shot { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.capsule .emblem { position: absolute; right: -6%; bottom: -14%; width: 62%; z-index: -1; opacity: .3; transform: rotate(-10deg); transition: transform .5s var(--ease), opacity .3s; }
.tile:hover .capsule .shot { transform: scale(1.06); }
.tile:hover .capsule .emblem { transform: rotate(-4deg) scale(1.06); opacity: .4; }
.capsule::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(4, 6, 9, .85), rgba(4, 6, 9, 0) 60%); }
.capsule .wordmark { position: absolute; left: 14px; right: 14px; bottom: 10px; font-size: 24px; font-weight: 900; letter-spacing: -.04em; line-height: 1; text-transform: uppercase; text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
.capsule .corner { position: absolute; left: 12px; top: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; }
.capsule .chip { background: rgba(0, 0, 0, .45); border-color: rgba(255, 255, 255, .1); backdrop-filter: blur(6px); }
.tile-body { padding: var(--s4); display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tile-blurb { color: var(--muted); font-size: 13px; line-height: 1.45; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; }
.tile-foot { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.tile-foot .btn { margin-left: auto; }
.stack-av { display: flex; align-items: center; min-width: 0; }
.stack-av .avatar { margin-right: -7px; border: 2px solid var(--panel); }
.stack-av .lbl { margin-left: 14px; font-size: 12px; color: var(--playing); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- friends rail ---------- */
.rail { position: sticky; top: 86px; padding: var(--s4); max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.rail .section-head { margin-bottom: var(--s3); }
.rail .scroll { overflow-y: auto; margin: 0 -6px; padding: 0 6px; min-height: 0; }
.rail-toggle { display: none; }
.flist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.fitem { display: flex; align-items: center; gap: var(--s3); padding: 8px; border-radius: var(--r); color: var(--text); min-width: 0; transition: background .12s; }
a.fitem:hover, .fitem.hoverable:hover { background: var(--panel-2); text-decoration: none; }
.fitem .who { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.fitem .who .dn { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.fitem .who a.dn:hover { text-decoration: underline; }
.fitem .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; }
.group-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: var(--s3) 8px 4px; list-style: none; }
.empty { color: var(--muted); font-size: 14px; padding: var(--s5) 8px; text-align: center; list-style: none; }
.empty .big { font-size: 34px; display: block; margin-bottom: 6px; }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: rgba(244, 63, 94, .08); border: 1px solid rgba(244, 63, 94, .25); color: var(--text); font-size: 13px; font-weight: 600; margin-bottom: var(--s3); }
.notice:hover { text-decoration: none; background: rgba(244, 63, 94, .13); }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { height: 40px; }

/* ---------- auth ---------- */
body.auth-mode .footer { display: none; }
.auth-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .6s; }
body.auth-mode .auth-bg { opacity: 1; }
.auth-bg span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: .32; animation: drift 22s ease-in-out infinite alternate; }
.auth-bg span:nth-child(1) { background: #16a34a; left: -20vmax; top: -25vmax; }
.auth-bg span:nth-child(2) { background: #0284c7; right: -25vmax; top: 0; animation-duration: 28s; animation-delay: -6s; }
.auth-bg span:nth-child(3) { background: #7c3aed; left: 20vmax; bottom: -35vmax; animation-duration: 32s; animation-delay: -12s; opacity: .22; }
.auth-bg::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%); -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%); }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(8vmax, 6vmax) scale(1.15); } }
.auth-wrap { display: grid; place-items: center; padding: var(--s5) 0; min-height: calc(100vh - 160px); }
.auth-card { width: 100%; max-width: 430px; padding: 36px; background: rgba(17, 22, 30, .82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); border-radius: var(--r-xl); }
.auth-card .wordmark { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 900; font-size: 26px; letter-spacing: -.04em; margin-bottom: var(--s5); }
.auth-card .wordmark .brand-mark { width: 34px; height: 34px; flex-basis: 34px; -webkit-mask: radial-gradient(circle, transparent 8px, #000 9px); mask: radial-gradient(circle, transparent 8px, #000 9px); }
.auth-card h1 { font-size: 24px; text-align: center; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: var(--s5); text-align: center; }
.auth-card .alt { margin-top: var(--s4); text-align: center; color: var(--muted); font-size: 14px; }
.auth-card .return-note { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; font-size: 13px; color: var(--muted); margin-bottom: var(--s4); word-break: break-all; text-align: center; }
.auth-card .return-note strong { color: var(--text); }

/* ---------- profile ---------- */
.profile-banner { position: relative; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); margin-bottom: var(--s5); background: var(--panel); }
.profile-banner .cover { height: 170px; background: radial-gradient(circle at 80% 0%, color-mix(in srgb, var(--av, #3b82f6) 85%, #fff 10%), transparent 55%), linear-gradient(120deg, color-mix(in srgb, var(--av, #3b82f6) 60%, #05070a), #0a0d12 85%); position: relative; }
.profile-banner .cover::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .04) 0 2px, transparent 2px 18px); }
.profile-banner .bar { display: flex; align-items: flex-end; gap: var(--s5); padding: 0 var(--s6) var(--s5); margin-top: -64px; position: relative; flex-wrap: wrap; }
.profile-banner .bar .avatar { border: 5px solid var(--panel); box-shadow: var(--shadow); }
.profile-banner .bar .avatar .pdot { border-width: 4px; }
.profile-banner .info { flex: 1; min-width: 220px; padding-bottom: 6px; }
.profile-banner h1 { overflow-wrap: anywhere; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-banner .handle { color: var(--muted); margin-top: 4px; }
.profile-banner .meta { display: flex; gap: var(--s4); flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.profile-banner .actions { display: flex; gap: var(--s2); flex-wrap: wrap; padding-bottom: 8px; }
.bio { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); }
.recent .tile .capsule .wordmark { font-size: 18px; }
.recent .tile-body { padding: 10px 12px; }

/* ---------- settings ---------- */
.avatar-editor { display: flex; gap: var(--s5); align-items: flex-start; flex-wrap: wrap; margin-bottom: var(--s4); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; background: var(--sw); padding: 0; transition: transform .12s; }
.swatch:hover { transform: scale(1.1); }
.swatch[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px var(--bg); }
.emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; margin: 6px 0 14px; }
.emoji-btn { height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); font-size: 20px; cursor: pointer; padding: 0; transition: background .12s, transform .12s; }
.emoji-btn:hover { background: var(--panel-3); transform: scale(1.06); }
.emoji-btn[aria-pressed="true"] { border-color: var(--brand); background: rgba(61, 220, 132, .14); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 12px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--text); }
.danger-zone { border-color: rgba(244, 63, 94, .35); }

/* ---------- admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); }
.stat .n { font-size: 30px; font-weight: 850; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.gstat { display: flex; align-items: center; gap: var(--s3); padding: 10px 4px; border-bottom: 1px solid var(--line); }
.gstat:last-child { border-bottom: 0; }
.gstat .sw { width: 10px; height: 34px; border-radius: 4px; background: var(--accent); flex: 0 0 10px; }
.gstat .nm { flex: 1; min-width: 0; font-weight: 650; }
.table-wrap { overflow-x: auto; margin: 0 calc(var(--s5) * -1); padding: 0 var(--s5); }
table.users { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
table.users th { text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.users td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.users tr:hover td { background: rgba(255, 255, 255, .015); }
table.users .u { display: flex; align-items: center; gap: 10px; min-width: 0; }
table.users .u .dn { font-weight: 650; color: var(--text); }
table.users .acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.pill-ban { font-size: 11px; font-weight: 800; color: #fda4af; background: rgba(244, 63, 94, .12); padding: 2px 8px; border-radius: 999px; }
.pager { display: flex; justify-content: center; align-items: center; gap: var(--s3); margin-top: var(--s4); }

/* ---------- dialog ---------- */
dialog.modal { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--panel-2); color: var(--text); padding: var(--s5); width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
dialog.modal::backdrop { background: rgba(3, 5, 8, .7); backdrop-filter: blur(4px); }
dialog.modal[open] { animation: fade-in .18s var(--ease); }
dialog.modal h2 { margin-bottom: var(--s3); }
dialog.modal .btns { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s4); flex-wrap: wrap; }
.secret { font: 600 18px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 12px 14px; text-align: center; user-select: all; word-break: break-all; margin: var(--s3) 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--panel-3); border: 1px solid var(--line-2); color: var(--text); padding: 11px 18px 11px 14px; border-radius: 999px;
  box-shadow: var(--shadow); font-size: 14px; font-weight: 650; transition: opacity .2s, transform .2s var(--ease); z-index: 60; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 10px;
}
.toast::before { content: "✓"; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--brand); color: var(--brand-ink); flex: 0 0 22px; font-weight: 900; }
.toast.bad::before { content: "!"; background: var(--danger); color: #fff; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(244, 63, 94, .6); }

.notfound { text-align: center; padding: 80px 16px; }
.notfound .big { font-size: 64px; }
.notfound h1 { margin: 12px 0 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .rail { position: static; max-height: none; order: -1; padding: 0; overflow: hidden; }
  .rail-toggle { display: flex; width: 100%; align-items: center; gap: 10px; padding: 14px var(--s4); background: none; border: 0; cursor: pointer; text-align: left; font-weight: 750; }
  .rail-toggle .chev { margin-left: auto; transition: transform .2s; color: var(--muted); }
  .rail.open .rail-toggle .chev { transform: rotate(180deg); }
  .rail .rail-body { display: none; padding: 0 var(--s4) var(--s4); }
  .rail.open .rail-body { display: block; }
  .rail .rail-body > .section-head { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar-inner { padding: 0 var(--s3); gap: var(--s2); height: 56px; }
  .brand-name { display: none; }
  .nav { gap: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 10px; font-size: 13px; }
  .nav a.active::after { bottom: -10px; left: 10px; right: 10px; }
  .avatar-btn .name, .avatar-btn .chev { display: none; }
  .icon-btn { width: 36px; height: 36px; }
  .account .btn { height: 34px; padding: 0 12px; font-size: 13px; }
  .page { padding: var(--s5) var(--s3) var(--s6); }
  h1 { font-size: 24px; }
  .hero-land { padding: 36px 22px; }
  .hero-land p { font-size: 15px; }
  .feature { min-height: 280px; }
  .feature .body { padding: 24px 20px; }
  .feature p { font-size: 14px; }
  .games { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: var(--s3); }
  .capsule .wordmark { font-size: 18px; }
  .tile-body { padding: 12px; }
  .tile-blurb { display: none; }
  .tile-foot { flex-wrap: wrap; }
  .tile-foot .btn { width: 100%; margin-left: 0; }
  .profile-banner .cover { height: 120px; }
  .profile-banner .bar { padding: 0 var(--s4) var(--s4); margin-top: -52px; gap: var(--s3); }
  .profile-banner .bar .avatar { --size: 104px; }
  .auth-card { padding: 26px 18px; }
  .panel { padding: var(--s4); }
  .table-wrap { margin: 0 calc(var(--s4) * -1); padding: 0 var(--s4); }
  .fitem .actions .btn.sm { height: 30px; padding: 0 10px; }
}
@media (max-width: 400px) {
  .games { grid-template-columns: 1fr 1fr; }
  .fitem { flex-wrap: wrap; }
  .fitem .actions { width: 100%; justify-content: flex-start; padding-left: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
