:root {
  --bg:         #050608;
  --bg-soft:    #0b0d12;
  --bg-card:    #11141c;
  --bg-elev:    #1a1e2a;
  --border:     #232838;
  --border-hi:  #3a4258;
  --text:       #eef1f8;
  --text-dim:   #8b93a8;
  --gold:       #e8b73a;
  --gold-soft:  #f0cd6e;
  --gold-glow:  rgba(232,183,58,.4);
  --accent:     #e8b73a;
  --accent-2:   #f0cd6e;
  --live:       #ef4444;
  --warn:       #f59e0b;
  --green:      #22c55e;
  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     0 14px 44px rgba(0,0,0,.6);
  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display:'Bebas Neue', 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100vw;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 500px at 20% -10%, rgba(232,183,58,.10), transparent 55%),
    radial-gradient(1000px 480px at 85% 5%, rgba(232,183,58,.06), transparent 55%),
    radial-gradient(700px 400px at 50% 110%, rgba(0,0,0,.8), transparent 70%);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.accent { color: var(--gold); }
.muted { color: var(--text-dim); }
.svg-defs { display: none; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(5,6,8,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 0 rgba(232,183,58,.25);
  padding-top: env(safe-area-inset-top, 0px);
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  height: 68px;
  padding-left: max(20px, env(safe-area-inset-left, 20px));
  padding-right: max(20px, env(safe-area-inset-right, 20px));
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; flex: 0 0 auto; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold), #b8901f);
  color: #050608;
  box-shadow: 0 4px 18px var(--gold-glow), inset 0 0 0 2px rgba(0,0,0,.2);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text {
  font-family: var(--font-display);
  font-size: 26px; letter-spacing: 2px; line-height: 1;
}
.brand-text .accent { color: var(--gold); }

.main-nav { display: flex; gap: 6px; margin-left: auto; }
.nav-link {
  padding: 8px 16px; border-radius: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .8px;
  color: var(--text-dim); transition: .15s;
  text-transform: uppercase;
}
.nav-link:hover { color: var(--text); background: var(--bg-elev); }
.nav-link.active {
  color: var(--gold);
  background: rgba(232,183,58,.12);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.search-wrap input {
  width: 240px; padding: 9px 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); font-size: 13.5px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,183,58,.2); }
.search-wrap input::placeholder { color: var(--text-dim); }

.btn-ghost {
  width: 40px; height: 40px; border-radius: 9px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 17px; transition: .15s;
}
.btn-ghost:hover { background: var(--bg-elev); border-color: var(--gold); color: var(--gold); }

.hero {
  position: relative;
  padding: 56px 0 38px;
  text-align: center;
  overflow: hidden;
}
.hero-bat {
  position: absolute;
  top: -50px; right: -50px;
  width: 380px; height: 380px;
  color: var(--gold);
  opacity: .10;
  pointer-events: none;
}
.hero-kicker {
  display: inline-block;
  margin-bottom: 16px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(232,183,58,.14);
  border: 1px solid rgba(232,183,58,.5);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 4px;
  animation: pulse 1.8s infinite;
  position: relative;
  z-index: 1;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,183,58,.5); }
  50%      { box-shadow: 0 0 0 8px rgba(232,183,58,0); }
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 88px);
  letter-spacing: 2px;
  line-height: .95;
  margin: 0 0 12px;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 rgba(232,183,58,.25), 6px 6px 30px rgba(232,183,58,.3);
  position: relative;
  z-index: 1;
}
.hero h1 .accent { color: var(--gold); }
.hero-sub { color: var(--text-dim); margin: 0 0 36px; font-size: 15px; letter-spacing: .3px; position: relative; z-index: 1; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 900px; margin: 0 auto; position: relative; z-index: 1; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 4px;
  transition: .2s;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), #b8901f);
  opacity: .7;
}
.stat-card:hover { border-color: var(--border-hi); box-shadow: 0 0 0 1px rgba(232,183,58,.3), 0 8px 24px rgba(0,0,0,.5); }
.stat-num {
  font-family: var(--font-display);
  font-size: 40px; letter-spacing: 1px; line-height: 1;
}
.stat-num.live { color: var(--live); text-shadow: 0 0 16px rgba(239,68,68,.6); }
.stat-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--text-dim); font-weight: 600;
}

.filters-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding-top: 24px; padding-bottom: 10px;
}
.tabs {
  display: flex; gap: 4px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px; padding: 4px;
}
.tab {
  padding: 8px 18px; border-radius: 7px; border: 0;
  background: transparent; color: var(--text-dim);
  font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
  transition: .15s;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: linear-gradient(135deg, var(--gold), #b8901f);
  color: #050608;
  box-shadow: 0 4px 16px var(--gold-glow);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; }
.chip {
  padding: 7px 16px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px; font-weight: 600;
  text-transform: capitalize; letter-spacing: .3px;
  transition: .15s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--gold); }
.chip.active {
  background: rgba(232,183,58,.14);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}

.main-content { padding: 20px 20px 40px; min-height: 40vh; }
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 18px;
  width: 100%;
}

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  position: relative;
}
.event-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), #b8901f);
  opacity: 0;
  transition: opacity .2s;
  z-index: 3;
}
.event-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow), 0 0 0 1px rgba(232,183,58,.4), 0 0 40px rgba(232,183,58,.15);
}
.event-card:hover::before { opacity: 1; }

.card-thumb {
  position: relative; aspect-ratio: 16 / 9; background: var(--bg-elev);
  overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .92; transition: transform .4s ease; }
.event-card:hover .card-thumb img { transform: scale(1.05); }
.card-thumb .thumb-fallback {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 40px; opacity: .3;
  background: radial-gradient(circle at 50% 40%, #232838, var(--bg-elev));
}

.badge {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  backdrop-filter: blur(6px); z-index: 2;
}
.badge.live    { background: rgba(239,68,68,.92); color: #fff; animation: pulse 1.8s infinite; }
.badge.upcoming{ background: rgba(232,183,58,.92); color: #050608; }
.badge.channel { background: rgba(232,183,58,.92); color: #050608; }

.badge-viewers {
  position: absolute; top: 10px; right: 10px;
  padding: 4px 9px; border-radius: 8px;
  font-size: 11px; font-weight: 700;
  background: rgba(5,6,8,.85); color: #fff; backdrop-filter: blur(6px);
  border: 1px solid rgba(232,183,58,.4);
  z-index: 2;
}

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.card-cat {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--gold); font-weight: 700;
}

.card-title {
  font-size: 14.5px; font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 40px;
}

.card-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 12px; color: var(--text-dim); margin-top: auto;
}
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }

.btn-watch {
  margin-top: 4px;
  padding: 11px 14px; border: 0; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold), #b8901f);
  color: #050608; font-weight: 900; font-size: 12.5px; letter-spacing: 1px;
  text-transform: uppercase;
  transition: filter .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 16px var(--gold-glow);
}
.btn-watch:hover { filter: brightness(1.12); box-shadow: 0 6px 24px rgba(232,183,58,.5); }
.btn-watch:active { transform: scale(.97); }
.btn-watch[disabled] { opacity: .4; cursor: not-allowed; box-shadow: none; }

.status-message {
  padding: 44px 20px; text-align: center; color: var(--text-dim);
  border: 1px dashed var(--border); border-radius: var(--radius);
  margin-bottom: 20px; font-size: 14px;
}

.disclaimer-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(232,183,58,.04);
}
.disclaimer-text {
  margin: 0; padding: 14px 20px; text-align: center;
  font-size: 12px; line-height: 1.6; color: var(--text-dim);
}
.disclaimer-text strong { color: var(--gold); font-weight: 700; }

/* ========= MODAL ========= */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2,3,5,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.modal-panel {
  position: relative; z-index: 1;
  width: min(1050px, 100%);
  max-height: 92vh;
  background: var(--bg-soft);
  border: 1px solid var(--border-hi);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.9), 0 0 60px rgba(232,183,58,.15);
  animation: pop .2s ease-out;
  display: flex; flex-direction: column;
}
@supports (height: 1dvh) {
  .modal-panel { max-height: 92dvh; }
}
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(232,183,58,.08), transparent);
}
.modal-title-wrap { min-width: 0; }
.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px; letter-spacing: 1.5px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.modal-meta { margin: 4px 0 0; font-size: 12px; color: var(--text-dim); letter-spacing: .3px; }
.btn-close {
  width: 36px; height: 36px; border-radius: 8px; flex: 0 0 auto;
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text); font-size: 15px;
}
.btn-close:hover { border-color: var(--gold); color: var(--gold); }

/* ========= PLAYER WRAP (for overlay) ========= */
.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  flex: 0 0 auto;
  overflow: hidden;
}
.player-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.player-frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
  display: block;
}

/* ========= SERVER OVERLAY (ON TOP of iframe) ========= */
.server-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.server-overlay > * { pointer-events: auto; }

.server-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  background: rgba(5,6,8,.88);
  border: 1px solid rgba(232,183,58,.6);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0,0,0,.6);
  cursor: pointer;
  transition: .15s;
}
.server-toggle:hover { border-color: var(--gold); background: rgba(20,18,12,.95); }
.server-toggle svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--gold); }

.server-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #050608;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.server-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
  max-width: 340px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 12px;
  background: rgba(5,6,8,.97);
  border: 1px solid rgba(232,183,58,.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0,0,0,.8), 0 0 0 1px rgba(232,183,58,.2);
  -webkit-overflow-scrolling: touch;
}
.server-overlay.open .server-menu { display: flex; }

.stream-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  transition: .12s;
  cursor: pointer;
  min-height: 44px;
  width: 100%;
}
.stream-btn:hover {
  background: rgba(232,183,58,.12);
  border-color: rgba(232,183,58,.4);
}
.stream-btn.active {
  background: rgba(232,183,58,.2);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 800;
}

.stream-logo {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .5px;
  color: #050608;
  background: linear-gradient(135deg, var(--gold), #b8901f);
  box-shadow: 0 2px 6px rgba(0,0,0,.4), inset 0 0 0 1px rgba(0,0,0,.15);
}

.stream-btn .lbl {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========= SERVER STATUS BAR ========= */
.server-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
  background: rgba(232,183,58,.04);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .3px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(34,197,94,.6);
  flex: 0 0 auto;
  animation: statusPulse 2s infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
.status-text { font-weight: 600; color: var(--text); }

.modal-foot {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
  background: var(--bg-soft);
}
.notice { margin: 0; font-size: 12px; color: var(--text-dim); }

.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); }
.footer-inner {
  display: flex; flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  gap: 6px;
  padding: 22px 20px;
  padding-left: max(20px, env(safe-area-inset-left, 20px));
  padding-right: max(20px, env(safe-area-inset-right, 20px));
  padding-bottom: max(22px, env(safe-area-inset-bottom, 22px));
  font-size: 13px; color: var(--text-dim);
}
@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ========= RESPONSIVE ========= */
@media (max-width: 980px) {
  .main-nav { display: none; }
  .search-wrap input { width: 180px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-bat { width: 280px; height: 280px; top: -40px; right: -40px; }
}

@media (max-width: 620px) {
  .header-inner { gap: 12px; }
  .brand-text { display: none; }
  .search-wrap input { width: 140px; font-size: 13px; }
  .hero { padding: 34px 0 22px; }
  .hero-bat { width: 180px; height: 180px; top: -30px; right: -30px; opacity: .08; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-num { font-size: 30px; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .tabs { justify-content: center; }
  .event-grid { grid-template-columns: 1fr; }
  .disclaimer-text { font-size: 11px; padding: 12px 16px; }

  .modal { padding: 0; align-items: stretch; }
  .modal-panel {
    border-radius: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-title { font-size: 20px; }
  .player-wrap { aspect-ratio: 16 / 9; flex: 0 0 auto; }
  .modal-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }

  .server-overlay {
    top: 8px;
    right: 8px;
    max-width: calc(100% - 16px);
  }
  .server-toggle {
    height: 40px;
    padding: 0 12px;
    font-size: 12px;
    gap: 6px;
  }
  .server-toggle svg { width: 16px; height: 16px; }
  .server-menu {
    min-width: 220px;
    max-width: calc(100vw - 32px);
    max-height: 55vh;
    max-height: 55dvh;
    padding: 6px;
    border-radius: 12px;
  }
  .stream-btn {
    padding: 11px 12px;
    min-height: 50px;
    font-size: 13px;
  }
  .stream-logo { width: 34px; height: 34px; font-size: 13px; }

  .server-status { padding: 10px 14px; font-size: 11.5px; }
}

@media (max-width: 420px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
    row-gap: 8px;
  }
  .brand { order: 1; }
  .header-actions { order: 2; margin-left: auto; }
  .search-wrap { flex: 1 1 100%; order: 3; }
  .search-wrap input { width: 100%; min-width: 0; }
  .main-nav { display: none; }
}

@media (max-height: 640px) {
  .modal-panel { overflow-y: auto; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .modal-panel {
    max-height: 100vh;
    max-height: 100dvh;
  }
  .modal-head { padding: 8px 14px; }
  .modal-title { font-size: 18px; }
  .modal-meta { display: none; }
  .player-wrap {
    aspect-ratio: auto;
    height: calc(100vh - 130px);
    height: calc(100dvh - 130px);
    min-height: 240px;
  }
  .server-menu { max-height: 60vh; max-height: 60dvh; }
  .modal-foot { display: none; }
  .btn-close { width: 32px; height: 32px; }
  .server-status { padding: 8px 14px; }
}