/* ==========================================================================
   ExiledHQ — The Exiled Gaming Community
   Identity: Exiled red (#b2000d) on deep black, street/garage energy.
   Type is set larger than typical (18px base) for readability.
   ========================================================================== */

:root {
  --red:        #b2000d;
  --red-bright: #e8111f;
  --red-dim:    #6e0009;
  --bg:         #0b0b0d;
  --bg-raise:   #131316;
  --bg-card:    #17171b;
  --line:       #2a2a30;
  --text:       #e9e7e4;
  --text-dim:   #a5a29c;
  --gold:       #d8a437;      /* difficulty stars */
  --purple:     #7c4dff;      /* shop/donation CTAs + progress (matches admin's gift accent) */
  --green:      #2ecc71;      /* earned rank state */
  --display:    "Chakra Petch", sans-serif;
  --body:       "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 18px; }                 /* larger base for readability */
html, body { height: 100%; }

/* Sticky footer: body's direct children (topbar/radiobar/goal-banner/main/
   footer) stack in a column, main grows to fill leftover space so the
   footer always sits at the bottom of the viewport, never floating mid-page. */
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.65;
}

main { flex: 1 0 auto; }

/* Site backdrop, dimmed for legibility — matches the original site */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: url('/assets/img/background.jpg') center center / cover no-repeat;
  background-attachment: fixed;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(rgba(8, 9, 12, .84), rgba(8, 9, 12, .93));
}

img { max-width: 100%; height: auto; }

a { color: var(--red-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--red-bright);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.15;
  letter-spacing: .01em;
  text-transform: uppercase;
}
h1 { font-size: 2.6rem; margin: .2em 0 .4em; }
h2 { font-size: 1.7rem; margin: 1.6em 0 .5em; }
h3 { font-size: 1.2rem; margin: 1.2em 0 .4em; }

.muted { color: var(--text-dim); }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--red); color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip:focus { left: 0; }

/* --- top bar ----------------------------------------------------------- */
/* .site-header wraps the topbar + radiobar as one sticky unit so the nav
   and the persistent player bar stay pinned together while scrolling --
   its real rendered height is measured in main.js into --header-h, which
   other sticky sidebars (.connect-box, .server-box) offset below. */
.site-header { position: sticky; top: 0; z-index: 50; }
.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .7rem 1.2rem;
  background: #000;
  border-bottom: 3px solid var(--red);
}
.brand {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--display); font-weight: 700; font-size: 1.25rem;
  color: #fff; letter-spacing: .06em;
}
.brand:hover { text-decoration: none; color: var(--red-bright); }

.nav { display: flex; align-items: center; gap: 1.05rem; flex-wrap: wrap; margin-left: auto; }
.nav > a:not(.btn), .dropdown > a:not(.btn) {
  color: var(--text); font-weight: 500; font-size: .95rem; white-space: nowrap;
}
.nav > a:not(.btn):hover, .dropdown > a:not(.btn):hover { color: var(--red-bright); text-decoration: none; }

.dropdown { position: relative; }
.dropdown .menu {
  display: none; position: absolute; left: 0; top: 100%;
  min-width: 240px; background: var(--bg-raise);
  border: 1px solid var(--line); border-top: 2px solid var(--red);
  padding: .4rem 0; z-index: 60;
}
.dropdown:hover .menu, .dropdown:focus-within .menu { display: block; }
.dropdown .menu a {
  display: block; padding: .45rem 1rem; color: var(--text); font-size: .92rem;
}
.dropdown .menu a:hover { background: var(--red-dim); text-decoration: none; }

.nav-toggle { display: none; }

.btn {
  display: inline-block; padding: .55rem 1.15rem;
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; border: 0; cursor: pointer; font-size: .95rem;
}
.btn:hover { text-decoration: none; }
.btn-discord, .btn-primary { background: var(--red); color: #fff; }
.btn-discord:hover, .btn-primary:hover { background: var(--red-bright); }
.btn-shop { background: var(--purple); color: #fff; }
.btn-shop:hover { background: #6a3ce0; }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 2px solid var(--line);
}
.btn-ghost:hover { border-color: var(--red-bright); color: var(--red-bright); }

/* --- radio bar ---------------------------------------------------------- */
.radiobar {
  background: linear-gradient(90deg, var(--bg-raise), #241114);
  border-bottom: 1px solid var(--line);
  color: var(--text); font-size: .92rem;
}
.radio-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 1.2rem; flex-wrap: wrap;
}
.radio-id { display: flex; align-items: center; gap: .6rem; letter-spacing: .06em; }
.radio-id strong { font-family: var(--display); }
.radio-now { color: var(--text-dim); }
.radio-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--red-bright);
  flex: none;
  box-shadow: 0 0 0 0 rgba(232,17,31,.6); animation: radio-pulse 2s infinite;
}
@keyframes radio-pulse {
  70% { box-shadow: 0 0 0 9px rgba(232,17,31,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,17,31,0); }
}
.radiobar-controls { display: flex; align-items: center; gap: .6rem; }
.radio-play {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 2.3rem; height: 2.3rem; border-radius: 50%; border: 0;
  background: var(--red); color: #fff; cursor: pointer; font-size: .85rem; line-height: 1;
}
.radio-play:hover { background: var(--red-bright); }
.radio-volume { width: 90px; accent-color: var(--red-bright); cursor: pointer; }

/* --- hero --------------------------------------------------------------- */
.hero {
  text-align: center;
  padding: 4.5rem 1.5rem 4rem;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(178,0,13,.28), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.hero img { width: 130px; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); margin: 0 0 .3em; }
.hero .motto {
  font-family: var(--display); color: var(--red-bright);
  font-size: 1.25rem; letter-spacing: .18em; margin-bottom: 1.6rem;
}
.hero .actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* --- layout ------------------------------------------------------------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.3rem; }
.section { padding: 2.6rem 0; }

/* --- server cards ------------------------------------------------------- */
/* Shared green "online status" language: a small pulsing dot (grey +
   un-pulsed when a server has no live data) next to player counts, and a
   green pill badge for the PvE/PvP mode tag -- used on the homepage cards,
   the /DayZ /StreetLife category listing, and the individual server page. */
@keyframes status-pulse {
  70% { box-shadow: 0 0 0 9px rgba(46,204,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 0 rgba(46,204,113,.6);
  animation: status-pulse 2s infinite; margin-right: .4em; vertical-align: middle;
}
.status-dot.offline { background: #6b6f73; box-shadow: none; animation: none; }

.mode {
  display: inline-block; align-self: flex-start; background: rgba(46,204,113,.15); color: var(--green);
  border: 1px solid rgba(46,204,113,.4); border-radius: 999px;
  padding: .18rem .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}

.online-summary {
  font-family: var(--display); font-size: 1.05rem;
  color: var(--text-dim); margin-bottom: 1.2rem;
}
.online-summary strong { color: var(--green); font-size: 1.3rem; }

.cards {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}
.card {
  display: flex; flex-direction: column; gap: .45rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  padding: 1.15rem 1.25rem;
  color: var(--text);
}
.card:hover { border-left-color: var(--red-bright); text-decoration: none; background: var(--bg-raise); }
.card-thumb { margin: -1.15rem -1.25rem .2rem; aspect-ratio: 16/9; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .mode { font-size: .72rem; }
.card h3 { margin: 0; font-size: 1.25rem; }
.card .blurb { color: var(--text-dim); font-style: italic; font-size: .95rem; min-height: 2.6em; }
.card .stars { color: var(--gold); letter-spacing: .15em; }
.card .players { font-family: var(--display); font-size: .95rem; color: var(--green); }
.card .players.offline { color: var(--text-dim); }
.card .go { color: var(--red-bright); font-weight: 600; font-size: .92rem; margin-top: auto; }

/* --- server detail ------------------------------------------------------ */
.server-head { padding: 2.4rem 0 0; }
.server-head .mode { font-size: .76rem; }
.server-grid {
  display: grid; grid-template-columns: 1fr 340px; gap: 2rem;
  align-items: start; padding: 1.6rem 0 3rem;
}
.server-body h2 { border-bottom: 2px solid var(--red-dim); padding-bottom: .25em; }
.server-body ul { padding-left: 1.3rem; }
.server-body li { margin: .25rem 0; }

.quick-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; margin-bottom: 1.8rem;
}
.quick-fact {
  background: var(--bg-card); padding: .8rem 1rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.quick-fact .muted { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.quick-fact strong { font-family: var(--display); font-size: 1.05rem; }
.quick-fact strong.stars { color: var(--gold); letter-spacing: .1em; }

.connect-box {
  background: var(--bg-card); border: 1px solid var(--line);
  border-top: 4px solid var(--red); padding: 1.2rem 1.3rem;
  position: sticky; top: var(--header-h, 84px);
}
.media-hero {
  aspect-ratio: 1; overflow: hidden; border-radius: 10px;
  margin: -1.2rem -1.3rem 1rem; border-bottom: 1px solid var(--line);
}
.media-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.connect-box h3 { margin-top: 0; }
.connect-box dl { margin: 0; }
.connect-box dt {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-dim); margin-top: .8rem;
}
.connect-box dd { margin: 0; font-family: var(--display); font-size: 1.05rem; word-break: break-all; }
.connect-box .players-big { color: var(--green); font-size: 1.4rem; }
.connect-box .players-big.offline { color: var(--text-dim); }
.connect-box code {
  display: block; background: #000; padding: .5rem .7rem; margin-top: .4rem;
  font-size: .9rem; border: 1px solid var(--line);
}

/* --- gallery ------------------------------------------------------------ */
.gallery {
  display: grid; gap: .8rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  padding: 1rem 0 2.5rem;
}
.gallery img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; border: 1px solid var(--line); }
.gallery a:hover img { border-color: var(--red-bright); }

/* --- rank cards (monetization) ------------------------------------------ */
.ranks { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rank {
  background: var(--bg-card); border: 1px solid var(--line);
  border-top: 4px solid var(--red); border-radius: 10px; overflow: hidden;
}
.rank-photo { display: block; width: 100%; aspect-ratio: 9/12; object-fit: cover; }
.rank-body { padding: 1.1rem 1.3rem 1.3rem; }
.rank .price { font-family: var(--display); font-size: 1.6rem; color: var(--red-bright); }
.rank h3 { margin: .2rem 0; }

/* --- generic content page ------------------------------------------------ */
.page { max-width: 820px; }
.page h2 { border-bottom: 2px solid var(--red-dim); padding-bottom: .25em; }
.page h3 { margin-top: 2.2rem; }
.page h4 {
  margin: 2.4rem 0 .4rem; padding-top: 1.6rem; border-top: 1px solid var(--line);
  font-family: var(--display); color: var(--red-bright);
}

/* Long-form rendered markdown (staff bios, handbook chunks) */
.prose { max-width: 780px; }
.prose h2 { font-size: 1.4rem; margin: 1.6rem 0 .6rem; color: #fff; }
.prose h3 { font-size: 1.15rem; margin: 1.4rem 0 .5rem; color: #fff; }
.prose p, .prose ul { margin: 0 0 .9rem; color: var(--text); }
.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: .4rem; }
.prose code {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 4px;
  padding: .1rem .4rem; font-size: .92em; font-family: monospace;
}
.staff-photo {
  display: block; width: 160px; height: 160px; object-fit: cover;
  border-radius: 50%; border: 2px solid var(--red-dim); margin: .3rem 0 1rem;
}

/* Staff & DJs index — tabs (reuses .tab-strip/.tab-btn/.tab-panel from the
   handbook) + photo cards, matching the original site. */
.tag-chip {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
}
.tag-chip.dj { background: var(--red-bright); color: #fff; }

/* NOTE: deliberately NOT named .card / .card-grid -- those are already
   taken by the homepage's server-listing cards (see "server cards" above);
   reusing them here would silently override that styling. */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.tile-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; color: var(--text); transition: .15s;
  display: flex; flex-direction: column; text-decoration: none;
}
.tile-card:hover { border-color: var(--red-bright); transform: translateY(-3px); color: var(--text); text-decoration: none; }
.tile-card h3 { font-size: 1.15rem; margin: 10px 0 4px; }
.tile-card p { color: var(--text-dim); font-size: .92rem; margin: 0; flex: 1; }
.tile-link { margin-top: 14px; color: var(--red-bright); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }

.staff-card { position: relative; }
.staff-avatar {
  position: relative; width: 100%; aspect-ratio: 1; background: #0f1115;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.staff-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.staff-avatar.empty { border-style: dashed; }
.staff-avatar .tag-chip.dj { position: absolute; top: 10px; right: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.45); }

/* --- account page ----------------------------------------------------------- */
.account-head { display: flex; align-items: center; gap: 1.1rem; }
.account-avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--line); background: var(--bg-card); flex: none;
}
.account-avatar-empty { display: block; }
.account-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.account-list-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px;
  padding: .8rem 1.1rem;
}
.account-list-info { display: flex; flex-direction: column; gap: .2rem; }
.nav-admin, .nav-account { margin-left: .5rem; }

/* --- staff profile page (individual) -------------------------------------- */
.page-head {
  padding: 54px 0 30px;
  background: linear-gradient(180deg, rgba(24,16,22,.65), rgba(12,13,16,.3));
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.page-head p { color: var(--text-dim); margin-top: 8px; }

/* Tabs (Player Handbook: DayZ / FiveM) */
.tab-strip {
  display: flex; flex-wrap: wrap; gap: 8px;
  border-bottom: 1px solid var(--line); margin-bottom: 26px; padding-bottom: 0;
}
.tab-strip[data-tabs="handbook-tabs"] { gap: 12px; }
.tab-btn {
  appearance: none; background: transparent; border: 0; color: var(--text-dim);
  font: inherit; font-family: var(--display); font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; font-size: .85rem; padding: 12px 16px; cursor: pointer;
  border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color .15s, border-color .15s, background .15s;
}
.tab-strip[data-tabs="handbook-tabs"] .tab-btn { font-size: 1.05rem; padding: 16px 30px; border-bottom-width: 3px; }
.tab-btn:hover { color: #fff; background: rgba(255,255,255,.03); }
.tab-btn.active { color: #fff; border-bottom-color: var(--red-bright); }
.tab-count {
  display: inline-block; min-width: 1.4em; padding: .05em .4em;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: .75em; color: var(--text-dim);
}
.tab-btn.active .tab-count { color: #fff; border-color: var(--red-bright); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Player Handbook: guide chunks, text + video side by side */
.section-title { margin-bottom: 1.2rem; }
.handbook-list { display: flex; flex-direction: column; gap: 24px; }
.handbook-chunk {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 12px; padding: 24px;
}
/* .handbook-chunk is a <details> element -- an FAQ-style accordion.
   .handbook-chunk__head is its <summary>: click to expand/collapse. */
.handbook-chunk__head {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.handbook-chunk__head::-webkit-details-marker { display: none; }
.handbook-chunk__head h3 { font-size: 1.3rem; color: #fff; margin: 0; }
.handbook-chunk__head::after {
  content: '+'; flex: none; font-family: var(--display); font-size: 1.6rem;
  color: var(--text-dim); transition: transform .2s ease, color .2s ease;
}
.handbook-chunk:hover .handbook-chunk__head::after { color: var(--red-bright); }
.handbook-chunk[open] .handbook-chunk__head::after { transform: rotate(45deg); }
.handbook-chunk__body { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; margin-top: 14px; }
.handbook-chunk__body:not(:has(.handbook-chunk__media)) { grid-template-columns: 1fr; }
.handbook-chunk__text.prose { max-width: none; }
.handbook-chunk__media { width: 100%; }
.handbook-chunk__media video {
  display: block; width: 100%; aspect-ratio: 16/9;
  border-radius: 10px; border: 1px solid var(--line); background: #000;
}
@media (max-width: 860px) { .handbook-chunk__body { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 360px; gap: 36px; align-items: start; margin: 2.5rem auto; }
.server-box {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px; position: sticky; top: var(--header-h, 88px);
}
.server-box h3 { margin-bottom: 12px; }

.staff-avatar.large { margin-bottom: 18px; }
.staff-avatar.large img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  border-radius: 12px; border: 1px solid var(--line);
}

.bio-stage { position: relative; }
.bio-stage__content {
  padding: 34px 30px;
  background: rgba(10,10,12,.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  max-width: none;
}
/* Plain gallery grid — square thumbnails, click to open full-size. */
.bio-stage__gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; margin-top: 24px;
}
.bio-stage__tile {
  display: block; aspect-ratio: 1; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px; background: #0f1115;
}
.bio-stage__tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.bio-stage__tile:hover { border-color: var(--red-bright); }
.bio-stage__tile:hover img { transform: scale(1.06); }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .server-box { position: static; }
  .bio-stage__content { padding: 22px 18px; }
}

/* --- footer -------------------------------------------------------------- */
.footer {
  flex-shrink: 0;
  margin-top: 3rem;
  background: var(--bg-raise); border-top: 1px solid var(--line);
  font-size: .95rem;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1.5rem; padding: 2rem 1.3rem; flex-wrap: wrap;
}
.footer-brand { display: flex; gap: .9rem; align-items: center; }
.footer-logo { width: 40px; height: 40px; object-fit: contain; }
.footer-links { display: flex; gap: 1.3rem; flex-wrap: wrap; align-items: center; }
.footer-links a { color: var(--text-dim); font-size: .9rem; }
.footer-links a:hover { color: var(--red-bright); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 1rem 1.3rem; color: var(--text-dim); font-size: .85rem; text-align: center;
}
.copyright { color: var(--text-dim); font-size: .85rem; }

/* --- mobile --------------------------------------------------------------- */
@media (max-width: 900px) {
  .nav-toggle {
    display: block; margin-left: auto;
    background: var(--red); color: #fff; border: 0;
    font-family: var(--display); font-weight: 600; text-transform: uppercase;
    padding: .5rem 1rem; cursor: pointer;
  }
  .nav {
    display: none; flex-direction: column; align-items: stretch;
    width: 100%; gap: 0; margin: 0; padding-top: .5rem;
  }
  .nav.open { display: flex; }
  .nav > a, .dropdown > a { padding: .6rem .3rem; border-bottom: 1px solid var(--line); display: block; }
  .dropdown .menu { position: static; display: block; border: 0; padding-left: 1rem; background: transparent; }
  .server-grid { grid-template-columns: 1fr; }
  .connect-box { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* --- admin ---------------------------------------------------------------- */
.admin-wrap { padding-bottom: 2rem; }
.admin-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; padding-top: 1.6rem; }
.admin-head h1 { margin: 0; }
.admin-user { margin-left: auto; color: var(--text-dim); font-size: .95rem; }

.admin-tabs { display: flex; gap: .55rem; flex-wrap: wrap; margin: 1.1rem 0 1.6rem; }
.admin-tab {
  padding: .5rem 1rem; background: var(--bg-card); border: 1px solid var(--line);
  color: var(--text); font-family: var(--display); font-size: .9rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.admin-tab:hover { border-color: var(--red-bright); text-decoration: none; }
.admin-tab.on { background: var(--red); border-color: var(--red); color: #fff; }

.subtabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; flex-wrap: wrap; }
.subtabs a { padding: .55rem 1rem; color: var(--text-dim); }
.subtabs a:hover { color: var(--text); text-decoration: none; }
.subtabs a.on { color: #fff; border-bottom: 3px solid #7c4dff; }

.bar-title { border-left: 4px solid var(--red); padding-left: .6rem; display: flex; align-items: center; gap: 1rem; }
.bar-title .toggle a { font-size: .8rem; padding: .2rem .6rem; background: var(--bg-card); color: var(--text-dim); }
.bar-title .toggle a.on { background: #7c4dff; color: #fff; }

.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.admin-table th {
  text-align: left; padding: .55rem .7rem; background: var(--bg-raise);
  font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim);
}
.admin-table td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }

.badge { padding: .15rem .55rem; font-size: .78rem; border-radius: 3px; }
.badge-completed { background: #14432a; color: #6fe3a1; }
.badge-pending   { background: #453a12; color: #ecd071; }
.badge-failed, .badge-refunded { background: #4a1418; color: #ff8d95; }
.badge-gifted    { background: #2c1a4a; color: #c9a6ff; }

.stat-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 1.2rem 0 1.8rem; }
.stat { background: var(--bg-card); border: 1px solid var(--line); padding: 1rem 1.2rem; }
.stat b { display: block; font-family: var(--display); font-size: 2rem; }
.stat span { color: var(--text-dim); font-size: .9rem; }
.stat.stat-champion { background: var(--gold); border-color: var(--gold); }
.stat.stat-champion b, .stat.stat-champion span { color: #1a1400; }

.two-col { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* log form */
.log-row {
  background: var(--bg-card); border: 1px solid var(--line);
  padding: 1.1rem 1.2rem 0.9rem; margin-bottom: 1rem;
}
.log-row label { display: block; font-size: .82rem; color: var(--text-dim); margin-bottom: .25rem; }
.type-line { display: flex; gap: .6rem; }
.log-type-note {
  display: inline-block; background: var(--gold); color: #1a1400;
  padding: .4rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
  margin: .7rem 0 0; max-width: 100%;
}
.log-type-note[hidden] { display: none; }
.log-row select, .log-row input {
  width: 100%; background: var(--bg-raise); color: var(--text);
  border: 1px solid var(--line); padding: .55rem .7rem; font-size: 1rem;
}
.log-row select:focus, .log-row input:focus { outline: 2px solid #7c4dff; }
.fields-grid { display: grid; gap: .9rem; grid-template-columns: 2fr 2fr 1fr; margin-top: .9rem; }
@media (max-width: 900px) { .fields-grid { grid-template-columns: 1fr; } }
.players-extra .field { display: flex; gap: .6rem; margin-top: .6rem; max-width: 420px; }
.row-x {
  background: transparent; color: var(--text-dim); border: 1px solid var(--line);
  width: 2.4rem; cursor: pointer; flex: none;
}
.row-x:hover { color: #fff; border-color: var(--red-bright); }
.btn-mini {
  margin-top: .45rem; background: var(--bg-raise); color: var(--text-dim);
  border: 1px solid var(--line); padding: .3rem .7rem; font-size: .82rem; cursor: pointer;
}
.btn-mini:hover { color: #fff; border-color: #7c4dff; }
.preview { margin-top: .8rem; color: var(--text-dim); white-space: pre-line; min-height: 1em; }

.page-jump { display: inline-flex; gap: .35rem; align-items: center; }
.page-jump input[type="number"] { width: 64px; background: var(--bg-card); color: var(--text); border: 1px solid var(--line); padding: .2rem .3rem; }

.ac-box {
  /* position/left/top/width are set inline by admin-autocomplete.js
     (fixed + viewport-relative, so it can't get clipped by a scrollable
     ancestor like the housing table's .table-scroll wrapper) */
  z-index: 40;
  background: var(--bg-raise); border: 1px solid #7c4dff; max-height: 260px; overflow-y: auto;
}
.ac-item { padding: .5rem .7rem; cursor: pointer; }
.ac-item:hover { background: #7c4dff; }
.ac-name { font-weight: 600; }
.ac-sub  { font-size: .8rem; color: var(--text-dim); }
.ac-item:hover .ac-sub { color: #eee; }

.notice { padding: .8rem 1rem; background: var(--bg-card); border: 1px solid var(--line); margin: .8rem 0; }
.notice-ok  { border-color: #2e7d4f; color: #8be3b0; }
.notice-err { border-color: var(--red); color: #ff9aa0; }

/* --- community goal banner ------------------------------------------------ */
.goal-banner { background: #1a0f10; border-bottom: 1px solid var(--red-dim); padding: .7rem 1.3rem .8rem; }
.goal-banner.goal-done { background: #0f1a13; border-bottom-color: #2e7d4f; }
.goal-line { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; max-width: 1100px; margin: 0 auto .4rem; }
.goal-line strong { font-family: var(--display); letter-spacing: .04em; }
.goal-nums { margin-left: auto; font-family: var(--display); color: var(--red-bright); }
.goal-done .goal-nums { color: #6fe3a1; }
.goal-track { max-width: 1100px; margin: 0 auto; height: 10px; background: #000; border: 1px solid var(--line); }
.goal-fill { height: 100%; background: linear-gradient(90deg, var(--red-dim), var(--red-bright)); transition: width .6s; }
.goal-done .goal-fill { background: linear-gradient(90deg, #1d5c38, #2ecc71); }
.goal-claim { max-width: 1100px; margin: .35rem auto 0; font-size: .85rem; color: var(--text-dim); }

/* --- donate page ----------------------------------------------------------- */
.dd-banner {
  max-width: 1100px; margin: 1.2rem auto 0; border-radius: 12px;
  background: linear-gradient(90deg, #7a0008, var(--red-bright), #7a0008);
  color: #fff; text-align: center; padding: .9rem 1.4rem;
  font-family: var(--display); letter-spacing: .06em;
  box-shadow: 0 10px 26px rgba(232,17,31,.25);
}
.dd-banner span { margin-left: 1rem; font-family: var(--body); opacity: .95; }
.donate-head {
  display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-end;
  background: linear-gradient(90deg, #241114, #13151a);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 1.6rem 1.8rem; margin-bottom: .5rem;
}
.welcome { font-size: 1.25rem; margin: 0 0 .3rem; }
.rank-chip {
  display: inline-block; background: var(--red); color: #fff; padding: .25rem .9rem;
  font-family: var(--display); font-size: .9rem; letter-spacing: .05em; border-radius: 999px;
}
.total-donated {
  margin-left: auto; min-width: 260px; text-align: right;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.3rem;
}
.total-donated .big { font-family: var(--display); font-size: 2rem; color: var(--purple); }
.total-donated .goal-track { margin-top: .5rem; background: #000; }
.total-donated .goal-fill { background: linear-gradient(90deg, #4d2fbf, var(--purple)); }

/* Each rank card carries its tier color via --tier-color (set inline from
   PHP); earned always shows green regardless of tier. */
.rank-cards { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.rank-card {
  --tier-color: var(--red);
  background: linear-gradient(180deg, var(--bg-card), var(--bg-raise));
  border: 1px solid var(--line); border-top: 4px solid var(--tier-color);
  border-radius: 14px; overflow: hidden;
  padding: 1.4rem 1.3rem; text-align: center;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.rank-card:hover {
  transform: translateY(-4px);
  border-color: var(--tier-color);
  box-shadow: 0 14px 30px rgba(0,0,0,.4);
}
.rank-card.earned { border-top-color: var(--green); }
.rank-card.hr { border-top-color: var(--gold); }
.rank-card.raffle { border-top-color: #2ecc71; }
.raffle-qty-line { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: .8rem; }
.raffle-qty-line input { background: var(--bg-card); color: var(--text); border: 1px solid var(--line); padding: .3rem; }
.rank-icon { font-size: 1.8rem; line-height: 1; margin-bottom: .3rem; }
.rank-card h3 { margin: .1rem 0 .5rem; font-size: 1.2rem; }
.rank-card .price { font-family: var(--display); font-size: 1.6rem; color: var(--tier-color); }
.rank-card.earned .price { color: var(--green); }
.rank-card .price s { color: var(--text-dim); font-size: 1.05rem; margin-right: .3rem; }
.x2 { background: var(--purple); color: #fff; font-size: .7rem; padding: .1rem .4rem; border-radius: 3px; vertical-align: middle; }
.rank-card .remain { color: var(--text-dim); font-size: .85rem; margin-top: .4rem; }
.rank-card .cta {
  display: inline-block; margin-top: 1rem; padding: .4rem 1.1rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border-radius: 999px; background: var(--purple); border: 1px solid var(--purple); color: #fff;
}
.rank-card.earned .cta { background: transparent; border-color: var(--green); color: #6fe3a1; }
.rank-card:not(.earned):hover .cta { background: #6a3ce0; }

.amount-line { display: flex; align-items: center; gap: .5rem; max-width: 480px; }
.amount-line .dollar { font-family: var(--display); font-size: 1.4rem; }
#don-amount, #don-message {
  width: 100%; max-width: 480px; background: var(--bg-card); color: var(--text);
  border: 1px solid var(--line); padding: .7rem .9rem; font-size: 1.05rem;
}
.quick-amounts { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0 1rem; }
.dd-note { border-color: var(--red); color: #ffb3b8; max-width: 640px; }
#paypal-button-container { max-width: 480px; margin-top: 1rem; }
.btn-override {
  margin-top: 1.2rem; background: #4a1418; color: #ff9aa0; border: 1px solid var(--red);
  display: block; width: 100%; max-width: 480px;
}
.btn-override:hover { background: var(--red); color: #fff; }
label { display: block; margin-top: 1rem; margin-bottom: .3rem; }

/* --- admin forms & event cards ------------------------------------------- */
.filter-line { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.filter-line input, .filter-line select {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--line);
  padding: .55rem .8rem; font-size: 1rem; min-width: 240px;
}
.inline-form { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form label, .stack-form label { display: block; font-size: .85rem; color: var(--text-dim); }
.inline-form input, .stack-form input, .stack-form textarea, .stack-form select {
  display: block; margin-top: .25rem; background: var(--bg-raise); color: var(--text);
  border: 1px solid var(--line); padding: .5rem .7rem; font-size: 1rem; min-width: 240px;
}
.stack-form { max-width: 960px; }
.stack-form label { margin-top: .9rem; }
.stack-form input, .stack-form textarea { width: 100%; }
.stack-form .check { display: flex; gap: .5rem; align-items: center; }
.stack-form .check input { min-width: 0; width: auto; }
.stack-form button { margin-top: 1.2rem; }
.admin-table input {
  background: var(--bg-raise); color: var(--text); border: 1px solid var(--line);
  padding: .35rem .5rem; width: 100%;
}
.actions { white-space: nowrap; }
.actions .btn-mini { margin: 0 .15rem; }
.btn-mini.danger { border-color: var(--red); color: #ff9aa0; }
.btn-mini.danger:hover { background: var(--red); color: #fff; }
.btn-mini.warn { border-color: var(--gold); color: var(--gold); }
.btn-mini.warn:hover { background: var(--gold); color: #1a1400; }
.big-key { display: block; margin-top: .5rem; padding: .7rem; background: #000; font-size: 1.05rem; word-break: break-all; }
.event-card {
  background: var(--bg-card); border: 1px solid var(--line); padding: 1.4rem 1.6rem;
  max-width: 1000px; margin-bottom: 1.5rem;
}
.event-card.active-card { border-color: var(--red); background: #1a0f10; }
.event-card dl { display: grid; grid-template-columns: 110px 1fr; gap: .3rem .8rem; }
.event-card dt { color: var(--text-dim); }
.event-card dd { margin: 0; font-family: var(--display); }

/* vehicle tables */
.veh-table td { vertical-align: middle; }
.owner-pill { background: #2c1a4a; color: #c9a6ff; padding: .1rem .5rem; border-radius: 10px; font-size: .82rem; }
.btn-mini.give { background: #7c4dff; color: #fff; border-color: #7c4dff; }
.btn-mini.give:hover { background: #9670ff; }
select.status-in_stock { color: #6fe3a1; }
select.status-sold_out { color: #ff8d95; }
.check-inline { display: inline-flex; gap: .3rem; align-items: center; font-size: .85rem; color: var(--text-dim); }

/* defaults + site editor */
.row-line { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .45rem 0; }
.row-line input, .row-line select {
  background: var(--bg-raise); color: var(--text); border: 1px solid var(--line); padding: .45rem .6rem;
}
.lt-card { background: var(--bg-card); border: 1px solid var(--line); padding: .7rem 1rem; margin-bottom: .6rem; }
.lt-fields { border-top: 1px dashed var(--line); margin-top: .6rem; padding: .6rem 0 0 1.5rem; }
.lock { color: var(--gold); font-size: .82rem; }
.editor-grid { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .editor-grid { grid-template-columns: 1fr; } }
.page-list { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--bg-card); }
.page-list a { padding: .55rem .9rem; color: var(--text-dim); border-bottom: 1px solid var(--line); font-size: .92rem; }
.page-list a:hover { color: #fff; text-decoration: none; }
.page-list a.on { background: var(--red-dim); color: #fff; }
.editor-pane textarea {
  width: 100%; background: var(--bg-card); color: var(--text); border: 1px solid var(--line);
  padding: 1rem; font-family: ui-monospace, Consolas, monospace; font-size: .95rem; line-height: 1.55;
}
.editor-pane button { margin-top: .8rem; }

/* housing */
.housing-note-row td { background: var(--bg-raise); border-top: none; padding: .3rem .8rem .5rem; }
.housing-note-row .row-line { margin: .2rem 0; }
.prop-pills { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.prop-pills a {
  padding: .45rem 1rem; background: var(--bg-card); border: 1px solid var(--line);
  color: var(--text-dim); font-size: .9rem; border-radius: 16px;
}
.prop-pills a:hover { color: #fff; text-decoration: none; }
.prop-pills a.on { background: var(--red); border-color: var(--red); color: #fff; }
.prop-head { display: flex; gap: 1.5rem; align-items: baseline; flex-wrap: wrap; }
.hstatus { padding: .12rem .6rem; border-radius: 10px; font-size: .8rem; }
.hstatus.current { background: #14432a; color: #6fe3a1; }
.hstatus.duesoon { background: #453a12; color: #ecd071; }
.hstatus.overdue { background: #58230f; color: #ffb187; }
.hstatus.evicted { background: #4a1418; color: #ff8d95; }
.hstatus.open    { background: #22303c; color: #9fc3e0; border: 1px dashed #3b566e; }

/* shop storefront */
.shop-nav { display: flex; gap: 1.4rem; padding: .8rem 1.3rem; border-bottom: 1px solid var(--line); }
.shop-nav a { color: var(--text-dim); font-weight: 600; }
.shop-nav a:hover { color: #fff; text-decoration: none; }
.shop-nav a.on { color: var(--red-bright); }
.shop-hero { text-align: center; }
.shop-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.shop-hero .red { color: var(--red-bright); }
.rank-card.soldout { opacity: .5; }

.shop-category-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 900px; margin: 0 auto; }
.shop-category-card {
  display: block; text-align: center; text-decoration: none; color: var(--text);
  background: linear-gradient(180deg, var(--bg-card), var(--bg-raise));
  border: 1px solid var(--line); border-radius: 16px;
  padding: 2.4rem 1.8rem; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.shop-category-card:hover {
  transform: translateY(-4px); border-color: var(--red-bright); color: var(--text);
  text-decoration: none; box-shadow: 0 14px 34px rgba(0,0,0,.4);
}
.shop-category-icon { font-size: 2.6rem; line-height: 1; margin-bottom: .8rem; }
.shop-category-card h2 { margin: 0 0 .6rem; }
.shop-category-card p { color: var(--text-dim); font-size: .95rem; margin: 0 0 1.2rem; }
.shop-category-cta {
  display: inline-block; padding: .5rem 1.3rem; border-radius: 999px;
  background: var(--purple); color: #fff; font-size: .8rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
}
.shop-category-card:hover .shop-category-cta { background: #6a3ce0; }

/* --- admin shell: grouped sidebar + main ---------------------------------- */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; align-items: start; }
.admin-side {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  background: #0d0d0f; border-right: 1px solid var(--line); padding: 1rem .6rem 2rem;
}
.admin-brand { display: block; font-family: var(--display); font-size: 1.4rem; letter-spacing: .04em;
  padding: .3rem .6rem 1rem; color: #fff; }
.admin-brand .red { color: var(--red-bright); }
.admin-brand:hover { text-decoration: none; }
.admin-navgroup {
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim);
  padding: 1rem .7rem .3rem; opacity: .7;
}
.admin-navitem {
  display: block; padding: .5rem .7rem; color: var(--text-dim); border-radius: 6px;
  font-size: .95rem; line-height: 1.3;
}
.admin-navitem:hover { background: #17171b; color: #fff; text-decoration: none; }
.admin-navitem.on { background: var(--red-dim); color: #fff; }
.admin-navwho { display: block; padding: .3rem .7rem .6rem; color: var(--text); font-size: .9rem; }
.admin-navwho small { color: var(--text-dim); }
.admin-main { padding: 1.4rem 1.8rem 3rem; min-width: 0; }
.admin-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.2rem; }
.admin-head h1 { margin: 0; }
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: .3rem;
    border-right: none; border-bottom: 1px solid var(--line); }
  .admin-brand { width: 100%; padding-bottom: .4rem; }
  .admin-navgroup { width: 100%; padding: .5rem .7rem .1rem; }
  .admin-navitem { flex: 0 0 auto; }
  .admin-navwho { width: 100%; }
}

/* dashboard quick actions */
.quick-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn-ghost { background: var(--bg-card); border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--red); color: #fff; }

/* --- CMS block rendering (public) ------------------------------------------ */
.cms-text p { margin: 0 0 .8rem; }
.cms-text ul { margin: 0 0 .8rem 1.2rem; }
.cms-img { max-width: 100%; height: auto; border-radius: 6px; }
.cms-figure { margin: 0 0 1rem; }
.cms-figure figcaption { color: var(--text-dim); font-size: .85rem; margin-top: .3rem; }
.cms-embed { position: relative; padding-bottom: 56.25%; height: 0; margin: 0 0 1rem; }
.cms-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 6px; }
.cms-divider { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }

/* --- CMS editor (admin) ---------------------------------------------------- */
.cms-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; align-items: start; }
@media (max-width: 1000px) { .cms-editor { grid-template-columns: 1fr; } }
.cms-block-card { background: var(--bg-card); border: 1px solid var(--line); border-left: 3px solid var(--red); margin-bottom: .8rem; }
.cms-block-head { display: flex; justify-content: space-between; align-items: center; padding: .5rem .8rem; border-bottom: 1px solid var(--line); }
.cms-block-type { font-family: var(--display); letter-spacing: .04em; font-size: .9rem; }
.cms-block-form { padding: .8rem; }
.cms-block-form label { display: block; font-size: .82rem; color: var(--text-dim); margin-bottom: .6rem; }
.cms-block-form input, .cms-block-form textarea { width: 100%; background: var(--bg-raise); color: var(--text); border: 1px solid var(--line); padding: .5rem .6rem; margin-top: .2rem; }
.cms-add-block { margin-top: 1rem; padding: 1rem; border: 1px dashed var(--line); border-radius: 6px; }
.cms-add-buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.cms-preview-frame { border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.2rem; background: var(--bg); position: sticky; top: 1rem; max-height: 80vh; overflow-y: auto; }

/* --- markdown toolbar + live preview (FAQ topics, Staff bios) -------------- */
.md-editor { margin: .4rem 0; }
.md-toolbar { display: flex; gap: .3rem; margin-bottom: .3rem; }
.md-toolbar button {
  background: var(--bg-raise); color: var(--text-dim); border: 1px solid var(--line);
  padding: .3rem .6rem; font-size: .82rem; cursor: pointer; border-radius: 4px;
}
.md-toolbar button:hover { color: #fff; border-color: #7c4dff; }
.md-preview-label { margin-top: .6rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.md-preview {
  margin-top: .3rem; padding: .8rem 1rem; background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; max-width: none;
}
.md-preview :first-child { margin-top: 0; }

/* --- collapsible admin cards (FAQ topics, Staff & DJs) ---------------------- */
.admin-shell .handbook-chunk { margin-bottom: .8rem; padding: 16px 20px; }
.admin-shell .handbook-chunk__head h3 { font-size: 1.05rem; }
.admin-shell .handbook-chunk__head .muted { font-size: .85rem; font-weight: 400; }

/* --- drag-and-drop reorder -------------------------------------------------- */
[data-reorder-group] > [data-id] { cursor: grab; }
[data-reorder-group] > [data-id].dragging { opacity: .4; }
[data-reorder-save] { margin: .6rem 0; }

/* --- photo / gallery upload (Staff & DJs) ----------------------------------- */
.upload-row { display: flex; align-items: center; gap: .8rem; margin: .5rem 0; flex-wrap: wrap; }
.upload-current { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-raise); flex: none; }
.upload-current img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-admin-grid { display: flex; flex-wrap: wrap; gap: .6rem; margin: .5rem 0; }
.gallery-admin-tile { position: relative; width: 84px; height: 84px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.gallery-admin-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-admin-tile button {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; line-height: 18px;
  border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; font-size: .75rem; cursor: pointer;
}
.gallery-admin-tile button:hover { background: var(--red); }

/* permission matrix */
.perm-matrix select { background: var(--bg-raise); color: var(--text); border: 1px solid var(--line); padding: .35rem .5rem; }
.perm-group td { background: #141418; font-family: var(--display); letter-spacing: .04em; color: var(--text-dim); font-size: .82rem; text-transform: uppercase; }

/* --- lightbox (server screenshots, staff photo galleries) ------------------ */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(5, 5, 7, .94);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-img {
  max-width: 90vw; max-height: 88vh; object-fit: contain;
  border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: fixed; background: rgba(0,0,0,.55); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 50%;
  width: 3rem; height: 3rem; font-size: 1.5rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  background: var(--red); border-color: var(--red);
}
.lightbox-close { top: 1.2rem; right: 1.2rem; }
.lightbox-prev { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.2rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lightbox-prev, .lightbox-next { width: 2.4rem; height: 2.4rem; font-size: 1.2rem; }
}
