﻿/* ═══════════════════════════════════════════════════════════════════════════
   Egyptian Football Facts — Light Egyptian Theme
   Colors: red / white / gold · Mobile-first · max-width 480px app shell
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Design Tokens ────────────────────────────────────────────────────────── */

:root {
  /* Brand — Egyptian palette */
  --egypt-red: #ce1126;
  --egypt-red-dark: #a30d1e;
  --egypt-red-deep: #7a0b16;
  --egypt-gold: #f5c518;
  --egypt-gold-dark: #d4a017;
  --egypt-gold-pale: #fef3c7;

  /* Surfaces & text */
  --cream: #fff9f0;
  --white: #ffffff;
  --slate: #1a1a1a;
  --slate-muted: #4a4a4a;
  --slate-soft: #6b7280;
  --slate-faint: #9ca3af;

  /* Semantic aliases */
  --bg: var(--cream);
  --bg-alt: var(--egypt-gold-pale);
  --surface: var(--white);
  --surface-raised: #fffdf8;
  --surface-muted: #f5efe4;
  --text: var(--slate);
  --text-muted: var(--slate-soft);
  --text-faint: var(--slate-faint);
  --border: rgba(26, 26, 26, 0.08);
  --border-strong: rgba(26, 26, 26, 0.14);
  --border-gold: rgba(245, 197, 24, 0.45);

  /* Accent colors (Egyptian-themed stat/category tints) */
  --accent-red: var(--egypt-red);
  --accent-red-soft: rgba(206, 17, 38, 0.1);
  --accent-red-glow: rgba(206, 17, 38, 0.22);
  --accent-gold: var(--egypt-gold);
  --accent-gold-soft: rgba(245, 197, 24, 0.18);
  --accent-gold-glow: rgba(245, 197, 24, 0.35);
  --accent-green: #15803d;
  --accent-green-soft: rgba(21, 128, 61, 0.1);
  --accent-orange: #c2410c;
  --accent-orange-soft: rgba(194, 65, 12, 0.1);
  --accent-teal: #0f766e;
  --accent-teal-soft: rgba(15, 118, 110, 0.1);
  --accent-maroon: #7a0b16;
  --accent-maroon-soft: rgba(122, 11, 22, 0.08);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Layout */
  --app-max: 480px;
  --nav-height: 72px;
  --header-height: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --page-pad-x: 16px;
  --page-pad-bottom: calc(var(--nav-height) + var(--safe-bottom) + 24px);

  /* Radii */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(26, 26, 26, 0.04);
  --shadow-sm: 0 2px 8px rgba(26, 26, 26, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 26, 26, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 26, 26, 0.1);
  --shadow-red: 0 4px 20px var(--accent-red-glow);
  --shadow-gold: 0 4px 20px var(--accent-gold-glow);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-normal: 250ms;
  --dur-slow: 400ms;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--safe-top) + 12px);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

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

a {
  color: var(--egypt-red);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--egypt-red-dark);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--egypt-gold);
  outline-offset: 2px;
}

::selection {
  background: var(--egypt-gold-pale);
  color: var(--egypt-red-deep);
}

/* Subtle Egyptian pattern overlay on body */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image:
    repeating-linear-gradient(
      45deg,
      var(--egypt-gold) 0,
      var(--egypt-gold) 1px,
      transparent 1px,
      transparent 12px
    );
}

/* ── App Shell ────────────────────────────────────────────────────────────── */

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  background: var(--bg);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px var(--border);
  overflow-x: hidden;
}

.app-shell::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--egypt-red) 0%,
    var(--egypt-gold) 50%,
    var(--egypt-red) 100%
  );
  z-index: 10;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  padding: calc(10px + var(--safe-top)) var(--page-pad-x) 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.logo:hover {
  color: var(--egypt-red);
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--egypt-gold);
}

.logo-text {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Main & Page Container ────────────────────────────────────────────────── */

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-container {
  width: 100%;
  padding-left: var(--page-pad-x);
  padding-right: var(--page-pad-x);
}

.home-view {
  padding-bottom: var(--page-pad-bottom);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  margin: 0 calc(var(--page-pad-x) * -1);
  padding: 20px var(--page-pad-x) 28px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-splash {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}

.hero-splash-blue {
  width: 220px;
  height: 220px;
  top: -40px;
  right: -30px;
  background: radial-gradient(circle, var(--accent-red-soft) 0%, transparent 70%);
  animation: heroFloat 10s ease-in-out infinite;
}

.hero-splash-pink {
  width: 180px;
  height: 180px;
  bottom: 10px;
  left: -40px;
  background: radial-gradient(circle, var(--accent-gold-soft) 0%, transparent 70%);
  animation: heroFloat 12s ease-in-out infinite reverse;
}

@keyframes heroFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12px, -8px) scale(1.05); }
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: end;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-greeting {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--egypt-red);
  margin-bottom: 8px;
}

.hero-title {
  font-size: clamp(28px, 8vw, 36px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.text-blue {
  display: block;
  color: var(--egypt-red);
}

.text-pink {
  display: block;
  color: var(--egypt-gold-dark);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hero-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 18px;
  max-width: 34ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-player {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-lg);
  border: 3px solid var(--white);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--border-gold);
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--dur-normal) var(--ease-out),
    color var(--dur-normal) var(--ease-out),
    box-shadow var(--dur-normal) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-normal) var(--ease-out);
}

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

.btn svg {
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--egypt-red) 0%, var(--egypt-red-dark) 100%);
  color: var(--white);
  box-shadow: var(--shadow-red);
  border: 1px solid var(--egypt-red-dark);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--egypt-red-dark) 0%, var(--egypt-red-deep) 100%);
  color: var(--white);
  box-shadow: 0 6px 24px var(--accent-red-glow);
}

.btn-secondary {
  background: var(--white);
  color: var(--egypt-red);
  border: 2px solid var(--egypt-gold);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--egypt-gold-pale);
  color: var(--egypt-red-dark);
  border-color: var(--egypt-gold-dark);
}

/* ── Stats Card ─────────────────────────────────────────────────────────────── */

.stats-card {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0 0 24px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  transition: box-shadow var(--dur-normal) var(--ease-out);
}

.stat:hover {
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.stat-icon-blue {
  background: var(--accent-red-soft);
  color: var(--egypt-red);
}

.stat-icon-green {
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.stat-icon-orange {
  background: var(--accent-orange-soft);
  color: var(--accent-orange);
}

.stat-icon-pink {
  background: var(--accent-gold-soft);
  color: var(--egypt-gold-dark);
}

.stat-number {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}

.stat-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── Sections ───────────────────────────────────────────────────────────────── */

.section {
  margin-bottom: 28px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.3;
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-reconnect {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  background: var(--surface-muted);
  color: var(--egypt-red);
  border: 1px solid var(--border-strong);
  transition: background var(--dur-fast) var(--ease-out);
}

.btn-reconnect:hover {
  background: var(--egypt-gold-pale);
}

.api-status {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-muted);
  color: var(--text-muted);
  white-space: nowrap;
}

.api-status-success {
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.api-status-error {
  background: var(--accent-red-soft);
  color: var(--egypt-red);
}

/* ── Club Search ────────────────────────────────────────────────────────────── */

.club-search {
  margin-bottom: 20px;
}

.search-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--egypt-red);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-strong);
  background: var(--white);
  font-size: 15px;
  transition:
    border-color var(--dur-normal) var(--ease-out),
    box-shadow var(--dur-normal) var(--ease-out);
}

.search-input::placeholder {
  color: var(--text-faint);
}

.search-input:hover {
  border-color: var(--egypt-gold);
}

.search-input:focus {
  outline: none;
  border-color: var(--egypt-red);
  box-shadow: 0 0 0 3px var(--accent-red-soft);
}

.search-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 8px;
  line-height: 1.4;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.search-results.is-visible {
  display: flex;
}

.clubs-list-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--egypt-gold-dark, #d4a017);
  margin: 4px 0 2px;
}

.clubs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(55vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--dur-normal) var(--ease-out),
    box-shadow var(--dur-normal) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.search-result-item:hover {
  border-color: var(--egypt-gold);
  box-shadow: var(--shadow-sm);
}

.search-result-item:active {
  transform: scale(0.99);
}

.search-result-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  padding: 4px;
}

.search-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 12px;
  color: var(--text-faint);
}

.search-result-tag {
  flex-shrink: 0;
}

.search-result-arrow {
  flex-shrink: 0;
  color: var(--egypt-gold-dark);
}

.search-empty {
  font-size: 14px;
  color: var(--text-muted);
  padding: 16px;
  text-align: center;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
}

/* ── Standings ──────────────────────────────────────────────────────────────── */

.standings-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.standings-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.standings-card-wc {
  border-top: 3px solid var(--egypt-red);
}

.standings-header {
  padding: 16px 16px 12px;
  background: linear-gradient(180deg, var(--egypt-gold-pale) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--border);
}

.standings-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--egypt-red-deep);
  line-height: 1.3;
  margin-bottom: 4px;
}

.standings-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.standings-skeleton {
  height: 200px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    90deg,
    var(--surface-muted) 25%,
    var(--egypt-gold-pale) 50%,
    var(--surface-muted) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.standings-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.standings-table th {
  padding: 10px 8px;
  text-align: left;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.standings-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.standings-table tr:last-child td {
  border-bottom: none;
}

.standings-rank {
  font-weight: 800;
  color: var(--text-muted);
  width: 28px;
  text-align: center;
}

.standings-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  min-width: 120px;
}

.standings-team-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.standings-row-egypt {
  background: linear-gradient(90deg, var(--accent-red-soft) 0%, transparent 100%);
}

.standings-row-egypt td {
  font-weight: 700;
  color: var(--egypt-red-deep);
}

.standings-row-qualify {
  background: linear-gradient(90deg, var(--accent-green-soft) 0%, transparent 60%);
}

.standings-row-out {
  opacity: 0.55;
}

.standings-qual-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: var(--accent-green);
  color: var(--white);
}

.standings-out-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: var(--slate-faint);
  color: var(--white);
}

.standings-form {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.standings-form-empty {
  color: var(--text-faint);
}

.form-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 900;
  color: var(--white);
}

.form-dot.W,
.form-dot.w {
  background: var(--accent-green);
}

.form-dot.D,
.form-dot.d {
  background: var(--egypt-gold-dark);
}

.form-dot.L,
.form-dot.l {
  background: var(--egypt-red);
}

.standings-points {
  font-weight: 800;
  color: var(--egypt-red);
  text-align: center;
}

.standings-group-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Live badge variants */
.live-badge,
.standings-live-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 12px;
  margin: 0 16px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.standings-live-badge {
  display: flex;
  margin: 0 0 12px;
}

.standings-live-badge-api {
  background: var(--accent-green-soft);
  color: var(--accent-green);
  border: 1px solid rgba(21, 128, 61, 0.2);
}

.standings-live-badge-official {
  background: var(--accent-gold-soft);
  color: var(--egypt-gold-dark);
  border: 1px solid var(--border-gold);
}

.standings-live-badge-fallback {
  background: var(--accent-orange-soft);
  color: var(--accent-orange);
  border: 1px solid rgba(194, 65, 12, 0.2);
}

.standings-live-label {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.standings-live-updated {
  font-weight: 600;
  opacity: 0.85;
}

.standings-live-reason {
  width: 100%;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.8;
}

.live-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ── Egypt Points Banner ────────────────────────────────────────────────────── */

.egypt-points-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 16px;
  margin: 0 16px 16px;
  background: linear-gradient(135deg, var(--egypt-red) 0%, var(--egypt-red-dark) 100%);
  border-radius: var(--radius-md);
  color: var(--white);
  box-shadow: var(--shadow-red);
}

.egypt-points-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 6px;
}

.egypt-points-info {
  flex: 1;
  min-width: 140px;
}

.egypt-points-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 2px;
}

.egypt-points-value {
  display: block;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
}

.egypt-points-value small {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
}

.egypt-points-stats {
  display: flex;
  gap: 16px;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.egypt-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
}

.egypt-stat-val {
  font-size: 16px;
  font-weight: 800;
}

.egypt-stat-lbl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* ── Egypt Knockout Path ────────────────────────────────────────────────────── */

.egypt-knockout {
  padding: 16px;
}

.knockout-path {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.knockout-step {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-raised);
}

.knockout-step-next {
  border-left: 4px solid var(--egypt-gold);
  background: var(--egypt-gold-pale);
}

.knockout-step-win {
  border-left: 4px solid var(--egypt-red);
  background: var(--accent-red-soft);
}

.knockout-step-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.knockout-matchup {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.knockout-matchup-future {
  opacity: 0.85;
}

.knockout-team {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.knockout-team-egypt {
  color: var(--egypt-red);
}

.knockout-team-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.knockout-vs {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}

.knockout-step-note {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.knockout-arrow {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--egypt-gold-dark);
  padding: 4px 0;
}

/* ── Group G Chart & Results ────────────────────────────────────────────────── */

.group-g-chart {
  padding: 16px;
}

.group-g-chart-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.group-g-chart-note {
  font-size: 11px;
  color: var(--text-faint);
}

.group-g-chart-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-g-chart-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-g-chart-row-egypt .group-g-chart-name {
  color: var(--egypt-red);
  font-weight: 800;
}

.group-g-chart-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.group-g-chart-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.group-g-chart-name {
  flex: 1;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-g-chart-pts {
  font-weight: 800;
  color: var(--egypt-red);
}

.group-g-chart-track {
  height: 8px;
  background: var(--surface-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.group-g-chart-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--egypt-red) 0%, var(--egypt-gold) 100%);
  border-radius: var(--radius-full);
  min-width: 4px;
  transition: width var(--dur-slow) var(--ease-out);
}

.group-g-results {
  padding: 0 16px 16px;
}

.group-g-matchday {
  margin-bottom: 14px;
}

.group-g-matchday-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--egypt-red);
  margin-bottom: 8px;
}

.group-g-results-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-g-result {
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.group-g-result-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.group-g-card-compact .standings-header {
  padding: 12px;
}

.standings-table-compact td,
.standings-table-compact th {
  padding: 8px 6px;
}

/* ── Fixtures ───────────────────────────────────────────────────────────────── */

.fixtures-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fixture-item {
  padding: 12px;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.fixture-date {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.fixture-match {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.fixture-team {
  font-weight: 600;
  flex: 1;
  min-width: 80px;
}

.fixture-team:first-child {
  text-align: right;
}

.fixture-team:last-child {
  text-align: left;
}

.fixture-vs {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-faint);
  flex-shrink: 0;
}

.fixture-score {
  color: var(--egypt-red);
  font-size: 14px;
}

.fixtures-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px;
  text-align: center;
}

/* ── Categories ─────────────────────────────────────────────────────────────── */

.categories-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 8px;
  margin: 0 calc(var(--page-pad-x) * -1);
  padding-left: var(--page-pad-x);
  padding-right: var(--page-pad-x);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-card {
  flex: 0 0 130px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow-xs);
  text-align: left;
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-normal) var(--ease-out);
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.category-card:active {
  transform: translateY(0);
}

.category-card svg {
  opacity: 0.9;
}

.category-name {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.category-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  line-height: 1.3;
}

.category-purple {
  background: linear-gradient(145deg, #fff 0%, var(--accent-maroon-soft) 100%);
  border-color: rgba(122, 11, 22, 0.15);
  color: var(--egypt-red-deep);
}

.category-green {
  background: linear-gradient(145deg, #fff 0%, var(--accent-green-soft) 100%);
  border-color: rgba(21, 128, 61, 0.15);
  color: var(--accent-green);
}

.category-orange {
  background: linear-gradient(145deg, #fff 0%, var(--accent-orange-soft) 100%);
  border-color: rgba(194, 65, 12, 0.15);
  color: var(--accent-orange);
}

.category-pink {
  background: linear-gradient(145deg, #fff 0%, var(--accent-red-soft) 100%);
  border-color: rgba(206, 17, 38, 0.15);
  color: var(--egypt-red);
}

.category-teal {
  background: linear-gradient(145deg, #fff 0%, var(--accent-teal-soft) 100%);
  border-color: rgba(15, 118, 110, 0.15);
  color: var(--accent-teal);
}

/* ── Did You Know ───────────────────────────────────────────────────────────── */

.did-you-know {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  margin-bottom: 28px;
  background: linear-gradient(135deg, var(--white) 0%, var(--egypt-gold-pale) 100%);
  border-radius: var(--radius-xl);
  border: 2px solid var(--egypt-gold);
  box-shadow: var(--shadow-gold);
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-normal) var(--ease-out);
}

.did-you-know:hover {
  box-shadow: 0 8px 28px var(--accent-gold-glow);
}

.did-you-know:active {
  transform: scale(0.99);
}

.dyk-content {
  min-width: 0;
}

.dyk-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--egypt-red);
  margin-bottom: 8px;
}

.dyk-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 12px;
}

.dyk-graphic {
  flex-shrink: 0;
}

.stopwatch {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--egypt-red) 0%, var(--egypt-red-dark) 100%);
  box-shadow: var(--shadow-red);
  border: 3px solid var(--egypt-gold);
}

.stopwatch-time {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--white);
}

.dyk-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  background: var(--white);
  color: var(--egypt-red);
  border: 1px solid var(--border-strong);
  transition:
    background var(--dur-normal) var(--ease-out),
    color var(--dur-normal) var(--ease-out),
    border-color var(--dur-normal) var(--ease-out);
}

.dyk-save-btn:hover {
  background: var(--egypt-gold-pale);
  border-color: var(--egypt-gold);
}

.dyk-save-btn.is-saved {
  background: var(--egypt-red);
  color: var(--white);
  border-color: var(--egypt-red-dark);
}

/* ── Club Page ──────────────────────────────────────────────────────────────── */

.club-page {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.club-page[hidden] {
  display: none !important;
}

.club-page-bar {
  flex-shrink: 0;
  padding: calc(10px + var(--safe-top)) var(--page-pad-x) 10px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.club-page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--egypt-red);
  padding: 8px 12px 8px 8px;
  border-radius: var(--radius-full);
  transition: background var(--dur-fast) var(--ease-out);
}

.club-page-back:hover {
  background: var(--egypt-gold-pale);
  color: var(--egypt-red-dark);
}

.club-page-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--safe-bottom) + 24px);
}

.club-page-header {
  margin-bottom: 20px;
}

.club-page-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.club-page-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 0;
}

.club-page-logo {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 2px solid var(--egypt-gold);
  box-shadow: var(--shadow-sm);
  padding: 10px;
}

.club-page-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.club-page-hero-info {
  flex: 1;
  min-width: 0;
}

.club-page-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 8px 0 6px;
  color: var(--text);
}

.club-page-meta {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.club-block {
  margin-bottom: 28px;
}

.club-block-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.club-facts-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  border-radius: var(--radius-full);
  background: var(--egypt-gold-pale);
  color: var(--egypt-red);
  border: 1px solid var(--border-gold);
}

.club-facts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.club-fact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  font-size: 14px;
  line-height: 1.55;
}

.club-fact-item p,
.club-fact-item span:first-child {
  flex: 1;
  min-width: 0;
}

.fact-save-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  background: var(--surface-muted);
  color: var(--egypt-red);
  border: 1px solid var(--border-strong);
  transition: all var(--dur-normal) var(--ease-out);
}

.fact-save-btn:hover {
  background: var(--egypt-gold-pale);
}

.fact-save-btn.is-saved {
  background: var(--egypt-red);
  color: var(--white);
  border-color: var(--egypt-red-dark);
}

.fact-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
}

.fact-tag-club {
  background: var(--accent-red-soft);
  color: var(--egypt-red);
}

.fact-tag-national {
  background: var(--accent-gold-soft);
  color: var(--egypt-gold-dark);
}

.fact-tag-league {
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.club-page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 16px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--surface-muted);
  border-top-color: var(--egypt-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Squad ──────────────────────────────────────────────────────────────────── */

.squad-section {
  margin-bottom: 24px;
}

.squad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.squad-player {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--dur-normal) var(--ease-out);
}

.squad-player:hover {
  box-shadow: var(--shadow-sm);
}

.squad-player-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  background: linear-gradient(180deg, var(--egypt-gold-pale) 0%, var(--surface-muted) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.squad-player-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.squad-player-placeholder {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.squad-player-number {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 900;
  background: var(--egypt-red);
  color: var(--white);
  border-radius: var(--radius-full);
  border: 2px solid var(--egypt-gold);
}

.squad-player-name {
  font-size: 13px;
  font-weight: 800;
  padding: 10px 12px 2px;
  line-height: 1.3;
  color: var(--text);
}

.squad-player-position {
  font-size: 11px;
  font-weight: 600;
  color: var(--egypt-red);
  padding: 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.squad-player-age {
  font-size: 11px;
  color: var(--text-faint);
  padding: 2px 12px 12px;
}

/* ── Bottom Navigation ──────────────────────────────────────────────────────── */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: 100%;
  max-width: var(--app-max);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  padding: 8px 4px calc(8px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(26, 26, 26, 0.06);
}

.bottom-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: linear-gradient(90deg, var(--egypt-red), var(--egypt-gold), var(--egypt-red));
  border-radius: var(--radius-full);
  opacity: 0.6;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
  padding: 6px 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition:
    color var(--dur-normal) var(--ease-out),
    background var(--dur-normal) var(--ease-out);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.nav-item:hover {
  color: var(--egypt-red);
}

.nav-item.active {
  color: var(--egypt-red);
  background: var(--accent-red-soft);
}

.nav-item.active svg {
  filter: drop-shadow(0 1px 2px var(--accent-red-glow));
}

.mobile-only {
  display: flex;
}

.desktop-only {
  display: none;
}

/* ── Toast ──────────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 500;
  max-width: min(calc(100vw - 32px), 380px);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--egypt-red-deep);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--egypt-red-dark);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--dur-normal) var(--ease-out),
    transform var(--dur-normal) var(--ease-out);
}

.toast[hidden] {
  display: block !important;
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */

.site-footer {
  margin-top: 8px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.footer-links a {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--egypt-red);
}

.footer-copy {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
}

.footer-credit {
  font-size: 12px;
  font-weight: 700;
  color: var(--egypt-red, #ce1126);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* ── Legal & Subpages ───────────────────────────────────────────────────────── */

.legal-page {
  padding-bottom: calc(var(--safe-bottom) + 32px);
}

.legal-content {
  padding: 20px var(--page-pad-x) 0;
  max-width: 680px;
  margin: 0 auto;
}

.legal-content h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--egypt-red-deep);
  margin: 24px 0 10px;
}

.legal-content h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--text);
}

.legal-content p,
.legal-content li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.legal-content ul,
.legal-content ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.legal-hero {
  text-align: center;
  padding: 24px 0 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.legal-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 14px;
  border-radius: var(--radius-md);
  border: 3px solid var(--egypt-gold);
  box-shadow: var(--shadow-sm);
}

.legal-hero h2 {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  margin: 0 0 6px;
}

.legal-tagline {
  font-size: 14px;
  font-weight: 600;
  color: var(--egypt-red);
}

.legal-intro {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.legal-updated {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.subpage-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: var(--header-height);
  padding: calc(10px + var(--safe-top)) var(--page-pad-x) 10px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.subpage-title {
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subpage-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--egypt-red);
  text-decoration: none;
  white-space: nowrap;
  justify-self: end;
}

.subpage-link:hover {
  color: var(--egypt-red-dark);
}

/* ── Contact ────────────────────────────────────────────────────────────────── */

.contact-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.contact-card {
  padding: 16px;
  background: var(--egypt-gold-pale);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-gold);
}

.contact-card h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--egypt-red-deep);
  margin-bottom: 6px;
}

.contact-card p,
.contact-card a {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 10px;
}

.contact-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-strong);
  background: var(--white);
  font-size: 15px;
  transition:
    border-color var(--dur-normal) var(--ease-out),
    box-shadow var(--dur-normal) var(--ease-out);
}

.contact-input:focus {
  outline: none;
  border-color: var(--egypt-red);
  box-shadow: 0 0 0 3px var(--accent-red-soft);
}

.contact-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.contact-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ce1126' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.contact-submit {
  margin-top: 20px;
  width: 100%;
}

.contact-note {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
}

.contact-note:not([hidden]) {
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

/* ── Videos Mode ─────────────────────────────────────────────────────────────── */

.videos-mode {
  max-width: 100%;
  background: #0a0a0a;
}

.videos-mode::after {
  display: none;
}

.videos-mode .subpage-bar {
  background: rgba(10, 10, 10, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.videos-mode .subpage-title {
  color: var(--white);
}

.videos-mode .club-page-back {
  color: var(--egypt-gold);
}

.videos-mode .subpage-link {
  color: var(--egypt-gold);
}

.videos-view {
  flex: 1;
  min-height: 0;
}

.video-feed {
  height: calc(100dvh - var(--header-height) - var(--safe-top));
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.video-feed::-webkit-scrollbar {
  display: none;
}

.video-slide {
  position: relative;
  height: calc(100dvh - var(--header-height) - var(--safe-top));
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #111;
  overflow: hidden;
}

.video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 40%,
    rgba(0, 0, 0, 0.35) 70%,
    rgba(0, 0, 0, 0.75) 100%
  );
  pointer-events: none;
}

.video-like-burst {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  opacity: 0;
  pointer-events: none;
  animation: none;
}

.video-info {
  position: absolute;
  bottom: 24px;
  left: 16px;
  right: 72px;
  z-index: 2;
  color: var(--white);
}

.video-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.video-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--egypt-gold);
  object-fit: cover;
}

.video-username {
  font-size: 14px;
  font-weight: 800;
}

.video-caption {
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 4px;
}

.video-tags {
  font-size: 12px;
  opacity: 0.75;
}

.video-actions {
  position: absolute;
  right: 12px;
  bottom: 80px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
}

.video-action-btn.is-liked .video-action-icon {
  color: var(--egypt-red);
}

.video-action-btn.is-saved .video-action-icon {
  color: var(--egypt-gold);
}

.video-action-icon svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Comment sheet */
.comment-sheet {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.comment-sheet[hidden] {
  display: none !important;
}

.comment-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.comment-sheet-panel {
  position: relative;
  z-index: 1;
  max-height: 70vh;
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
}

.comment-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-strong);
  border-radius: var(--radius-full);
  margin: 10px auto 0;
}

.comment-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.comment-sheet-head h2 {
  font-size: 16px;
  font-weight: 800;
}

.comment-sheet-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-muted);
  border-radius: 50%;
  background: var(--surface-muted);
}

.comment-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.comment-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.45;
}

.comment-empty {
  text-align: center;
  color: var(--text-faint);
  padding: 24px;
}

.comment-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.comment-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--surface-muted);
}

.comment-submit {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 800;
  color: var(--white);
  background: var(--egypt-red);
  border-radius: var(--radius-full);
}

/* ── Saved Page ─────────────────────────────────────────────────────────────── */

.saved-page {
  padding: 0 var(--page-pad-x) calc(var(--safe-bottom) + 32px);
}

.saved-section {
  margin-bottom: 32px;
}

.saved-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.saved-section-title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.saved-section-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--dur-normal) var(--ease-out);
}

.saved-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--egypt-gold);
}

.saved-thumb {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.saved-card-body {
  flex: 1;
  min-width: 0;
}

.saved-card-user {
  font-size: 13px;
  font-weight: 800;
  color: var(--egypt-red);
  margin-bottom: 4px;
}

.saved-card-caption {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.saved-facts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-fact-card {
  padding: 14px;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  border-left: 4px solid var(--egypt-red);
  box-shadow: var(--shadow-xs);
}

.saved-fact-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.saved-fact-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.saved-fact-team {
  flex: 1;
  font-size: 13px;
  font-weight: 800;
  color: var(--egypt-red);
}

.saved-fact-remove {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-faint);
  border-radius: 50%;
  background: var(--surface-muted);
  transition: background var(--dur-fast) var(--ease-out);
}

.saved-fact-remove:hover {
  background: var(--accent-red-soft);
  color: var(--egypt-red);
}

.saved-fact-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.saved-empty {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  padding: 20px;
  text-align: center;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
}

.saved-empty a {
  font-weight: 700;
}

.api-reconnect-section {
  padding: 20px;
  background: var(--egypt-gold-pale);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-gold);
}

.api-reconnect-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
}

.api-refresh-link {
  display: flex;
  margin-top: 10px;
  width: 100%;
}

/* ── API Error ──────────────────────────────────────────────────────────────── */

.api-error {
  padding: 24px 20px;
  text-align: center;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.api-error h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--egypt-red);
  margin-bottom: 8px;
}

.api-error-detail {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
}

.api-error-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ── Utility Cards ──────────────────────────────────────────────────────────── */

.glow-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.glow-card-sm {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

/* ── Reduced Motion ─────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MEDIA QUERIES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Mobile (max-width: 767px) ──────────────────────────────────────────────── */

@media (max-width: 767px) {
  .logo-text {
    font-size: 13px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-player {
    max-height: 220px;
  }

  .stats-card {
    grid-template-columns: repeat(2, 1fr);
  }

  .squad-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .egypt-points-banner {
    margin: 0 0 16px;
  }

  .standings-table {
    font-size: 11px;
  }

  .standings-team {
    min-width: 100px;
  }

  .category-card {
    flex: 0 0 120px;
  }

  .did-you-know {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .dyk-graphic {
    justify-self: start;
  }

  .nav-item span {
    font-size: 9px;
  }

  .contact-cards {
    grid-template-columns: 1fr;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }
}

/* ── Desktop (min-width: 768px) ─────────────────────────────────────────────── */

@media (min-width: 768px) {
  :root {
    --app-max: 920px;
    --page-pad-x: 24px;
    --nav-height: 0px;
    --page-pad-bottom: 48px;
  }

  body {
    background: linear-gradient(180deg, var(--egypt-gold-pale) 0%, var(--cream) 40%);
  }

  .app-shell {
    margin-top: 24px;
    margin-bottom: 24px;
    min-height: calc(100vh - 48px);
    min-height: calc(100dvh - 48px);
    border-radius: var(--radius-xl);
    overflow: hidden;
  }

  .app-header {
    padding-top: 16px;
  }

  .logo-img {
    width: 48px;
    height: 48px;
  }

  .logo-text {
    font-size: 18px;
  }

  .hero {
    padding: 32px var(--page-pad-x) 36px;
  }

  .hero-inner {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    align-items: center;
  }

  .hero-title {
    font-size: 42px;
  }

  .hero-desc {
    font-size: 15px;
    max-width: 42ch;
  }

  .hero-player {
    max-height: 360px;
  }

  .stats-card {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .stat-number {
    font-size: 20px;
  }

  .section-title {
    font-size: 14px;
  }

  .categories-scroll {
    flex-wrap: wrap;
    overflow-x: visible;
    margin: 0;
    padding: 0;
  }

  .category-card {
    flex: 1 1 calc(20% - 12px);
    min-width: 140px;
  }

  .did-you-know {
    padding: 28px 32px;
  }

  .dyk-text {
    font-size: 17px;
  }

  .squad-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .contact-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-form {
    max-width: 560px;
  }

  .legal-content {
    padding-top: 32px;
  }

  .bottom-nav,
  .mobile-only {
    display: none !important;
  }

  .desktop-only {
    display: block !important;
  }

  .toast {
    bottom: calc(var(--safe-bottom) + 24px);
  }

  .home-view {
    padding-bottom: var(--page-pad-bottom);
  }

  .club-page {
    position: relative;
    inset: auto;
    z-index: auto;
    flex: 1;
  }

  .knockout-path {
    flex-direction: row;
    align-items: stretch;
  }

  .knockout-step {
    flex: 1;
  }

  .knockout-arrow {
    display: flex;
    align-items: center;
    padding: 0 8px;
  }

  .egypt-points-stats {
    width: auto;
    border-top: none;
    padding-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 16px;
  }

  .egypt-points-banner {
    flex-wrap: nowrap;
  }

  .videos-mode {
    max-width: 480px;
  }

  .video-feed {
    max-width: 480px;
    margin: 0 auto;
  }
}

/* ── Large Desktop (min-width: 1024px) ───────────────────────────────────────── */

@media (min-width: 1024px) {
  .squad-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-title {
    font-size: 48px;
  }
}

/* ── Local club search + fact pages ── */
a.category-card {
  text-decoration: none;
  color: inherit;
}

.club-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.search-result-item:hover {
  border-color: var(--egypt-gold);
  background: var(--egypt-gold-bg, #fffbeb);
}

.search-result-name {
  display: block;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
}

.search-result-meta {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-empty {
  font-size: 14px;
  color: var(--text-muted);
  padding: 12px 0;
}

.club-page-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 20px;
}

.club-page-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--egypt-gold-dark);
  margin-bottom: 4px;
}

.club-page-name {
  font-size: 22px;
  font-weight: 900;
  color: var(--egypt-red);
  line-height: 1.2;
}

.club-page-nick {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.club-facts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.club-page-more {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 700;
}

.club-page-more a {
  color: var(--egypt-red);
}

.facts-page {
  padding-bottom: 24px;
}

.facts-hero {
  padding: 20px 16px 8px;
}

.facts-hero h2 {
  font-size: 24px;
  font-weight: 900;
  color: var(--egypt-red);
  margin-bottom: 6px;
}

.facts-hero p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.facts-cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.facts-cat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}

.facts-cat-card:hover {
  border-color: var(--egypt-gold);
}

.facts-cat-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--egypt-red);
}

.facts-cat-count {
  font-size: 12px;
  color: var(--text-muted);
}

.facts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fact-card,
.club-list-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}

.club-list-card {
  align-items: center;
}

.fact-card-text {
  font-size: 14px;
  line-height: 1.55;
  flex: 1;
}

.saved-fact-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--egypt-red);
}

.form-dot {
  display: inline-flex;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
}

.form-w { background: #16a34a; }
.form-d { background: #ca8a04; }
.form-l { background: #dc2626; }

.live-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: var(--egypt-gold-pale);
  color: var(--egypt-gold-dark);
}

.live-badge-final {
  background: var(--egypt-red);
  color: #fff;
}

@media (min-width: 768px) {
  .facts-cat-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ── Articles & AdSense content pages ── */
.article-cards {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.article-cards-home {
  grid-template-columns: 1fr;
}

.article-card {
  display: block;
  padding: 16px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #f0e6d6);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 16px rgba(122, 11, 22, 0.06);
}

.article-card:hover {
  border-color: var(--egypt-gold, #f5c518);
}

.article-card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--egypt-gold-dark, #d4a017);
  margin-bottom: 6px;
}

.article-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--egypt-red, #ce1126);
  margin-bottom: 6px;
}

.article-card p {
  font-size: 13px;
  color: var(--text-muted, #5c5c5c);
  line-height: 1.45;
  margin: 0;
}

.article-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--egypt-gold-dark, #d4a017);
  margin-bottom: 8px;
}

.article-body h2 {
  margin-bottom: 10px;
}

.article-body h3 {
  margin-top: 22px;
}

.section-more {
  font-size: 13px;
  font-weight: 700;
  color: var(--egypt-red, #ce1126);
  text-decoration: none;
}

.static-facts {
  display: grid;
  gap: 10px;
}

.static-fact {
  padding: 14px 16px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #f0e6d6);
  border-radius: 12px;
}

.static-fact h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--egypt-red, #ce1126);
  margin-bottom: 6px;
}

.static-fact p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text, #1a1a1a);
  margin: 0;
}

.static-facts-more {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted, #5c5c5c);
}

.static-facts-more a {
  color: var(--egypt-red, #ce1126);
  font-weight: 700;
}

@media (min-width: 768px) {
  .article-cards-home {
    grid-template-columns: repeat(3, 1fr);
  }

  .static-facts {
    grid-template-columns: 1fr 1fr;
  }

  .article-cards {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Games & Penalty Shootout ── */
.games-points-card {
  text-align: center;
  padding: 20px 16px;
  margin: 16px 0 20px;
  background: linear-gradient(135deg, var(--egypt-red, #ce1126), #a30d1e);
  color: #fff;
  border-radius: 16px;
  border: 2px solid var(--egypt-gold, #f5c518);
}

.games-points-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
  margin: 0;
}

.games-points-value {
  font-size: 40px;
  font-weight: 900;
  margin: 4px 0;
}

.games-points-stats {
  font-size: 13px;
  opacity: 0.9;
  margin: 0;
}

.game-card h3 { color: var(--egypt-red, #ce1126); }

.penalty-page {
  padding: 12px 16px 32px;
  max-width: 520px;
  margin: 0 auto;
}

.pen-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--egypt-red, #ce1126);
  text-align: center;
}

.pen-sub {
  text-align: center;
  color: var(--text-muted, #5c5c5c);
  font-size: 14px;
  margin: 6px 0 20px;
}

.pen-field-group { margin-bottom: 18px; }

.pen-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #5c5c5c);
  margin-bottom: 8px;
}

.pen-choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#diffChoices.pen-choice-row {
  grid-template-columns: 1fr 1fr 1fr;
}

.pen-choice {
  padding: 14px 10px;
  border-radius: 12px;
  border: 2px solid var(--border, #f0e6d6);
  background: #fff;
  font-weight: 800;
  font-size: 14px;
  color: var(--text, #1a1a1a);
  line-height: 1.25;
}

.pen-choice small {
  display: block;
  font-weight: 600;
  font-size: 10px;
  color: var(--text-muted, #5c5c5c);
  margin-top: 4px;
}

.pen-choice.is-selected {
  border-color: var(--egypt-red, #ce1126);
  background: #fde8eb;
  color: var(--egypt-red, #ce1126);
}

.pen-start-btn { width: 100%; margin-top: 8px; }

.pen-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border, #f0e6d6);
  margin-bottom: 12px;
}

.pen-score-side { text-align: center; }
.pen-score-name {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted, #5c5c5c);
}
.pen-score-num {
  font-size: 28px;
  font-weight: 900;
  color: var(--egypt-red, #ce1126);
}
.pen-score-mid { text-align: center; }
.pen-score-mid span { display: block; }
.pen-mode-tag {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--egypt-gold-dark, #d4a017);
}

.pen-pitch {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #166534;
  background: #14532d;
  margin-bottom: 12px;
}

.pen-sky {
  height: 36px;
  background: linear-gradient(180deg, #7dd3fc, #bae6fd);
}

.pen-goal {
  position: relative;
  height: 200px;
  margin: 0 12px;
  border: 4px solid #f8fafc;
  border-bottom: none;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(255,255,255,0.08) 10px, rgba(255,255,255,0.08) 11px),
    repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(255,255,255,0.08) 10px, rgba(255,255,255,0.08) 11px),
    #166534;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.15);
}

.pen-zones {
  position: absolute;
  inset: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  z-index: 3;
}

.pen-zone {
  border: 2px dashed rgba(255,255,255,0.35);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  font-weight: 900;
  font-size: 16px;
}

.pen-zone:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.pen-zone:not(:disabled):active {
  background: rgba(245, 197, 24, 0.35);
  border-color: #f5c518;
}

.pen-keeper {
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 44px;
  height: 64px;
  transform: translateX(-50%);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 4;
  pointer-events: none;
}

.pen-keeper[data-dive="left"] { transform: translateX(-120%); }
.pen-keeper[data-dive="center"] { transform: translateX(-50%); }
.pen-keeper[data-dive="right"] { transform: translateX(20%); }
.pen-keeper.is-diving[data-dive="left"] { transform: translateX(-130%) rotate(-18deg); }
.pen-keeper.is-diving[data-dive="right"] { transform: translateX(30%) rotate(18deg); }
.pen-keeper.is-save .pen-keeper-gloves {
  box-shadow: 0 0 16px #f5c518;
}

.pen-keeper-body {
  width: 100%;
  height: 100%;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(180deg, #f5c518, #d4a017);
  border: 2px solid #fff;
  position: relative;
}

.pen-keeper-body::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  background: #fde68a;
  border: 2px solid #fff;
}

.pen-keeper-gloves {
  position: absolute;
  bottom: 18px;
  left: -6px;
  right: -6px;
  height: 14px;
  border-radius: 8px;
  background: #ce1126;
  border: 2px solid #fff;
}

.pen-ball {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #e5e5e5 40%, #111 42%, #fff 60%);
  border: 1px solid #333;
  z-index: 5;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  transition: left 0.55s ease, bottom 0.55s ease, transform 0.55s ease;
  pointer-events: none;
}

.pen-ball[data-pos="spot"] {
  left: 50%;
  bottom: -28px;
}

.pen-ball.is-flying[data-pos="left"] { left: 18%; bottom: 70px; }
.pen-ball.is-flying[data-pos="center"] { left: 50%; bottom: 85px; }
.pen-ball.is-flying[data-pos="right"] { left: 82%; bottom: 70px; }

.pen-ball.is-saved {
  transform: translateX(-50%) scale(0.7);
  opacity: 0.85;
}

.pen-ball.is-goal {
  bottom: 110px !important;
}

.pen-grass {
  height: 48px;
  background: linear-gradient(180deg, #15803d, #166534);
}

.pen-prompt {
  text-align: center;
  padding: 10px;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: rgba(0,0,0,0.25);
  margin: 0;
}

.pen-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  min-height: 28px;
}

.pen-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eee;
  color: #333;
}

.pen-chip.is-goal { background: #dcfce7; color: #166534; }
.pen-chip.is-save { background: #fee2e2; color: #991b1b; }

.pen-result {
  text-align: center;
  padding: 28px 12px;
}

.pen-result-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--egypt-red, #ce1126);
}

.pen-result-score {
  font-size: 36px;
  font-weight: 900;
  margin: 8px 0;
}

.pen-result-points {
  font-size: 18px;
  font-weight: 800;
  color: var(--egypt-gold-dark, #d4a017);
}

.pen-result-total {
  font-size: 14px;
  color: var(--text-muted, #5c5c5c);
  margin-bottom: 18px;
}

.pen-result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Football Life Simulator ── */
.life-body {
  background: #070b14;
}
.life-shell {
  max-width: 520px;
  background: #0b1220;
  color: #e8eefc;
}
.life-bar {
  background: rgba(11, 18, 32, 0.95);
  border-bottom-color: rgba(255,255,255,0.08);
  color: #fff;
}
.life-bar .club-page-back,
.life-bar .subpage-title,
.life-bar .subpage-link { color: #fff; }
.life-main { padding: 12px 14px 28px; }
.life-hero {
  padding: 8px 4px 16px;
}
.life-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #7dd3fc;
  margin: 0 0 6px;
}
.life-hero h2 {
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 8px;
  color: #fff;
}
.life-hero p {
  font-size: 14px;
  color: #9db0d0;
  line-height: 1.5;
  margin: 0;
}
.life-invite-card {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, #132038, #0f1a2e);
  border: 1px solid rgba(125, 211, 252, 0.25);
  margin-bottom: 14px;
}
.life-invite-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7dd3fc;
  margin: 0 0 6px;
}
.life-invite-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: #fff;
}
.life-invite-card p {
  margin: 0 0 12px;
  font-size: 13px;
  color: #9db0d0;
}
.life-invite-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.life-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.life-btn-go {
  background: #16a34a;
  color: #fff;
}
.life-btn-miss {
  background: #b91c1c;
  color: #fff;
}
.life-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.life-card {
  background: #121a2b;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px;
}
.life-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px;
}
.life-help {
  font-size: 12px;
  color: #8ea0c0;
  margin: 0 0 12px;
}
.life-profile {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
}
.life-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ce1126, #f5c518);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  font-size: 18px;
}
.life-profile-info h3 {
  margin: 0;
  font-size: 20px;
  color: #fff;
}
.life-level {
  margin: 2px 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #7dd3fc;
}
.life-xp-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.life-xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
}
.life-xp-text {
  font-size: 11px;
  color: #8ea0c0;
  margin: 4px 0 0;
}
.life-stat-list {
  grid-column: 1 / -1;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
}
.life-stat-list li {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}
.life-stat-list span {
  display: block;
  font-size: 10px;
  color: #8ea0c0;
  margin-bottom: 2px;
}
.life-stat-list strong {
  font-size: 16px;
  color: #fff;
}
.life-goals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.life-goals li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: #c9d6ef;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
}
.life-goals li.is-done {
  color: #86efac;
}
.life-goal-check {
  font-weight: 900;
  color: #7dd3fc;
}
.life-skill-row {
  margin-bottom: 12px;
}
.life-skill-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #c9d6ef;
  margin-bottom: 4px;
}
.life-skill-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 6px;
}
.life-skill-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #22d3ee);
}
.life-train-btn,
.life-buy-btn {
  width: 100%;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(125,211,252,0.35);
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.life-train-btn:disabled,
.life-buy-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.life-houses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.life-house {
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}
.life-house.is-owned {
  border-color: #22c55e;
}
.life-house-visual {
  height: 54px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #334155, #1e293b);
}
.life-house-visual[data-house="flat"] { background: linear-gradient(135deg, #64748b, #334155); }
.life-house-visual[data-house="town"] { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.life-house-visual[data-house="villa"] { background: linear-gradient(135deg, #f5c518, #ce1126); }
.life-house-visual[data-house="pent"] { background: linear-gradient(135deg, #a78bfa, #4c1d95); }
.life-house h4 {
  margin: 0 0 4px;
  font-size: 13px;
  color: #fff;
}
.life-house p {
  margin: 0;
  font-size: 11px;
  color: #8ea0c0;
  line-height: 1.35;
}
.life-house-price {
  margin: 6px 0 !important;
  font-weight: 800 !important;
  color: #fde68a !important;
}
.life-places {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.life-place {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #e8eefc;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.life-place-msg {
  margin: 10px 0 0;
  font-size: 12px;
  color: #9db0d0;
}
.life-footer {
  background: transparent;
  border-top-color: rgba(255,255,255,0.08);
  margin-top: 16px;
}
.life-footer .footer-copy { color: #8ea0c0; }
.life-nav {
  background: #0b1220;
  border-top-color: rgba(255,255,255,0.08);
}
.life-nav .nav-item { color: #8ea0c0; }
.life-nav .nav-item.active {
  color: #7dd3fc;
  background: rgba(125, 211, 252, 0.12);
}

/* ── 3D Penalty ── */
.pen3d-body { background: #0a1f12; }
.pen3d-shell { background: #0d2818; }
.pen3d-page { color: #e8fff0; }
.pen3d-preview {
  height: 160px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 2px solid rgba(245, 197, 24, 0.45);
  background: #87b7e8;
}
.pen3d-preview canvas,
.pen3d-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.pen3d-stage {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #166534;
  background: #0a1f12;
  margin-bottom: 12px;
}
.pen3d-canvas-wrap {
  width: 100%;
  min-height: 280px;
  background: #87b7e8;
}
.pen3d-zones {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 8px;
  background: rgba(0,0,0,0.45);
}
.pen3d-zone {
  min-height: 44px;
  border: 2px solid rgba(245, 197, 24, 0.5) !important;
  background: rgba(206, 17, 38, 0.85) !important;
  color: #fff !important;
  font-size: 12px !important;
  letter-spacing: 0.04em;
}
.pen3d-zone:not(:disabled):active {
  background: #f5c518 !important;
  color: #111 !important;
}
.pen3d-prompt {
  background: rgba(0,0,0,0.55) !important;
}
.pen3d-fallback {
  padding: 24px;
  text-align: center;
  color: #fff;
}
.pen3d-page .pen-title { color: #f5c518; }
.pen3d-page .pen-sub { color: #a7f3d0; }
.pen3d-page .pen-choice {
  background: #132a1c;
  color: #e8fff0;
  border-color: #245c3a;
}
.pen3d-page .pen-choice.is-selected {
  background: #ce1126;
  border-color: #f5c518;
  color: #fff;
}
.pen3d-page .pen-choice small { color: #a7f3d0; }
.pen3d-page .pen-scoreboard {
  background: #132a1c;
  border-color: #245c3a;
  color: #fff;
}
.pen3d-page .pen-score-num { color: #f5c518; }

/* ── 3D Football Life stage ── */
.life3d-stage {
  width: 100%;
  height: 200px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 2px solid rgba(245, 197, 24, 0.4);
  background: #1a3a5c;
}
.life3d-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ── Auth / Profile / Online multiplayer ── */
.auth-page { max-width: 480px; margin: 0 auto; }
.auth-card {
  background: #132a1c;
  border: 1px solid #245c3a;
  border-radius: 16px;
  padding: 20px 16px 24px;
  margin-bottom: 16px;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.auth-tab {
  border: 2px solid #245c3a;
  background: #0d2818;
  color: #a7f3d0;
  border-radius: 10px;
  padding: 10px;
  font-weight: 700;
  cursor: pointer;
}
.auth-tab.is-active {
  background: #ce1126;
  border-color: #f5c518;
  color: #fff;
}
.auth-form { display: flex; flex-direction: column; gap: 8px; }
.auth-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #a7f3d0;
  margin-top: 6px;
}
.auth-input {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid #245c3a;
  background: #0a1f12;
  color: #e8fff0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
}
.auth-input:focus {
  outline: none;
  border-color: #f5c518;
}
.auth-error {
  color: #fecaca;
  background: rgba(206, 17, 38, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  margin: 4px 0 0;
}
.auth-banner {
  background: #422006;
  color: #fde68a;
  border: 1px solid #f5c518;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
  font-size: 14px;
}
.auth-section-title {
  color: #f5c518;
  font-size: 16px;
  margin: 20px 0 8px;
}
.profile-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #ce1126;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  border: 2px solid #f5c518;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.profile-stat {
  background: #0a1f12;
  border: 1px solid #245c3a;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.profile-stat span {
  display: block;
  font-size: 11px;
  color: #a7f3d0;
  margin-bottom: 4px;
}
.profile-stat strong {
  color: #f5c518;
  font-size: 18px;
}
.lb-table-wrap { overflow-x: auto; }
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #e8fff0;
}
.lb-table th, .lb-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #245c3a;
  text-align: left;
}
.lb-table th { color: #f5c518; font-size: 11px; letter-spacing: 0.04em; }
.mp-online-actions { display: flex; flex-direction: column; gap: 10px; }
.mp-join-row { display: flex; gap: 8px; }
.mp-join-row .auth-input { flex: 1; }
.mp-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}
.mp-links a { color: #f5c518; font-weight: 600; font-size: 14px; }
.mp-room-code {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-align: center;
  color: #f5c518;
  margin: 12px 0;
}
.mp-search-spinner {
  width: 48px;
  height: 48px;
  margin: 18px auto;
  border: 4px solid #245c3a;
  border-top-color: #f5c518;
  border-radius: 50%;
  animation: mp-spin 0.8s linear infinite;
}
@keyframes mp-spin { to { transform: rotate(360deg); } }
.mp-zones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  background: rgba(0,0,0,0.45);
}
.mp-zone {
  min-height: 48px;
  border: 2px solid rgba(245, 197, 24, 0.5) !important;
  background: rgba(206, 17, 38, 0.85) !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.mp-zone:not(:disabled):active {
  background: #f5c518 !important;
  color: #111 !important;
}
.mp-zone:disabled { opacity: 0.45; }
.mp-scoreboard { margin-bottom: 10px; }
@media (max-width: 480px) {
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .mp-room-code { font-size: 32px; }
}
