/* AniList-inspired theme, loaded after styles.css.
   Same markup, new look: deep navy page, lighter slate panels, one bright
   blue accent, small radii, flat buttons, covers with the title underneath,
   and quiet uppercase-free section headings with a "view all" link on the
   right. Everything here is token or component overrides - the layout rules
   in styles.css still apply. */

:root {
  --bg: #0b1622;
  --bg-2: #0f1b2b;
  --surface: #151f2e;
  --surface-2: #1b2839;
  --surface-3: #243247;
  --line: rgba(159, 173, 189, 0.09);
  --line-2: rgba(159, 173, 189, 0.18);
  --text: #c9d5e3;
  --dim: #9fadbd;
  --faint: #6f8096;

  --accent: #3db4f2;
  --accent-hi: #5fc4f7;
  --accent-soft: rgba(61, 180, 242, 0.14);
  --accent-ink: #05121c;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 14px 30px -14px rgba(6, 13, 24, 0.85);
  --max: 1240px;

  --font: 'Overpass', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Overpass', 'Inter', system-ui, sans-serif;
}

body {
  background: var(--bg);
  background-attachment: scroll;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 { color: #edf1f5; letter-spacing: 0; }
h1 { font-family: var(--font); font-weight: 800; font-size: clamp(26px, 3.4vw, 34px); }
h2 { font-family: var(--font); font-weight: 700; font-size: 18px; }
h3 { font-size: 16px; }
a { color: var(--accent); }
a:hover { color: var(--accent-hi); }
code { background: var(--surface-3); color: var(--accent-hi); border-radius: 4px; }

/* Eyebrows were small blue shouty labels; AniList section titles are quiet. */
.eyebrow { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 700; color: var(--faint); }
.section { margin-top: 40px; }
.section-head { margin-bottom: 12px; align-items: center; }
.section-head h2 { font-size: 16px; font-weight: 700; color: var(--dim); }
.link-more { font-size: 13px; font-weight: 700; color: var(--faint); }
.link-more:hover { color: var(--accent); }

/* ---------- Buttons: rectangular, flat, solid blue ---------- */
.btn { border-radius: 4px; height: 38px; font-weight: 700; letter-spacing: 0; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: none; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); color: #fff; box-shadow: none; }
.btn-ghost { background: var(--surface-2); border-color: transparent; color: var(--dim); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: #fff; }
.btn-sm { height: 30px; }
.btn-lg { height: 46px; }
.is-busy::after { border-color: #fff transparent #fff transparent; }
.icon-btn { border-radius: 4px; }

.seg { border-radius: 4px; background: var(--surface); border-color: transparent; padding: 3px; }
.seg > * { border-radius: 3px; }
.seg > [aria-selected="true"] { background: var(--accent); color: #fff; box-shadow: none; }

/* ---------- Header: solid slate bar like AniList's ---------- */
.topbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; }
.topbar.scrolled { box-shadow: 0 2px 12px rgba(6, 13, 24, 0.5); }
.topbar-inner { height: 56px; }
.brand { font-family: var(--font); font-weight: 800; font-size: 21px; color: #edf1f5; }
.brand-mark { border-radius: 3px; background: var(--accent); box-shadow: none; width: 16px; height: 16px; }
.nav a { border-radius: 4px; font-weight: 700; font-size: 14px; color: var(--dim); padding: 8px 12px; }
.nav a:hover { background: transparent; color: var(--accent); }
.nav a.active { background: transparent; color: var(--accent); }
.search input { border-radius: 4px; background: var(--bg-2); border-color: transparent; height: 34px; }
.search input:focus { background: var(--bg); }
.user-chip { border-radius: 4px; background: transparent; border-color: transparent; }
.user-chip:hover { background: var(--surface-2); }
.avatar { border-radius: 4px; }
@media (max-width: 960px) {
  .nav, .search { background: var(--surface); }
  .menu-open .search { top: 56px; }
  .menu-open .nav { top: 118px; }
  .menu-btn { border-radius: 4px; background: transparent; border-color: transparent; }
}

main { padding-top: 28px; }

/* ---------- Panels & forms ---------- */
.panel { background: var(--surface); border: 0; border-radius: var(--radius); padding: 18px 20px; }
.panel-head h3 { font-size: 15px; color: var(--dim); }
input, select, textarea { background: var(--bg-2); border-color: transparent; border-radius: 4px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: none; }
.form label { color: var(--dim); }
.combo-list { border-radius: 6px; background: var(--surface-2); }
.chip { border-radius: 4px; }
.badge, .rank { border-radius: 3px; }
.progress { border-radius: 3px; }

/* ---------- Covers: art on top, title below, no card chrome ---------- */
.tile, .card { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.tile:hover, button.card:hover, a.card:hover { transform: none; border: 0; box-shadow: none; }
.tile-art, .card-art { border-radius: 4px; box-shadow: 0 6px 16px -8px rgba(6, 13, 24, 0.9); }
.tile:hover .tile-art img, .card:hover .card-art img { transform: scale(1.03); }
.tile-body { padding: 8px 2px 0; }
.tile-title { font-size: 13.5px; font-weight: 700; color: var(--dim); }
.tile:hover .tile-title { color: var(--accent); }
.tile-meta { color: var(--faint); }
.grid-series { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 18px; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 20px 16px; }

/* ---------- Home hero: a quiet banner instead of a marketing splash ---------- */
.hero-glow { display: none; }
.display { font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.01em; font-weight: 800; color: #edf1f5; }
.display em { background: none; color: var(--accent); -webkit-background-clip: border-box; background-clip: border-box; font-style: normal; }
.hero .lede, .lede { font-size: 16px; color: var(--dim); }

/* ---------- Profile: full-bleed banner, square-ish avatar, flat stat bar ---------- */
.pp-hero { border-radius: var(--radius); }
.pp-banner { border-radius: var(--radius) var(--radius) 0 0; }
.pp-avatar, .pp-avatar.img-empty { border-radius: 6px; box-shadow: none; width: 124px; height: 124px; }
.pp-id { margin-top: -64px; padding: 0 20px; }
.pp-names h1 { font-size: 24px; text-shadow: 0 2px 10px rgba(6, 13, 24, 0.7); }
.pp-bio { padding: 0 20px; color: var(--dim); }
.pp-stats { gap: 0; background: var(--surface); border-radius: var(--radius); margin-top: 18px; overflow: hidden; }
.pp-stats div { background: transparent; border: 0; border-radius: 0; border-right: 1px solid var(--line); }
.pp-stats div:last-child { border-right: 0; }
.pp-stats dd { font-family: var(--font); font-size: 18px; font-weight: 800; color: var(--accent); }
.pp-stats dt { text-transform: none; letter-spacing: 0; }
.showcase-row .framed, .framed { border-radius: 4px; }
.back-link { display: inline-block; margin-bottom: 14px; font-size: 14px; font-weight: 700; color: var(--faint); }
.back-link:hover { color: var(--accent); }

.staff-tag { border-radius: 3px; height: 22px; font-size: 11.5px; padding: 0 8px; }
.uuis-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
  border-radius: 3px; background: var(--surface-3); color: var(--dim); font-size: 11.5px; font-weight: 700;
}
.uuis-tag code { background: none; padding: 0; color: var(--accent-hi); letter-spacing: .06em; user-select: all; }

/* ---------- Editor on its own /settings page ---------- */
.settings { max-width: 860px; margin: 0 auto; }
.editor { background: var(--surface); border-radius: var(--radius); padding: 20px; }
.editor-tabs { width: 100%; overflow-x: auto; }

/* ---------- Verify / claim handle ---------- */
.verify { max-width: 640px; margin: 24px auto 0; }
.verify-steps li { border-radius: var(--radius); background: var(--surface); }
.hint.is-error { color: var(--bad); }

/* ---------- Modals, toast, footer ---------- */
.modal { background: var(--surface); border-radius: var(--radius); border: 0; }
.toast { border-radius: 4px; }
.footer { background: var(--surface); border-top: 0; margin-top: 40px; }
.footer-links a:hover { color: var(--accent); }
.skeleton, .skeleton-block { border-radius: 4px; }

/* The empty-image placeholder is width:100%, which stretched a missing avatar
   across the whole user chip and hid the name. */
.avatar.img-empty { width: 28px; height: 28px; flex-shrink: 0; }

/* Keep a staff tag whole in the nav chip; the name is what gets trimmed. */
.user-chip { max-width: 280px; }
.user-chip .staff-tag { flex-shrink: 0; overflow: visible; }
.search { min-width: 150px; }

/* ---------- Admin: one section at a time ---------- */
.admin-tabs { margin-bottom: 20px; max-width: 100%; overflow-x: auto; }
[data-pane][hidden] { display: none !important; }
.giveaway-admin { margin: 0; }
.giveaway-admin-layout { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 28px; }
.giveaway-form { padding-right: 28px; }
.giveaway-form h4, .giveaway-admin-list-head h4 { color: var(--dim); }
.giveaway-more-fields { margin: 6px 0; }
.giveaway-more-fields summary { cursor: pointer; color: var(--faint); font-size: 13px; font-weight: 700; padding: 4px 0; }
.giveaway-more-fields summary:hover { color: var(--accent); }
.giveaway-more-fields[open] { display: grid; gap: 8px; }
.giveaway-admin-event { padding: 10px 0; }

/* ---------- Calendar: quiet month grid and a clean upcoming list ---------- */
.giveaway-calendar { padding: 18px 20px; }
.giveaway-calendar-toolbar { margin-bottom: 14px; }
.giveaway-calendar-nav h2 { font-size: 18px; min-width: 0; margin-left: 4px; display: inline-block; }
.giveaway-calendar-nav { gap: 6px; }
#giveawayNavButtons { display: inline-flex; gap: 6px; }
.giveaway-scale button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.giveaway-weekdays > div { border-bottom: 0; text-align: center; padding: 6px 0; }
.giveaway-month-grid { border: 0; gap: 4px; }
.giveaway-day { min-height: 84px; padding: 6px; border: 0; border-radius: 4px; background: var(--bg-2); display: flex; flex-direction: column; gap: 3px; }
.giveaway-day.is-outside { background: transparent; opacity: .45; }
.giveaway-day.is-today { box-shadow: inset 0 0 0 1px var(--accent); }
.giveaway-day-number { justify-content: flex-start; font-size: 12px; }
.giveaway-calendar-chip { padding: 2px 6px; border: 0; border-radius: 3px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.giveaway-more { color: var(--faint); font-size: 11px; font-weight: 700; }
.giveaway-list { max-width: none; gap: 8px; }
.giveaway-event { border: 0; background: var(--bg-2); border-radius: 6px; padding: 14px 16px; }
.giveaway-event-date { color: var(--accent); }
.giveaway-reward span { border-radius: 3px; text-transform: none; }
@media (max-width: 860px) {
  .giveaway-admin-layout { grid-template-columns: 1fr; }
  .giveaway-form { padding-right: 0; }
}
@media (max-width: 520px) {
  .giveaway-day { min-height: 56px; padding: 3px; }
  .giveaway-calendar-chip { font-size: 9px; padding: 1px 3px; }
}

/* ---------- Giveaways run by Tome ---------- */
.giveaway-tome-fields { display: grid; gap: 8px; padding: 12px; border-radius: 6px; background: var(--bg-2); }
.giveaway-requirements { border: 0; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; }
.giveaway-requirements legend { padding: 0; font-size: 13px; font-weight: 700; color: var(--dim); }
.giveaway-req-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 8px; align-items: center; }
.giveaway-status { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 3px; background: var(--surface-3); color: var(--dim); font-size: 11px; font-weight: 700; vertical-align: middle; }
.giveaway-status.is-open { background: var(--accent); color: #fff; }
.giveaway-status.is-drawn { background: var(--surface-3); color: var(--faint); }
.giveaway-rules { margin-top: 10px; padding: 10px 12px; border-radius: 6px; background: var(--surface); }
.giveaway-rules ul { margin: 4px 0 8px; padding-left: 18px; }
.giveaway-rules li { margin: 2px 0; }
.giveaway-rules p + p { margin-top: 4px; }
.giveaway-winners { margin-top: 8px; color: var(--text); }

/* Bold in the rulebook is the important part, so make it read that way. */
.rule-list strong, .rules ul strong, .tier-notes strong { color: #edf1f5; font-weight: 800; }

/* ---------- Profile picture shape: circle (default) or square ---------- */
.shape-circle { --avatar-radius: 50%; }
.shape-square { --avatar-radius: 10px; }
.user-chip.shape-square { --avatar-radius: 5px; }
.avatar, .avatar.img-empty { border-radius: var(--avatar-radius, 50%); }
.pp-avatar, .pp-avatar.img-empty { border-radius: var(--avatar-radius, 50%); }
.shape-pick { display: flex; gap: 12px; margin: 4px 0 14px; }
.shape-option { display: grid; justify-items: center; gap: 6px; padding: 10px 14px; border: 2px solid transparent; border-radius: 6px; background: var(--bg-2); color: var(--dim); font-weight: 700; font-size: 13px; cursor: pointer; }
.shape-option:hover { color: #fff; }
.shape-option[aria-checked="true"] { border-color: var(--accent); color: #fff; }
.avatar-preview, .avatar-preview.img-empty { width: 64px; height: 64px; object-fit: cover; border-radius: var(--avatar-radius, 50%); background: var(--surface-3); }

/* ---------- Patch notes page ---------- */
.patchnotes { display: grid; gap: 16px; max-width: 760px; }
.patchnote { background: var(--surface); border-radius: var(--radius); padding: 18px 22px; }
.patchnote header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.patchnote h2 { font-size: 18px; }
.patchnote time { color: var(--faint); font-size: 13px; font-weight: 700; }
.patch-latest { margin-left: 6px; padding: 1px 7px; border-radius: 3px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; vertical-align: middle; }
.patch-section { margin-top: 12px; }
.patch-section h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 4px; }
.patch-section.is-fixed h3 { color: var(--good); }
.patch-section.is-removed h3 { color: var(--bad); }
.patch-section ul { margin: 0; padding-left: 18px; color: var(--text); }
.patch-section li { margin: 3px 0; }
.nav a { white-space: nowrap; }

/* ---------- Giveaway form: rewards list and tidy two column fields ---------- */
.reward-list { display: grid; gap: 8px; }
.reward-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.reward-row select, .reward-row input { width: 100%; }
.giveaway-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.giveaway-tome-fields .field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--dim); margin: 0; }
.giveaway-tome-fields .field input, .giveaway-tome-fields .field select { width: 100%; }
@media (max-width: 520px) { .reward-row { grid-template-columns: 1fr auto; } .reward-row .reward-value { grid-column: 1 / -1; grid-row: 2; } .giveaway-two { grid-template-columns: 1fr; } }

/* ---------- Custom profiles (core/customprofile.py) ---------- */
/* A custom profile can restyle the whole page while it is open (the page gets
   body.tome-custom-page). These rules always win over it: the specificity is
   deliberately higher than anything the sanitizer lets through, and they keep
   the real header and the preview bar visible, in place and clickable. */
html body.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page { pointer-events: auto !important; overflow: visible !important; }
html body.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page .topbar { display: block !important; visibility: visible !important; opacity: 1 !important; position: sticky !important; top: 0 !important; z-index: 40 !important; transform: none !important; filter: none !important; clip-path: none !important; pointer-events: auto !important; }
html body.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page .topbar * { visibility: visible !important; pointer-events: auto !important; opacity: 1 !important; }
html body.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page .topbar-inner { display: flex !important; }
html body.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page.tome-custom-page main { display: block !important; visibility: visible !important; }
.preview-bar { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 6px; background: #151f2e; color: #c9d5e3; box-shadow: 0 10px 30px rgba(0,0,0,.6); font: 700 13px/1.2 Overpass, system-ui, sans-serif; }
html body .preview-bar, html body .preview-bar * { position: static; visibility: visible !important; display: flex !important; opacity: 1 !important; pointer-events: auto !important; }
html body .preview-bar { position: fixed !important; z-index: 60 !important; right: 16px !important; bottom: 16px !important; transform: none !important; filter: none !important; }
.pp-custom-html { overflow-wrap: anywhere; }
.pp-custom-html img { max-width: 100%; height: auto; }
.advanced { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.advanced h3 { font-size: 15px; color: var(--dim); }
.advanced textarea { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 12.5px; line-height: 1.45; min-height: 140px; }
.advanced-help summary { cursor: pointer; color: var(--faint); font-size: 13px; font-weight: 700; }
.hook-list code { display: inline-block; margin: 2px 2px; }
.req-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; }
.req-list .is-ok { color: var(--good); }
.req-list .is-no { color: var(--dim); }
.custom-preview { min-height: 120px; border-radius: 6px; background: var(--profile-bg, var(--bg-2)); padding: 12px; }
.hook-title { margin-top: 8px; font-weight: 700; color: var(--dim); }
.theme-picker { display: grid; gap: 6px; padding: 12px; border-radius: 6px; background: var(--bg-2); } .theme-picker .input-row select { flex: 1; }
