/* ====================================================================
   UTY Unity HQ — Design System
   Near-black / midnight-blue surfaces · metallic-gold accent
   ==================================================================== */

:root {
  /* Surfaces */
  --bg-0:   #07090f;   /* page */
  --bg-1:   #0b0e17;   /* raised */
  --bg-2:   #111624;   /* card */
  --bg-3:   #19202f;   /* card hover / input */
  --bg-4:   #222b3d;
  --line:   rgba(201,162,74,.14);
  --line-2: rgba(255,255,255,.07);

  /* Brand */
  --gold:   #c9a24a;
  --gold-bright: #e7c66b;
  --gold-deep:   #9a7a33;
  --amber:  #d98a3d;
  --blue:   #4f83b3;
  --blue-bright: #6fa8d6;
  --red:    #c0453b;
  --green:  #4f9b7a;

  /* Text */
  --ink-0: #f4f1e9;   /* headings on dark */
  --ink-1: #d7dae2;
  --ink-2: #9aa4b2;
  --ink-3: #6b7482;

  /* Effects */
  --radius:   14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow:   0 18px 48px -24px rgba(0,0,0,.8);
  --shadow-gold: 0 12px 34px -16px rgba(201,162,74,.4);
  --grad-gold: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  --grad-surface: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  --ease: cubic-bezier(.2,.7,.3,1);

  --maxw: 1240px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Cinzel', 'Inter', serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--ink-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(79,131,179,.10), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(201,162,74,.07), transparent 55%);
  background-attachment: fixed;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto; }
}

h1,h2,h3,h4 { color: var(--ink-0); line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
h1,h2 { font-family: var(--display); letter-spacing: .5px; }
a { color: var(--blue-bright); text-decoration: none; transition: color .18s; }
a:hover { color: var(--gold-bright); }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
small { font-size: .82em; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; border-radius: 4px; }

.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; width: 100%; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 16px; top: 10px; z-index: 100; background: var(--gold); color: #000; padding: 8px 14px; border-radius: 8px; }
.muted { color: var(--ink-2); }
.tiny { font-size: .78rem; }
.center { text-align: center; }

/* ----------------------------- Buttons ----------------------------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px; border-radius: 10px;
  font-weight: 600; font-size: .95rem; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-sm { --h: 36px; padding: 0 14px; font-size: .86rem; }
.btn-lg { --h: 52px; padding: 0 28px; font-size: 1rem; }
.btn-gold { background: var(--grad-gold); color: #1a1407; box-shadow: var(--shadow-gold); }
.btn-gold:hover { color: #1a1407; box-shadow: 0 16px 40px -14px rgba(201,162,74,.6); transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,.04); color: var(--ink-0); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,.08); border-color: var(--gold); color: var(--ink-0); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink-1); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn-danger { background: rgba(192,69,59,.14); border-color: rgba(192,69,59,.4); color: #e58b82; }
.btn-danger:hover { background: rgba(192,69,59,.25); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ------------------------------ Header ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,10,16,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-emblem { filter: drop-shadow(0 2px 8px rgba(201,162,74,.4)); }
.brand-word { font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--ink-0); line-height: .9; display: flex; flex-direction: column; letter-spacing: 1px; }
.brand-word small { font-size: .5rem; letter-spacing: 5px; color: var(--gold); font-weight: 600; }
.main-nav { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.main-nav a {
  color: var(--ink-2); font-weight: 500; font-size: .92rem; padding: 8px 12px; border-radius: 8px;
  position: relative; transition: color .18s, background .18s;
}
.main-nav a:hover { color: var(--ink-0); background: rgba(255,255,255,.04); }
.main-nav a.active { color: var(--gold-bright); }
.main-nav a.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--grad-gold); border-radius: 2px; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--ink-1);
  cursor: pointer; position: relative; transition: background .18s, border-color .18s, color .18s;
}
.icon-btn:hover { background: rgba(255,255,255,.07); color: var(--gold-bright); border-color: var(--line); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--red); color: #fff; font-size: .62rem; font-weight: 700; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg-0);
}
.avatar-xs { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--grad-gold); color: #1a1407; font-weight: 700; font-size: .8rem; }

/* User menu */
.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 5px 10px 5px 6px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { border-color: var(--line); }
.um-name { font-size: .88rem; font-weight: 600; color: var(--ink-0); }
.chev { width: 15px; height: 15px; fill: none; stroke: var(--ink-2); stroke-width: 2; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60;
}
.user-dropdown a, .user-dropdown button {
  display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 8px; color: var(--ink-1); font-size: .9rem; font-weight: 500;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: rgba(255,255,255,.05); color: var(--gold-bright); }
.user-dropdown .staff { color: var(--gold); }
.pill { background: var(--red); color: #fff; font-size: .68rem; padding: 1px 7px; border-radius: 9px; }

/* Mobile nav */
.mobile-toggle { display: none; }
.mobile-nav { display: none; flex-direction: column; padding: 8px 16px 16px; border-top: 1px solid var(--line); }
.mobile-nav a { padding: 12px 10px; color: var(--ink-1); font-weight: 500; border-radius: 8px; }
.mobile-nav a:hover { background: rgba(255,255,255,.05); }
.mobile-nav.open { display: flex; }

/* ------------------------------- Flash ------------------------------ */
.flash { margin: 14px 0 0; padding: 13px 16px; border-radius: 11px; font-size: .92rem; font-weight: 500; border: 1px solid; }
.flash-success { background: rgba(79,155,122,.12); border-color: rgba(79,155,122,.4); color: #7fd0ab; }
.flash-error   { background: rgba(192,69,59,.12); border-color: rgba(192,69,59,.4); color: #e58b82; }
.flash-info    { background: rgba(79,131,179,.12); border-color: rgba(79,131,179,.4); color: var(--blue-bright); }

/* ------------------------------- Cards ------------------------------ */
.card {
  background: var(--grad-surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.panel { background: var(--grad-surface); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.panel-head h3 { margin: 0; font-size: 1.02rem; font-family: var(--display); }
.panel-head .link { font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.panel-head .link:hover { color: var(--gold-bright); }

/* Section titles */
.section { padding: 44px 0; }
.section-title { font-family: var(--display); font-size: 1.5rem; margin-bottom: 4px; }
.section-sub { color: var(--ink-2); margin-bottom: 24px; }

/* Badges / chips */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-1); background: rgba(255,255,255,.03); }
.role-badge { font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .5px; }
.rarity-common    { color: #9aa4b2; border-color: rgba(154,164,178,.4); }
.rarity-uncommon  { color: var(--green); border-color: rgba(79,155,122,.45); }
.rarity-rare      { color: var(--blue-bright); border-color: rgba(79,131,179,.5); }
.rarity-epic      { color: #b483d9; border-color: rgba(142,111,179,.5); }
.rarity-legendary { color: var(--gold-bright); border-color: rgba(201,162,74,.6); background: rgba(201,162,74,.08); }

/* ------------------------------- Hero ------------------------------- */
.hero { position: relative; margin-top: 20px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: #0a0d14 url('../img/hero-bg.jpg') center 30% / cover no-repeat;
}
.hero-bg::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(5,7,12,.97) 0%, rgba(6,8,14,.9) 32%, rgba(7,9,15,.5) 62%, rgba(7,9,15,.72) 100%),
    linear-gradient(0deg, rgba(5,7,12,.95) 2%, transparent 50%),
    radial-gradient(120% 100% at 100% 0%, rgba(79,131,179,.18), transparent 55%);
}
/* subtle gold vignette to tie the art into the brand */
.hero-bg::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 160px 40px rgba(0,0,0,.55);
  background: radial-gradient(80% 60% at 18% 42%, rgba(201,162,74,.08), transparent 60%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.4fr .9fr; gap: 28px; align-items: center; padding: 56px 44px; min-height: 420px; }
.hero-kicker { font-size: .8rem; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 14px; }
.hero-title { font-family: var(--display); font-size: clamp(3rem, 7vw, 5.2rem); line-height: .92; margin: 0; color: var(--ink-0); text-shadow: 0 4px 30px rgba(0,0,0,.6); }
.hero-title .u { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-title .unity { display: block; font-size: .42em; letter-spacing: 14px; color: var(--ink-1); font-weight: 500; margin-top: 6px; }
.hero-tag { font-size: 1.05rem; color: var(--gold-bright); font-weight: 600; margin: 10px 0 18px; }
.hero-desc { color: var(--ink-1); max-width: 42ch; margin-bottom: 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero stat card */
.hero-card { background: rgba(11,14,23,.72); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.hero-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hero-crest { width: 46px; height: 46px; }
.hero-card-top strong { font-family: var(--display); font-size: 1.4rem; color: var(--ink-0); }
.hero-stat { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line-2); }
.hero-stat:first-of-type { border-top: none; }
.hero-stat .k { color: var(--ink-2); font-size: .82rem; }
.hero-stat .v { color: var(--gold-bright); font-weight: 700; font-size: 1.05rem; }
.hero-card-foot { margin-top: 16px; text-align: center; font-size: .78rem; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); border-top: 1px solid var(--line-2); padding-top: 14px; }

/* ----------------------------- Stat row ----------------------------- */
.stat-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-top: 26px; }
.stat-tile { background: var(--grad-surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px; text-align: center; transition: transform .2s var(--ease), border-color .2s; }
.stat-tile:hover { transform: translateY(-3px); border-color: var(--line); }
.stat-tile .num { font-family: var(--display); font-size: 1.7rem; color: var(--gold-bright); font-weight: 700; }
.stat-tile .lbl { font-size: .74rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .6px; margin-top: 2px; }

/* --------------------------- Home layout ---------------------------- */
.home-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }

/* Forum list rows */
.thread-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; }
.thread-tabs a { font-size: .84rem; font-weight: 600; color: var(--ink-2); padding: 7px 13px; border-radius: 8px; }
.thread-tabs a.active, .thread-tabs a:hover { background: rgba(201,162,74,.12); color: var(--gold-bright); }
.thread-row { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 14px; align-items: center; padding: 15px 18px; border-top: 1px solid var(--line-2); transition: background .15s; }
.thread-row:hover { background: rgba(255,255,255,.02); }
.thread-ico { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(201,162,74,.1); color: var(--gold); border: 1px solid var(--line); }
.thread-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.thread-main .t { color: var(--ink-0); font-weight: 600; font-size: .98rem; display: inline-block; }
.thread-main .t:hover { color: var(--gold-bright); }
.thread-main .d { color: var(--ink-2); font-size: .84rem; margin-top: 2px; }
.thread-cat { font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.thread-meta { text-align: right; font-size: .78rem; color: var(--ink-2); min-width: 86px; }
.thread-meta b { color: var(--ink-0); display: block; font-size: .9rem; }
.thread-author { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.thread-author img, .thread-author .avatar-fallback { width: 30px; height: 30px; border-radius: 50%; }
.thread-author .n { font-size: .82rem; }
.thread-author .n b { display: block; color: var(--ink-0); font-size: .85rem; }

/* Sidebar */
.side-stack { display: flex; flex-direction: column; gap: 20px; }
.online-list, .event-list, .member-list { display: flex; flex-direction: column; }
.online-item { display: flex; align-items: center; gap: 11px; padding: 11px 18px; border-top: 1px solid var(--line-2); }
.online-item:first-child { border-top: none; }
.online-avatar { position: relative; }
.online-avatar img, .online-avatar .avatar-fallback { width: 34px; height: 34px; border-radius: 50%; }
.online-dot { position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg-2); }
.online-item .oi-name { font-weight: 600; color: var(--ink-0); font-size: .88rem; }
.online-item .oi-role { font-size: .74rem; }
.count-pill { font-size: .72rem; color: var(--green); font-weight: 700; }

.event-item { display: flex; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line-2); }
.event-item:first-child { border-top: none; }
.event-date { flex-shrink: 0; width: 46px; text-align: center; background: rgba(201,162,74,.1); border: 1px solid var(--line); border-radius: 10px; padding: 6px 0; }
.event-date .m { font-size: .64rem; text-transform: uppercase; color: var(--gold); font-weight: 700; letter-spacing: .5px; }
.event-date .d { font-size: 1.2rem; font-weight: 700; color: var(--ink-0); font-family: var(--display); line-height: 1; }
.event-info .et { font-weight: 600; color: var(--ink-0); font-size: .9rem; }
.event-info .ew { font-size: .78rem; color: var(--ink-2); margin-top: 2px; }

/* --------------------------- Feature band --------------------------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 16px; margin-top: 24px; }
.feature { padding: 22px; }
.feature .fi { width: 44px; height: 44px; border-radius: 12px; background: rgba(201,162,74,.12); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; color: var(--gold); border: 1px solid var(--line); }
.feature .fi svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.feature h4 { margin-bottom: 4px; }
.feature p { color: var(--ink-2); font-size: .88rem; margin: 0; }

/* ------------------------------- Forms ------------------------------ */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-1); margin-bottom: 7px; }
.field .hint { font-size: .78rem; color: var(--ink-3); margin-top: 6px; }
.input, .textarea, .select {
  width: 100%; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink-0); font: inherit; padding: 12px 14px; transition: border-color .18s, box-shadow .18s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,74,.15); }
.textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.input::placeholder { color: var(--ink-3); }
.code-input { font-family: 'Cinzel', serif; letter-spacing: 4px; text-align: center; font-size: 1.2rem; text-transform: uppercase; }

/* Auth pages */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 40px 16px; position: relative; }
.auth-card { width: 100%; max-width: 440px; position: relative; z-index: 1; }
.auth-card .card-pad { padding: 34px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .emblem { width: 64px; height: 64px; margin: 0 auto 14px; }
.auth-head h1 { font-size: 1.7rem; margin-bottom: 6px; }
.auth-head p { color: var(--ink-2); font-size: .92rem; margin: 0; }
.auth-foot { text-align: center; margin-top: 18px; font-size: .88rem; color: var(--ink-2); }

/* ----------------------------- Profile ------------------------------ */
.profile-cover { height: 240px; border-radius: var(--radius-lg); position: relative; overflow: hidden; border: 1px solid var(--line); margin-top: 20px;
  background: linear-gradient(120deg, #16202f, #0b1119), radial-gradient(70% 120% at 80% 0%, rgba(79,131,179,.3), transparent); }
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-head { display: flex; align-items: flex-end; gap: 22px; margin-top: -60px; padding: 0 24px; position: relative; z-index: 2; }
.profile-avatar { width: 128px; height: 128px; border-radius: 22px; border: 3px solid var(--bg-0); object-fit: cover; background: var(--grad-gold); box-shadow: var(--shadow); }
.profile-avatar.avatar-fallback { font-size: 3rem; }
.profile-id { flex: 1; padding-bottom: 8px; }
.profile-id h1 { font-size: 1.8rem; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.profile-id .sub { color: var(--ink-2); font-size: .92rem; }
.profile-actions { display: flex; gap: 10px; padding-bottom: 10px; }
.xp-bar { height: 10px; border-radius: 999px; background: var(--bg-3); overflow: hidden; margin: 10px 0 4px; border: 1px solid var(--line-2); }
.xp-fill { height: 100%; background: var(--grad-gold); border-radius: 999px; }
.profile-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin: 26px 0; }
.pstat { text-align: center; padding: 16px; }
.pstat .n { font-family: var(--display); font-size: 1.5rem; color: var(--gold-bright); font-weight: 700; }
.pstat .l { font-size: .74rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 12px 16px; color: var(--ink-2); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--gold-bright); border-color: var(--gold); }
.like-btn.liked { background: rgba(192,69,59,.16); border-color: rgba(192,69,59,.5); color: #e58b82; }

/* Achievement grid */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 14px; }
.ach { padding: 18px; display: flex; gap: 14px; align-items: flex-start; opacity: 1; transition: transform .2s; }
.ach.locked { opacity: .45; filter: grayscale(.5); }
.ach:hover { transform: translateY(-2px); }
.ach-ico { width: 46px; height: 46px; border-radius: 12px; background: rgba(201,162,74,.12); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--gold-bright); flex-shrink: 0; }
.ach-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ach h4 { font-size: .95rem; margin: 0 0 3px; }
.ach p { font-size: .8rem; color: var(--ink-2); margin: 0 0 6px; }
.ach-badges { width: 32px; height: 32px; }

/* ----------------------------- Members ------------------------------ */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 16px; }
.member-card { padding: 20px; text-align: center; transition: transform .2s var(--ease), border-color .2s; }
.member-card:hover { transform: translateY(-3px); border-color: var(--line); }
.member-card .mavatar { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 12px; object-fit: cover; background: var(--grad-gold); }
.member-card .mavatar.avatar-fallback { font-size: 1.7rem; }
.member-card h3 { font-size: 1.05rem; margin: 0 0 3px; }
.member-card .mg { color: var(--ink-2); font-size: .82rem; margin-bottom: 10px; }
.member-mini { display: flex; justify-content: center; gap: 16px; font-size: .78rem; color: var(--ink-2); }
.member-mini b { color: var(--ink-0); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.toolbar .select, .toolbar .input { width: auto; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { padding: 7px 14px; border-radius: 8px; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.seg a.active { background: rgba(201,162,74,.14); color: var(--gold-bright); }

/* ------------------------------ Thread ------------------------------ */
.breadcrumb { display: flex; gap: 8px; align-items: center; color: var(--ink-3); font-size: .84rem; margin: 20px 0 14px; flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-2); }
.breadcrumb a:hover { color: var(--gold-bright); }
.post { display: grid; grid-template-columns: 180px 1fr; gap: 0; border-top: 1px solid var(--line-2); }
.post:first-child { border-top: none; }
.post-author { padding: 22px 18px; text-align: center; border-right: 1px solid var(--line-2); background: rgba(0,0,0,.15); }
.post-author img, .post-author .avatar-fallback { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 10px; }
.post-author .pa-name { font-weight: 700; color: var(--ink-0); }
.post-author .pa-lvl { font-size: .76rem; color: var(--ink-2); margin-top: 6px; }
.post-body { padding: 22px; }
.post-body .pb-head { display: flex; justify-content: space-between; color: var(--ink-3); font-size: .8rem; margin-bottom: 12px; border-bottom: 1px solid var(--line-2); padding-bottom: 10px; }
.prose { color: var(--ink-1); }
.prose p { margin: 0 0 .8em; }
.prose h4 { margin: 1em 0 .4em; }
.prose code { background: var(--bg-3); padding: 2px 6px; border-radius: 5px; font-size: .88em; color: var(--gold-bright); }
.prose blockquote { border-left: 3px solid var(--gold); margin: .6em 0; padding: 4px 14px; color: var(--ink-2); background: rgba(255,255,255,.02); }
.prose ul { padding-left: 20px; }
.prose a { word-break: break-word; }
.mention { color: var(--gold-bright); font-weight: 600; }
.reply-box { margin-top: 20px; }

/* ------------------------------- Admin ------------------------------ */
.admin { display: grid; grid-template-columns: 234px 1fr; min-height: calc(100vh - 66px); }
.admin-side { background: var(--bg-1); border-right: 1px solid var(--line-2); padding: 20px 14px; }
.admin-side .as-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; border-bottom: 1px solid var(--line-2); margin-bottom: 14px; }
.admin-side .as-brand img { width: 30px; }
.admin-side .as-brand b { font-family: var(--display); color: var(--ink-0); }
.admin-nav a { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: .9rem; margin-bottom: 2px; }
.admin-nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.admin-nav a:hover { background: rgba(255,255,255,.04); color: var(--ink-0); }
.admin-nav a.active { background: rgba(201,162,74,.14); color: var(--gold-bright); }
.admin-main { padding: 28px; overflow-x: auto; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-head h1 { font-size: 1.5rem; margin: 0; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { padding: 18px; }
.kpi .kl { font-size: .78rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .5px; }
.kpi .kv { font-family: var(--display); font-size: 1.9rem; color: var(--ink-0); font-weight: 700; margin-top: 4px; }
.kpi .kd { font-size: .78rem; margin-top: 4px; color: var(--green); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line-2); }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
table.data th { text-align: left; padding: 12px 14px; background: var(--bg-1); color: var(--ink-2); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--line-2); }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink-1); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: rgba(255,255,255,.02); }
.status-tag { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; }
.st-active { color: var(--green); background: rgba(79,155,122,.14); }
.st-redeemed { color: var(--blue-bright); background: rgba(79,131,179,.14); }
.st-revoked, .st-banned { color: #e58b82; background: rgba(192,69,59,.14); }
.st-expired, .st-suspended { color: var(--amber); background: rgba(217,138,61,.14); }
.code-mono { font-family: 'Cinzel', monospace; letter-spacing: 1px; color: var(--gold-bright); }

/* Fresh codes box */
.fresh-codes { background: rgba(201,162,74,.08); border: 1px solid rgba(201,162,74,.4); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.fresh-codes h3 { font-size: 1rem; }
.fresh-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 10px; margin-top: 12px; }
.fresh-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg-0); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.fresh-item code { color: var(--gold-bright); font-family: 'Cinzel', monospace; letter-spacing: 1px; font-size: .9rem; }
.copy-btn { background: none; border: 1px solid var(--line); color: var(--ink-2); border-radius: 7px; padding: 4px 9px; font-size: .74rem; cursor: pointer; }
.copy-btn:hover { color: var(--gold-bright); border-color: var(--gold); }

/* Empty state */
.empty { text-align: center; padding: 50px 24px; color: var(--ink-2); }
.empty .ei { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.04); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; border: 1px solid var(--line-2); color: var(--ink-3); }
.empty .ei svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.empty h3 { color: var(--ink-1); }

/* Skeleton */
.skel { background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.pagination a, .pagination span { padding: 8px 13px; border-radius: 8px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: .86rem; font-weight: 600; }
.pagination a:hover { border-color: var(--gold); color: var(--gold-bright); }
.pagination .cur { background: rgba(201,162,74,.14); color: var(--gold-bright); border-color: var(--gold); }

/* Utility layout */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.flex { display: flex; } .items-center { align-items: center; } .gap { gap: 12px; }
.mt { margin-top: 20px; } .mb { margin-bottom: 20px; }
.narrow { max-width: 760px; margin: 0 auto; }

/* ============================ Responsive ============================ */
@media (max-width: 1000px) {
  .main-nav { display: none; }
  .mobile-toggle { display: inline-flex; }
  .um-name { display: none; }
  .home-grid { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; padding: 40px 26px; }
  .hero-card { max-width: 420px; }
  .stat-row { grid-template-columns: repeat(3,1fr); }
  .admin { grid-template-columns: 1fr; }
  .admin-side { border-right: none; border-bottom: 1px solid var(--line-2); }
  .admin-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-nav a { margin: 0; }
}
@media (max-width: 680px) {
  .header-inner { height: 58px; }
  .hero-title { font-size: clamp(2.4rem,12vw,3.4rem); }
  .stat-row { grid-template-columns: repeat(2,1fr); }
  .profile-stats { grid-template-columns: repeat(2,1fr); }
  .thread-row { grid-template-columns: 36px 1fr; }
  .thread-author, .thread-meta { display: none; }
  .post { grid-template-columns: 1fr; }
  .post-author { display: flex; align-items: center; gap: 12px; text-align: left; border-right: none; border-bottom: 1px solid var(--line-2); padding: 14px; }
  .post-author img, .post-author .avatar-fallback { width: 40px; height: 40px; margin: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .section { padding: 30px 0; }
}

/* ------------------------------- Footer ----------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 56px; background: linear-gradient(180deg, var(--bg-1), var(--bg-0)); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding: 52px 16px 34px; }
.footer-brand { display: flex; gap: 14px; align-items: flex-start; max-width: 320px; }
.footer-brand img { flex-shrink: 0; filter: drop-shadow(0 2px 8px rgba(201,162,74,.35)); }
.footer-brand strong { color: var(--ink-0); font-family: var(--display); display: block; letter-spacing: 1.5px; font-size: 1.05rem; }
.footer-brand p { color: var(--ink-2); font-size: .88rem; margin: 6px 0 0; line-height: 1.5; }
.site-footer nav { display: flex; flex-direction: column; align-items: flex-start; }
.site-footer nav h4 { color: var(--gold); font-size: .72rem; text-transform: uppercase; letter-spacing: 1.2px; margin: 0 0 14px; font-weight: 700; }
.site-footer nav a { display: block; color: var(--ink-2); font-size: .9rem; line-height: 1; padding: 7px 0; width: fit-content; transition: color .15s, padding-left .15s; }
.site-footer nav a:hover { color: var(--gold-bright); padding-left: 4px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  padding: 18px 16px; border-top: 1px solid var(--line-2); color: var(--ink-3); font-size: .82rem; }
.footer-bottom .footer-tag { color: var(--ink-3); letter-spacing: .3px; }
.footer-credit { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3);
  font-size: .82rem; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255,255,255,.02);
  transition: border-color .18s, background .18s; }
.footer-credit:hover { border-color: var(--gold); background: rgba(201,162,74,.06); }
.footer-credit img { width: 24px; height: 24px; border-radius: 50%; }
.footer-credit strong { color: var(--gold); font-weight: 700; }
.footer-credit:hover strong { color: var(--gold-bright); }
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; padding: 40px 16px 26px; }
  .footer-brand { grid-column: 1 / -1; max-width: none; }
  .footer-bottom { justify-content: center; text-align: center; }
  .footer-credit { margin: 4px auto 0; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ------------------------ Post images & reactions ------------------- */
.post-image { display:inline-block; margin:14px 0 4px; }
.post-image img { border-radius:10px; border:1px solid var(--line-2); max-width:100%; max-height:380px; width:auto; display:block; }
.reactions { display:flex; gap:6px; flex-wrap:wrap; margin-top:14px; align-items:center; }
.react-form { margin:0; }
.react-form button { display:inline-flex; align-items:center; gap:5px; background:var(--bg-3); border:1px solid var(--line-2);
  border-radius:999px; padding:5px 11px; font-size:1rem; line-height:1; cursor:pointer; color:var(--ink-1);
  transition:border-color .15s, background .15s, transform .1s; font-family:inherit; }
.react-form button:hover { border-color:var(--gold); transform:translateY(-1px); }
.react-form.active button { background:rgba(201,162,74,.16); border-color:var(--gold); }
.react-form .rc { font-size:.78rem; color:var(--ink-2); font-weight:700; }
.react-form.active .rc { color:var(--gold-bright); }
.react-chip { font-size:.86rem; background:var(--bg-3); border:1px solid var(--line-2); border-radius:999px; padding:4px 10px; color:var(--ink-2); }

/* ------------------------------ Staff chat -------------------------- */
.chat-stream { height:52vh; min-height:320px; overflow-y:auto; padding:18px; display:flex; flex-direction:column; gap:12px; }
.chat-empty { text-align:center; color:var(--ink-3); margin:auto; }
.chat-msg { display:flex; gap:10px; max-width:82%; }
.chat-msg.mine { flex-direction:row-reverse; align-self:flex-end; }
.chat-avatar img, .chat-avatar .avatar-fallback { width:34px; height:34px; border-radius:50%; object-fit:cover; }
.chat-bubble { background:var(--bg-3); border:1px solid var(--line-2); border-radius:12px; padding:9px 13px; }
.chat-msg.mine .chat-bubble { background:rgba(201,162,74,.12); border-color:var(--line); }
.chat-meta { display:flex; gap:8px; align-items:baseline; font-size:.78rem; margin-bottom:3px; }
.chat-meta b { color:var(--ink-0); font-size:.84rem; }
.chat-role { font-weight:700; font-size:.72rem; text-transform:uppercase; letter-spacing:.4px; }
.chat-time { color:var(--ink-3); margin-left:auto; white-space:nowrap; }
.chat-text { color:var(--ink-1); font-size:.92rem; line-height:1.45; word-break:break-word; }
.chat-input { display:flex; gap:10px; padding:14px; border-top:1px solid var(--line-2); }
.chat-input input { flex:1; background:var(--bg-3); border:1px solid var(--line-2); border-radius:10px; color:var(--ink-0); font:inherit; padding:11px 14px; }
.chat-input input:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,162,74,.15); }

/* Password requirements checklist */
.pw-rules { margin-top:9px; font-size:.82rem; color:var(--ink-2); }
.pw-rules p { margin:0 0 5px; font-weight:600; color:var(--ink-1); }
.pw-rules ul { margin:0; padding-left:18px; }
.pw-rules li { margin:2px 0; }

/* Authenticator QR */
.qr-box { display:flex; justify-content:center; margin:8px 0 18px; }
.qr-box svg { border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,.45); width:280px; height:280px; }
