:root {
  /* Color Palette */
  --bg-base: #050508;
  --bg-gradient: radial-gradient(circle at top, #1a0b16 0%, #050508 60%);
  --bg-surface: rgba(255, 255, 255, 0.02);
  --bg-surface-hover: rgba(255, 255, 255, 0.05);
  --bg-glass: rgba(10, 10, 15, 0.6);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-strong: rgba(255, 255, 255, 0.15);
  
  --primary: #f82541;
  --primary-hover: #ff3a54;
  --primary-glow: rgba(248, 37, 65, 0.3);
  
  --text-main: #f8f8f8;
  --text-muted: #a0a0ab;
  --text-dim: #6c6c75;
  
  --success: #10b981;
  --danger: #ef4444;

  /* Typography & Layout */
  --font-main: "Cairo", system-ui, sans-serif;
  --container-max: 1200px;
  --header-height: 80px;

  /* Effects */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-glow: 0 0 20px var(--primary-glow);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --blur-md: blur(12px);
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg-base);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  overflow-x: hidden;
}

main {
  flex: 1;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

.container {
  width: min(100% - 2rem, var(--container-max));
  margin-inline: auto;
}

.hidden {
  display: none !important;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Background Atmosphere */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-size: 50px 50px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: 
    radial-gradient(circle at 15% 50%, rgba(248, 37, 65, 0.08), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(120, 10, 255, 0.05), transparent 40%);
  pointer-events: none;
  filter: blur(60px);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: var(--blur-md);
  border-bottom: 1px solid var(--border-glass);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  group: hover;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass-strong);
  transition: var(--transition-fast);
}

.brand:hover .brand-logo {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 800;
  font-size: 1.25rem;
  background: linear-gradient(135deg, #fff, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
}

.brand-tag {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-fast);
  padding: 0.5rem 0;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--primary);
  transition: var(--transition-smooth);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-admin {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
}

.nav-admin::after {
  display: none;
}

.nav-admin:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* Views & Animations */
.view {
  display: none;
  animation: fadeScale 0.5s var(--transition-smooth) both;
}

.view.active {
  display: block;
}

@keyframes fadeScale {
  from { opacity: 0; transform: scale(0.98) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Hero Section */
.hero {
  padding: 6rem 0 4rem;
  position: relative;
  text-align: center;
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(248, 37, 65, 0.2);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #a0a0ab 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* Section */
.section {
  padding: 3rem 0 6rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.section-head h2 {
  font-size: 2rem;
  font-weight: 800;
  position: relative;
  padding-right: 1rem;
}

.section-head h2::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 80%;
  background: var(--primary);
  border-radius: 4px;
}

/* Hero Single Tournament Showcase */
.single-tournament-hero {
  min-height: calc(100vh - var(--header-height) - 100px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0 4rem;
}

.hero-showcase {
  position: relative;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-glass), 0 30px 60px rgba(0, 0, 0, 0.5);
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.hero-cover-wrap {
  width: 100%;
  aspect-ratio: 21/9;
  max-height: 420px;
  position: relative;
  overflow: hidden;
  background: #0a0a0f;
}

.hero-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-cover-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #180914 0%, #08080c 100%);
  color: rgba(248, 37, 65, 0.3);
}

.hero-cover-placeholder svg {
  width: 6rem;
  height: 6rem;
}

.hero-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-base) 0%, rgba(5, 5, 8, 0.4) 60%, transparent 100%);
}

.hero-showcase-content {
  padding: 2.5rem 3rem 3rem;
  margin-top: -4rem;
  position: relative;
  z-index: 5;
}



.hero-showcase-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #d0d0d8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-showcase-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  white-space: pre-wrap;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.hero-stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.hero-stat-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--primary);
  transform: translateY(-3px);
}

.hero-stat-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--primary-glow);
  border: 1px solid rgba(248, 37, 65, 0.2);
  border-radius: var(--radius-sm);
  color: var(--primary);
  flex-shrink: 0;
}

.hero-stat-icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.hero-stat-info {
  display: flex;
  flex-direction: column;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
}

.hero-stat-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.hero-stat-full {
  grid-column: 1 / -1;
}

.hero-notify-bar {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.btn-notify {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.75rem;
  background: rgba(248, 37, 65, 0.12);
  border: 1px solid rgba(248, 37, 65, 0.35);
  color: var(--text-main);
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition-fast);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(248, 37, 65, 0.15);
}

.btn-notify:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 25px var(--primary-glow);
  transform: translateY(-2px);
}

.btn-notify.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--success);
  box-shadow: none;
}

.t-card-meta {
  display: flex;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-glass);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
}

.meta-item svg {
  color: var(--primary);
  opacity: 0.8;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 6rem 2rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-glass-strong);
  border-radius: var(--radius-lg);
}

.empty-icon {
  width: 4rem;
  height: 4rem;
  color: var(--border-glass-strong);
  margin-bottom: 1.5rem;
}

.empty-state p {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Detail View */
.detail-wrap {
  padding: 2rem 0 6rem;
  max-width: 1000px;
  margin: 0 auto;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 2rem;
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.back-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
  border-color: var(--border-glass-strong);
  transform: translateX(-4px);
}

.detail-card {
  background: var(--bg-glass);
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-glass);
}

.detail-media {
  width: 100%;
  aspect-ratio: 21/9;
  max-height: 400px;
  position: relative;
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-base) 0%, transparent 100%);
}

.detail-media-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #15161a, #0a0a0c);
  display: grid;
  place-items: center;
}

.detail-media-placeholder svg {
  width: 5rem;
  height: 5rem;
  color: var(--border-glass-strong);
}

.detail-body {
  padding: 3rem;
  position: relative;
  z-index: 10;
  margin-top: -3rem; /* Overlap the media gradient */
}

.detail-type {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(248, 37, 65, 0.4);
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.detail-body h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.detail-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 3rem;
  white-space: pre-wrap;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

.stat {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  text-align: right;
  transition: var(--transition-fast);
}

.stat:hover {
  background: var(--bg-surface-hover);
  border-color: var(--primary);
  transform: translateY(-4px);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.stat-label svg {
  color: var(--primary);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Admin Login & Layout */
.admin-wrap {
  padding: 4rem 0;
}

.admin-login {
  display: grid;
  place-items: center;
  min-height: 60vh;
}

.login-panel {
  width: 100%;
  max-width: 440px;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-glass);
}

.login-icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--primary);
}

.login-icon-wrap svg {
  width: 2rem;
  height: 2rem;
}

.login-panel h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.login-panel p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: right;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  transition: var(--transition-fast);
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255,255,255,0.05);
}

.form-error {
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-ghost {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

.btn-ghost:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-glass-strong);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  white-space: nowrap;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.push-input-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--primary);
}

/* Admin Dashboard */
.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-glass);
}

.admin-top h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.muted {
  color: var(--text-muted);
  font-size: 1rem;
}

.admin-actions {
  display: flex;
  gap: 1rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
}

.admin-list-panel h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  text-align: right;
  transition: var(--transition-fast);
}

.admin-item:hover, .admin-item.active {
  background: var(--bg-surface-hover);
  border-color: var(--primary);
}

.admin-item-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.admin-item-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-form-panel {
  background: var(--bg-glass);
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.form-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.form-panel-head h3 {
  font-size: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-row.two {
  grid-template-columns: 1fr 1fr;
}

.req {
  color: var(--primary);
}

.image-upload {
  background: var(--bg-surface);
  border: 1px dashed var(--border-glass-strong);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.image-upload input[type="file"] {
  margin-bottom: 1rem;
}

.image-preview {
  margin-top: 1.5rem;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16/9;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  border: none;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-glass);
}

.form-actions-end {
  display: flex;
  gap: 1rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-glass);
  padding: 2rem 0;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-md);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

.footer-admin-link {
  color: var(--text-muted);
  transition: var(--transition-fast);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.85rem;
}

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

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translate(-50%, 150%);
  background: var(--bg-glass);
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--border-glass);
  padding: 1rem 2rem;
  border-radius: 100px;
  font-weight: 700;
  z-index: 1000;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-glass);
}

.toast.show {
  transform: translate(-50%, 0);
}



/* Responsive */
@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-showcase-content { padding: 1.5rem; margin-top: -2rem; }
  .hero-cover-wrap { aspect-ratio: 16/9; }
  .hero-stats-grid { grid-template-columns: 1fr; }
  .form-row.two { grid-template-columns: 1fr; }
  .detail-body { padding: 1.5rem; }
  .admin-top { flex-direction: column; align-items: stretch; }
}
