@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* dark surfaces */
  --bg: #0B0E14;
  --surface: #141821;
  --surface-2: #1C212C;
  --surface-3: #242A38;
  --border: #2A3040;
  --border-strong: #3A4258;

  /* text */
  --text: #F5F7FB;
  --text-dim: #9099B0;
  --text-mute: #5A6278;

  /* signature neon green */
  --primary: #22E88C;
  --primary-hover: #14D67C;
  --primary-dark: #0FA85F;
  --primary-bg: rgba(34, 232, 140, 0.10);
  --primary-glow: rgba(34, 232, 140, 0.35);

  --robux: #22E88C;
  --robux-bg: rgba(34, 232, 140, 0.10);

  --purple: #8B5CF6;
  --purple-bg: rgba(139, 92, 246, 0.12);

  --success: #22E88C;
  --success-bg: rgba(34, 232, 140, 0.12);
  --danger: #FF5B6B;
  --danger-bg: rgba(255, 91, 107, 0.12);
  --warning: #FFB547;
  --warning-bg: rgba(255, 181, 71, 0.12);

  /* fonts */
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Bricolage Grotesque', 'Inter', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* legacy aliases */
  --serif: var(--display);
  --accent: var(--primary);
  --accent-dim: var(--primary-bg);

  /* shadows / glows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 24px var(--primary-glow);
  --shadow-btn: 0 4px 14px rgba(34, 232, 140, 0.35);

  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(34, 232, 140, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

a { color: var(--primary); text-decoration: none; font-weight: 600; }
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }

/* layout */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 20px 80px;
}

/* header */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  margin-bottom: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.brand {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #0B0E14;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}

.masthead nav {
  display: flex;
  gap: 4px;
  font-size: 14px;
}
.masthead nav a {
  color: var(--text-dim);
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  transition: all 120ms;
}
.masthead nav a:hover {
  color: var(--primary);
  background: var(--primary-bg);
  text-decoration: none;
}

/* section labels & headings */
.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: 12px;
  font-weight: 700;
}

h1.headline {
  font-family: var(--display);
  font-size: 44px;
  line-height: 1.05;
  margin: 0 0 8px;
  letter-spacing: -1.5px;
  font-weight: 800;
  color: var(--text);
}
h2.headline {
  font-family: var(--display);
  font-size: 30px;
  line-height: 1.1;
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: -0.8px;
}

/* raffle cards */
.raffles { display: grid; gap: 14px; }

.raffle-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: all 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  display: block;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.raffle-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
  background: var(--surface-2);
}

.raffle-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.raffle-name {
  font-family: var(--display);
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.4px;
  font-weight: 700;
}

.raffle-clock {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
  background: var(--warning-bg);
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Robux prize display */
.prize {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--robux-bg);
  border: 1px solid rgba(34, 232, 140, 0.2);
  border-radius: var(--radius);
  margin: 8px 0 20px;
}
.prize::before {
  content: '💎';
  font-size: 22px;
  width: 40px;
  height: 40px;
  background: var(--surface-3);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.prize-number {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -1.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.prize-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--primary);
  font-weight: 700;
  align-self: flex-end;
  padding-bottom: 4px;
  opacity: 0.75;
  line-height: 1.3;
}

.prize-note {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius);
  margin: 14px 0;
  line-height: 1.6;
  border-top: 1px solid var(--border) !important;
}
.prize-note strong {
  color: var(--primary);
  font-weight: 700;
}

.raffle-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-weight: 500;
}
.raffle-meta .cta {
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}

/* forms */
form { margin: 0; }

label {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  transition: all 120ms;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-bg);
}
input::placeholder { color: var(--text-mute); }

.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* buttons */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #0B0E14;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
  text-decoration: none;
  box-shadow: var(--shadow-btn);
  letter-spacing: -0.1px;
}
button:hover, .btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(34, 232, 140, 0.5);
  text-decoration: none;
}
button:active, .btn:active { transform: translateY(0); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-3); border-color: var(--border-strong); box-shadow: none; }

.btn-danger { background: var(--danger); color: white; box-shadow: 0 4px 14px rgba(255,91,107,0.25); }
.btn-danger:hover { background: #FF4256; box-shadow: 0 6px 20px rgba(255,91,107,0.4); }

/* panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}
.divider-fancy {
  text-align: center;
  color: var(--primary);
  margin: 32px 0;
  font-size: 16px;
  letter-spacing: 6px;
  opacity: 0.5;
}

/* winner alert banner */
.win-alert {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #0B0E14;
  padding: 12px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(255, 215, 0, 0.3);
}
.win-alert a {
  color: #0B0E14;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 6px;
  font-weight: 800;
}

/* flash */
.flash {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: none;
  border: 1px solid;
}
.flash::before {
  font-size: 14px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.flash-success { background: var(--success-bg); color: var(--success); border-color: rgba(34, 232, 140, 0.3); }
.flash-success::before { content: '✓'; background: var(--success); color: #0B0E14; }
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: rgba(255,91,107,0.3); }
.flash-error::before { content: '!'; background: var(--danger); color: white; }

/* steps */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.steps li {
  counter-increment: step;
  padding: 14px 0 14px 44px;
  position: relative;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 12px;
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: #0B0E14;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 0 12px var(--primary-glow);
}
.steps li strong { color: var(--text); font-weight: 700; }

/* proof / mono */
.proof {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  word-break: break-all;
  line-height: 1.8;
}
.proof strong { color: var(--primary); font-weight: 700; }

/* tables */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}
table.data th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-mute);
  font-weight: 700;
}
table.data td { color: var(--text); font-weight: 500; }
table.data td.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  font-weight: 700;
}

/* pills */
.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  border: 1px solid;
}
.pill-pending { background: var(--warning-bg); color: var(--warning); border-color: rgba(255,181,71,0.3); }
.pill-approved { background: var(--success-bg); color: var(--success); border-color: rgba(34,232,140,0.3); }
.pill-rejected { background: var(--danger-bg); color: var(--danger); border-color: rgba(255,91,107,0.3); }
.pill-active { background: var(--success-bg); color: var(--success); border-color: rgba(34,232,140,0.3); }
.pill-drawn { background: var(--purple-bg); color: var(--purple); border-color: rgba(139,92,246,0.3); }
.pill-paid { background: var(--success-bg); color: var(--success); border-color: rgba(34,232,140,0.3); }

/* empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
}

/* winner banner */
.winner-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #14D67C 100%);
  border-radius: var(--radius-xl);
  padding: 48px 32px;
  text-align: center;
  margin-bottom: 24px;
  color: #0B0E14;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px var(--primary-glow);
  border: none;
}
.winner-banner::before,
.winner-banner::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  background: white;
}
.winner-banner::before { width: 200px; height: 200px; top: -80px; right: -60px; }
.winner-banner::after { width: 140px; height: 140px; bottom: -60px; left: -40px; }
.winner-banner .kicker {
  font-family: var(--display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #0B0E14;
  margin-bottom: 12px;
  font-weight: 800;
  opacity: 0.75;
  position: relative;
}
.winner-banner .title {
  font-family: var(--display);
  font-size: 60px;
  line-height: 1;
  letter-spacing: -2px;
  font-weight: 800;
  color: #0B0E14;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.winner-banner .title::before {
  content: '💎';
  font-size: 40px;
  background: rgba(11, 14, 20, 0.15);
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* avatars */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: inline-block;
}
.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #0B0E14;
  font-family: var(--display);
  font-weight: 800;
}
.avatar-sm { width: 24px; height: 24px; font-size: 12px; }
.avatar-md { width: 36px; height: 36px; font-size: 15px; }
.avatar-lg { width: 64px; height: 64px; font-size: 26px; border: 3px solid var(--primary); box-shadow: 0 0 16px var(--primary-glow); }

/* title badges */
.user-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-left: 5px;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,0.15);
  white-space: nowrap;
}

.chat-msg-user {
  cursor: pointer;
}
.chat-msg-user:hover {
  text-decoration: underline;
}

/* profile modal */
.profile-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.profile-modal-overlay.open { display: flex; }

.profile-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 360px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.profile-stat-num {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}
.profile-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-mute);
  margin-top: 2px;
}

/* copy link */
.copy-link {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 10px;
}
.copy-link input {
  border: none;
  padding: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}
.copy-link input:focus { box-shadow: none; }
.copy-link button {
  padding: 6px 14px;
  font-size: 12px;
  flex-shrink: 0;
  box-shadow: none;
}
.copy-link button:hover { box-shadow: var(--shadow-btn); }

/* chat panel */
.chat-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 40;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #0B0E14;
  border: none;
  font-size: 22px;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.discord-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #5865F2;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.4);
  transition: all 150ms ease;
}
.discord-float:hover {
  background: #4752C4;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
  text-decoration: none;
  color: white;
}

.chat-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 300px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transform: translateX(0);
  transition: transform 200ms ease;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.chat-close {
  display: none;
  background: none;
  box-shadow: none;
  color: var(--text-dim);
  padding: 4px 8px;
  font-size: 16px;
}
.chat-close:hover { background: var(--surface-2); box-shadow: none; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; }
.chat-msg-body { flex: 1; min-width: 0; }
.chat-msg-user { font-weight: 700; color: var(--primary); margin-right: 6px; }
.chat-msg-text { color: var(--text); word-break: break-word; }
.chat-msg-delete {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--text-mute);
  font-size: 12px;
  padding: 2px 6px;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 4px;
}
.chat-msg-delete:hover { color: var(--danger); background: var(--danger-bg); box-shadow: none; }
.chat-msg-delete:disabled { opacity: 0.4; cursor: default; }

.chat-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
.chat-form input { flex: 1; }
.chat-form button { padding: 10px 14px; flex-shrink: 0; }

.chat-login-prompt {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  flex-shrink: 0;
}

/* main content makes room for the persistent sidebar on wide screens */
#main-wrap {
  margin-left: max(300px, calc((100vw - 760px) / 2));
  transition: margin-left 200ms ease;
}

/* narrow / tablet screens: sidebar becomes a slide-out drawer instead of eating the whole layout */
@media (max-width: 900px) {
  .chat-toggle { display: flex; }
  .chat-panel {
    transform: translateX(-100%);
    width: 85vw;
    max-width: 320px;
    box-shadow: var(--shadow-lg);
  }
  .chat-panel.open { transform: translateX(0); }
  .chat-close { display: inline-flex; align-items: center; justify-content: center; }
  #main-wrap { margin-left: 0; }
}

/* footer */
.site-footer {
  margin-top: 48px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.site-footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 13px;
}
.site-footer-links a { color: var(--text-dim); font-weight: 600; }
.site-footer-links a:hover { color: var(--primary); }
.site-footer-tagline { font-size: 12px; color: var(--text-mute); font-family: var(--display); }

/* mobile */
@media (max-width: 500px) {
  .wrap { padding: 16px 14px 60px; }
  .masthead { padding: 12px 16px; margin-bottom: 24px; }
  .brand { font-size: 18px; }
  .brand-mark { width: 30px; height: 30px; font-size: 16px; }
  .masthead nav a { padding: 6px 10px; font-size: 13px; }
  h1.headline { font-size: 34px; }
  h2.headline { font-size: 24px; }
  .prize-number { font-size: 34px; }
  .prize { padding: 12px 16px; gap: 10px; }
  .prize::before { width: 36px; height: 36px; font-size: 18px; }
  .raffle-card { padding: 18px 20px; }
  .panel { padding: 20px; }
  .field-row { grid-template-columns: 1fr; }
  .winner-banner { padding: 36px 20px; }
  .winner-banner .title { font-size: 42px; gap: 10px; }
  .winner-banner .title::before { width: 48px; height: 48px; font-size: 32px; }
  .discord-float { padding: 10px 16px; font-size: 13px; }
}
