:root {
  --bg: #0a0608;
  --bg-soft: #120a0e;
  --panel: rgba(16, 10, 14, 0.92);
  --line: rgba(200, 168, 76, 0.15);
  --txt: #e8ddd0;
  --muted: #a09080;
  --gold: #c9a84c;
  --gold-light: #e8c44a;
  --gold-dark: #8a6e2b;
  --blood: #6b0000;
  --blood-light: #8b1a1a;
  --discord: #5865f2;
  --discord-hover: #4752c4;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; scroll-behavior: smooth; }
body { font-family: Manrope, sans-serif; background: radial-gradient(circle at 50% 0%, #1a1015 0%, var(--bg) 60%); color: var(--txt); overflow-x: hidden; }
.bg-gradient { position: fixed; inset: 0; background: radial-gradient(circle at 80% 10%, rgba(200,168,76,.06), transparent 45%), radial-gradient(circle at 20% 90%, rgba(107,0,0,.08), transparent 40%); z-index: -1; pointer-events: none; }
.container { width: min(1120px, 92vw); margin: 0 auto; }

/* Navigation */
.nav { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; gap: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.nav-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { font-family: Cinzel, serif; font-weight: 800; font-size: 1.5rem; color: var(--gold-light); text-decoration: none; display: flex; align-items: center; gap: 10px; text-transform: uppercase; letter-spacing: .08em; }
.dot { width: 10px; height: 10px; border-radius: 0; background: var(--gold); transform: rotate(45deg); display: inline-block; }
nav { display: flex; gap: 14px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; }
nav a:hover { color: var(--gold-light); }

/* User menu */
.user-menu { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border: 1px solid var(--line); background: var(--panel); }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; }
.user-name { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gold); }
.user-logout { background: none; border: none; color: var(--muted); padding: 4px 8px; cursor: pointer; font-size: .8rem; font-family: Manrope, sans-serif; }
.user-logout:hover { color: var(--blood-light); }

/* Hero */
.hero { padding: 48px 0 28px; text-align: center; position: relative; }
.hero::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 60%; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dark), var(--gold), var(--gold-dark), transparent); }
.tag { color: var(--gold); letter-spacing: .12em; text-transform: uppercase; font-size: .7rem; font-weight: 700; font-family: Cinzel, serif; }
h1, h2, h3 { font-family: Cinzel, serif; margin: 0; text-transform: uppercase; letter-spacing: .03em; }
h1 { font-size: clamp(2rem, 6vw, 3.5rem); line-height: 1.05; max-width: 18ch; margin: 0 auto; }
h1 span { color: var(--gold-light); }
.lead { max-width: 62ch; color: var(--muted); margin: 14px auto 0; font-size: 1rem; line-height: 1.6; }

/* Discord login button */
.discord-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; background: var(--discord); color: #fff; border-radius: 4px; text-decoration: none; font-weight: 700; font-family: Manrope, sans-serif; font-size: .95rem; margin-top: 20px; }
.discord-btn:hover { background: var(--discord-hover); }

/* Server grid */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 16px; }
.server-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); cursor: pointer; transition: .2s; text-align: left; }
.server-card:hover { border-color: var(--gold-dark); background: rgba(200,168,76,.06); }
.server-card.selected { border-color: var(--gold); background: rgba(200,168,76,.1); }
.server-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--panel); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; overflow: hidden; }
.server-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-info h4 { font-family: Manrope, sans-serif; text-transform: none; font-size: .9rem; color: var(--txt); }
.server-info p { font-size: .75rem; color: var(--muted); margin: 2px 0 0; }

/* Template badges */
.templates-preview { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.template-badge { padding: 6px 14px; border: 1px solid var(--line); background: rgba(200,168,76,.06); color: var(--gold); font-size: .8rem; cursor: pointer; font-weight: 600; }
.template-badge:hover { background: rgba(200,168,76,.15); border-color: var(--gold-dark); }

/* Input area */
.input-area { margin-top: 28px; }
.input-wrapper { display: flex; max-width: 640px; margin: 0 auto; border: 1px solid var(--line); background: var(--panel); align-items: center; overflow: hidden; }
.input-icon { padding: 0 12px; font-size: 1.3rem; flex-shrink: 0; }
.input-wrapper input { flex: 1; padding: 14px 0; border: none; background: transparent; color: var(--txt); font-family: Manrope, sans-serif; font-size: .9rem; outline: none; min-width: 0; }
.input-wrapper input::placeholder { color: var(--muted); opacity: .7; }
.input-wrapper .btn { border-radius: 0; padding: 14px 20px; cursor: pointer; font-size: .8rem; }
.btn { display: inline-flex; padding: 12px 20px; border-radius: 2px; text-decoration: none; font-weight: 700; border: 1px solid transparent; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; font-family: Cinzel, serif; }
.btn-sm { padding: 8px 14px; font-size: .7rem; }
.primary { background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light)); color: #0a0608; border-color: var(--gold); cursor: pointer; }
.primary:disabled { opacity: .5; cursor: not-allowed; }
.ghost { border-color: var(--gold-dark); color: var(--gold); background: rgba(200,168,76,.05); cursor: pointer; }
.ghost:hover { background: rgba(200,168,76,.12); }
.input-hint { color: var(--muted); font-size: .8rem; margin-top: 6px; opacity: .7; }

/* Generate section */
.generate-section { margin-top: 48px; padding: 0; }
.generate-panel { border: 1px solid var(--line); border-top: 2px solid var(--gold-dark); background: var(--panel); }
.gen-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.gen-server-info { display: flex; align-items: center; gap: 12px; }
.gen-server-info img { width: 36px; height: 36px; border-radius: 50%; background: var(--bg); }
.gen-server-info h3 { font-size: 1rem; text-transform: none; font-family: Manrope, sans-serif; color: var(--txt); }
.gen-server-id { font-size: .7rem; color: var(--muted); margin: 0; }
.gen-body { padding: 18px; }

/* Gen status */
.gen-status { margin-top: 14px; padding: 12px 16px; border: 1px solid var(--line); }
.gen-status.success { border-color: rgba(100,200,100,.3); background: rgba(100,200,100,.05); }
.gen-status.info { border-color: var(--gold-dark); background: rgba(200,168,76,.05); }
.gen-status.error { border-color: rgba(200,50,50,.3); background: rgba(200,50,50,.05); }
.gen-status p { margin: 0; font-size: .9rem; }
.gen-status code { color: var(--gold-light); background: rgba(200,168,76,.1); padding: 2px 6px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal { background: var(--bg); border: 1px solid var(--line); border-top: 3px solid var(--gold); padding: 28px; max-width: 420px; width: 90vw; text-align: center; }
.modal-icon { font-size: 2.5rem; }
.modal h3 { margin-top: 8px; font-size: 1.2rem; color: var(--gold); }
.modal-actions { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }

/* Features */
.features { margin-top: 48px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--gold-dark); }
.features h2 { text-align: center; margin-bottom: 20px; font-size: 1.5rem; color: var(--gold); }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card { padding: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.02); position: relative; }
.card-icon { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.card h3 { font-size: 1rem; color: var(--gold); }
.card p { margin: 8px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }

/* Templates section */
.templates-section { margin-top: 48px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--gold-dark); }
.templates-section h2 { text-align: center; margin-bottom: 20px; font-size: 1.5rem; color: var(--gold); }
.templates-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.template-card { border: 1px solid var(--line); overflow: hidden; cursor: pointer; transition: .2s; }
.template-card:hover { border-color: var(--gold-dark); }
.template-header { padding: 24px; text-align: center; font-size: 2.5rem; }
.gaming { background: linear-gradient(135deg, rgba(0,100,200,.2), rgba(0,50,150,.1)); }
.rp { background: linear-gradient(135deg, rgba(150,50,0,.2), rgba(100,30,0,.1)); }
.school { background: linear-gradient(135deg, rgba(0,150,50,.2), rgba(0,100,30,.1)); }
.friends { background: linear-gradient(135deg, rgba(200,100,0,.2), rgba(150,70,0,.1)); }
.template-body { padding: 14px; }
.template-body h3 { font-size: 1rem; color: var(--gold-light); text-align: center; }
.template-structure { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.template-structure span { color: var(--muted); font-size: .8rem; padding: 3px 8px; background: rgba(255,255,255,.03); }

/* How it works */
.how-section { margin-top: 48px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--gold-dark); }
.how-section h2 { text-align: center; margin-bottom: 20px; font-size: 1.5rem; color: var(--gold); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.steps article { border: 1px solid var(--line); padding: 16px; background: rgba(255,255,255,.02); border-bottom: 2px solid var(--gold-dark); }
.step-num { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; background: rgba(200,168,76,.15); color: var(--gold); font-weight: 800; font-family: Cinzel, serif; font-size: 1rem; }
.steps h3 { margin-top: 10px; font-size: 1rem; text-transform: none; color: var(--gold); }
.steps p { color: var(--muted); margin: 8px 0 0; font-size: .85rem; line-height: 1.5; }

/* FAQ */
.faq { margin-top: 48px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--gold-dark); }
.faq h2 { text-align: center; margin-bottom: 20px; font-size: 1.5rem; color: var(--gold); }
.faq details { border: 1px solid var(--line); padding: 10px 14px; background: rgba(255,255,255,.02); border-bottom: 2px solid var(--gold-dark); }
.faq details + details { margin-top: 8px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--gold); font-family: Cinzel, serif; text-transform: uppercase; font-size: .85rem; letter-spacing: .04em; }
.faq p { color: var(--muted); margin: 10px 0 4px; font-size: .9rem; line-height: 1.5; }
.faq code { color: var(--gold-light); background: rgba(200,168,76,.1); padding: 2px 6px; }

/* CTA */
.cta { margin-top: 48px; padding: 36px 20px; text-align: center; background: linear-gradient(160deg, rgba(200,168,76,.08), rgba(107,0,0,.06)); border: 1px solid var(--line); }
.cta h2 { font-size: 1.5rem; color: var(--gold-light); margin-bottom: 10px; }
.cta p { color: var(--muted); }
.cta .btn { margin-top: 16px; }
.small { font-size: .85rem; }
.small a { color: var(--gold); text-decoration: none; }
.small a:hover { text-decoration: underline; }

/* Footer */
.footer { padding: 28px 0 34px; border-top: 1px solid var(--line); margin-top: 20px; }
.footer-content { text-align: center; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: Cinzel, serif; font-weight: 800; font-size: 1.2rem; color: var(--gold-light); text-transform: uppercase; letter-spacing: .08em; }
.footer-links { margin-top: 14px; display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: .85rem; }
.footer-links a:hover { color: var(--gold-light); }
.footer-text { color: var(--muted); font-size: .8rem; margin-top: 14px; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(16px); transition: .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===== DASHBOARD ===== */
.dashboard { margin-top: 20px; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--gold-dark); padding: 0; }
.dash-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap; }
.dash-guild { display: flex; align-items: center; gap: 12px; }
.dash-guild img { width: 36px; height: 36px; border-radius: 50%; background: var(--bg); }
.dash-guild h3 { font-size: 1rem; text-transform: none; font-family: Manrope, sans-serif; }
.dash-stats { font-size: .75rem; color: var(--muted); margin: 2px 0 0; }
.dash-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.dash-tab { padding: 12px 18px; background: none; border: none; color: var(--muted); font-family: Manrope, sans-serif; font-weight: 700; font-size: .8rem; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
.dash-tab:hover { color: var(--txt); }
.dash-tab.active { color: var(--gold-light); border-bottom-color: var(--gold); }
.dash-panel { display: none; padding: 18px; }
.dash-panel.active { display: block; }

/* Overview grid */
.overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.stat-card { border: 1px solid var(--line); padding: 16px; text-align: center; background: rgba(255,255,255,.02); }
.stat-card .stat-num { display: block; font-family: Cinzel, serif; font-size: 1.5rem; color: var(--gold-light); }
.stat-card span:last-child { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.ov-section { margin-top: 12px; }
.ov-section h4 { font-size: .85rem; color: var(--gold); margin-bottom: 6px; }
.ov-section code { color: var(--muted); font-size: .75rem; }
.ov-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ov-chip { padding: 3px 8px; font-size: .75rem; border: 1px solid var(--line); }

/* Rules */
textarea { font-family: Manrope, sans-serif; }
.ticket-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ticket-opt { padding: 8px 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.ticket-opt label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .85rem; color: var(--txt); }
.ticket-opt input[type="checkbox"] { accent-color: var(--gold); width: 16px; height: 16px; }

/* Responsive updates */
@media (max-width: 1100px) { .features-grid, .templates-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .nav, .nav-right { flex-direction: column; width: 100%; }
  .nav-right { align-items: stretch; }
  .features-grid, .templates-grid, .steps { grid-template-columns: 1fr; }
  .input-wrapper { flex-direction: column; }
  .input-wrapper input { width: 100%; padding: 14px; }
  .input-wrapper .btn { width: 100%; }
  .gen-header { flex-direction: column; align-items: flex-start; }
  .server-grid { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .ticket-options { grid-template-columns: 1fr; }
  .dash-tabs { gap: 0; }
  .dash-tab { padding: 10px 12px; font-size: .7rem; }
}
