/* Tome web.
   Palette follows the bot's moonlit steel-blue brand (core/embeds.py
   PRIMARY, core/cardrender.py's _WALLET_* colors) so the site and the
   rendered Discord cards read as one identity. */

:root {
  --bg: #0a0b10;
  --bg-2: #0e1017;
  --surface: #12151e;
  --surface-2: #181c28;
  --surface-3: #202536;
  --line: rgba(160, 180, 220, 0.09);
  --line-2: rgba(160, 180, 220, 0.16);
  --text: #e7ebf3;
  --dim: #9ba4b9;
  --faint: #667089;

  --accent: #7a9cc5;
  --accent-hi: #a9c2e6;
  --accent-soft: rgba(122, 156, 197, 0.14);
  --accent-ink: #0b1220;

  --good: #6cd4a0;
  --good-soft: rgba(108, 212, 160, 0.14);
  --warn: #f0c068;
  --warn-soft: rgba(240, 192, 104, 0.14);
  --bad: #f08a8a;
  --bad-soft: rgba(240, 138, 138, 0.14);

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 32px);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 500px at 75% -120px, rgba(122, 156, 197, 0.13), transparent 70%),
    radial-gradient(800px 400px at -10% 10%, rgba(169, 194, 230, 0.05), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { color: #fff; }
button { font: inherit; color: inherit; }
code { font: 12.5px/1 ui-monospace, 'SF Mono', Consolas, monospace; background: var(--surface-3); padding: 3px 6px; border-radius: 6px; color: var(--accent-hi); }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-family: var(--display); font-size: clamp(28px, 4vw, 40px); font-weight: 600; }
h2 { font-family: var(--display); font-size: clamp(22px, 3vw, 28px); font-weight: 600; }
h3 { font-size: 17px; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.muted { color: var(--dim); }
.small { font-size: 13px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.lede { color: var(--dim); font-size: 16.5px; max-width: 56ch; margin-top: 10px; }
.stars { color: var(--warn); letter-spacing: 1px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
  text-decoration: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--accent-ink); box-shadow: 0 6px 20px -8px rgba(122, 156, 197, .7); }
.btn-primary:hover:not(:disabled) { color: var(--accent-ink); box-shadow: 0 8px 26px -8px rgba(122, 156, 197, .95); }
.btn-ghost { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn .dc { width: 18px; height: 18px; }
.is-busy { position: relative; color: transparent !important; }
.is-busy::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--accent-ink) transparent var(--accent-ink) transparent;
  animation: spin .7s linear infinite;
}
.btn-ghost.is-busy::after { border-color: var(--text) transparent var(--text) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 22px; line-height: 1; cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); }
.link-more { font-weight: 600; font-size: 14px; color: var(--accent-hi); display: inline-flex; align-items: center; gap: 6px; }
.link-more .dc { width: 16px; height: 16px; }

/* Segmented control (tabs/toggles) - buttons or links with aria-selected. */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.seg > * {
  border: 0; background: none; cursor: pointer; color: var(--dim);
  height: 30px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; white-space: nowrap;
}
.seg > *:hover { color: var(--text); }
.seg > [aria-selected="true"] { background: var(--surface-3); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.seg-lg > * { height: 36px; padding: 0 16px; font-size: 14px; }

/* ---------- Header ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10, 11, 16, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-inner {
  max-width: var(--max); margin: 0 auto; height: 64px; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 22px; color: #fff; letter-spacing: -0.01em; }
.brand:hover { color: #fff; }
.brand-mark { width: 18px; height: 18px; transform: rotate(45deg); border-radius: 4px; background: linear-gradient(135deg, var(--accent-hi), var(--accent)); box-shadow: 0 0 18px rgba(122, 156, 197, .55); }
.nav { display: flex; gap: 2px; }
.nav a { color: var(--dim); font-weight: 500; font-size: 14px; padding: 8px 12px; border-radius: 999px; transition: color .15s, background .15s; }
.nav a:hover { color: #fff; background: var(--surface); }
.nav a.active { color: #fff; background: var(--surface-2); }
.search { position: relative; margin-left: auto; flex: 0 1 280px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; height: 38px; padding-left: 36px; border-radius: 999px; background: var(--surface); }
.auth { display: flex; align-items: center; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 13.5px; max-width: 180px; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip:hover { color: #fff; border-color: var(--line-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--surface-3); }
.menu-btn { display: none; width: 40px; height: 40px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 12px; cursor: pointer; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.menu-btn span { width: 16px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
.menu-open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .topbar-inner { gap: 10px; }
  .menu-btn { display: inline-flex; order: 5; }
  .auth { margin-left: auto; }
  .nav, .search {
    display: none;
    position: absolute; left: 0; right: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter);
  }
  .menu-open .search { display: block; top: 64px; margin: 0; flex: none; }
  .menu-open .search svg { left: calc(var(--gutter) + 12px); }
  .menu-open .nav { display: flex; flex-direction: column; top: 126px; padding-top: 0; padding-bottom: 16px; box-shadow: var(--shadow); }
  .menu-open .nav a { padding: 12px; font-size: 16px; }
}
@media (max-width: 520px) {
  .user-chip span, .user-menu .btn { display: none; }
  .user-chip { padding: 0 4px; }
  .auth .btn-sm { padding: 0 10px; }
}

/* ---------- Layout ---------- */

main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 80px; outline: none; }
.view { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.section { margin-top: 64px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-stat, .panel-stat { display: flex; align-items: baseline; gap: 6px; color: var(--dim); font-size: 14px; }
.page-stat strong, .panel-stat strong { font-family: var(--display); font-size: 30px; color: #fff; font-weight: 600; }
.sub-head { font-family: var(--font); font-size: 18px; font-weight: 700; margin: 36px 0 16px; display: flex; gap: 10px; align-items: baseline; }
.sub-head:first-child { margin-top: 0; }
.back { display: inline-block; font-size: 14px; color: var(--dim); margin-bottom: 14px; }
.back:hover { color: #fff; }
.split { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.split-wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
@media (max-width: 860px) { .split, .split-wide { grid-template-columns: 1fr; } }

.panel { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.panel + .panel { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head h3 { font-size: 18px; overflow-wrap: anywhere; }
.panel-head .muted { margin-top: 4px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.toolbar input[type="search"] { flex: 1 1 240px; max-width: 360px; }
.toolbar-count { margin-left: auto; color: var(--faint); font-size: 13px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 28px; color: var(--dim); font-size: 14px; }
.pager:empty { display: none; }

/* ---------- Forms ---------- */

input, select, textarea {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  height: 40px; padding: 0 12px; width: 100%; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { cursor: pointer; width: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="search"]::-webkit-search-cancel-button { filter: invert(.7); }
input[type="color"] { width: 44px; height: 36px; padding: 3px; cursor: pointer; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.form { display: grid; gap: 8px; }
.form + .form { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.form label { font-size: 13px; font-weight: 600; color: var(--dim); margin-top: 6px; }
.form > .btn { justify-self: start; margin-top: 8px; }
.input-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.input-row > input, .input-row > select { flex: 1 1 140px; }
.hint { font-size: 12.5px; color: var(--faint); }
.color-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin: 6px 0; }
.color-row label { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--dim); cursor: pointer; }

.combo { position: relative; }
.combo-list { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); max-height: 320px; overflow: auto; }
.combo-list li { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 8px; cursor: pointer; }
.combo-list li:hover, .combo-list li[aria-selected="true"] { background: var(--surface-3); }
.combo-list img, .combo-list .img-empty { width: 32px; height: 44px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.combo-list span { display: flex; flex-direction: column; min-width: 0; }
.combo-list strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-list small { color: var(--faint); font-size: 12px; }

/* ---------- Hero ---------- */

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 24px 0 8px; }
.hero-glow { position: absolute; inset: -80px -40px auto auto; width: 520px; height: 520px; background: radial-gradient(closest-side, rgba(122, 156, 197, .22), transparent); filter: blur(20px); pointer-events: none; z-index: -1; }
.display { font-size: clamp(40px, 7vw, 72px); line-height: 1.02; letter-spacing: -0.025em; margin-top: 6px; }
.display em { font-style: italic; background: linear-gradient(100deg, var(--accent-hi), var(--accent) 60%, #c9d8ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { font-size: 18px; margin-top: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(108, 212, 160, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(108, 212, 160, 0); } 100% { box-shadow: 0 0 0 0 rgba(108, 212, 160, 0); } }
.hero-stats { display: flex; gap: 36px; margin: 36px 0 0; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column-reverse; }
.hero-stats dt { font-size: 12.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.hero-stats dd { margin: 0; font-family: var(--display); font-size: 32px; font-weight: 600; color: #fff; min-width: 3ch; }
.hero-stats dd.live { color: var(--good); }
.skeleton-text { background: var(--surface-2); border-radius: 6px; animation: shimmer 1.4s ease-in-out infinite; }

.hero-fan { position: relative; height: 420px; }
.fan-card {
  position: absolute; top: 50%; left: 50%; width: 220px; aspect-ratio: 3 / 4;
  border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, var(--surface-3), var(--surface));
  border: 1px solid var(--line-2); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.fan-card img { width: 100%; height: 100%; object-fit: cover; }
.fan-card:nth-child(1) { transform: translate(-95%, -48%) rotate(-12deg); }
.fan-card:nth-child(2) { transform: translate(-5%, -48%) rotate(10deg); }
.fan-card:nth-child(3) { transform: translate(-50%, -54%); z-index: 2; box-shadow: 0 30px 70px -18px rgba(0, 0, 0, .9), 0 0 0 1px rgba(169, 194, 230, .25); }
.hero-fan:hover .fan-card:nth-child(1) { transform: translate(-110%, -46%) rotate(-16deg); }
.hero-fan:hover .fan-card:nth-child(2) { transform: translate(10%, -46%) rotate(14deg); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 8px; }
  .hero-fan { height: 280px; order: -1; }
  .fan-card { width: 150px; }
}
@media (max-width: 520px) { .hero-stats { gap: 24px; } .hero-actions .btn { flex: 1 1 100%; } }

/* ---------- Tiles & cards ---------- */

.grid { display: grid; gap: 16px; }
.grid-series { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (max-width: 520px) {
  .grid { gap: 12px; }
  .grid-series, .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tile, .card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--text); text-align: left; padding: 0; cursor: pointer;
  transition: transform .2s ease, border-color .2s, box-shadow .2s;
}
div.card { cursor: default; }
.tile:hover, button.card:hover, a.card:hover { transform: translateY(-3px); border-color: rgba(169, 194, 230, .35); box-shadow: 0 16px 32px -16px rgba(0, 0, 0, .8), 0 0 0 1px rgba(122, 156, 197, .15); color: var(--text); }
.tile-art, .card-art { position: relative; aspect-ratio: 3 / 4; background: linear-gradient(160deg, var(--surface-3), var(--surface-2)); overflow: hidden; }
.tile-art img, .card-art img, .tile-art .img-empty, .card-art .img-empty { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s ease; }
.tile:hover .tile-art img, .card:hover .card-art img { transform: scale(1.04); }
.tile-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.tile-title { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { font-size: 12.5px; color: var(--faint); }
.card-name { padding: 10px 12px 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { padding: 2px 12px 0; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 12px 12px; margin-top: auto; }
.card > .card-name:last-child, .card > .card-sub:last-child { padding-bottom: 12px; }
.card > .btn-block { margin: 0 12px 12px; width: calc(100% - 24px); }
.card.is-missing .card-art img, .mini.is-missing img { filter: grayscale(1) brightness(.45); }
.card.is-missing .card-name { color: var(--faint); }
.card > .badge { position: absolute; top: 10px; right: 10px; }
.card-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.card-badges:empty { display: none; }
.card-badges.static { position: static; margin: 12px 0; }
.price { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--accent-hi); font-size: 14px; }
.price small { font-weight: 500; color: var(--faint); font-size: 11.5px; }
.coin { width: 18px; height: 18px; object-fit: contain; display: inline-block; vertical-align: -3px; flex-shrink: 0; }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(10, 11, 16, .8); border: 1px solid var(--line-2); color: var(--text); backdrop-filter: blur(6px); }
.badge-good { color: var(--good); border-color: rgba(108, 212, 160, .35); }
.badge-warn { color: var(--warn); border-color: rgba(240, 192, 104, .35); }

.img-empty { display: block; width: 100%; height: 100%; background: linear-gradient(160deg, var(--surface-3), var(--surface-2)); }
img.broken { opacity: 0; }

/* ---------- Home panels ---------- */

.mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mini { display: flex; flex-direction: column; gap: 6px; color: var(--text); min-width: 0; }
.mini img, .mini .img-empty, .mini.skeleton .tile-art { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; object-position: top; border-radius: 10px; background: var(--surface-2); }
.mini span { font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini.skeleton .tile-body { display: none; }
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin: 18px 0 14px; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); border-radius: inherit; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.progress-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 4px; }
.progress-card.muted { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.progress-card .progress { margin: 10px 0 0; }

.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.board-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.board-row:nth-child(odd) { background: rgba(255, 255, 255, .02); }
.board-rank { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--dim); }
.board-row.top .board-rank { background: var(--accent-soft); color: var(--accent-hi); }
.board-row:first-child .board-rank { background: var(--warn-soft); color: var(--warn); }
.board-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-val { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.board-val small { color: var(--faint); font-weight: 500; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { padding: 26px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.step-n { font-family: var(--display); font-size: 15px; color: var(--accent); font-weight: 600; }
.step h3 { font-family: var(--display); font-size: 24px; font-weight: 600; margin: 8px 0 6px; }
.step p { color: var(--dim); font-size: 14.5px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.cta {
  display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: clamp(28px, 5vw, 48px); border-radius: 24px;
  background:
    radial-gradient(600px 240px at 90% 0%, rgba(169, 194, 230, .18), transparent 70%),
    linear-gradient(135deg, #16203a, #10131d 70%);
  border: 1px solid rgba(169, 194, 230, .2);
}
.cta h2 { font-size: clamp(26px, 3.5vw, 36px); }
.cta p { color: var(--dim); margin-top: 10px; max-width: 52ch; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Loading & empty states ---------- */

.skeleton { pointer-events: none; cursor: default; }
.skeleton .tile-art, .skeleton span, .row.skeleton span, .skeleton-block {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton .tile-body span { display: block; height: 10px; border-radius: 6px; }
.skeleton .tile-body span + span { width: 50%; margin-top: 6px; }
.row.skeleton { padding: 10px; }
.row.skeleton span { display: block; height: 14px; border-radius: 6px; }
.skeleton-block { height: 260px; border-radius: var(--radius); }
.skeleton-block.short { height: 180px; }
.variant.skeleton .tile-art { aspect-ratio: 3 / 4; border-radius: 12px; }
.variant.skeleton .tile-body { display: none; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.empty { grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: var(--dim); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty-action { margin-top: 16px; }
.error-box { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; background: var(--bad-soft); border: 1px solid rgba(240, 138, 138, .3); border-radius: var(--radius-sm); color: var(--bad); font-size: 14px; }

/* ---------- Modal ---------- */

.modal {
  width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 48px);
  padding: 22px; border: 1px solid var(--line-2); border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9);
  overflow: auto;
}
.modal.modal-wide { width: min(760px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(4, 5, 9, .72); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .2s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-head h3 { font-family: var(--display); font-size: 22px; font-weight: 600; overflow-wrap: anywhere; }

.item-detail { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.item-art { aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.item-art img, .item-art .img-empty { width: 100%; height: 100%; object-fit: cover; }
.item-info { display: flex; flex-direction: column; gap: 10px; }
.item-info .seg { align-self: flex-start; }
.kv { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 6px 24px; margin: 4px 0; }
.kv div { display: flex; flex-direction: column; gap: 2px; }
.kv dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; }
@media (max-width: 600px) { .item-detail { grid-template-columns: 1fr; } .item-art { max-width: 220px; } }

.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 12px; }
.variant { margin: 0; }
.variant img { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
.variant figcaption { font-size: 12px; color: var(--dim); margin-top: 6px; }

/* ---------- Profile ---------- */

.profile {
  --profile-bg: var(--surface);
  background:
    radial-gradient(500px 200px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--profile-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 24px; padding: clamp(20px, 4vw, 32px); margin-bottom: 20px;
}
.profile-head { display: flex; gap: 20px; align-items: center; }
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.profile-avatar.img-empty { width: 96px; height: 96px; border-radius: 50%; }
.profile-id { min-width: 0; }
.profile-id h1 { overflow-wrap: anywhere; }
.profile-tags { display: flex; gap: 12px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.rank { display: inline-flex; height: 26px; align-items: center; padding: 0 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); font-size: 12.5px; font-weight: 700; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.bio { margin-top: 12px; color: var(--dim); max-width: 60ch; overflow-wrap: anywhere; }
.profile-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; margin-top: 28px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 0; }
.stats div { display: flex; flex-direction: column-reverse; padding: 14px 16px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 12px; }
.stats dt { font-size: 12px; color: var(--faint); font-weight: 600; }
.stats dd { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 600; }
.showcase { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 14px; }
.showcase-art { aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.showcase-art img, .showcase-art .img-empty { width: 100%; height: 100%; object-fit: cover; }
.showcase-name { font-weight: 700; font-size: 16px; }
@media (max-width: 760px) {
  .profile-main { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .profile-avatar { width: 76px; height: 76px; }
}
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: 1fr; } }
.wallet { display: flex; flex-direction: column; gap: 6px; }
.wallet-row { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .02); }
.wallet-row .coin { width: 22px; height: 22px; }
.wallet-row span { text-transform: capitalize; color: var(--dim); }
.wallet-row strong { font-variant-numeric: tabular-nums; }
.big-num { font-family: var(--display); font-size: 36px; font-weight: 600; }
.big-num .muted { font-size: 22px; }

/* ---------- Suggestions / admin ---------- */

.suggest-list { display: flex; flex-direction: column; gap: 2px; max-height: 640px; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.suggest-row { padding: 12px 10px; border-bottom: 1px solid var(--line); }
.suggest-row:last-child { border-bottom: 0; }
.suggest-title { font-weight: 600; overflow-wrap: anywhere; }
.suggest-note { color: var(--dim); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.incident { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
#incidents { margin-bottom: 14px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 500; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast[data-kind="good"] { border-color: rgba(108, 212, 160, .45); }
.toast[data-kind="error"] { border-color: rgba(240, 138, 138, .5); color: #ffd6d6; }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); background: var(--bg-2); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 36px var(--gutter) max(36px, env(safe-area-inset-bottom)); display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.footer-tag { color: var(--faint); font-size: 13.5px; margin-top: 8px; max-width: 40ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-content: flex-start; max-width: 520px; }
.footer-links a { color: var(--dim); font-size: 14px; }
.footer-links a:hover { color: #fff; }

/* ---------- Legal pages ---------- */

.legal { max-width: 720px; line-height: 1.7; }
.legal h1 { margin-bottom: 4px; }
.legal .updated { color: var(--faint); font-size: 13px; margin-bottom: 28px; }
.legal h2 { font-family: var(--font); font-size: 18px; font-weight: 700; margin: 32px 0 10px; }
.legal p, .legal li { color: var(--dim); font-size: 15px; }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 20px; margin: 8px 0; }
.legal b { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Admin card tools ---------- */

.admin-grid-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); margin-bottom: 20px; }
@media (max-width: 420px) { .admin-grid, .admin-grid-2 { grid-template-columns: 1fr; } }
label.inline { display: flex; flex-direction: column; gap: 6px; flex: 1 1 140px; margin: 0; }
label.inline select { width: 100%; }
.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow: auto; }
.pick-list:empty { display: none; }
.pick { display: flex; gap: 10px; align-items: center; width: 100%; padding: 6px; border-radius: 10px; border: 1px solid transparent; background: var(--bg-2); text-align: left; cursor: pointer; }
.pick:hover { border-color: var(--line-2); background: var(--surface-2); }
.pick img, .pick .img-empty { width: 34px; height: 46px; object-fit: cover; border-radius: 5px; flex-shrink: 0; }
.pick span, .own-main { display: flex; flex-direction: column; min-width: 0; }
.pick strong, .own-main strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick small, .own-main small { font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick.is-picked { border-color: var(--accent); background: var(--accent-soft); cursor: default; }
.remove-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 18px 0 10px; }
.own-list { display: flex; flex-direction: column; margin-top: 10px; max-height: 460px; overflow: auto; }
.own-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.own-row .own-main { flex: 1; }
.btn-danger:hover:not(:disabled) { background: var(--bad-soft); border-color: rgba(240, 138, 138, .4); color: var(--bad); }
@media (max-width: 960px) { .nav.nav-static { display: flex; position: static; background: none; border: 0; padding: 0; margin-left: auto; } }

/* ---------- Profile page (public + own) ---------- */

.pp { --profile-bg: var(--surface); }
.pp-skeleton { height: 420px; border-radius: 24px; }
.pp-hero {
  position: relative; border-radius: 24px; overflow: hidden;
  background: var(--profile-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: 0 clamp(18px, 4vw, 32px) clamp(20px, 4vw, 28px);
}
.pp-banner {
  position: relative; height: clamp(140px, 22vw, 220px); margin: 0 calc(-1 * clamp(18px, 4vw, 32px));
  background:
    radial-gradient(600px 220px at 20% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, var(--profile-bg)), var(--profile-bg));
}
.pp-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.pp-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, var(--profile-bg)); }
.pp-id { position: relative; display: flex; align-items: flex-end; gap: 18px; margin-top: -56px; flex-wrap: wrap; }
.pp-avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--surface-3); box-shadow: 0 0 0 4px var(--profile-bg), 0 0 0 6px var(--accent); }
.pp-avatar.img-empty { width: 112px; height: 112px; border-radius: 50%; }
.pp-names { flex: 1; min-width: 200px; padding-bottom: 6px; }
.pp-names h1 { overflow-wrap: anywhere; }
.pp-tags { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.pp-banner-src { font-size: 12.5px; color: var(--dim); }
.pp-actions { display: flex; gap: 8px; padding-bottom: 8px; }
.pp-bio { margin-top: 16px; color: var(--text); max-width: 62ch; overflow-wrap: anywhere; font-size: 15.5px; }
.pp-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 22px 0 0; }
.pp-stats div { display: flex; flex-direction: column-reverse; padding: 12px 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.pp-stats dt { font-size: 11.5px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.pp-stats dd { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .pp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .pp-avatar, .pp-avatar.img-empty { width: 88px; height: 88px; }
  .pp-id { margin-top: -44px; }
  .pp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pp-section { margin-top: 40px; }
.pp .rank { color: var(--accent); }

.showcase-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.showcase-row.is-single { grid-template-columns: minmax(0, 260px); }
@media (max-width: 520px) { .showcase-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.framed { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; min-width: 0; }
.framed-art { display: block; aspect-ratio: 330 / 450; border-radius: 10px; overflow: hidden; background: var(--surface-2); transition: transform .25s ease, box-shadow .25s ease; }
.framed-art img { width: 100%; height: 100%; object-fit: contain; }
.framed:hover .framed-art { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .9), 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.framed-name { font-weight: 600; font-size: 14px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.framed-sub { font-size: 12.5px; color: var(--faint); }
.framed-big { aspect-ratio: 330 / 450; background: none; }
.framed-big img { object-fit: contain; }

.series-progress { display: flex; flex-direction: column; gap: 6px; }
.sp-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px; border-radius: 10px; color: var(--text); }
.sp-row:hover { background: var(--surface-2); color: var(--text); }
.sp-cover { width: 40px; height: 52px; object-fit: cover; border-radius: 6px; background: var(--surface-3); }
.sp-main { display: flex; flex-direction: column; min-width: 0; gap: 6px; }
.sp-main strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-main .progress { margin: 0; height: 5px; }
.sp-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-num small { color: var(--faint); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; max-height: 260px; overflow: auto; }
.chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); font-size: 13px; font-weight: 500; }
.chip:hover { color: #fff; border-color: var(--accent); }
.lock-icon { display: inline-block; width: 12px; height: 10px; margin-right: 8px; border: 2px solid currentColor; border-radius: 2px; position: relative; top: 1px; }
.lock-icon::before { content: ""; position: absolute; left: 1px; top: -8px; width: 6px; height: 6px; border: 2px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; }
.card.is-picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.card.is-picked::after { content: "Pinned"; position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; }

/* Editor */
.editor { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line-2); border-radius: 20px; padding: clamp(18px, 3vw, 26px); }
.editor-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.wallet-inline { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.wallet-inline span { display: inline-flex; align-items: center; gap: 6px; }
.editor-tabs { margin-bottom: 22px; max-width: 100%; overflow-x: auto; }
.editor-body > .muted { margin-bottom: 16px; max-width: 70ch; }
.pin-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .pin-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pin { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pin img, .pin .img-empty { aspect-ratio: 330 / 450; width: 100%; object-fit: contain; border-radius: 8px; background: var(--surface-2); }
.pin-name { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-tools { display: flex; justify-content: center; gap: 4px; }
.pin-empty { aspect-ratio: 330 / 450; align-items: center; justify-content: center; border: 1px dashed var(--line-2); border-radius: 8px; color: var(--faint); font-size: 12px; }
.icon-btn.sm { width: 28px; height: 28px; font-size: 16px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.look-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 18px; }
@media (max-width: 760px) { .look-grid { grid-template-columns: 1fr; } }
.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.swatch { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--b); color: var(--text); font-size: 13px; cursor: pointer; }
.swatch span { width: 16px; height: 16px; border-radius: 50%; background: var(--a); box-shadow: 0 0 10px var(--a); flex-shrink: 0; }
.swatch:hover { border-color: var(--a); }
.banner-current .pick { cursor: default; }
.banner-current .pick .btn { margin-left: auto; }
.toggles { display: flex; flex-direction: column; gap: 4px; max-width: 640px; }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, .02); border: 1px solid var(--line); cursor: pointer; }
.toggle span { display: flex; flex-direction: column; gap: 2px; }
.toggle small { color: var(--dim); font-size: 13px; }
.toggle input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; flex-shrink: 0; padding: 0; transition: background .2s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--dim); transition: transform .2s, background .2s; }
.toggle input:checked { background: var(--accent); border-color: var(--accent); }
.toggle input:checked::after { transform: translateX(18px); background: var(--accent-ink); }

/* People (search results, leaderboard links) */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); min-width: 0; }
.person:hover { border-color: var(--line-2); color: #fff; }
.person .avatar { width: 40px; height: 40px; }
.person span { display: flex; flex-direction: column; min-width: 0; }
.person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person small { color: var(--faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.board-name { color: var(--text); }
a.board-name:hover { color: var(--accent-hi); text-decoration: underline; }

/* Banner picker */
.banner-options { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow: auto; }
.banner-row { display: flex; flex-direction: column; gap: 6px; }
.banner-row strong { font-size: 13.5px; }
.banner-choices { display: flex; gap: 8px; }
.banner-choice { display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; color: var(--dim); font-size: 12px; width: 76px; }
.banner-choice.wide { width: 220px; }
.banner-choice img, .banner-choice .img-empty { width: 100%; height: 64px; object-fit: cover; border-radius: 6px; }
.banner-choice:hover { border-color: var(--accent); color: var(--text); }
.banner-pick { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent-soft); margin-bottom: 8px; }
.banner-img img, .banner-img .img-empty { width: 100%; height: 56px; object-fit: cover; border-radius: 8px; display: block; }
.banner-pick span { display: flex; flex-direction: column; min-width: 0; }
.banner-pick small { color: var(--dim); font-size: 12px; }
@media (max-width: 520px) { .banner-pick { grid-template-columns: 1fr; } .banner-choice.wide { width: 100%; } .banner-choices { flex-wrap: wrap; } }


/* Admin: series banners + cropper */
.admin-banners { margin-bottom: 20px; }
.bn-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.bn-row { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .02); border: 1px solid var(--line); }
.bn-img { aspect-ratio: 1900 / 400; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.bn-img img, .bn-img .img-empty { width: 100%; height: 100%; object-fit: cover; }
.bn-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bn-meta small { color: var(--dim); font-size: 12.5px; }
.bn-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { .bn-row { grid-template-columns: 1fr; } .bn-actions { justify-content: flex-start; } }
.bn-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1900 / 400; min-height: 110px; border: 2px dashed var(--line-2); border-radius: 12px; cursor: pointer; color: var(--dim); text-align: center; padding: 12px; }
.bn-drop:hover { border-color: var(--accent); color: var(--text); }
.bn-drop span { font-weight: 600; }
.bn-drop small { font-size: 12.5px; color: var(--faint); }
.bn-frame { position: relative; aspect-ratio: 1900 / 400; overflow: hidden; border-radius: 12px; background: var(--bg-2); cursor: grab; touch-action: none; user-select: none; box-shadow: 0 0 0 2px var(--accent); }
.bn-frame:active { cursor: grabbing; }
.bn-frame img { position: absolute; top: 0; left: 0; max-width: none; pointer-events: none; transform-origin: 0 0; }
.bn-phone { position: absolute; top: 0; bottom: 0; left: 50%; width: var(--slice); transform: translateX(-50%); border-left: 2px dashed rgba(255, 255, 255, .7); border-right: 2px dashed rgba(255, 255, 255, .7); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); pointer-events: none; }
.bn-phone span { position: absolute; top: 6px; left: 8px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000; }
.bn-frame.no-guide .bn-phone { display: none; }
.bn-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 12px 0 4px; }
.bn-controls label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); }
.bn-controls input[type="range"] { width: 180px; height: auto; padding: 0; accent-color: var(--accent); border: 0; background: none; box-shadow: none; }

/* ---------- Giveaway calendar ---------- */

.giveaway-page-head { align-items: flex-end; }
.giveaway-calendar { padding: clamp(14px, 2vw, 24px); }
.giveaway-calendar-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.giveaway-calendar-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.giveaway-calendar-nav h2 { min-width: 190px; margin-left: 8px; font-size: 22px; }
.giveaway-scale button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.giveaway-weekdays, .giveaway-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.giveaway-weekdays > div { padding: 8px 10px; border-bottom: 1px solid var(--line-2); color: var(--faint); font-size: 11px; font-weight: 700; text-align: right; text-transform: uppercase; }
.giveaway-month-grid { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.giveaway-day { min-width: 0; min-height: 112px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(18, 21, 30, .64); }
.giveaway-day.is-outside { background: rgba(10, 11, 16, .55); }
.giveaway-day.is-today { box-shadow: inset 0 2px 0 var(--accent); }
.giveaway-day-number { display: flex; justify-content: flex-end; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.giveaway-day.is-today .giveaway-day-number { color: var(--accent-hi); font-weight: 700; }
.giveaway-day-events { display: grid; gap: 4px; margin-top: 5px; }
.giveaway-calendar-chip { min-width: 0; padding: 4px 6px; border-left: 2px solid var(--accent); border-radius: 4px; background: var(--accent-soft); line-height: 1.25; }
.giveaway-calendar-chip strong, .giveaway-calendar-chip span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.giveaway-calendar-chip strong { color: var(--text); font-size: 10px; }
.giveaway-calendar-chip span { margin-top: 2px; color: var(--dim); font-size: 9px; }
.giveaway-more { color: var(--accent-hi); font-size: 10px; }
.giveaway-week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.giveaway-week-day { min-width: 0; min-height: 150px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.giveaway-week-day h3 { margin-bottom: 10px; color: var(--dim); font-size: 12px; }
.giveaway-list { display: grid; gap: 10px; max-width: 820px; }
.giveaway-event { display: flex; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.giveaway-event-date { flex: 0 0 108px; color: var(--accent-hi); font-size: 13px; font-weight: 700; }
.giveaway-event-main { min-width: 0; }
.giveaway-event-main h3 { overflow-wrap: anywhere; }
.giveaway-reward { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 6px; color: var(--text); font-weight: 600; }
.giveaway-reward span { padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-hi); font-size: 11px; text-transform: uppercase; }
.giveaway-event-main .muted { margin-top: 6px; }
.giveaway-rule { margin-top: 7px; color: var(--dim); font-size: 12px; }
.giveaway-admin { margin: 0 0 22px; }
.giveaway-admin-layout { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr); gap: 26px; align-items: start; }
.giveaway-form { padding-right: 20px; border-right: 1px solid var(--line); }
.giveaway-form h4, .giveaway-admin-list-head h4 { margin: 0; font-size: 15px; }
.giveaway-date-suggest { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto; gap: 8px; align-items: end; }
.giveaway-date-suggest label { display: grid; gap: 5px; color: var(--dim); font-size: 12px; }
.giveaway-date-suggest .btn { white-space: nowrap; }
.giveaway-admin-events { min-width: 0; }
.giveaway-admin-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.giveaway-admin-event { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.giveaway-admin-event > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.giveaway-admin-event strong { overflow-wrap: anywhere; }
.giveaway-admin-event-actions { display: flex; flex: 0 0 auto; gap: 6px; }
.giveaway-admin-event .btn { white-space: nowrap; }

@media (max-width: 760px) {
  .giveaway-admin-layout { grid-template-columns: 1fr; }
  .giveaway-form { padding-right: 0; padding-bottom: 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .giveaway-week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .giveaway-week-day:last-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .giveaway-day { min-height: 72px; padding: 4px; }
  .giveaway-weekdays > div { padding: 6px 2px; text-align: center; }
  .giveaway-calendar-chip { padding: 3px; }
  .giveaway-calendar-chip strong { font-size: 9px; }
  .giveaway-calendar-chip span { display: none; }
  .giveaway-event { flex-direction: column; gap: 6px; }
  .giveaway-event-date { flex-basis: auto; }
  .giveaway-date-suggest { grid-template-columns: 1fr 1fr; }
  .giveaway-date-suggest .btn { grid-column: 1 / -1; justify-self: start; }
  .giveaway-admin-event { align-items: flex-start; flex-direction: column; }
}


/* ---------- Rules page ---------- */

.legal.rules { max-width: 820px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.rules .rules-intro { font-size: 16.5px; color: var(--text); margin-bottom: 8px; }
.rules h2 { font-family: var(--display); font-size: 26px; font-weight: 600; margin: 0 0 4px; }
.rules > h2 { margin-top: 32px; }
.rules .eyebrow { margin-bottom: 4px; }
.rules-toc { margin: 32px 0 8px; padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.rules-toc ol { list-style: none; padding: 0; margin: 6px 0 0; columns: 2; column-gap: 24px; }
.rules-toc li { break-inside: avoid; }
.rules-toc a { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; color: var(--text); }
.rules-toc a:hover { color: var(--accent-hi); }
.toc-num { width: 34px; flex-shrink: 0; text-align: right; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--accent); }
@media (max-width: 560px) { .rules-toc ol { columns: 1; } }
.rule-chapter { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.rule-sub { color: var(--dim); font-style: italic; margin: 2px 0 16px; }
.rule-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.rule-list li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-radius: 10px; scroll-margin-top: 90px; }
.rule-list li:target { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.rule-list li p { margin: 0; color: var(--text); }
.rule-num { font-weight: 700; color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.to-top { display: inline-block; margin-top: 14px; font-size: 13.5px; color: var(--dim); }
.spoiler { background: var(--surface-3); color: transparent; border-radius: 4px; padding: 0 4px; cursor: pointer; transition: color .15s; }
.spoiler:hover, .spoiler:focus { color: var(--text); outline: none; }
.tiers { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.tier { padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.tier h3 { font-family: var(--display); font-size: 21px; font-weight: 600; }
.tier h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 16px 0 8px; }
.tier .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.rule-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-hi); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rule-chip:hover { background: var(--accent); color: var(--accent-ink); }
.ladder { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.ladder li::marker { color: var(--accent); font-weight: 700; }
.tier-max { margin: 0; font-weight: 600; color: var(--text); }
.tier-notes { margin: 12px 0 0; padding-left: 18px; }
.tier-notes li { color: var(--dim); font-size: 14px; }
.tier-zero { border-color: rgba(240, 138, 138, .45); background: linear-gradient(180deg, rgba(240, 138, 138, .08), var(--surface)); }
.tier-zero .eyebrow, .tier-zero h4 { color: var(--bad); }
.nav.nav-static a.active { color: #fff; background: var(--surface-2); }
@media (max-width: 560px) { .nav.nav-static { gap: 0; } .nav.nav-static a { padding: 8px 8px; font-size: 13px; } }


/* Admin: rules editor */
.rules-tabs { margin: 4px 0 16px; }
.rc-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.rc { border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .02); }
.rc > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.rc > summary::-webkit-details-marker { display: none; }
.rc[open] > summary { border-bottom: 1px solid var(--line); }
.rc-num { font-family: ui-monospace, Consolas, monospace; color: var(--accent); font-size: 13px; }
.rc-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rc-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rc-rules li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.rc-rnum { font-weight: 700; color: var(--accent-hi); padding-top: 10px; font-variant-numeric: tabular-nums; }
.rc-rules textarea { min-height: 58px; }
.rc-tools { display: flex; flex-direction: column; gap: 2px; }
.rc-chtools { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.rules-warn { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); border: 1px solid rgba(240, 192, 104, .35); color: var(--warn); font-size: 13.5px; }
.rules-warn p + p { margin-top: 4px; }
.rules-danger { margin-top: 16px; }
.rules-danger summary { cursor: pointer; color: var(--dim); font-size: 13.5px; }
.rules-danger p { margin: 8px 0; }
@media (max-width: 600px) { .rc-rules li { grid-template-columns: 1fr auto; } .rc-rnum { grid-column: 1 / -1; padding: 0; } }

#rulesEditor textarea { overflow: hidden; resize: none; }


/* ---------- Verify ---------- */
.verify { max-width: 640px; margin: 0 auto; padding: 12px 0 40px; }
.verify h1 { margin-top: 4px; }
.verify .lede { max-width: none; }
.verify-steps { list-style: none; counter-reset: step; padding: 0; margin: 28px 0; display: flex; flex-direction: column; gap: 10px; }
.verify-steps li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--dim); }
.verify-steps li::before { content: counter(step); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; }
.verify-steps li strong { color: var(--text); }
.verify-steps li span { font-size: 13px; }
.verify-steps li.is-current { border-color: var(--accent); background: var(--accent-soft); }
.verify-steps li.is-current::before { background: var(--accent); color: var(--accent-ink); }
.verify-steps li.is-done::before { content: "✓"; background: var(--good-soft); color: var(--good); }
.verify-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.verify-error { padding: 12px 14px; border-radius: 10px; background: var(--bad-soft); border: 1px solid rgba(240, 138, 138, .35); color: var(--bad); }
.verify-privacy { font-size: 13px; color: var(--faint); margin-top: 24px; }
.verify-done { text-align: center; padding: 20px 0 8px; }
.verify-check { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 700; background: var(--good-soft); color: var(--good); box-shadow: 0 0 0 6px rgba(108, 212, 160, .08); }
.verify-handle { margin-top: 24px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); }
.verify-handle-done { text-align: center; color: var(--dim); }
