/* ════════════════════════════════════════════════════════════════
   PIXEL PALACE CS2 — SHARED DESIGN SYSTEM
   Premium dark theme with amber/gold accents
   ════════════════════════════════════════════════════════════════ */

/* ─── Tokens ────────────────────────────────────────────────── */
:root {
  /* backgrounds */
  --bg-root:      #070710;
  --bg-surface:   #0d0d18;
  --bg-card:      #111122;
  --bg-card-hover:#161630;
  --bg-elevated:  #1a1a30;
  --bg-input:     #0f0f20;

  /* borders */
  --border:       rgba(255, 255, 255, .06);
  --border-hover: rgba(255, 255, 255, .12);
  --border-accent:rgba(245, 166, 35, .3);

  /* text */
  --text:         #e8e8f0;
  --text-secondary:#9090b0;
  --text-muted:   #606080;

  /* accent palette */
  --accent:       #f5a623;
  --accent-light: #ffc857;
  --accent-dark:  #c47f0a;
  --accent-bg:    rgba(245, 166, 35, .08);
  --accent-bg-strong:rgba(245, 166, 35, .15);

  /* status */
  --win:          #22c55e;
  --win-bg:       rgba(34, 197, 94, .1);
  --loss:         #ef4444;
  --loss-bg:      rgba(239, 68, 68, .1);
  --live:         #f43f5e;
  --live-bg:      rgba(244, 63, 94, .12);
  --pending:      #6366f1;
  --pending-bg:   rgba(99, 102, 241, .08);

  /* spacing & radius */
  --radius-xs:    6px;
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    16px;
  --radius-xl:    20px;

  /* fonts */
  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:         'JetBrains Mono', 'Fira Code', monospace;

  /* transitions */
  --ease:         cubic-bezier(.4, 0, .2, 1);

  /* shadows */
  --shadow-sm:    0 1px 2px rgba(0,0,0,.3);
  --shadow:       0 4px 12px rgba(0,0,0,.4);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.5);
  --shadow-glow:  0 0 30px rgba(245, 166, 35, .08);
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-root);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font); }

/* ─── Utilities ─────────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 50%, var(--accent-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Particles Canvas ──────────────────────────────────────── */
#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .4;
}

/* ─── Navbar ────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(7, 7, 16, .7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background .3s var(--ease);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  color: #000;
  letter-spacing: -.5px;
}

.brand-icon.sm {
  width: 28px;
  height: 28px;
  font-size: 10px;
  border-radius: var(--radius-xs);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.brand-logo.sm {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: .9rem; font-weight: 700; }
.brand-event { font-size: .68rem; color: var(--text-secondary); font-weight: 500; }

.nav-links { display: flex; gap: 4px; }

.nav-link {
  padding: 8px 16px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all .2s var(--ease);
}

.nav-link:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-link.active { color: var(--accent); background: var(--accent-bg); }

/* ─── Hero ──────────────────────────────────────────────────── */
#hero {
  position: relative;
  z-index: 1;
  padding: 140px 24px 70px;
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse at center,
    rgba(245, 166, 35, .10) 0%,
    rgba(245, 166, 35, .04) 40%,
    transparent 70%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }

.hero-badge-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #000;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  border-radius: 999px;
}

.hero-badge.outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  font-weight: 400;
}

.hero-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-value {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}

.stat-value.accent { color: var(--accent); }

.stat-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* ─── Control Bar ───────────────────────────────────────────── */
.control-bar {
  position: sticky;
  top: 64px;
  z-index: 99;
  background: rgba(7, 7, 16, .8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.control-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.pill {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: transparent;
  transition: all .2s var(--ease);
}

.pill:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: rgba(255,255,255,.03);
}

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

/* ─── Schedule Container ────────────────────────────────────── */
.schedule-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 100px;
}

/* ─── Round Section ─────────────────────────────────────────── */
.round-section {
  margin-bottom: 48px;
  opacity: 0;
  transform: translateY(16px);
  animation: slide-in .4s var(--ease) forwards;
}

.round-section:nth-child(1) { animation-delay: .05s; }
.round-section:nth-child(2) { animation-delay: .12s; }
.round-section:nth-child(3) { animation-delay: .19s; }
.round-section:nth-child(4) { animation-delay: .26s; }
.round-section:nth-child(5) { animation-delay: .33s; }

@keyframes slide-in {
  to { opacity: 1; transform: translateY(0); }
}

.round-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 24px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.round-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent-light), var(--accent-dark));
}

.round-info { display: flex; flex-direction: column; gap: 4px; }

.round-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .2px;
}

.round-title .highlight {
  color: var(--accent);
  font-weight: 800;
}

.round-sub {
  font-size: .75rem;
  color: var(--text-muted);
  font-family: var(--mono);
  display: flex;
  gap: 16px;
}

.round-tags { display: flex; gap: 6px; align-items: center; }

.round-tag {
  font-size: .68rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: .5px;
}

.round-tag.format {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid rgba(245, 166, 35, .2);
}

.round-tag.map {
  background: var(--pending-bg);
  color: var(--pending);
  border: 1px solid rgba(99, 102, 241, .15);
}

/* ─── Match Grid ────────────────────────────────────────────── */
.match-grid { display: flex; flex-direction: column; gap: 4px; }

/* ─── Match Card ────────────────────────────────────────────── */
.match-card {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all .25s var(--ease);
}

.match-card:hover {
  background: var(--bg-card);
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
  transform: translateX(2px);
}

.match-card.is-live {
  border-color: rgba(244, 63, 94, .3);
  background: rgba(244, 63, 94, .04);
}

.match-card.is-live:hover {
  border-color: rgba(244, 63, 94, .5);
}

.match-id {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  background: rgba(255, 255, 255, .03);
  padding: 6px 0;
  border-radius: var(--radius-xs);
}

.match-teams {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team {
  font-weight: 600;
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  transition: color .2s;
}

.team.w { color: var(--win); }
.team.l { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.1); }

.vs {
  flex-shrink: 0;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 3px 8px;
  border-radius: 4px;
}

/* ─── Score Display ─────────────────────────────────────────── */
.score-box {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--mono);
  font-size: .9rem;
  font-weight: 800;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  flex-shrink: 0;
}

.score-win {
  color: var(--win);
}

.score-loss {
  color: var(--text-muted);
}

.score-sep {
  color: var(--text-muted);
  margin: 0 4px;
  font-weight: 400;
}

.score-text {
  color: var(--text);
}

.score-badge.live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 800;
  color: #fff;
  background: var(--live);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  animation: pulse-live 2s ease-in-out infinite;
  flex-shrink: 0;
}

.match-time {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

.match-result-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid rgba(245, 166, 35, .2);
  transition: all .2s var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.demo-btn:hover {
  background: rgba(245, 166, 35, .15);
  border-color: rgba(245, 166, 35, .4);
  box-shadow: 0 0 12px rgba(245, 166, 35, .1);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--radius-xs);
  letter-spacing: .3px;
}

.status-chip.upcoming {
  color: var(--text-muted);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
}

.status-chip.completed {
  color: var(--win);
  background: var(--win-bg);
  border: 1px solid rgba(34, 197, 94, .15);
}

.status-chip.live {
  color: #fff;
  background: var(--live);
  animation: pulse-live 2s ease-in-out infinite;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1s steps(1) infinite;
}

@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, .4); }
  50%      { box-shadow: 0 0 16px 2px rgba(244, 63, 94, .25); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ─── Events Page ───────────────────────────────────────────── */
.events-page {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 100px;
}

.events-filter {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* ─── Event Card ────────────────────────────────────────────── */
.event-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all .3s var(--ease);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  animation: slide-in .4s var(--ease) forwards;
}

.event-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  opacity: 0;
  transition: opacity .3s;
}

.event-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
}

.event-card:hover::before { opacity: 1; }

.event-card.live { border-color: rgba(244, 63, 94, .2); }
.event-card.live::before {
  background: linear-gradient(90deg, var(--live), #ff6b8a);
  opacity: 1;
}

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

.event-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: .5px;
}

.event-status.upcoming {
  color: var(--pending);
  background: var(--pending-bg);
  border: 1px solid rgba(99, 102, 241, .15);
}

.event-status.live {
  color: #fff;
  background: var(--live);
  animation: pulse-live 2s ease-in-out infinite;
}

.event-status.completed {
  color: var(--win);
  background: var(--win-bg);
  border: 1px solid rgba(34, 197, 94, .15);
}

.event-format {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.event-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -.2px;
  line-height: 1.3;
}

.event-card-desc {
  font-size: .82rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
  flex: 1;
}

.event-card-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.event-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-muted);
}

.event-card-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, .06);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-light), var(--accent));
  border-radius: 999px;
  transition: width .5s var(--ease);
}

.progress-label {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.event-card-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  color: var(--text-muted);
  opacity: 0;
  transition: all .3s var(--ease);
}

.event-card:hover .event-card-arrow {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  color: var(--accent);
}

/* ─── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.empty-state svg { margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p { font-size: .85rem; }

/* ─── Footer ────────────────────────────────────────────────── */
#footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: .85rem;
}

.footer-links { display: flex; gap: 16px; }

.footer-link {
  font-size: .78rem;
  color: var(--text-muted);
  transition: color .2s;
}

.footer-link:hover { color: var(--accent); }

.admin-link {
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.admin-link:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}

.footer-copy {
  font-size: .7rem;
  color: var(--text-muted);
}

/* ═════════════════════════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .match-card {
    grid-template-columns: 40px 1fr;
    gap: 6px 10px;
    padding: 10px 14px;
  }

  .match-teams { grid-column: 2; flex-wrap: wrap; gap: 4px; }
  .match-time  { grid-column: 2; text-align: left; font-size: .72rem; }
  .match-result-area { grid-column: 2; justify-content: flex-start; }

  .events-grid { grid-template-columns: 1fr; }

  .team { max-width: 130px; font-size: .82rem; }

  .control-inner { gap: 16px; }
  .control-group { flex-wrap: wrap; gap: 6px; }

  .round-header { padding: 16px 18px; }
  .round-sub { flex-direction: column; gap: 4px; }

  .hero-stats { gap: 20px; }
  .stat-value { font-size: 1.3rem; }

  h1 { letter-spacing: -.5px; }
}

@media (max-width: 480px) {
  .hero-badge-row { gap: 6px; }
  .hero-badge { font-size: 9px; padding: 4px 12px; }
  .nav-inner { padding: 0 16px; }
  .schedule-container { padding: 32px 12px 80px; }
  .control-bar { top: 56px; }
  .nav-inner { height: 56px; }
  .brand-text { display: none; }
}
