:root {
  --bg:      #0c0c10;
  --s1:      #141418;
  --s2:      #1c1c22;
  --s3:      #242430;
  --s4:      #2c2c3a;
  --border:  #2a2a36;
  --border2: #38384a;
  --acc:     #ff6b35;
  --acc2:    #ff8c5a;
  --accg:    rgba(255, 107, 53, .14);
  --blue:    #5b8fff;
  --blueg:   rgba(91,143,255,.12);
  --green:   #3dd68c;
  --red:     #ff4d6d;
  --yellow:  #ffd60a;
  --text:    #eeeef5;
  --t2:      #9090b0;
  --t3:      #55556a;
  --r:       14px;
  --r2:      10px;
  --r3:      7px;
  --ff:      'Plus Jakarta Sans', sans-serif;
  --fm:      'JetBrains Mono', monospace;
  --shadow:  0 4px 24px rgba(0,0,0,.5);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--ff); min-height: 100dvh; overflow-x: hidden; }

body::after {
  content: '';
  position: fixed;
  top: -160px; right: -160px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(255,107,53,.07) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ── LOADING SCREEN ── */
#loading-screen {
  position: fixed; inset: 0; z-index: 9998;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
}
#loading-screen.hide {
  opacity: 0; pointer-events: none;
  transition: opacity .4s ease;
}
.ld-logo { font-size: 32px; font-weight: 800; letter-spacing: -.5px; }
.ld-logo b { color: var(--acc); }
.ld-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border2);
  border-top-color: var(--acc);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ld-sub { font-size: 12px; color: var(--t3); font-family: var(--fm); }

/* ── CONFETTI CANVAS ── */
#confettiCanvas {
  position: fixed; inset: 0; pointer-events: none;
  z-index: 9999; display: none;
}

/* ─────────────────────────────────────────
   NAV
───────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12,12,16,.92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; height: 56px; gap: 10px;
}
.logo { font-size: 18px; font-weight: 800; letter-spacing: -.5px; flex: 1; }
.logo b { color: var(--acc); }
.nav-ps {
  flex: 1; max-width: 148px;
  background: var(--s2); border: 1px solid var(--border);
  border-radius: var(--r3); color: var(--text);
  font-family: var(--ff); font-size: 12px; font-weight: 600;
  padding: 6px 10px; cursor: pointer; outline: none; appearance: none;
}
.nav-ps option { background: var(--s2); }
.nav-av {
  width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; border: 2px solid var(--border2);
  overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; background: var(--s2); transition: border-color .2s;
}
.nav-av:hover { border-color: var(--acc); }
.nav-av img { width: 100%; height: 100%; object-fit: cover; }

/* ─────────────────────────────────────────
   TABS
───────────────────────────────────────── */
.tabs {
  position: sticky; top: 56px; z-index: 49;
  background: rgba(12,12,16,.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; padding: 0 8px; gap: 2px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; padding: 13px 14px 11px;
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--t3); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .2s; white-space: nowrap;
}
.tab.active { color: var(--acc); border-bottom-color: var(--acc); }
.tab:hover:not(.active) { color: var(--t2); }

/* ─────────────────────────────────────────
   PAGES
───────────────────────────────────────── */
.page { display: none; padding: 20px 16px 20px; max-width: 640px; margin: 0 auto; }
.page.active { display: block; }

/* ─────────────────────────────────────────
   CARDS
───────────────────────────────────────── */
.card { background: var(--s1); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; margin-bottom: 14px; }
.ctitle { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--t3); margin-bottom: 14px; }

/* ─────────────────────────────────────────
   BUTTONS
───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 13px 20px; border-radius: var(--r2);
  font-family: var(--ff); font-weight: 700; font-size: 14px;
  cursor: pointer; border: none; transition: all .18s;
  text-align: center; line-height: 1; white-space: nowrap;
}
.bfull { width: 100%; }
.bpr { background: var(--acc); color: #fff; }
.bpr:hover { background: var(--acc2); transform: translateY(-1px); box-shadow: 0 6px 20px var(--accg); }
.bpr:active { transform: translateY(0); }
.bgh { background: var(--s2); color: var(--text); border: 1px solid var(--border2); }
.bgh:hover { background: var(--s3); }
.bdanger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.bdanger:hover { background: rgba(255,77,109,.08); }
.bsm { padding: 8px 14px; font-size: 12px; border-radius: var(--r3); }
.btn[disabled] { opacity: .32; cursor: not-allowed; transform: none !important; }

/* ─────────────────────────────────────────
   FORM FIELDS
───────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--t2); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--s2); border: 1.5px solid var(--border);
  border-radius: var(--r3); color: var(--text); font-family: var(--ff);
  font-size: 14px; padding: 11px 14px; outline: none; transition: border-color .2s;
}
.field input[type=file] { color: var(--t2); font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--acc); }
.field select option { background: var(--s1); }
.field textarea { resize: vertical; min-height: 72px; }
.hint { font-size: 12px; color: var(--t3); margin-top: 5px; }

/* ─────────────────────────────────────────
   TOGGLE
───────────────────────────────────────── */
.trow { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.trow:last-child { border-bottom: none; }
.tl { font-size: 14px; font-weight: 600; }
.td { font-size: 12px; color: var(--t3); margin-top: 2px; }
.tog { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.tog input { opacity: 0; width: 0; height: 0; }
.tt { position: absolute; cursor: pointer; inset: 0; background: var(--border2); border-radius: 13px; transition: .3s; }
.tt::before { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; background: var(--t3); border-radius: 50%; transition: .3s; }
input:checked + .tt { background: var(--acc); }
input:checked + .tt::before { transform: translateX(18px); background: #fff; }

/* ─────────────────────────────────────────
   MODALS
───────────────────────────────────────── */
.mbg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.68); backdrop-filter: blur(7px); z-index: 200; align-items: flex-end; justify-content: center; }
.mbg.open { display: flex; }
.modal {
  background: var(--s1); border: 1px solid var(--border);
  border-radius: var(--r) var(--r) 0 0;
  padding: 24px 20px 48px; width: 100%; max-width: 640px;
  max-height: 92dvh; /*overflow-y: auto;*/ position: relative;
  animation: mup .28s cubic-bezier(.22,.68,0,1.2);
}
@keyframes mup { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.mhandle { width: 36px; height: 4px; border-radius: 2px; background: var(--border2); margin: 0 auto 20px; }
.mtitle { font-size: 20px; font-weight: 800; margin-bottom: 18px; }
.mclose { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--s3); border: none; color: var(--t2); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ─────────────────────────────────────────
   TOAST
───────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--s2); border: 1px solid var(--border2);
  border-radius: 40px; padding: 11px 22px; font-size: 13px; font-weight: 600;
  z-index: 9000; transition: transform .3s cubic-bezier(.22,.68,0,1.2);
  white-space: nowrap; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.ok  { border-color: var(--green); color: var(--green); }
.toast.err { border-color: var(--red);   color: var(--red);   }
.toast.inf { border-color: var(--blue);  color: var(--blue);  }

/* ─────────────────────────────────────────
   AUTH PAGE
───────────────────────────────────────── */
#auth-page { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 24px; position: relative; z-index: 10; }
#auth-page.gone { display: none; }
.abox { background: var(--s1); border: 1px solid var(--border); border-radius: var(--r); padding: 32px 28px; width: 100%; max-width: 380px; }
.alogo { font-size: 28px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.alogo b { color: var(--acc); }
.asub { text-align: center; color: var(--t2); font-size: 14px; margin-bottom: 26px; }
.atabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--s2); border-radius: var(--r3); padding: 3px; margin-bottom: 20px; }
.atab { padding: 9px; text-align: center; border-radius: var(--r3); cursor: pointer; font-size: 13px; font-weight: 700; color: var(--t3); transition: all .2s; }
.atab.active { background: var(--s3); color: var(--text); }

/* pfp picker */
.pfp-pick { text-align: center; margin-bottom: 16px; }
.pfp-prev { width: 70px; height: 70px; border-radius: 50%; background: var(--s3); border: 2px dashed var(--border2); margin: 0 auto 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 30px; overflow: hidden; transition: border-color .2s; position: relative; }
.pfp-prev:hover { border-color: var(--acc); }
.pfp-prev img { width: 100%; height: 100%; object-fit: cover; }
.pfp-prev input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 6px; }
.eg-btn { font-size: 20px; padding: 5px; border-radius: 7px; cursor: pointer; background: var(--s2); border: 1.5px solid transparent; transition: all .15s; }
.eg-btn:hover, .eg-btn.sel { border-color: var(--acc); background: var(--accg); }

/* image upload with crop */
.img-upload-wrap { background: var(--s2); border: 1.5px solid var(--border); border-radius: var(--r2); padding: 14px; }
.img-upload-preview { width: 100%; max-height: 200px; object-fit: contain; border-radius: var(--r3); margin-bottom: 10px; display: none; }
.img-upload-preview.show { display: block; }
.img-upload-info { font-family: var(--fm); font-size: 11px; color: var(--t3); margin-bottom: 10px; }
.img-upload-info.warn { color: var(--red); }
.img-crop-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; color: var(--t2); }
.img-crop-row input[type=range] { flex: 1; accent-color: var(--acc); }
canvas.crop-canvas { display: none; }

/* ─────────────────────────────────────────
   TODAY
───────────────────────────────────────── */
.prog-sticky {
  position: sticky; top: 97px; z-index: 40;
  background: rgba(12,12,16,.95);
  backdrop-filter: blur(8px);
  padding: 8px 16px 10px;
  margin: -20px -16px 14px;
  border-bottom: 1px solid var(--border);
}
.prog-w { height: 3px; background: var(--s3); border-radius: 2px; margin-bottom: 6px; }
.prog-b { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--acc), var(--acc2)); transition: width .35s; }
.prog-meta { display: flex; justify-content: space-between; }
.prog-meta span { font-size: 11px; color: var(--t3); font-family: var(--fm); }
.prog-meta .prog-score { color: var(--acc); }

.q-sec-hd { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.q-sec-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--accg); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.q-sec-tit { font-size: 17px; font-weight: 800; }
.q-sec-sub { font-size: 12px; color: var(--t3); margin-top: 1px; }
.qcard { background: var(--s1); border: 1.5px solid var(--border); border-radius: var(--r); padding: 18px; margin-bottom: 12px; transition: border-color .2s; }
.qcard.ans { border-color: rgba(255,107,53,.38); }
.qhead { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.qic { width: 34px; height: 34px; border-radius: 10px; background: var(--s3); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.qnum { font-family: var(--fm); font-size: 10px; color: var(--acc); font-weight: 500; margin-bottom: 3px; }
.qtxt { font-size: 15px; font-weight: 600; line-height: 1.45; }

.yn-w { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yn-b { padding: 14px; border-radius: var(--r2); border: 1.5px solid var(--border); background: var(--s2); color: var(--text); font-family: var(--ff); font-weight: 700; font-size: 15px; cursor: pointer; transition: all .18s; text-align: center; }
.yn-b:hover { border-color: var(--border2); }
.yn-b.sy { border-color: var(--green); background: rgba(61,214,140,.1); color: var(--green); }
.yn-b.sn { border-color: var(--red);   background: rgba(255,77,109,.1);   color: var(--red);   }
.yn-pts { font-size: 11px; font-family: var(--fm); opacity: .55; font-weight: 400; display: block; margin-top: 2px; }

.mc-o { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r2); border: 1.5px solid var(--border); background: var(--s2); cursor: pointer; transition: all .18s; margin-bottom: 7px; font-weight: 600; font-size: 14px; }
.mc-o:last-child { margin-bottom: 0; }
.mc-o:hover { border-color: var(--border2); }
.mc-o.sel { border-color: var(--blue); background: var(--blueg); color: var(--blue); }
.mc-lt { width: 24px; height: 24px; border-radius: 6px; background: var(--s3); display: flex; align-items: center; justify-content: center; font-family: var(--fm); font-size: 11px; flex-shrink: 0; transition: all .18s; }
.mc-o.sel .mc-lt { background: var(--blue); color: #fff; }
.mc-pt { margin-left: auto; font-family: var(--fm); font-size: 11px; color: var(--t3); }
.mc-o.sel .mc-pt { color: var(--blue); }

.num-inp { width: 100%; background: var(--s2); border: 1.5px solid var(--border); border-radius: var(--r2); color: var(--text); font-family: var(--fm); font-size: 22px; padding: 14px 16px; outline: none; transition: border-color .2s; }
.num-inp:focus { border-color: var(--acc); }
.num-meta { font-family: var(--fm); font-size: 11px; color: var(--t3); margin-top: 8px; }
.num-prev { font-family: var(--fm); font-size: 13px; color: var(--acc); margin-top: 5px; min-height: 18px; }

.score-hero { text-align: center; padding: 36px 20px 28px; background: var(--s1); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 14px; position: relative; overflow: hidden; }
.score-hero::before { content: ''; position: absolute; top: -80px; left: 50%; transform: translateX(-50%); width: 220px; height: 220px; background: radial-gradient(circle, var(--accg) 0%, transparent 70%); pointer-events: none; }
.sh-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: var(--t3); margin-bottom: 10px; }
.sh-sc { font-size: 68px; font-weight: 800; font-family: var(--fm); letter-spacing: -3px; color: var(--acc); line-height: 1; }
.sh-sc.neg { color: var(--red); }
.sh-dt { margin-top: 10px; font-size: 12px; color: var(--t3); font-family: var(--fm); }
.sh-rank { display: inline-block; margin-top: 12px; padding: 4px 14px; border-radius: 20px; background: var(--accg); color: var(--acc); font-size: 12px; font-weight: 700; }

.adr { padding: 10px 0; border-bottom: 1px solid var(--border); }
.adr:last-child { border-bottom: none; }
.adr-q { font-size: 11px; color: var(--t3); margin-bottom: 3px; }
.adr-v { font-size: 14px; font-weight: 600; }
/* edit answers button */
.edit-ans-btn { font-size: 11px; color: var(--acc); background: none; border: none; cursor: pointer; font-family: var(--ff); font-weight: 700; padding: 4px 0; text-decoration: underline; }

/* ─────────────────────────────────────────
   LEADERBOARD
───────────────────────────────────────── */
.lb-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 4px; gap: 2px; }
.lb-tab { flex: 1; padding: 12px 8px 10px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--t3); cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s; }
.lb-tab.active { color: var(--acc); border-bottom-color: var(--acc); }

.winner-banner { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, rgba(255,214,10,.08), rgba(255,107,53,.06)); border: 1px solid rgba(255,214,10,.25); border-radius: var(--r2); padding: 12px 14px; margin-bottom: 14px; }
.winner-crown { font-size: 22px; flex-shrink: 0; }

.lb-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--r2); border: 1px solid var(--border); background: var(--s2); margin-bottom: 8px; cursor: pointer; transition: all .18s; }
.lb-row:hover { background: var(--s3); }
.lb-row.me { border-color: rgba(255,107,53,.4); background: var(--accg); }
.lbrank { font-family: var(--fm); font-size: 12px; color: var(--t3); width: 26px; flex-shrink: 0; text-align: center; }
.lbrank.g { color: var(--yellow); font-weight: 700; }
.lbrank.s { color: #b8b8c8; }
.lbrank.b { color: #cd7f32; }
.av-sm { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--s3); overflow: hidden; cursor: pointer; transition: opacity .15s; }
.av-sm:hover { opacity: .8; }
.av-sm img { width: 100%; height: 100%; object-fit: cover; }
.lbn { flex: 1; font-weight: 700; font-size: 14px; }
.u-link { cursor: pointer; text-decoration: none; color: inherit; transition: color .15s; }
.u-link:hover { color: var(--acc); }
.lbsub { font-size: 11px; color: var(--t3); margin-top: 2px; }
.lbsc { font-family: var(--fm); font-size: 18px; font-weight: 500; color: var(--acc); }
.lbsc.neg { color: var(--red); }
.pid-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: var(--s2); border: 1px solid var(--border); font-family: var(--fm); font-size: 11px; color: var(--t2); margin-bottom: 14px; cursor: pointer; transition: border-color .2s; }
.pid-badge:hover { border-color: var(--acc); color: var(--acc); }

/* ─────────────────────────────────────────
   HISTORY
───────────────────────────────────────── */
.sgrid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 14px; }
.sbox { background: var(--s1); border: 1px solid var(--border); border-radius: var(--r2); padding: 14px 16px; }
.sval { font-family: var(--fm); font-size: 26px; font-weight: 500; color: var(--acc); }
.sval.neg { color: var(--red); }
.slbl { font-size: 10px; color: var(--t3); margin-top: 3px; text-transform: uppercase; letter-spacing: .8px; }
.chart-w { width: 100%; height: 130px; position: relative; margin-top: 4px; }
canvas#histChart { width: 100% !important; height: 130px !important; }
.qhrow { padding: 14px 0; border-bottom: 1px solid var(--border); }
.qhrow:last-child { border-bottom: none; }
.qhhd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.qhic { font-size: 16px; }
.qhn { font-size: 13px; font-weight: 600; flex: 1; }
.qhav { font-family: var(--fm); font-size: 12px; color: var(--acc); }
.spark-w { height: 36px; }
canvas.spark { width: 100% !important; height: 36px !important; }
.hent { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.hent:last-child { border-bottom: none; }
.hdt { font-family: var(--fm); font-size: 11px; color: var(--t3); flex: 1; }
.hbw { flex: 2; height: 5px; background: var(--s3); border-radius: 3px; overflow: hidden; }
.hbf { height: 100%; background: var(--acc); border-radius: 3px; transition: width .4s; }
.hbf.neg { background: var(--red); }
.hsc { font-family: var(--fm); font-size: 15px; color: var(--acc); min-width: 52px; text-align: right; }
.hsc.neg { color: var(--red); }
.trophy-box { background: var(--s2); border: 1px solid var(--border); border-radius: var(--r2); padding: 14px 10px; text-align: center; }
.trophy-ic { font-size: 28px; margin-bottom: 6px; }
.trophy-val { font-family: var(--fm); font-size: 24px; font-weight: 500; color: var(--yellow); }
.trophy-lbl { font-size: 10px; color: var(--t3); margin-top: 3px; text-transform: uppercase; letter-spacing: .8px; }
.hist-lb-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.hist-lb-row:last-child { border-bottom: none; }

/* ─────────────────────────────────────────
   PACKS PAGE
───────────────────────────────────────── */
.pc { background: var(--s1); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; margin-bottom: 10px; }
.pc.act { border-color: var(--acc); }
.pcn { font-size: 16px; font-weight: 700; }
.pcm { font-family: var(--fm); font-size: 11px; color: var(--t3); margin-top: 3px; }
.pcact { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.sec-blk { background: var(--s2); border: 1px solid var(--border); border-radius: var(--r2); margin-bottom: 8px; overflow: hidden; }
.sec-hd { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.sec-ic { font-size: 18px; width: 26px; text-align: center; }
.sec-tit { font-size: 13px; font-weight: 700; flex: 1; }
.sec-body { padding: 10px 14px 14px; }

/* question item: drag-handle | edit | delete | icon | text */
.qi {
  display: flex; align-items: center; gap: 0;
  padding: 0; background: var(--s1);
  border-radius: var(--r3); margin-bottom: 6px;
  border: 1px solid var(--border);
  transition: background .15s, box-shadow .15s;
}
.qi.drag-over { box-shadow: 0 0 0 2px var(--acc); }
.qi.dragging  { opacity: .4; }
.qi-drag {
  width: 32px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: grab; color: var(--t3); font-size: 14px;
  border-right: 1px solid var(--border);
  touch-action: none;
}
.qi-drag:active { cursor: grabbing; }
.qi-drag::before { content: '⠿'; font-size: 16px; }
.qi-act { display: flex; gap: 0; flex-shrink: 0; border-left: 1px solid var(--border); }
.ibtn { background: none; border: none; color: var(--t3); cursor: pointer; font-size: 15px; padding: 6px 8px; transition: color .15s; height: 44px; display: flex; align-items: center; }
.ibtn:hover { color: var(--text); }
.ibtn.d:hover { color: var(--red); }
.qi-body { display: flex; align-items: center; gap: 8px; padding: 10px 12px; flex: 1; min-width: 0; }
.qi-ic { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.qi-txt { font-size: 13px; font-weight: 600; flex: 1; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qi-ty { font-family: var(--fm); font-size: 10px; color: var(--t3); }

/* icon grid */
.igrid { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; max-height: 190px; overflow-y: auto; padding: 2px; }
.igbtn { aspect-ratio: 1; border-radius: 8px; background: var(--s2); border: 1.5px solid transparent; display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; transition: all .15s; }
.igbtn:hover, .igbtn.sel { border-color: var(--acc); background: var(--accg); }

.join-input-row { display: flex; gap: 8px; margin-bottom: 14px; }
.join-input-row input { flex: 1; }

/* ─────────────────────────────────────────
   PROFILE
───────────────────────────────────────── */
.pfp-big { width: 88px; height: 88px; border-radius: 50%; border: 2.5px solid var(--acc); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 40px; background: var(--s2); margin: 0 auto 12px; }
.pfp-big img { width: 100%; height: 100%; object-fit: cover; }
.pname { font-size: 24px; font-weight: 800; text-align: center; }
.psince { font-size: 12px; color: var(--t3); font-family: var(--fm); text-align: center; margin-top: 4px; }
.del-opt { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.del-opt:last-child { border-bottom: none; }
.del-opt input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--red); flex-shrink: 0; }

/* ─────────────────────────────────────────
   COMMENTS
───────────────────────────────────────── */
.comment-modal-inner {
  display: flex;
  flex-direction: column;
  height: 97vh;
  overflow: hidden;
}
.comment-modal-inner * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.comment-modal-inner *::-webkit-scrollbar {
  display: none;
}
.comment-scroll-area {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.comment-composer-sticky {
  flex-shrink: 0;
  background: var(--s1);
  border-top: 1px solid var(--border);
  padding: 12px;
  padding-bottom: 100px;
}
.comment-section { }
.comment-header { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--t3); margin-bottom: 14px; }
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-item.reply { padding-left: 16px; border-left: 2px solid var(--border2); margin-left: 8px; }
.c-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.c-av { width: 28px; height: 28px; border-radius: 50%; background: var(--s3); display: flex; align-items: center; justify-content: center; font-size: 14px; overflow: hidden; flex-shrink: 0; cursor: pointer; transition: opacity .15s; }
.c-av:hover { opacity: .75; }
.c-av img { width: 100%; height: 100%; object-fit: cover; }
.c-name { font-size: 13px; font-weight: 700; cursor: pointer; transition: color .15s; }
.c-name:hover { color: var(--acc); }
/* role badges */
.c-role { font-size: 10px; font-family: var(--fm); padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.c-role.admin { background: rgba(255,77,109,.15); color: var(--red); }
.c-role.owner { background: rgba(255,107,53,.15); color: var(--acc); }
.c-time { font-family: var(--fm); font-size: 10px; color: var(--t3); margin-left: auto; }
.c-text { font-size: 14px; color: var(--t2); line-height: 1.55; margin-bottom: 6px; word-break: break-word; }
/* @mention highlight */
.c-mention { color: var(--acc); font-weight: 600; text-decoration: none;}
/* link in comments */
.c-link { color: var(--blue); text-decoration: underline; cursor: pointer; }
.c-img { max-width: 100%; border-radius: var(--r3); margin-top: 8px; display: block; }
.c-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.c-reply-btn, .c-like-btn, .c-del-btn { font-size: 11px; background: none; border: none; cursor: pointer; font-family: var(--ff); font-weight: 600; padding: 0; transition: color .15s; }
.c-reply-btn { color: var(--t3); }
.c-reply-btn:hover { color: var(--acc); }
.c-like-btn { color: var(--t3); display: flex; align-items: center; gap: 4px; }
.c-like-btn.liked { color: var(--red); }
.c-like-btn:hover { color: var(--red); }
.c-del-btn { color: var(--t3); margin-left: auto; }
.c-del-btn:hover { color: var(--red); }

.comment-composer { background: var(--s2); border: 1.5px solid var(--border); border-radius: var(--r2); padding: 12px 14px; }
.comment-composer textarea { width: 100%; background: transparent; border: none; outline: none; color: var(--text); font-family: var(--ff); font-size: 14px; resize: none; min-height: 56px; }
.comment-composer-footer { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.c-img-btn { background: var(--s3); border: 1px solid var(--border); border-radius: var(--r3); padding: 6px 10px; font-size: 12px; cursor: pointer; color: var(--t2); transition: color .15s; }
.c-img-btn:hover { color: var(--acc); border-color: var(--acc); }
.c-reply-tag { font-size: 11px; color: var(--blue); font-family: var(--fm); }

/* ─────────────────────────────────────────
   PUBLIC USER PROFILE (user.html)
───────────────────────────────────────── */
.up-hero { text-align: center; padding: 40px 20px 28px; }
.up-av { width: 88px; height: 88px; border-radius: 50%; border: 2.5px solid var(--acc); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 40px; background: var(--s2); margin: 0 auto 12px; }
.up-av img { width: 100%; height: 100%; object-fit: cover; }
.up-name { font-size: 26px; font-weight: 800; }
.up-since { font-size: 12px; color: var(--t3); font-family: var(--fm); margin-top: 4px; }
.up-roles { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.up-badge { font-size: 11px; font-family: var(--fm); padding: 3px 10px; border-radius: 20px; font-weight: 700; }
.up-badge.admin { background: rgba(255,77,109,.15); color: var(--red); border: 1px solid rgba(255,77,109,.3); }
.up-badge.member { background: var(--accg); color: var(--acc); border: 1px solid rgba(255,107,53,.3); }
.up-private { text-align: center; padding: 40px 20px; color: var(--t3); font-size: 14px; }

/* ─────────────────────────────────────────
   LANDING PAGE (index.html)
───────────────────────────────────────── */
.land-wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; text-align: center; position: relative; z-index: 1; }
.land-logo { font-size: 48px; font-weight: 800; letter-spacing: -2px; margin-bottom: 8px; }
.land-logo b { color: var(--acc); }
.land-tagline { font-size: 16px; color: var(--t2); margin-bottom: 10px; max-width: 320px; line-height: 1.6; }
.land-version { font-family: var(--fm); font-size: 11px; color: var(--t3); margin-bottom: 36px; }
.land-features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 400px; width: 100%; margin-bottom: 36px; }
.land-feat { background: var(--s1); border: 1px solid var(--border); border-radius: var(--r2); padding: 14px; text-align: left; }
.land-feat-icon { font-size: 22px; margin-bottom: 6px; }
.land-feat-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.land-feat-desc { font-size: 11px; color: var(--t3); line-height: 1.5; }
.land-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
.land-footer { margin-top: 40px; font-size: 11px; color: var(--t3); }
.land-footer a { color: var(--blue); text-decoration: none; }

/* ─────────────────────────────────────────
   MISC
───────────────────────────────────────── */
/* Submit date selector */
.submit-date-row { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.submit-date-tabs { display: flex; gap: 6px; }
.submit-date-tab { flex: 1; padding: 9px 10px; border-radius: var(--r3); border: 1.5px solid var(--border); background: var(--s2); color: var(--t3); font-size: 12px; font-weight: 700; cursor: pointer; text-align: center; transition: all .18s; }
.submit-date-tab.active { border-color: var(--acc); color: var(--acc); background: var(--accg); }

/* PFP background color picker */
.pfp-bg-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.pfp-bg-swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all .15s; flex-shrink: 0; }
.pfp-bg-swatch:hover { transform: scale(1.15); }
.pfp-bg-swatch.sel { border-color: var(--acc); box-shadow: 0 0 0 2px var(--accg); }
.pfp-bg-custom { display: flex; align-items: center; justify-content: center; background: var(--s3); border: 1.5px dashed var(--border2); font-size: 13px; position: relative; overflow: hidden; }
.pfp-bg-custom input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* Comment image crop overlay */
.c-crop-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.85); backdrop-filter: blur(8px); z-index: 9500; display: none; align-items: center; justify-content: center; padding: 20px; }
.c-crop-box { background: var(--s1); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; width: 100%; max-width: 420px; animation: mup .25s cubic-bezier(.22,.68,0,1.2); }
.c-crop-title { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.c-crop-wrap { width: 100%; margin-bottom: 14px; }
.c-crop-canvas { width: 100%; display: block; border-radius: var(--r2); background: #000; cursor: crosshair; touch-action: none; }
.c-crop-controls { margin-bottom: 14px; }
.c-crop-actions { display: flex; gap: 8px; }
.ascii-wrap { display: flex; justify-content: center; }
.ascii-art { color: var(--red); margin: 0; }
.noselect { -webkit-user-select: none; -moz-user-select: none; user-select: none; cursor: default; }
