/* ============================================================
   RennCraft — Shared sub-page components (loads after styles.css)
============================================================ */

/* ---------- page header ---------- */
.page-head { padding: 54px 0 34px; position: relative; overflow: hidden; }
.page-head::before { content: ""; position: absolute; inset: -40% -10% auto -10%; height: 150%;
  background: radial-gradient(ellipse 55% 60% at 30% 0%, rgba(61,155,255,.16), transparent 62%); pointer-events: none; }
.page-head .inner { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--pixel); font-weight: 700; font-size: clamp(32px, 5vw, 50px); margin: 14px 0 0; line-height: 1.05; }
.page-head .sub { color: var(--text-dim); margin: 12px 0 0; max-width: 56ch; font-size: 16.5px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-mute); margin-bottom: 4px; }
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--diamond-bright); }

/* ---------- generic panel ---------- */
.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 26px; }
.panel-h { font-family: var(--pixel); font-size: 20px; margin: 0 0 18px; display: flex; align-items: center; gap: 10px; }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- pill tabs ---------- */
.pills { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; font-weight: 700; font-size: 14px; color: var(--text-dim); border: 1px solid transparent; border-radius: var(--r); white-space: nowrap; transition: all .15s; }
.pills button:hover { color: var(--text); background: rgba(125,165,255,.07); }
.pills button.active { color: var(--diamond-bright); background: rgba(61,155,255,.12); border-color: rgba(61,155,255,.4); }
.pills.sticky-pills { position: sticky; top: 70px; z-index: 40; background: rgba(8,13,26,.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); padding: 12px 0; }

/* ---------- skin head ---------- */
.skin-head { width: 38px; height: 38px; flex: none; display: grid; place-items: center; image-rendering: pixelated;
  font-family: var(--pixel); font-weight: 700; color: #0a1530; border: 1px solid var(--line); border-radius: 3px; font-size: 18px; }
.skin-head.lg { width: 120px; height: 120px; font-size: 56px; border-radius: var(--r); }

/* ---------- data / leaderboard table ---------- */
.tbl-wrap { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-family: var(--pixel); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-mute); padding: 16px 20px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 20px; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; cursor: pointer; }
.tbl tbody tr:hover { background: rgba(125,165,255,.05); }
.tbl .rank { font-family: var(--pixel); font-weight: 700; color: var(--text-mute); width: 56px; }
.tbl tr.t1 .rank { color: var(--gold); }
.tbl tr.t2 .rank { color: #cdd6ea; }
.tbl tr.t3 .rank { color: #d79a5a; }
.tbl .who { display: flex; align-items: center; gap: 13px; font-weight: 700; }
.tbl .val { font-family: var(--pixel); font-weight: 600; color: var(--cyan); }
.tbl .seen { color: var(--text-mute); font-size: 13.5px; }
.tbl .online-tag { color: var(--online); font-weight: 700; font-size: 13px; }
.online-tag { color: var(--online); font-weight: 700; font-size: 13px; white-space: nowrap; }

/* search + pager */
.search { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 15px; max-width: 320px; }
.search input { flex: 1; background: none; border: none; color: var(--text); font-family: inherit; font-size: 15px; outline: none; }
.search svg { color: var(--text-mute); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 26px; }
.pager button { min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); font-weight: 700; color: var(--text-dim); }
.pager button:hover { border-color: var(--diamond); color: #fff; }
.pager button.active { background: rgba(61,155,255,.16); border-color: var(--diamond); color: var(--diamond-bright); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- badges ---------- */
.rb { display: inline-flex; align-items: center; font-family: var(--pixel); font-weight: 700; font-size: 11px; letter-spacing: .5px; padding: 4px 10px; border-radius: 3px; border: 1px solid; }
.rb-vip { color: #56c46b; border-color: #56c46b; background: rgba(86,196,107,.12); }
.rb-mvp { color: #3d9bff; border-color: #3d9bff; background: rgba(61,155,255,.12); }
.rb-elite { color: #f1c04a; border-color: #f1c04a; background: rgba(241,192,74,.12); }
.rb-legend { color: #b46cff; border-color: #b46cff; background: rgba(180,108,255,.12); }
.rb-owner { color: var(--gold); border-color: var(--gold); background: rgba(241,192,74,.14); }
.rb-admin { color: #ff7e9d; border-color: #ff7e9d; background: rgba(255,126,157,.12); }
.rb-mod { color: #56c46b; border-color: #56c46b; background: rgba(86,196,107,.12); }
.rb-default { color: var(--text-mute); border-color: var(--line); }

.pill-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; padding: 4px 11px; border-radius: 999px; border: 1px solid; }
.tag-warn { color: var(--gold); border-color: rgba(241,192,74,.4); background: rgba(241,192,74,.1); }
.tag-mute { color: #ff9d57; border-color: rgba(255,157,87,.4); background: rgba(255,157,87,.1); }
.tag-ban { color: var(--offline); border-color: rgba(255,93,108,.4); background: rgba(255,93,108,.1); }
.tag-active { color: var(--offline); border-color: var(--offline); background: rgba(255,93,108,.12); }
.tag-expired { color: var(--text-mute); border-color: var(--line); }
.tag-pending { color: var(--diamond-bright); border-color: rgba(61,155,255,.4); background: rgba(61,155,255,.1); }
.tag-ok { color: var(--online); border-color: rgba(70,209,127,.4); background: rgba(70,209,127,.1); }

/* ---------- stat grid ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 18px 20px; }
.stat .k { font-size: 13px; color: var(--text-mute); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat .v { font-family: var(--pixel); font-weight: 700; font-size: 26px; margin-top: 6px; }
.stat .v.cyan { color: var(--cyan); }
.stat .v.gold { color: var(--gold); }
.stat .v.green { color: var(--online); }

/* ---------- bar chart (CSS) ---------- */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 10px; }
.chart .bar { flex: 1; background: linear-gradient(180deg, var(--diamond-bright), rgba(31,95,214,.3)); border-radius: 3px 3px 0 0; min-height: 3px; position: relative; transition: height .4s ease; }
.chart .bar:hover { background: linear-gradient(180deg, var(--cyan), var(--diamond)); }
.chart-x { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--text-mute); }

/* ---------- accordion ---------- */
.acc { border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; background: var(--panel); margin-bottom: 10px; }
.acc summary { list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 700; font-size: 16.5px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .chev { transition: transform .2s; color: var(--diamond-bright); flex: none; }
.acc[open] summary .chev { transform: rotate(180deg); }
.acc[open] summary { border-bottom: 1px solid var(--line-soft); }
.acc .acc-body { padding: 18px 22px; color: var(--text-dim); font-size: 15px; line-height: 1.7; }
.acc .acc-body code { background: var(--bg-0); padding: 2px 7px; border-radius: 3px; color: var(--cyan); font-family: var(--pixel); }

/* ---------- forms ---------- */
.form-card { max-width: 520px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 7px; }
.field label .hint { color: var(--text-mute); font-weight: 500; }
.field input, .field textarea, .field select { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; color: var(--text); font-family: inherit; font-size: 15px; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--diamond); }
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 26px; text-align: center; color: var(--text-mute); font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--diamond); background: rgba(61,155,255,.05); }

/* ---------- timeline / list rows ---------- */
.row-list { display: flex; flex-direction: column; gap: 10px; }
.lrow { display: flex; align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 14px 18px; }
.lrow .lr-main { flex: 1; min-width: 0; }
.lrow .lr-title { font-weight: 700; font-size: 15px; }
.lrow .lr-sub { font-size: 13px; color: var(--text-mute); margin-top: 2px; }

/* ---------- changelog ---------- */
.cl-entry { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 28px; margin-bottom: 18px; }
.cl-entry .cl-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.cl-entry .cl-ver { font-family: var(--pixel); font-weight: 700; font-size: 26px; color: var(--diamond-bright); }
.cl-entry .cl-date { color: var(--text-mute); font-size: 14px; }
.cl-group { margin-bottom: 16px; }
.cl-group:last-child { margin-bottom: 0; }
.cl-label { display: inline-flex; font-family: var(--pixel); font-size: 11px; letter-spacing: 1px; padding: 3px 9px; border-radius: 3px; margin-bottom: 10px; font-weight: 700; }
.cl-added { color: var(--online); background: rgba(70,209,127,.12); }
.cl-changed { color: var(--diamond-bright); background: rgba(61,155,255,.12); }
.cl-fixed { color: var(--gold); background: rgba(241,192,74,.12); }
.cl-removed { color: var(--offline); background: rgba(255,93,108,.12); }
.cl-group ul { display: flex; flex-direction: column; gap: 8px; }
.cl-group li { font-size: 14.5px; color: var(--text-dim); display: flex; gap: 10px; }
.cl-group li .plug { font-family: var(--pixel); font-size: 12px; color: var(--text-mute); flex: none; }

/* ---------- vote site ---------- */
.vote-site { display: flex; align-items: center; gap: 18px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 16px 20px; transition: border-color .15s; }
.vote-site:hover { border-color: rgba(61,155,255,.4); }
.vote-site .vlogo { width: 48px; height: 48px; flex: none; border-radius: var(--r); background: color-mix(in srgb, var(--accent,#3d9bff) 18%, #0c1730); border: 1px solid color-mix(in srgb, var(--accent,#3d9bff) 50%, transparent); display: grid; place-items: center; font-family: var(--pixel); font-weight: 700; color: var(--accent,#3d9bff); }
.vote-site .vinfo { flex: 1; }
.vote-site .vinfo .vn { font-weight: 700; font-size: 16px; }
.vote-site .vinfo .vs { font-size: 13px; color: var(--text-mute); margin-top: 2px; }
.streak { display: flex; gap: 8px; }
.streak .day { flex: 1; aspect-ratio: 1; border-radius: var(--r); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--pixel); font-weight: 700; font-size: 13px; color: var(--text-mute); }
.streak .day.done { background: rgba(70,209,127,.14); border-color: var(--online); color: var(--online); }
.streak .day.bonus { background: rgba(241,192,74,.14); border-color: var(--gold); color: var(--gold); }

/* ---------- login ---------- */
.login-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 40px 0; position: relative; overflow: hidden; }
.login-wrap::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 50% 50% at 50% 35%, rgba(61,155,255,.16), transparent 60%); }
.login-card { position: relative; z-index: 1; width: min(440px, 92vw); background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 40px; text-align: center; box-shadow: var(--shadow-block); }
.login-card img { width: 64px; margin: 0 auto 18px; image-rendering: pixelated; }
.login-card h1 { font-family: var(--pixel); font-size: 26px; margin: 0 0 8px; }
.login-card p { color: var(--text-dim); margin: 0 0 26px; }
.login-perks { text-align: left; margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; }
.login-perks li { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; color: var(--text-dim); }
.login-perks svg { color: var(--diamond-bright); flex: none; margin-top: 2px; }

/* ---------- dashboard / admin layout ---------- */
.split { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.side-nav { position: sticky; top: 90px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 14px; }
.side-nav a, .side-nav button { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 11px 14px; border-radius: var(--r); font-weight: 600; font-size: 14.5px; color: var(--text-dim); transition: all .12s; }
.side-nav a:hover, .side-nav button:hover { background: rgba(125,165,255,.07); color: var(--text); }
.side-nav a.active, .side-nav button.active { background: rgba(61,155,255,.12); color: var(--diamond-bright); }
.side-nav svg { width: 18px; height: 18px; flex: none; }
.side-sep { height: 1px; background: var(--line-soft); margin: 10px 0; }

.welcome { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line-soft); background: var(--panel); }
.notif .nd { width: 8px; height: 8px; border-radius: 50%; background: var(--diamond); margin-top: 6px; flex: none; }
.notif.warn .nd { background: var(--gold); }

/* mini metric cards for admin */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 18px 20px; }
.metric .ml { font-size: 13px; color: var(--text-mute); font-weight: 600; }
.metric .mv { font-family: var(--pixel); font-weight: 700; font-size: 28px; margin-top: 6px; }
.metric .md { font-size: 12.5px; margin-top: 4px; color: var(--online); font-weight: 700; }
.metric .md.down { color: var(--offline); }

/* legal doc */
.legal-body { max-width: 760px; }
.legal-body h2 { font-family: var(--pixel); font-size: 22px; margin: 32px 0 12px; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p, .legal-body li { color: var(--text-dim); font-size: 15.5px; line-height: 1.75; }
.legal-body ul { padding-left: 22px; list-style: disc; margin: 10px 0; }
.legal-body li { margin-bottom: 6px; }
.legal-body .updated { color: var(--text-mute); font-size: 13.5px; margin-bottom: 30px; }

/* ---------- shared modal / overlay / drawer-close (used by Punishments, Admin) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(3,6,14,.66); backdrop-filter: blur(3px); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .25s; }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--r); display: grid; place-items: center; color: var(--text-dim); }
.drawer-close:hover { color: #fff; border-color: var(--diamond); }
.modal-card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.96); z-index: 100;
  width: min(520px, 94vw); max-height: 90vh; overflow-y: auto; background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.modal-card.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-family: var(--pixel); font-size: 22px; margin: 0; }
.modal-body { padding: 24px 26px; }
.modal-foot { padding: 0 26px 26px; }
.checkout-success { text-align: center; padding: 40px 26px; }
.checkout-success .big { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 50%; background: rgba(70,209,127,.14); border: 1px solid var(--online); display: grid; place-items: center; }
.checkout-success h3 { font-family: var(--pixel); font-size: 24px; margin: 0 0 10px; }
.checkout-success p { color: var(--text-dim); margin: 0 auto; max-width: 38ch; }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .stat-grid, .metrics { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .side-nav a, .side-nav button { width: auto; }
  .side-sep { display: none; }
}
@media (max-width: 720px) {
  .stat-grid, .metrics { grid-template-columns: 1fr 1fr; }
  .tbl th:nth-child(4), .tbl td:nth-child(4) { display: none; }
  .page-head { padding: 40px 0 26px; }
}
