/* ============================================================
   LOLZZZ GAMING — Dark gaming theme
   Palette: near-black bg, neon purple #a855f7, neon green #22c55e
   ============================================================ */

/* ----- RESET & TOKENS ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #08080f;
  --bg2:          #0e0e1a;
  --card-bg:      rgba(14, 14, 26, 0.72);
  --purple:       #a855f7;
  --purple-d:     #7c3aed;
  --purple-l:     #c084fc;
  --green:        #22c55e;
  --green-d:      #16a34a;
  --text:         #f1f5f9;
  --text2:        #94a3b8;
  --muted:        #475569;
  --border:       rgba(168, 85, 247, 0.18);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glow-p:       0 0 24px rgba(168,85,247,.45), 0 0 48px rgba(168,85,247,.18);
  --glow-g:       0 0 24px rgba(34,197,94,.4),  0 0 48px rgba(34,197,94,.15);
  --radius:       14px;
  --radius-sm:    9px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: hidden;
}

/* Ambient gradient blobs */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 15%, rgba(168,85,247,.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 85%, rgba(34,197,94,.045) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 55%, rgba(124,58,237,.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Scanline overlay */
.scanlines {
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 3px,
    rgba(0,0,0,.025) 3px, rgba(0,0,0,.025) 4px
  );
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--purple-d); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* ----- NAV ----- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  background: rgba(8,8,15,.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 1.4rem; font-weight: 900; letter-spacing: -.5px;
  background: linear-gradient(135deg, var(--purple), var(--green));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; text-decoration: none;
  filter: drop-shadow(0 0 14px rgba(168,85,247,.5));
}

.nav-links { display: flex; gap: 2rem; list-style: none; }

.nav-links a {
  color: var(--text2); text-decoration: none;
  font-size: .875rem; font-weight: 500;
  transition: color .2s; position: relative; padding-bottom: 2px;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: var(--purple); border-radius: 2px;
  transform: scaleX(0); transition: transform .25s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* ----- MAIN ----- */
main { position: relative; z-index: 1; padding-top: 64px; }

/* ----- HERO ----- */
.hero {
  text-align: center;
  padding: 5.5rem 2rem 3.5rem;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(168,85,247,.1);
  border: 1px solid rgba(168,85,247,.3);
  border-radius: 100px; padding: .35rem 1rem;
  font-size: .75rem; letter-spacing: .8px; font-weight: 600;
  color: var(--purple-l); margin-bottom: 1.5rem; text-transform: uppercase;
}

.hero-badge .dot {
  width: 7px; height: 7px; background: var(--green);
  border-radius: 50%; animation: blink 2s infinite;
}

@keyframes blink {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  50%      { opacity: .7; box-shadow: 0 0 0 7px rgba(34,197,94,0); }
}

.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 5.5rem);
  font-weight: 900; letter-spacing: -3px; line-height: 1; margin-bottom: 1.1rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-l) 45%, var(--green) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(168,85,247,.55));
}

.hero-sub {
  font-size: 1.05rem; color: var(--text2);
  max-width: 520px; margin: 0 auto 2.5rem;
}

/* ----- BUTTONS ----- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.65rem; border-radius: 11px;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: all .22s ease; border: none;
  text-decoration: none; letter-spacing: .25px; font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-d));
  color: #fff; box-shadow: 0 4px 20px rgba(168,85,247,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--glow-p); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(255,255,255,.055);
  color: var(--text); border: 1px solid var(--glass-border);
}
.btn-secondary:hover { background: rgba(255,255,255,.1); transform: translateY(-2px); }

.btn-green {
  background: linear-gradient(135deg, var(--green), var(--green-d));
  color: #fff; box-shadow: 0 4px 20px rgba(34,197,94,.28);
}
.btn-green:hover { transform: translateY(-2px); box-shadow: var(--glow-g); }

.btn-group { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ----- SECTION ----- */
.section { padding: 3rem 2rem; max-width: 1240px; margin: 0 auto; }

.section-title {
  font-size: 1.35rem; font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: .65rem;
}
.section-title .accent { color: var(--purple); }

/* ----- GLASS CARD ----- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color .3s, box-shadow .3s;
}
.card:hover { border-color: rgba(168,85,247,.28); box-shadow: 0 8px 32px rgba(168,85,247,.09); }
.card-body { padding: 1.5rem; }

/* ----- LIVE SECTION ----- */
.live-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem;
}

.live-player-wrap {
  position: relative; aspect-ratio: 16/9;
  border-radius: var(--radius); overflow: hidden;
  background: #000; border: 1px solid var(--border);
}
.live-player-wrap iframe { width: 100%; height: 100%; border: none; display: block; }

.live-chat-wrap {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); min-height: 420px;
  display: flex; flex-direction: column;
}
.live-chat-wrap iframe { flex: 1; border: none; width: 100%; min-height: 420px; }

.live-offline {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1rem;
  min-height: 320px; color: var(--muted);
  padding: 2rem;
}
.live-offline svg { opacity: .25; }

@keyframes borderGlow {
  0%,100% { border-color: rgba(168,85,247,.3); box-shadow: 0 0 0 rgba(168,85,247,0); }
  50%      { border-color: rgba(34,197,94,.35);  box-shadow: 0 0 28px rgba(34,197,94,.12); }
}
.glow-border { animation: borderGlow 4s ease-in-out infinite; }

/* ----- MESSAGE CARD ----- */
.message-card {
  background: var(--card-bg); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 1.2rem; margin-bottom: .9rem;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.message-card:hover {
  border-color: rgba(168,85,247,.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(168,85,247,.08);
}
.message-card.unread {
  border-color: rgba(168,85,247,.4);
  background: rgba(168,85,247,.045);
}

.message-header {
  display: flex; align-items: center; gap: .7rem;
  margin-bottom: .7rem; flex-wrap: wrap;
}

.message-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple), var(--green));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .8rem; color: #fff;
}

.message-name { font-weight: 600; font-size: .92rem; }
.message-time { font-size: .72rem; color: var(--muted); margin-left: auto; }

.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .18rem .55rem; border-radius: 100px;
  font-size: .7rem; font-weight: 700; letter-spacing: .3px;
}
.badge-donation {
  background: rgba(34,197,94,.12); color: var(--green);
  border: 1px solid rgba(34,197,94,.3);
}

.message-text { color: var(--text2); font-size: .88rem; line-height: 1.65; }

.reply-box {
  background: rgba(168,85,247,.06);
  border-left: 3px solid var(--purple);
  border-radius: 0 8px 8px 0;
  padding: .75rem 1rem; margin-top: .75rem;
}
.reply-label {
  font-size: .72rem; color: var(--purple-l); font-weight: 700;
  margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .5px;
}
.reply-text { font-size: .85rem; color: var(--text2); }

/* ----- FORMS ----- */
.form-group { margin-bottom: 1.2rem; }

.form-label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--text2); margin-bottom: .45rem; letter-spacing: .2px;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,.038);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text); padding: .7rem 1rem;
  font-size: .88rem; font-family: inherit;
  transition: border-color .2s, background .2s, box-shadow .2s;
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--purple);
  background: rgba(168,85,247,.045);
  box-shadow: 0 0 0 3px rgba(168,85,247,.12);
}
.form-control::placeholder { color: var(--muted); }
textarea.form-control { resize: vertical; min-height: 110px; }

.char-counter { font-size: .72rem; color: var(--muted); text-align: right; margin-top: .25rem; }
.char-counter.warn   { color: #f59e0b; }
.char-counter.danger { color: #ef4444; }

/* ----- DONATION GRID ----- */
.donation-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
  gap: .45rem; margin-top: .5rem;
}
.donation-option { position: relative; }
.donation-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.donation-option label {
  display: flex; align-items: center; justify-content: center;
  padding: .55rem; min-height: 42px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: all .2s; text-align: center; user-select: none;
}
.donation-option input:checked + label {
  background: rgba(168,85,247,.15); border-color: var(--purple);
  color: var(--purple-l); box-shadow: 0 0 14px rgba(168,85,247,.22);
}
.donation-option label:hover {
  border-color: rgba(168,85,247,.4); background: rgba(168,85,247,.06);
}
.custom-amount-wrap { margin-top: .7rem; display: none; }
.custom-amount-wrap.show { display: block; }

/* ----- MESSAGES PAGE LAYOUT ----- */
.messages-layout {
  display: grid; grid-template-columns: 1fr 420px; gap: 2rem;
  align-items: start;
}
.form-sticky { position: sticky; top: 5rem; }
.loading-state {
  display: flex; align-items: center; justify-content: center;
  gap: .75rem; color: var(--muted); padding: 2.5rem;
}

/* ----- ADMIN ----- */
.admin-header {
  background: rgba(168,85,247,.06);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-title { font-size: 1rem; font-weight: 700; color: var(--purple-l); }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--card-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 1.4rem; text-align: center;
}
.stat-value { font-size: 2.2rem; font-weight: 900; line-height: 1; }
.stat-label { font-size: .75rem; color: var(--muted); margin-top: .35rem; text-transform: uppercase; letter-spacing: .5px; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--glass-border); }
table { width: 100%; border-collapse: collapse; font-size: .855rem; }
thead { background: rgba(168,85,247,.07); }
th {
  padding: .85rem 1rem; text-align: left;
  font-size: .72rem; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}
td { padding: .85rem 1rem; border-bottom: 1px solid rgba(255,255,255,.035); color: var(--text2); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr.unread td { background: rgba(168,85,247,.038); }
tr:hover td { background: rgba(255,255,255,.018); }

.reply-inline { margin-top: .6rem; }
.reply-inline textarea {
  width: 100%; background: rgba(255,255,255,.04);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: .5rem .75rem;
  font-size: .84rem; font-family: inherit;
  resize: vertical; min-height: 72px; outline: none;
}
.reply-inline textarea:focus { border-color: var(--purple); }
.reply-inline .btn { margin-top: .45rem; padding: .45rem .9rem; font-size: .78rem; }

.stream-settings-form { display: flex; gap: .75rem; align-items: flex-end; }
.stream-settings-form .form-group { flex: 1; margin-bottom: 0; }

/* ----- LOGIN ----- */
.login-wrap { max-width: 420px; margin: 4rem auto; padding: 0 1.25rem; }
.login-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px; padding: 2.5rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 60px rgba(168,85,247,.06);
}

/* ----- TOAST ----- */
.toast-container {
  position: fixed; bottom: 2rem; right: 2rem;
  z-index: 9999; display: flex; flex-direction: column;
  gap: .65rem; pointer-events: none;
}
.toast {
  background: var(--bg2); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: .9rem 1.2rem;
  display: flex; align-items: center; gap: .65rem;
  font-size: .86rem; font-weight: 500;
  min-width: 260px; max-width: 350px;
  pointer-events: all; backdrop-filter: blur(16px);
  animation: slideIn .3s ease;
}
.toast.success { border-color: rgba(34,197,94,.4);  color: var(--green); }
.toast.error   { border-color: rgba(239,68,68,.4);  color: #f87171; }
.toast.info    { border-color: rgba(168,85,247,.4); color: var(--purple-l); }
.toast.hide    { animation: slideOut .3s ease forwards; }

@keyframes slideIn  { from { transform: translateX(110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideOut { from { transform: none; opacity: 1; } to { transform: translateX(110%); opacity: 0; } }

/* ----- SPINNER ----- */
.spinner {
  display: inline-block; width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: currentColor; border-radius: 50%;
  animation: spin .55s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- FOOTER ----- */
footer {
  text-align: center; padding: 1.75rem 2rem;
  color: var(--muted); font-size: .8rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 2rem; position: relative; z-index: 1;
}

/* ----- UTILITIES ----- */
.text-purple { color: var(--purple); }
.text-green  { color: var(--green);  }
.text-muted  { color: var(--muted);  }
.text-xs     { font-size: .75rem;    }
.text-sm     { font-size: .875rem;   }
.font-bold   { font-weight: 700;     }
.mt-2 { margin-top: .5rem;  }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem;   }
.mb-4 { margin-bottom: 1rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.error-text { color: #f87171; font-size: .8rem; margin-top: .35rem; }
.divider { height: 1px; background: var(--glass-border); margin: 2rem 0; }

/* ----- NAV LOGO IMAGE ----- */
.nav-logo { display: flex; align-items: center; gap: .55rem; }
.nav-logo-img {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(168,85,247,.5);
  box-shadow: 0 0 10px rgba(168,85,247,.3);
}

/* ----- NAV SOCIAL LINKS ----- */
.nav-social {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--text2); text-decoration: none;
  font-size: .875rem; font-weight: 500;
  transition: color .2s;
}
.nav-social:hover { color: var(--text); }

/* ----- HERO LOGO ----- */
.hero-logo-wrap { margin-bottom: 1.25rem; }
.hero-logo {
  width: 110px; height: 110px; border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(168,85,247,.6);
  box-shadow: 0 0 30px rgba(168,85,247,.35), 0 0 60px rgba(168,85,247,.15);
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%,100% { box-shadow: 0 0 30px rgba(168,85,247,.35), 0 0 60px rgba(168,85,247,.15); }
  50%      { box-shadow: 0 0 40px rgba(168,85,247,.6),  0 0 80px rgba(168,85,247,.25); }
}

/* ----- INSTAGRAM BUTTON ----- */
.btn-insta {
  background: linear-gradient(135deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888);
  color: #fff;
  box-shadow: 0 4px 20px rgba(220,39,67,.3);
}
.btn-insta:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(220,39,67,.45); }

/* ----- STATS STRIP ----- */
.stats-strip {
  display: flex; align-items: center; justify-content: center;
  gap: 0; flex-wrap: wrap;
  background: var(--card-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: .9rem 1.5rem;
  backdrop-filter: blur(12px);
}
.stat-pill {
  display: flex; align-items: center; gap: .55rem;
  font-size: .85rem; color: var(--text2); padding: .35rem .75rem;
}
.stat-pill strong { color: var(--text); }
.stat-divider { width: 1px; height: 24px; background: var(--glass-border); margin: 0 .25rem; }

/* ----- VIDEOS GRID ----- */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.video-card {
  text-decoration: none; color: inherit;
  background: var(--card-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .25s, transform .25s, box-shadow .25s;
  display: block;
}
.video-card:hover {
  border-color: rgba(168,85,247,.35);
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(168,85,247,.12);
}
.video-thumb-wrap {
  position: relative; aspect-ratio: 16/9;
  background: #000; overflow: hidden;
}
.video-thumb {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .3s;
}
.video-card:hover .video-thumb { transform: scale(1.04); }
.video-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.3);
  opacity: 0; transition: opacity .25s;
}
.video-card:hover .video-play-btn { opacity: 1; }
.video-play-btn svg { filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.video-info { padding: .85rem 1rem; }
.video-title {
  font-size: .82rem; font-weight: 600; color: var(--text2);
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.video-card:hover .video-title { color: var(--text); }

/* ----- ADMIN LIVE STATUS BAR ----- */
.admin-live-status {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; border-radius: var(--radius-sm);
  font-size: .85rem; flex-wrap: wrap;
  margin-bottom: .75rem;
}
.admin-live-status.live    { background: rgba(34,197,94,.08);  border: 1px solid rgba(34,197,94,.3);  color: var(--green); }
.admin-live-status.offline { background: rgba(100,100,100,.08); border: 1px solid var(--glass-border); color: var(--text2); }
.admin-live-status.nokey   { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.3);  color: #fbbf24; }
.admin-live-status code    { background: rgba(255,255,255,.08); padding: .1rem .4rem; border-radius: 4px; font-size: .8rem; }

/* ----- FOOTER SOCIAL ----- */
.footer-social {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--muted); text-decoration: none; font-size: .82rem;
  transition: color .2s;
}
.footer-social:hover { color: var(--purple-l); }

/* ----- RESPONSIVE ----- */
@media (max-width: 900px) {
  .messages-layout { grid-template-columns: 1fr; }
  .form-sticky { position: static; }
  .live-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .videos-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .nav { padding: 0 1rem; }
  .nav-links { display: none; }
  .videos-grid { grid-template-columns: 1fr; }
  .stats-strip { gap: .5rem; flex-direction: column; }
  .stat-divider { width: 80%; height: 1px; margin: .15rem 0; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .section { padding: 2rem 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stream-settings-form { flex-direction: column; }
  .login-card { padding: 1.75rem 1.25rem; }
  .toast-container { bottom: 1rem; right: 1rem; left: 1rem; }
  .toast { min-width: unset; max-width: 100%; }
  .admin-header { padding: .85rem 1rem; flex-wrap: wrap; gap: .5rem; }
  .donation-grid { grid-template-columns: repeat(3, 1fr); }
}
