@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #08080d;
  --bg-2: #0c0c15;
  --surface: rgba(22, 22, 32, 0.72);
  --surface-solid: #16161f;
  --surface2: rgba(32, 32, 46, 0.6);
  --surface2-solid: #1e1e2a;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --accent: #8b7cf6;
  --accent-bright: #a99ef9;
  --accent2: #5eead4;
  --accent2-bright: #7ff0de;
  --gold: #ffc24b;
  --text: #f2f2fa;
  --muted: #8b8b9e;
  --muted-2: #6b6b7e;
  --danger: #f0566a;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
  --grad-accent: linear-gradient(135deg, #8b7cf6 0%, #6d5ce8 100%);
  --grad-teal: linear-gradient(135deg, #5eead4 0%, #34c9b0 100%);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', 'Noto Sans KR', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ambient glow background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(720px circle at 12% -8%, rgba(139, 124, 246, 0.14), transparent 55%),
    radial-gradient(680px circle at 92% 4%, rgba(94, 234, 212, 0.10), transparent 50%),
    radial-gradient(900px circle at 50% 110%, rgba(139, 124, 246, 0.07), transparent 60%),
    var(--bg);
}

a { color: var(--accent-bright); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--text); }

::selection { background: rgba(139, 124, 246, 0.35); color: #fff; }

/* scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.09); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); background-clip: content-box; }

/* ── layout ── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 16, 0.62);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  position: sticky; top: 0; z-index: 100;
}
.nav-logo {
  font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 9px;
}
.nav-logo span {
  background: var(--grad-accent);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav a { color: var(--muted); font-size: 0.9rem; font-weight: 500; position: relative; }
.nav a:hover { color: var(--text); }

.container { max-width: 920px; margin: 0 auto; padding: 40px 22px; }
.wide { max-width: 1140px; }

/* ── cards ── */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
}
.card + .card { margin-top: 18px; }
.card-title {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ""; width: 3px; height: 13px; border-radius: 3px;
  background: var(--grad-accent);
}

/* ── form ── */
label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; margin-top: 16px; font-weight: 500; }
label:first-child { margin-top: 0; }
input[type=text], input[type=password], input[type=email], input[type=number], textarea, select {
  width: 100%; padding: 12px 15px;
  background: var(--surface2-solid); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 0.95rem;
  outline: none; transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
  font-family: inherit;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: #20202e;
  box-shadow: 0 0 0 4px rgba(139, 124, 246, 0.14);
}
textarea { resize: vertical; min-height: 96px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 22px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  border: none; font-family: inherit; letter-spacing: 0.01em;
  transition: transform 0.12s var(--ease), box-shadow 0.18s var(--ease), opacity 0.15s, filter 0.15s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: var(--grad-accent); color: #fff;
  box-shadow: 0 6px 18px rgba(109, 92, 232, 0.35), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 28px rgba(109, 92, 232, 0.5), inset 0 1px 0 rgba(255,255,255,0.18); transform: translateY(-1px); }
.btn-teal {
  background: var(--grad-teal); color: #06241e;
  box-shadow: 0 6px 18px rgba(52, 201, 176, 0.3), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-teal:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 10px 28px rgba(52, 201, 176, 0.42), inset 0 1px 0 rgba(255,255,255,0.3); }
.btn-ghost { background: var(--surface2-solid); color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: rgba(255,255,255,0.28); background: #24243340; transform: translateY(-1px); }
.btn-danger { background: rgba(240,86,106,0.12); color: var(--danger); border: 1px solid rgba(240,86,106,0.3); }
.btn-danger:hover { background: rgba(240,86,106,0.22); transform: translateY(-1px); }
.btn-sm { padding: 7px 13px; font-size: 0.82rem; }
.btn-full { width: 100%; justify-content: center; margin-top: 20px; }
.btn-naver {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  background: #03c75a; color: #fff; font-weight: 700; font-size: 0.92rem;
  border: none; cursor: pointer; text-decoration: none;
  box-shadow: 0 6px 18px rgba(3, 199, 90, 0.28), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.12s var(--ease), filter 0.15s, box-shadow 0.18s;
}
.btn-naver:hover { filter: brightness(1.06); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 26px rgba(3, 199, 90, 0.4), inset 0 1px 0 rgba(255,255,255,0.2); }

/* ── poll bar ── */
.poll-option {
  position: relative; overflow: hidden;
  background: var(--surface2-solid); border-radius: var(--radius-sm);
  padding: 13px 15px; margin-bottom: 9px;
  border: 1px solid var(--border); cursor: pointer;
  transition: border-color 0.18s var(--ease), transform 0.12s var(--ease);
}
.poll-option:hover { border-color: var(--accent); transform: translateX(2px); }
.poll-option .fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(139,124,246,0.28), rgba(94,234,212,0.16));
  transition: width 0.6s var(--ease);
}
.poll-option .label { position: relative; display: flex; justify-content: space-between; font-size: 0.9rem; font-weight: 500; }
.poll-pct { font-size: 0.82rem; color: var(--accent-bright); font-weight: 700; }

/* ── roulette ── */
.roulette-track {
  overflow: hidden; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface2-solid);
  height: 64px; position: relative; margin: 18px 0;
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.4);
}
.roulette-inner { display: flex; flex-direction: column; transition: transform 0.1s linear; }
.roulette-item {
  height: 64px; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 600; flex-shrink: 0;
}
.roulette-highlight {
  position: absolute; inset: 0; border: 2px solid var(--accent2);
  border-radius: var(--radius-sm); pointer-events: none;
  box-shadow: inset 0 0 28px rgba(94,234,212,0.18), 0 0 18px rgba(94,234,212,0.12);
}
.winner-banner {
  background: linear-gradient(135deg, rgba(94,234,212,0.14), rgba(139,124,246,0.14));
  border: 1px solid rgba(94,234,212,0.3);
  border-radius: var(--radius);
  padding: 24px; text-align: center; display: none;
  box-shadow: var(--shadow), 0 0 40px rgba(94,234,212,0.1);
}
.winner-banner .name {
  font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em;
  background: var(--grad-teal); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.winner-banner .sub { font-size: 0.85rem; color: var(--muted); margin-top: 5px; }

/* ── user table ── */
.user-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.user-table th { color: var(--muted); font-weight: 600; padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border-strong); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; }
.user-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.user-table tr:last-child td { border-bottom: none; }
.user-table tbody tr { transition: background 0.15s var(--ease); }
.user-table tbody tr:hover td { background: rgba(139,124,246,0.05); }

/* ── badge ── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em;
}
.badge-purple { background: rgba(139,124,246,0.18); color: var(--accent-bright); border: 1px solid rgba(139,124,246,0.28); }
.badge-teal   { background: rgba(94,234,212,0.16);  color: var(--accent2); border: 1px solid rgba(94,234,212,0.26); }

/* ── grid ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── stat card ── */
.stat { text-align: center; padding: 22px; }
.stat .num {
  font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em;
  background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat .lbl { font-size: 0.78rem; color: var(--muted); margin-top: 5px; font-weight: 500; }

/* ── toast ── */
.toast {
  position: fixed; bottom: 26px; right: 26px;
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 13px 20px;
  font-size: 0.88rem; box-shadow: var(--shadow-lg);
  transform: translateY(80px); opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); pointer-events: none; z-index: 999;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── alerts ── */
.alert-error {
  background: rgba(240,86,106,0.1); border: 1px solid rgba(240,86,106,0.32);
  color: #f0566a; border-radius: var(--radius-sm);
  padding: 12px 15px; font-size: 0.85rem; margin-bottom: 18px;
}
.alert-success {
  background: rgba(94,234,212,0.1); border: 1px solid rgba(94,234,212,0.32);
  color: var(--accent2); border-radius: var(--radius-sm);
  padding: 12px 15px; font-size: 0.85rem; margin-bottom: 18px;
}

/* ── section gap ── */
.section-gap { margin-top: 30px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
h1 { letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.01em; }
h3 { font-size: 0.95rem; font-weight: 600; }
.text-muted { color: var(--muted); font-size: 0.85rem; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* ── hero ── */
.hero { text-align: center; padding: 18px 10px 34px; }
.hero-title {
  font-size: clamp(1.8rem, 5vw, 2.7rem); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.15;
}
.hero-title span {
  background: var(--grad-accent);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin: 0 4px;
}
.hero-sub {
  color: var(--muted); font-size: 0.96rem; margin-top: 12px;
  max-width: 460px; margin-left: auto; margin-right: auto;
}

/* ── entrance animation ── */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card, .profile-card, .winner-banner { animation: rise 0.5s var(--ease) both; }
