:root {
  color-scheme: dark;
  --bg: #08090d;
  --ink: #fff8ee;
  --muted: rgba(255, 248, 238, 0.72);
  --line: rgba(255, 255, 255, 0.16);
  --panel: rgba(8, 10, 16, 0.76);
  --panel-strong: rgba(16, 18, 25, 0.92);
  --red: #df2332;
  --gold: #f5c86d;
  --green: #1aa260;
  --flag-black: #111217;
  --white: #ffffff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cairo", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  position: relative;
  overflow-x: hidden;
}

.page-shell::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(6, 7, 11, 0.92), rgba(8, 9, 13, 0.42) 47%, rgba(5, 6, 10, 0.88)),
    linear-gradient(180deg, rgba(6, 7, 11, 0.08), rgba(6, 7, 11, 0.82)),
    url("assets/fan-zone-bg.png") center / cover no-repeat;
  content: "";
}

.page-shell::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(223, 35, 50, 0.2), transparent 24rem),
    linear-gradient(115deg, transparent 0 49%, rgba(255, 255, 255, 0.08) 49.2% 49.8%, transparent 50%),
    linear-gradient(62deg, transparent 0 53%, rgba(245, 200, 109, 0.12) 53.2% 53.8%, transparent 54%);
  content: "";
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  width: min(1180px, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem 0;
}

.brand-panel {
  max-width: 680px;
  padding-top: 8vh;
}

.egypt-flag {
  display: grid;
  width: clamp(8.5rem, 18vw, 13.5rem);
  height: clamp(3.2rem, 6vw, 5rem);
  margin-bottom: 1.1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.egypt-flag span {
  position: relative;
  display: block;
}

.egypt-flag span:first-child {
  background: #ce1126;
}

.egypt-flag span:nth-child(2) {
  background: #ffffff;
}

.egypt-flag span:last-child {
  background: var(--flag-black);
}

.egypt-flag i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.1rem;
  height: 1.45rem;
  transform: translate(-50%, -50%);
  clip-path: polygon(50% 0, 88% 24%, 72% 100%, 50% 82%, 28% 100%, 12% 24%);
  background: #c0932f;
}

.egypt-flag-small {
  width: 6.75rem;
  height: 2.55rem;
  margin-bottom: 0.8rem;
}

.event-kicker {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.brand-panel h1 {
  max-width: 12ch;
  margin-bottom: 1rem;
  font-size: clamp(3rem, 8vw, 6.8rem);
  font-weight: 900;
  line-height: 0.95;
}

.brand-en {
  max-width: 560px;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  direction: ltr;
}

.match-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.match-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  font-weight: 700;
  backdrop-filter: blur(14px);
}

.form-panel,
.admin-panel,
.stat-tile {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.form-panel {
  border-radius: 8px;
  padding: clamp(1.1rem, 3vw, 2rem);
}

.panel-heading {
  margin-bottom: 1.2rem;
}

.panel-heading p,
.admin-panel-bar p {
  margin-bottom: 0.25rem;
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 900;
}

.panel-heading h2,
.admin-panel-bar h2,
.admin-header h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.15;
}

.fan-form {
  display: grid;
  gap: 0.95rem;
}

.fan-form label {
  display: grid;
  gap: 0.4rem;
}

.fan-form span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

input {
  width: 100%;
  min-height: 3.25rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.8rem 0.95rem;
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

input:focus {
  border-color: rgba(245, 200, 109, 0.72);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 4px rgba(245, 200, 109, 0.12);
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border: 0;
  border-radius: 8px;
  padding: 0.72rem 1rem;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    background 180ms ease;
}

.primary-button {
  margin-top: 0.35rem;
  background: linear-gradient(135deg, var(--red), #ff5c50 55%, var(--gold));
  color: #11080a;
}

.primary-button:disabled {
  cursor: wait;
  filter: grayscale(0.25);
  opacity: 0.72;
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.danger-button {
  background: rgba(223, 35, 50, 0.18);
  color: #ffd8dc;
}

button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.form-message {
  min-height: 1.5rem;
  margin: 0;
  color: #bff8d5;
  font-weight: 800;
  opacity: 0;
}

.form-message.is-visible {
  opacity: 1;
}

.admin-layout {
  width: min(1180px, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2.5rem) 0;
}

.admin-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.stat-tile {
  border-radius: 8px;
  padding: 1rem;
}

.stat-tile span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.stat-tile strong {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1;
}

.admin-panel {
  border-radius: 8px;
  overflow: hidden;
}

.admin-panel-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 1rem;
}

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

.table-wrap {
  position: relative;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  padding: 0.85rem 1rem;
  text-align: right;
  white-space: nowrap;
}

th {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 900;
}

td {
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
}

.empty-state {
  padding: 2rem 1rem;
  color: var(--muted);
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .hero-layout {
    grid-template-columns: 1fr;
    align-items: start;
    width: min(100% - 1rem, 720px);
    min-height: auto;
    padding: 1rem 0 1.75rem;
  }

  .brand-panel {
    padding-top: 0.35rem;
  }

  .brand-panel h1 {
    max-width: 13ch;
    font-size: clamp(2.45rem, 12vw, 4.2rem);
  }

  .form-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .admin-panel-bar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .page-shell::before {
    background:
      linear-gradient(180deg, rgba(6, 7, 11, 0.7), rgba(6, 7, 11, 0.94)),
      url("assets/fan-zone-bg.png") center top / cover no-repeat;
  }

  .form-panel,
  .admin-panel,
  .stat-tile {
    backdrop-filter: blur(18px);
  }

  .brand-panel h1 {
    font-size: 2.65rem;
    line-height: 1;
  }

  .brand-en {
    font-size: 1rem;
  }

  .match-strip span {
    width: 100%;
    text-align: center;
  }

  .form-panel {
    padding: 1rem;
  }

  input {
    min-height: 3rem;
  }

  .primary-button,
  .secondary-button,
  .danger-button,
  .ghost-button {
    width: 100%;
  }

  .admin-layout {
    width: min(100% - 1rem, 720px);
  }

  .admin-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 0.75rem;
  }
}
