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

:root {
  --bg: #0e0e10;
  --surface: #18181b;
  --surface-2: #2d2d35;
  --text: #efeff1;
  --text-muted: #adadb8;
  --purple: #9147ff;
  --purple-dark: #6c35c1;
  --green: #00b26f;
  --red: #e91916;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

/* ── Layout ── */
.layout {
  min-height: 100vh;
}

.layout-body {
  margin-left: 56px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 56px;
  background: var(--surface);
  border-right: 1px solid var(--surface-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar:hover {
  width: 240px;
  box-shadow: 4px 0 32px rgba(0,0,0,0.4);
}

/* Labels hidden by default, fade in on hover */
.sidebar-label {
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar:hover .sidebar-label { opacity: 1; }

/* Circular hint button on the right border */
.sidebar-toggle-btn {
  position: fixed;
  left: 42px;
  top: 20px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  z-index: 102;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 0;
  cursor: default;
}

.sidebar:hover .sidebar-toggle-btn { opacity: 0; }

.sidebar-header {
  padding: 14px 11px;
  border-bottom: 1px solid var(--surface-2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  min-height: 56px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.sidebar-logo {
  height: 28px;
  width: auto;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  min-width: 0;
}

.sidebar-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.sidebar-link.active {
  background: rgba(145,71,255,0.15);
  color: var(--purple);
}

.sidebar-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link.active svg,
.sidebar-link:hover svg { opacity: 1; }

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 11px 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.sidebar:hover .sidebar-section-label { opacity: 0.6; }

.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
  flex-shrink: 0;
}

.sidebar-user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-kick-tag {
  font-size: 11px;
  color: #53fc18;
  font-weight: 500;
  white-space: nowrap;
}

.sidebar-balance {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  padding: 7px 10px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.sidebar:hover .sidebar-balance { opacity: 1; }

.sidebar-balance strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--purple);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.sidebar-balance span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-action-btn {
  width: 100%;
  justify-content: center;
}

/* ── Topbar (mobile only) ── */
.topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.topbar-toggle {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}

.topbar-toggle:hover { background: var(--surface-2); }

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  flex: 1;
}

.topbar-logo {
  height: 24px;
  width: auto;
}

.topbar-pts {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-pts strong {
  color: var(--purple);
  font-weight: 700;
}

/* ── Sidebar backdrop (mobile) ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.sidebar-backdrop.open { display: block; }
.body.sidebar-open { overflow: hidden; }

/* ── Avatar (shared) ── */
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
}

.btn-kick { background: #53fc18; color: #000; font-weight: 700; }
.btn-kick:hover { background: #3fd410; }

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 28px 0;
  padding: 12px 18px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 500;
}

.flash::before {
  font-size: 16px;
  flex-shrink: 0;
}

.flash-notice {
  background: rgba(0, 178, 111, 0.08);
  color: var(--green);
  border-color: rgba(0, 178, 111, 0.2);
}

.flash-notice::before { content: "✓"; }

.flash-alert {
  background: rgba(233, 25, 22, 0.08);
  color: var(--red);
  border-color: rgba(233, 25, 22, 0.2);
}

.flash-alert::before { content: "!"; }

main {
  padding: 36px 28px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

.page-hero main {
  max-width: none;
  padding: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0.01em;
  font-family: inherit;
}

.btn:hover { background: #3a3a46; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-primary { background: var(--purple); color: white; border-color: transparent; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #009960; }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #c51513; }
.btn-twitch { background: var(--purple); color: white; }
.btn-twitch:hover { background: var(--purple-dark); }
.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.12);
  color: var(--text-muted);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.22);
  color: var(--text);
}
.btn-disabled, button:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
  border-color: transparent;
}

.hero {
  position: relative;
  text-align: center;
  padding: 0 20px;
  overflow: hidden;
  border-radius: 0;
  background: #0a0a0f;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  transition: transform 0.1s ease-out;
}
.hero-glow-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #9147ff, transparent 70%);
  top: -120px; left: -100px;
  animation-duration: 9s;
}
.hero-glow-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #4a9eff, transparent 70%);
  bottom: -100px; right: -80px;
  animation-duration: 11s;
  animation-delay: -4s;
}
.hero-glow-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #bf5fff, transparent 70%);
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 13s;
  animation-delay: -2s;
  opacity: 0.10;
}
.hero-glow-4 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #ff6eb4, transparent 70%);
  top: -60px; right: -60px;
  opacity: 0.12;
}

@keyframes heroGlowDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, 20px) scale(1.08); }
  100% { transform: translate(-20px, 40px) scale(0.95); }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 { font-size: 36px; margin-bottom: 16px; font-weight: 900; }
.hero p { font-size: 18px; color: var(--text-muted); margin-bottom: 32px; }

.hero-stream-embed {
  position: relative;
  width: 480px;
  aspect-ratio: 4 / 3;
  margin: 0 auto 32px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  border: 2px solid var(--surface-2);
}

.hero-stream-iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

.hero-stream-overlay {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
}

.hero-stream-live {
  background: #53fc18;
  color: #000;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.home-header { margin-bottom: 32px; }
.home-header h1 { font-size: 28px; }
.balance-display { font-size: 18px; color: var(--text-muted); margin-top: 8px; }
.balance-display strong { color: var(--purple); font-size: 24px; }

h2 { font-size: 20px; margin-bottom: 16px; }

.rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.reward-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s;
}

.reward-card:hover { border-color: #3d3d4e; }

.reward-icon { font-size: 32px; }
.reward-info h3 { font-size: 16px; margin-bottom: 4px; }
.reward-info p { font-size: 13px; color: var(--text-muted); }
.reward-cost {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  background: #1f1b2e;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
}

.info-box {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 12px;
  padding: 24px;
}

.info-box h3 { font-size: 16px; margin-bottom: 12px; }
.info-box ol { padding-left: 20px; }
.info-box li { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
.conversion-note { font-size: 13px; color: var(--muted); margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--surface-2); line-height: 1.6; }

.home-section-header { display: flex; align-items: center; justify-content: space-between; margin: 32px 0 16px; }
.home-section-header h2 { margin: 0; }
.home-section-link { font-size: 14px; color: var(--accent); text-decoration: none; }
.home-section-link:hover { text-decoration: underline; }

.info-box-support { margin-bottom: 16px; }
.info-box-support-content { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.info-box-support-content h3 { margin-bottom: 6px; }
.info-box-support-content p { font-size: 14px; color: var(--text-muted); margin: 0; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-header h1 { font-size: 24px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--surface-2);
}

.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

.table-actions { display: flex; align-items: center; gap: 8px; }
.table-actions form { margin: 0; }

.admin-form { max-width: 500px; }
.admin-form h1 { margin-bottom: 8px; }
.admin-form > p { margin-bottom: 24px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.form-group { margin-bottom: 20px; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.field-error { display: block; color: var(--red); font-size: 12px; margin-top: 4px; }

.field-error ~ .form-control,
.form-control.field-invalid {
  border-color: var(--red);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-control {
  width: 100%;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.form-control:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(145,71,255,0.15); }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check label { margin-bottom: 0; }

.form-errors {
  background: #2e1a1a;
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--red);
}

.empty-state { color: var(--text-muted); font-size: 15px; padding: 40px 0; text-align: center; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.points-toast {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 14px;
  background: var(--purple);
  color: white;
  font-size: 16px;
  font-weight: 700;
  border-radius: 20px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.points-toast-show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .layout-body { margin-left: 0; }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
  }

  .sidebar .sidebar-label { opacity: 1; }
  .sidebar-toggle-btn { display: none; }
  .sidebar:hover { width: 260px; box-shadow: none; }

  .sidebar.open { transform: translateX(0); }

  .topbar { display: flex; }

  main { padding: 20px 16px; }

  .home-header h1 { font-size: 22px; }
  .balance-display { font-size: 16px; }
  .balance-display strong { font-size: 20px; }
  h2 { font-size: 17px; margin-bottom: 12px; }

  .rewards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .reward-card .btn,
  .reward-card .btn-disabled {
    width: 100%;
  }

  .hero { padding: 0 16px; }
  .hero-glow-1 { width: 280px; height: 280px; }
  .hero-glow-2 { width: 220px; height: 220px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 15px; margin-bottom: 24px; }
  .hero-stream-embed { width: 320px; margin-bottom: 24px; }

  .info-box { padding: 18px; }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .admin-header .btn { width: 100%; justify-content: center; }

  .admin-table { min-width: 480px; }

  .flash { padding: 10px 16px; }

  .admin-form { max-width: 100%; }
}

/* ── Tickets ── */
.ticket-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e53e3e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-left: 2px;
}

.ticket-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.ticket-status-open { background: rgba(237,137,54,0.15); color: #ed8936; }
.ticket-status-in_progress { background: rgba(66,153,225,0.15); color: #4299e1; }
.ticket-status-resolved { background: rgba(72,187,120,0.15); color: #48bb78; }

.ticket-detail {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ticket-info-box {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticket-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.ticket-info-label {
  color: var(--muted);
  font-weight: 500;
}

.ticket-message-box {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  padding: 16px 20px;
}

.ticket-message-box h3 {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.ticket-message-box p {
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.ticket-row-unread td { font-weight: 600; }
.ticket-id-link { color: var(--purple); font-weight: 600; text-decoration: none; }
.ticket-id-link:hover { text-decoration: underline; }

.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-thread-message {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  padding: 14px 18px;
}

.ticket-thread-admin {
  border-left: 3px solid var(--purple);
}

.ticket-thread-user {
  border-left: 3px solid var(--surface-2);
}

.ticket-thread-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ticket-thread-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.ticket-thread-admin .ticket-thread-author { color: var(--purple); }

.ticket-thread-time {
  font-size: 12px;
  color: var(--text-muted);
}

.ticket-thread-message p {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check input { width: auto; }

.form-info {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ── Stream floating widget ── */
.stream-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  text-decoration: none;
  z-index: 1000;
  border: 2px solid var(--surface-2);
  background: var(--surface);
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}

.stream-widget:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  border-color: #53fc18;
}

.stream-widget-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #000;
}

.stream-widget-iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

.stream-widget-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stream-widget-live {
  background: #53fc18;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.stream-widget-label {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ── Live page ── */
.live-page {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  height: calc(100vh - 58px);
  padding: 16px;
  box-sizing: border-box;
}

.live-player-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.live-player {
  width: 100%;
  height: 100%;
  border: none;
}

.live-chat-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--surface-2);
}

.live-chat {
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 768px) {
  .live-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 400px;
    height: auto;
  }

  .live-player-wrap {
    aspect-ratio: 16/9;
    height: auto;
  }

  .stream-widget {
    width: 150px;
    bottom: 16px;
    right: 16px;
  }
}

/* ── 7TV emote picker ── */
.emote-picker-wrapper {
  position: relative;
}

.emote-picker-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s;
  line-height: 1;
}

.emote-picker-btn:hover {
  background: var(--surface-3);
}

.emote-picker-popover {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 100;
  padding: 10px;
  flex-direction: column;
  gap: 8px;
}

.emote-picker-popover.open {
  display: flex;
}

.emote-picker-search {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  box-sizing: border-box;
  outline: none;
}

.emote-picker-search:focus {
  border-color: var(--purple);
}

.emote-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.emote-picker-emote {
  height: 48px;
  width: auto;
  object-fit: contain;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px;
  transition: background 0.1s;
}

.emote-picker-emote:hover {
  background: var(--surface-2);
}

.inline-emote {
  height: 24px;
  width: auto;
  vertical-align: middle;
  display: inline;
}

/* ── Static pages (FAQ, Privacy) ── */
.static-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px;
}

.static-page-header {
  margin-bottom: 36px;
}

.static-page-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.static-page-subtitle {
  color: var(--muted);
  font-size: 15px;
}

/* FAQ accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--surface-2);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::before {
  content: "›";
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.2s;
  display: inline-block;
  width: 16px;
}

.faq-item[open] > .faq-question::before {
  transform: rotate(90deg);
}

.faq-question:hover {
  background: var(--surface);
}

.faq-answer {
  padding: 4px 20px 20px 48px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.faq-answer p { margin-bottom: 8px; }
.faq-answer p:last-child { margin-bottom: 0; }

/* Privacy sections */
.privacy-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.privacy-section h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.privacy-section p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.privacy-section p:last-child { margin-bottom: 0; }

.privacy-section ul {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  padding-left: 20px;
}

/* Site footer */
.page-hero .site-footer { margin-top: 0; }

.site-footer {
  text-align: center;
  padding: 24px;
  margin-top: 48px;
  border-top: 1px solid var(--surface-2);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  gap: 20px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover { color: var(--text); }

/* ── Raffles ── */
.raffle-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.raffle-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
  border-color: rgba(145,71,255,0.4);
}

.raffle-card-ended { opacity: 0.7; }
.raffle-card-ended:hover { transform: none; box-shadow: none; border-color: var(--surface-2); }

.raffle-card-upcoming { opacity: 0.9; cursor: default; }
.raffle-card-upcoming:hover { transform: none; box-shadow: none; border-color: rgba(255,170,0,0.35); }

.raffle-card-upcoming-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  z-index: 1;
}

.raffle-card-upcoming-label {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.9);
}

.raffle-card-upcoming-date {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* Full-bleed image area */
.raffle-card-img {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--surface-2) center/cover no-repeat;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-shrink: 0;
}

.raffle-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.raffle-card-countdown {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 0 0 0 10px;
  letter-spacing: 0.03em;
}

.raffle-card-ended-badge {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 0 0 0 10px;
  letter-spacing: 0.03em;
}

/* Text area below image */
.raffle-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.raffle-card-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.raffle-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.raffle-card-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.raffle-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.raffle-card-participants { font-size: 12px; color: var(--text-muted); }

.raffle-card-footer .btn,
.raffle-card-footer .btn-disabled,
.raffle-entered-btn { width: 100%; justify-content: center; }

.raffle-winner {
  font-size: 13px;
  color: var(--green);
  padding: 6px 10px;
  background: rgba(0, 178, 111, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(0, 178, 111, 0.2);
}

/* Date presets */
.raffle-winner-row td { background: rgba(0, 178, 111, 0.05) !important; }

.date-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.date-preset {
  border: 1px solid var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 10px;
}

.date-preset:hover { border-color: var(--purple); color: var(--text); }
.date-preset.active { background: var(--purple); color: #fff; border-color: var(--purple); }

.raffle-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 500;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.raffle-modal-backdrop.open { opacity: 1; }

.raffle-modal {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 16px;
  padding: 32px 28px 24px;
  max-width: 380px;
  width: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  transform: translateY(16px);
  transition: transform 0.2s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.raffle-modal-backdrop.open .raffle-modal { transform: translateY(0); }

.raffle-modal-title { font-size: 17px; font-weight: 700; }
.raffle-modal-body { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

.raffle-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
  justify-content: center;
}

/* Leaderboard */
.leaderboard-header {
  margin-bottom: 24px;
}
.leaderboard-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}
.leaderboard-my-rank {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--purple);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.leaderboard-my-rank-label {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}
.leaderboard-my-rank-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--purple);
}
.leaderboard-my-rank-pts {
  font-size: 14px;
  color: var(--text-muted);
}
.leaderboard-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 10px;
  padding: 12px 16px;
  transition: border-color 0.15s;
}
.leaderboard-row:hover {
  border-color: var(--surface-2);
  background: var(--surface-2);
}
.leaderboard-row--me {
  border-color: var(--purple) !important;
}
.leaderboard-rank {
  font-size: 15px;
  font-weight: 700;
  min-width: 32px;
  color: var(--text-muted);
  text-align: center;
}
.leaderboard-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.leaderboard-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard-pts {
  font-size: 14px;
  font-weight: 700;
  color: var(--purple);
  white-space: nowrap;
}

.raffle-modal-actions .btn { flex: 1; }
