:root {
    --bg: #0f1020;
    --bg-2: #151731;
    --card: rgba(255, 255, 255, 0.05);
    --card-hover: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.08);
    --text: #eef0ff;
    --muted: #9aa1c0;
    --purple: #c084fc;
    --indigo: #818cf8;
    --blue: #60a5fa;
    --green: #10b981;
    --discord: #5865f2;
    --radius: 16px;
    --font-main: "Unbounded", ui-sans-serif, system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* Prevent flash of logged-out UI before JS applies auth state */
.boot .auth-area,
.boot .comment-hint,
.boot .comment-form-box { visibility: hidden; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* Glows */
.glow { position: absolute; border-radius: 50%; filter: blur(120px); pointer-events: none; z-index: 0; }
.glow-hero { width: 600px; height: 600px; top: -160px; right: -140px; background: radial-gradient(circle, rgba(192,132,252,.35), transparent 70%); }
.glow-exp { width: 500px; height: 500px; top: 40%; left: -180px; background: radial-gradient(circle, rgba(96,165,250,.22), transparent 70%); }

/* Header */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 26px;
    padding: 14px 34px;
    background: rgba(15, 16, 32, 0.72);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; letter-spacing: .5px; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 12px var(--purple); animation: pulse 2s infinite; }
.nav { display: flex; gap: 22px; flex: 1; }
.nav a { position: relative; color: var(--muted); font-size: .85rem; font-weight: 500; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: -5px; height: 2px; width: 0; background: var(--purple); transition: width .25s ease; }
.nav a:hover { color: var(--text); }
.nav a:hover::after { width: 100%; }
.auth-area { display: flex; align-items: center; gap: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 10px 20px; font-family: var(--font-main); font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .15s ease; border: 1px solid transparent; }
.btn:active { transform: scale(.95); }
.btn-solid { background: var(--discord); color: #fff; }
.btn-solid:hover { background: #4752c4; }
.btn-outline { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid rgba(255,255,255,.18); }
.btn-outline:hover { background: #fff; color: #000; transform: scale(1.05); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--card); border: 1px solid var(--border); color: var(--muted); cursor: pointer; transition: all .15s ease; font-size: 1rem; }
.btn-icon:hover { color: var(--text); background: var(--card-hover); box-shadow: 0 0 20px rgba(192,132,252,.3); }

/* User chip */
.user-chip { display: inline-flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--border); padding: 4px 10px 4px 4px; border-radius: 999px; }
.user-chip img { border-radius: 50%; object-fit: cover; }
.chip-x { background: transparent; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 0 2px; }
.chip-x:hover { color: #fff; }

/* Hero */
.hero { position: relative; display: grid; place-items: center; text-align: center; padding: 110px 24px 90px; overflow: hidden; }
.hero-inner { position: relative; z-index: 1; max-width: 900px; }
.badge { display: inline-flex; align-items: center; gap: 9px; padding: 8px 16px; border-radius: 999px; background: rgba(192,132,252,.12); border: 1px solid rgba(192,132,252,.3); color: var(--purple); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); animation: pulse 1.6s infinite; }
.hero-title { margin-top: 26px; font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.05; text-shadow: 0 25px 50px rgba(0,0,0,.4); }
.grad-text { background: linear-gradient(90deg, #c084fc, #818cf8, #60a5fa); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.grad-text-b { background: linear-gradient(180deg, #fff, rgba(255,255,255,.25)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { margin-top: 18px; color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.25rem); font-weight: 300; }

/* Socials row */
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.soc-link { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--card); border: 1px solid var(--border); transition: all .18s ease; }
.soc-link:hover { transform: translateY(-3px); box-shadow: 0 0 34px rgba(192,132,252,.35); background: var(--card-hover); }
.soc-link img { width: 26px; height: 26px; border-radius: 6px; }
.soc-name { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .62rem; color: var(--muted); opacity: 0; transition: opacity .18s ease; }
.soc-link:hover .soc-name { opacity: 1; }
.soc-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #ef4444; color: #fff; border: none; font-size: .8rem; line-height: 1; cursor: pointer; }

/* Sections */
.section { position: relative; max-width: 1060px; margin: 0 auto; padding: 70px 28px; overflow: hidden; }
.section.alt { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; }
.micro { color: var(--purple); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; }
.section-title { margin-top: 10px; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; }
.section-sub { margin-top: 12px; color: var(--muted); font-weight: 300; }

.mono-list { list-style: none; margin-top: 30px; display: grid; gap: 14px; max-width: 720px; }
.mono-list li { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.mono-list i { color: var(--purple); width: 20px; text-align: center; }
.mono { font-family: var(--font-mono); color: var(--indigo); font-size: .9em; }

/* Gallery */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 34px; }
.tile { aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--border); transition: transform .2s ease, box-shadow .2s ease; }
.tile:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.placeholder { display: grid; place-items: center; color: var(--muted); font-family: var(--font-mono); font-size: .8rem; border-style: dashed; }

/* CTA */
.cta { display: grid; place-items: center; text-align: center; }
.cta-card { max-width: 620px; width: 100%; padding: 54px 40px; background: var(--card); border: 1px solid var(--border); border-radius: 24px; backdrop-filter: blur(8px); }
.cta-icon { font-size: 2.4rem; color: var(--discord); animation: float 3.5s ease-in-out infinite; }
.cta-card .btn { margin-top: 24px; }

/* Footer */
footer { padding: 40px 30px 60px; }
.hairline { height: 1px; max-width: 1060px; margin: 0 auto 30px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); }
.footer-inner { max-width: 1060px; margin: 0 auto; display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; }
.footer-inner a:hover { color: var(--text); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); padding: 20px; }
.modal-panel { width: min(360px, 90vw); max-height: 88vh; overflow-y: auto; padding: 26px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 18px; }
.modal-panel.wide { width: min(560px, 92vw); }
.modal-panel h3 { margin-bottom: 16px; }
.modal-panel input[type="text"], .modal-panel input[type="url"] { width: 100%; margin-bottom: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.05); color: var(--text); font-family: var(--font-main); }
.modal-panel input:focus, .modal-panel textarea:focus { outline: none; border-color: var(--purple); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; }

/* Tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.tab { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer; font-family: var(--font-main); font-size: .8rem; }
.tab.active { background: rgba(192,132,252,.15); border-color: rgba(192,132,252,.4); color: var(--purple); }

/* Content editor fields */
.field-group { margin-bottom: 14px; }
.field-label { display: block; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field-group input, .field-group textarea { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.05); color: var(--text); font-family: var(--font-main); font-size: .85rem; }
.field-group textarea { resize: vertical; min-height: 64px; }

/* Comments */
.comment-form { margin-top: 28px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.comment-hint { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.comment-form-box { display: flex; flex-direction: column; gap: 10px; }
.comment-form-box textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(0,0,0,.25); color: var(--text); font-family: var(--font-main); font-size: .9rem; resize: vertical; }
.comment-form-row { display: flex; align-items: center; justify-content: space-between; }
.muted-sm { color: var(--muted); font-size: .75rem; font-family: var(--font-mono); }
.comments { margin-top: 22px; display: grid; gap: 14px; }
.comment { position: relative; display: flex; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.comment img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.comment-author { font-weight: 600; font-size: .9rem; }
.comment-date { color: var(--muted); font-size: .72rem; font-family: var(--font-mono); }
.comment-text { color: var(--text); font-size: .9rem; word-break: break-word; }
.comment-empty { color: var(--muted); text-align: center; padding: 30px 0; font-size: .85rem; }
.comment-del { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%; background: #ef4444; color: #fff; border: none; cursor: pointer; font-size: .85rem; line-height: 1; }

/* Admin comments list */
.admin-comment { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.admin-comment img { width: 32px; height: 32px; border-radius: 50%; }
.admin-comment .ac-main { flex: 1; min-width: 0; }
.admin-comment .ac-name { font-size: .8rem; font-weight: 600; }
.admin-comment .ac-text { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

@media (max-width: 720px) {
    .topbar { padding: 12px 18px; gap: 16px; }
    .nav { gap: 14px; }
    .nav a { font-size: .75rem; }
    .hero { padding: 70px 18px 60px; }
}