/* ================================================================
   LIGA AL-AHYAA  —  Modern UI Redesign v9
   Design: Dark Slate + Vibrant Green
   Fonts: Tajawal + Oswald
================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;900&family=Oswald:wght@400;500;600;700&display=swap');

:root {
  --bg-base:      #0D1117;
  --bg-surface:   #161B22;
  --bg-elevated:  #1C2128;
  --bg-overlay:   #21262D;
  --border:       #30363D;
  --border-muted: #21262D;
  --accent:       #3FB950;
  --accent-dim:   rgba(63,185,80,.12);
  --accent-glow:  rgba(63,185,80,.25);
  --gold:         #E3B341;
  --gold-dim:     rgba(227,179,65,.12);
  --red:          #F85149;
  --red-dim:      rgba(248,81,73,.12);
  --blue:         #58A6FF;
  --blue-dim:     rgba(88,166,255,.12);
  --text-primary: #E6EDF3;
  --text-secondary:#8B949E;
  --text-muted:   #656D76;
  --text-white:   #FFFFFF;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.4);
  --shadow-md:    0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.6);
  --shadow-green: 0 4px 20px rgba(63,185,80,.2);
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    16px;
  --radius-xl:    20px;
  --transition:   all .2s cubic-bezier(.4,0,.2,1);
  --sidebar-w:    256px;

  /* Backward-compat aliases kept for operator/viewer inline styles */
  --green-dark:   #0D1117;
  --green-deep:   #0D1117;
  --green-main:   #3FB950;
  --green-light:  #58e672;
  --green-neon:   #3FB950;
  --green-glow:   rgba(63,185,80,.12);
  --dark-card:    #161B22;
  --dark-surface: #1C2128;
  --dark-border:  #30363D;
  --dark-bg:      #0D1117;
  --text-primary: #E6EDF3;
  --text-muted:   #8B949E;
  --teal:         #3FB950;
  --yellow-card:  #E3B341;
  --blue-live:    #58A6FF;
  --white:        #FFFFFF;
}

/* ---------------------------------------------------------------- BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: 'Tajawal', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* Typography */
h1,h2,h3,h4,h5,h6 { font-family: 'Tajawal', sans-serif; font-weight: 700; color: var(--text-primary); }
.score-font, .display-font { font-family: 'Oswald', sans-serif; }

/* ---------------------------------------------------------------- LAYOUT */
.wrapper { display: flex; min-height: 100vh; }

/* ---------------------------------------------------------------- SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; right: 0; top: 0; bottom: 0;
  z-index: 100; overflow-y: auto; overflow-x: hidden;
}

.sidebar-brand {
  padding: 20px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #1a6e2e, var(--accent));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(63,185,80,.3);
}

.brand-name { font-size: 16px; font-weight: 900; color: var(--text-white); line-height: 1.2; }
.brand-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 8px 0; }

.nav-section-title {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  padding: 16px 18px 5px; letter-spacing: 1.2px; text-transform: uppercase;
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; color: var(--text-secondary);
  font-size: 13.5px; font-weight: 500;
  transition: var(--transition);
  border-right: 2px solid transparent;
}

.nav-link .nav-icon {
  width: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

.nav-link:hover  { color: var(--text-primary); background: var(--bg-elevated); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); border-right-color: var(--accent); font-weight: 600; }

.nav-badge {
  margin-right: auto; background: var(--red); color: #fff;
  font-size: 10px; padding: 2px 7px; border-radius: 20px; font-weight: 700;
}
.nav-badge.live { background: var(--accent); color: var(--bg-base); animation: pulseBadge 1.5s infinite; }
@keyframes pulseBadge { 0%,100%{opacity:1} 50%{opacity:.5} }

.sidebar-user {
  padding: 14px 18px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #1a6e2e, var(--accent));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ---------------------------------------------------------------- MAIN */
.main-content {
  margin-right: var(--sidebar-w); flex: 1;
  display: flex; flex-direction: column; min-height: 100vh; min-width: 0;
}

.topbar {
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 90; gap: 12px;
}

.page-title { font-size: 18px; font-weight: 800; color: var(--text-white); letter-spacing: -.3px; }
.page-breadcrumb { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.content-area { padding: 24px; flex: 1; }

/* ---------------------------------------------------------------- CARDS */
.card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition);
}

.card-header {
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 7px; }
.card-body  { padding: 20px; }

/* ---------------------------------------------------------------- STAT CARDS */
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr));
  gap: 14px; margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: var(--transition); position: relative; overflow: hidden;
}

.stat-card::after {
  content: ''; position: absolute; top: 0; right: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), #58e672); opacity: .6;
}

.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-green); }

.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: var(--accent-dim); border: 1px solid rgba(63,185,80,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}

.stat-value { font-family: 'Oswald', sans-serif; font-size: 30px; font-weight: 700; color: var(--text-white); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

/* ---------------------------------------------------------------- TABLES */
.table-container { overflow-x: auto; }

table.league-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.league-table th {
  background: var(--bg-elevated); color: var(--text-muted);
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  padding: 11px 16px; text-align: right; border-bottom: 1px solid var(--border);
}

.league-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--border-muted);
  color: var(--text-primary); vertical-align: middle;
}

.league-table tr:hover td { background: var(--bg-elevated); }
.league-table tr:last-child td { border-bottom: none; }

.team-rank {
  width: 26px; height: 26px; border-radius: 6px; background: var(--bg-overlay);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.team-rank.top1    { background: var(--gold); color: var(--bg-base); }
.team-rank.top2    { background: #C0C0C0; color: var(--bg-base); }
.team-rank.top3    { background: #CD7F32; color: #fff; }
.team-rank.qualify { border: 1px solid var(--accent); color: var(--accent); }

.team-cell { display: flex; align-items: center; gap: 10px; }
.team-logo-sm { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; }
.team-logo-placeholder {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--accent-dim); border: 1px solid rgba(63,185,80,.2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--accent);
}

/* ---------------------------------------------------------------- BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-family: 'Tajawal', sans-serif; font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: var(--transition); text-decoration: none;
  white-space: nowrap; line-height: 1.4; user-select: none;
}

.btn-primary   { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px rgba(63,185,80,.2); }
.btn-primary:hover { background: #2da44e; border-color: #2da44e; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(63,185,80,.35); }

.btn-secondary { background: var(--bg-elevated); color: var(--text-secondary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-overlay); color: var(--text-primary); border-color: var(--text-secondary); }

.btn-danger    { background: var(--red-dim); color: var(--red); border-color: rgba(248,81,73,.25); }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }

.btn-gold      { background: var(--gold-dim); color: var(--gold); border-color: rgba(227,179,65,.25); }
.btn-gold:hover { background: var(--gold); color: var(--bg-base); border-color: var(--gold); }

.btn-sm   { padding: 6px 12px; font-size: 12px; border-radius: 7px; }
.btn-lg   { padding: 12px 24px; font-size: 15px; border-radius: 10px; }
.btn-icon { padding: 8px; min-width: 34px; justify-content: center; }
.w-100    { width: 100%; justify-content: center; }

/* ---------------------------------------------------------------- FORMS */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

.form-control {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  padding: 10px 13px; font-family: 'Tajawal', sans-serif; font-size: 14px;
  transition: var(--transition); outline: none;
}

.form-control::placeholder { color: var(--text-muted); }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63,185,80,.12); background: var(--bg-overlay); }
.form-control option { background: var(--bg-elevated); }
select.form-control { cursor: pointer; }

/* ---------------------------------------------------------------- BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700;
}
.badge-green  { background: var(--accent-dim);  color: var(--accent);          border: 1px solid rgba(63,185,80,.2); }
.badge-gold   { background: var(--gold-dim);     color: var(--gold);            border: 1px solid rgba(227,179,65,.2); }
.badge-red    { background: var(--red-dim);      color: var(--red);             border: 1px solid rgba(248,81,73,.2); }
.badge-blue   { background: var(--blue-dim);     color: var(--blue);            border: 1px solid rgba(88,166,255,.2); }
.badge-gray   { background: var(--bg-overlay);   color: var(--text-secondary);  border: 1px solid var(--border); }
.badge-paused { background: var(--gold-dim);     color: var(--gold);            border: 1px solid rgba(227,179,65,.2); }

/* ---------------------------------------------------------------- MATCH CARD */
.match-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: var(--transition); position: relative; overflow: hidden;
}
.match-card:hover { border-color: var(--accent); box-shadow: var(--shadow-green); }

.match-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 11px; color: var(--text-muted); }
.match-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.match-team { text-align: center; }
.match-team-logo { width: 50px; height: 50px; object-fit: cover; border-radius: 10px; margin: 0 auto 8px; display: block; border: 1px solid var(--border); }
.match-team-name { font-size: 14px; font-weight: 700; color: var(--text-white); }
.match-team-hood { font-size: 11px; color: var(--text-muted); }
.match-score-box { text-align: center; min-width: 90px; }
.match-score { font-family: 'Oswald', sans-serif; font-size: 36px; font-weight: 700; color: var(--text-white); letter-spacing: 4px; }

.match-status-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  border-radius: 20px; font-size: 11px; font-weight: 700; margin-top: 6px;
}
.badge-live      { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(63,185,80,.25); }
.badge-scheduled { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(88,166,255,.25); }
.badge-finished  { background: var(--bg-overlay);  color: var(--text-secondary); border: 1px solid var(--border); }

.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: livePulse 1.2s ease infinite; }
@keyframes livePulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(1.4)} }

/* ---------------------------------------------------------------- TABS */
.tabs {
  display: flex; gap: 3px; padding: 4px;
  background: var(--bg-elevated); border-radius: var(--radius-sm);
  margin-bottom: 22px; width: fit-content; border: 1px solid var(--border);
}
.tab-btn {
  padding: 8px 18px; border-radius: 7px; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; transition: var(--transition);
  border: none; background: transparent; font-family: 'Tajawal', sans-serif;
}
.tab-btn.active { color: var(--accent); background: var(--bg-surface); box-shadow: var(--shadow-sm); }
.tab-btn:hover  { color: var(--text-primary); background: var(--bg-surface); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------------------------------------------------------------- GROUPS */
.groups-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 18px; }
.group-card  { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.group-header {
  background: linear-gradient(135deg,#162821,#1a3424);
  border-bottom: 1px solid var(--border); padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.group-name { font-size: 16px; font-weight: 900; color: var(--text-white); font-family: 'Oswald', sans-serif; letter-spacing: 1px; }

/* ---------------------------------------------------------------- OPERATOR */
.operator-panel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.match-live-score { text-align: center; padding: 24px 0; }
.live-score-display { font-family: 'Oswald', sans-serif; font-size: 72px; font-weight: 700; color: var(--text-white); letter-spacing: 10px; text-shadow: 0 0 40px rgba(63,185,80,.3); }

.timer-big { font-family: 'Oswald', sans-serif; font-size: 28px; font-weight: 700; letter-spacing: 3px; }
.timer-big.first-half  { color: var(--accent); }
.timer-big.second-half { color: var(--blue); }
.timer-big.half-time   { color: var(--gold); }
.timer-big.overtime    { color: var(--red); }

.half-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 20px; font-size: 11px; font-weight: 700; margin-top: 6px; }
.half-badge.h1     { background: var(--accent-dim); color: var(--accent); }
.half-badge.h2     { background: var(--blue-dim);   color: var(--blue); }
.half-badge.ht     { background: var(--gold-dim);   color: var(--gold); }
.half-badge.ot     { background: var(--red-dim);    color: var(--red); }

.event-buttons { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 18px; }
.btn-event { padding: 13px 10px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; border: none; cursor: pointer; transition: var(--transition); display: flex; flex-direction: column; align-items: center; gap: 5px; font-family: 'Tajawal',sans-serif; }
.btn-goal   { background: linear-gradient(135deg,#163a20,var(--accent)); color: #fff; }
.btn-yellow { background: linear-gradient(135deg,#3d2a00,var(--gold));   color: #fff; }
.btn-red    { background: linear-gradient(135deg,#3d0a0a,var(--red));    color: #fff; }
.btn-sub    { background: linear-gradient(135deg,#0a2040,var(--blue));   color: #fff; }
.btn-event:hover { transform: translateY(-2px); filter: brightness(1.1); }

/* ---------------------------------------------------------------- EVENTS FEED */
.events-feed { display: flex; flex-direction: column; gap: 6px; max-height: 400px; overflow-y: auto; }
.event-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg-elevated); border: 1px solid var(--border-muted);
  font-size: 13px; animation: fadeUp .3s ease;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
.event-minute { font-family: 'Oswald',sans-serif; font-size: 15px; font-weight: 700; color: var(--accent); min-width: 36px; }
.event-icon { font-size: 18px; }
.event-text { flex: 1; font-weight: 600; }
.event-team { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ---------------------------------------------------------------- GOAL OVERLAY */
#goal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(ellipse at center,#0a2e10 0%,#000 75%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#goal-overlay.show { opacity: 1; pointer-events: all; animation: goalAnim .3s ease; }
@keyframes goalAnim { from{transform:scale(.85)} to{transform:scale(1)} }
.goal-text { font-family: 'Oswald',sans-serif; font-size: clamp(56px,11vw,130px); font-weight: 900; color: #fff; letter-spacing: 6px; text-shadow: 0 0 40px var(--accent),0 0 80px var(--accent); animation: goalPulse .6s ease infinite alternate; }
@keyframes goalPulse { from{text-shadow:0 0 40px var(--accent)} to{text-shadow:0 0 80px var(--accent),0 0 120px #fff} }
.goal-team   { font-size: 26px; color: var(--gold); font-weight: 700; margin-top: 10px; }
.goal-player { font-size: 17px; color: var(--text-secondary); margin-top: 4px; }
.goal-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* ---------------------------------------------------------------- PITCH */
.pitch-container {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; padding: 20px; min-height: 500px;
  background: linear-gradient(180deg,#1a5c2a 0%,#0d3a18 50%,#1a5c2a 100%);
  border: 1px solid rgba(63,185,80,.2);
}
.player-spot { width: 58px; height: 58px; border-radius: 50%; background: rgba(0,0,0,.35); border: 2px dashed rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); position: relative; }
.player-spot.filled { background: rgba(63,185,80,.2); border: 2px solid var(--accent); box-shadow: 0 0 12px rgba(63,185,80,.3); }
.player-spot:hover { transform: scale(1.1); }
.player-spot .jersey { font-size: 17px; font-weight: 800; color: #fff; }
.player-spot .pname  { position: absolute; bottom: -22px; font-size: 10px; color: #fff; white-space: nowrap; font-weight: 600; }

/* ---------------------------------------------------------------- BRACKET */
.bracket-container { overflow-x: auto; padding: 20px 0; }
.bracket { display: flex; gap: 48px; align-items: center; min-width: 800px; }
.bracket-round { display: flex; flex-direction: column; gap: 28px; flex-shrink: 0; }
.bracket-round-title { text-align: center; font-size: 10px; letter-spacing: 1.5px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; font-weight: 700; }
.bracket-match { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; width: 176px; transition: var(--transition); }
.bracket-match:hover { border-color: var(--accent); }
.bracket-team { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; font-size: 12.5px; font-weight: 600; }
.bracket-team:first-child { border-bottom: 1px solid var(--border); }
.bracket-team.winner { color: var(--gold); }
.bracket-score { font-family: 'Oswald',sans-serif; font-weight: 700; font-size: 15px; color: var(--text-white); }

/* ---------------------------------------------------------------- LOGIN */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-base); position: relative; overflow: hidden;
}
.login-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 55% at 25% 35%,rgba(63,185,80,.08),transparent 65%), radial-gradient(ellipse 50% 60% at 75% 65%,rgba(88,166,255,.05),transparent 65%);
}
.login-bg::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(var(--border-muted) 1px,transparent 1px),linear-gradient(90deg,var(--border-muted) 1px,transparent 1px);
  background-size: 40px 40px; opacity: .4;
}
.login-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 40px; width: 100%; max-width: 400px;
  position: relative; z-index: 1; box-shadow: var(--shadow-lg);
}
.login-logo {
  width: 60px; height: 60px; background: linear-gradient(135deg,#1a6e2e,var(--accent));
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto 18px; box-shadow: 0 4px 20px rgba(63,185,80,.35);
}
.login-title { text-align: center; font-size: 22px; font-weight: 900; color: var(--text-white); margin-bottom: 6px; }
.login-sub   { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }
.login-demo  { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 22px; font-size: 12px; color: var(--text-secondary); line-height: 1.7; }
.login-demo span { color: var(--accent); font-weight: 700; }

/* ---------------------------------------------------------------- ALERTS */
.alert { padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.alert-danger  { background: var(--red-dim);    color: var(--red);    border: 1px solid rgba(248,81,73,.25); }
.alert-success { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(63,185,80,.25); }
.alert-warning { background: var(--gold-dim);   color: var(--gold);   border: 1px solid rgba(227,179,65,.25); }
.alert-info    { background: var(--blue-dim);   color: var(--blue);   border: 1px solid rgba(88,166,255,.25); }

/* ---------------------------------------------------------------- PLAYER CARD */
.player-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; transition: var(--transition); }
.player-card:hover { border-color: rgba(63,185,80,.4); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.player-photo { width: 62px; height: 62px; object-fit: cover; border-radius: 50%; margin: 0 auto 10px; border: 2px solid var(--accent); }
.player-photo-placeholder { width: 62px; height: 62px; border-radius: 50%; background: var(--accent-dim); border: 2px solid rgba(63,185,80,.3); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: var(--accent); margin: 0 auto 10px; }
.player-number { font-family: 'Oswald',sans-serif; font-size: 26px; font-weight: 700; color: var(--text-white); }
.player-name   { font-size: 13px; font-weight: 700; color: var(--text-white); margin: 4px 0; }
.player-pos    { font-size: 11px; }
.pos-GK  { color: var(--gold); }
.pos-DEF { color: var(--blue); }
.pos-MID { color: var(--accent); }
.pos-FWD { color: var(--red); }
.pos-FLD { color: var(--text-secondary); }

/* ---------------------------------------------------------------- UTILITIES */
.grid-2    { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; }
.grid-3    { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 18px; }
.flex         { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }  .gap-3 { gap: 12px; }  .gap-4 { gap: 16px; }
.mb-2  { margin-bottom: 8px; }   .mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }  .mb-8  { margin-bottom: 32px; }
.mt-4  { margin-top: 16px; }     .mt-6  { margin-top: 24px; }
.p-0   { padding: 0 !important; }
.text-center    { text-align: center; }
.text-muted     { color: var(--text-muted) !important; }
.text-white     { color: var(--text-white); }
.text-green     { color: var(--accent); }
.text-gold      { color: var(--gold); }
.text-red       { color: var(--red); }
.text-blue      { color: var(--blue); }
.text-secondary { color: var(--text-secondary); }
.fw-700 { font-weight: 700; }
.fw-900 { font-weight: 900; }
.fs-12  { font-size: 12px; }
.fs-14  { font-size: 14px; }
.d-none { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.squad-stats-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(90px,1fr)); gap: 10px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
input[type="color"] { height: 44px !important; padding: 4px !important; cursor: pointer; border-radius: var(--radius-sm) !important; }
input[type="file"].form-control { padding: 8px 12px; cursor: pointer; height: auto !important; }

/* ---------------------------------------------------------------- MATCH LAYOUT (operator) */
#pitch-events-grid { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }

/* ---------------------------------------------------------------- RESPONSIVE */
@media (max-width: 768px) {
  .sidebar { width:100%!important; height:56px!important; top:auto!important; bottom:0!important; right:0!important; left:0!important; flex-direction:row!important; border-left:none!important; border-top:1px solid var(--border); overflow:visible!important; z-index:200; padding:0; }
  .sidebar-brand,.sidebar-user { display:none!important; }
  .nav-section-title { display:none!important; }
  .sidebar-nav { flex:1; display:flex!important; flex-direction:row!important; align-items:center; justify-content:space-around; padding:0!important; overflow:visible; }
  .nav-link { flex:1; flex-direction:column!important; justify-content:center; align-items:center; gap:2px!important; padding:6px 4px!important; border-right:none!important; border-top:2px solid transparent; font-size:9px!important; text-align:center; min-width:0; }
  .nav-link .nav-icon { font-size:19px!important; width:auto!important; }
  .nav-link.active { border-top-color:var(--accent)!important; background:var(--accent-dim)!important; color:var(--accent)!important; }
  .nav-badge { position:absolute; top:4px; left:50%; transform:translateX(50%); margin:0!important; font-size:8px!important; padding:1px 4px!important; min-width:14px; }
  .main-content { margin-right:0!important; padding-bottom:68px!important; }
  .content-area { padding:12px!important; }
  .topbar { padding:10px 14px!important; }
  .page-title { font-size:16px!important; }
  .page-breadcrumb { display:none!important; }
  .grid-2,.grid-3,[style*="grid-template-columns:1fr 1fr"],[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns:1fr!important; }
  .stat-cards { grid-template-columns:repeat(2,1fr)!important; }
  .match-score { font-size:26px!important; }
  .live-score-display { font-size:48px!important; }
  .card { border-radius:var(--radius)!important; }
  .card-header { padding:10px 14px!important; }
  .card-body { padding:12px 14px!important; }
  .groups-grid { grid-template-columns:1fr!important; gap:10px!important; }
  .btn-lg { font-size:14px!important; padding:11px 16px!important; }
  .events-feed-grid { grid-template-columns:1fr!important; }
  .lineup-grid { grid-template-columns:1fr!important; }
  #pitches-row { grid-template-columns:1fr!important; }
  select.form-control,input.form-control { font-size:16px!important; height:44px!important; }
  .lineup-grid label { padding:10px 8px!important; }
  .lineup-grid input[type=checkbox] { width:18px!important; height:18px!important; }
  #pitch-events-grid { grid-template-columns:1fr!important; }
  #pitch-events-grid > div:first-child { order:2; }
  #pitch-events-grid > div:last-child  { order:1; }
  #ctrl-btns { position:sticky; bottom:60px; z-index:50; background:var(--bg-base); border-top:1px solid var(--border); margin:0 -12px; padding:10px 12px; }
  input[type=datetime-local] { width:100%!important; }
  .players-layout-grid { grid-template-columns:1fr!important; }
  .players-layout-grid > div:last-child { position:static!important; }
  .match-row-op { padding:12px 10px!important; }
  .ctrl-btns-row .btn-lg { flex:1; min-width:120px; }
}
@media (max-width:380px) {
  .content-area { padding:8px!important; }
  .nav-link { font-size:8px!important; }
  .nav-link .nav-icon { font-size:17px!important; }
}

/* ================================================================
   UI/UX UPGRADE v14 — Liga Al-Ahyaa
   Micro-animations · Better components · Improved UX
================================================================ */

/* ---------------------------------------------------------------- CSS CUSTOM PROPS ADDITIONS */
:root {
  --gradient-green: linear-gradient(135deg, #0d2e17 0%, #1a5c30 100%);
  --gradient-gold:  linear-gradient(135deg, #2a1f00 0%, #5c3d00 100%);
  --gradient-blue:  linear-gradient(135deg, #0d1f3a 0%, #1a3a6b 100%);
  --gradient-red:   linear-gradient(135deg, #2a0d0d 0%, #5c1a1a 100%);
  --gradient-dark:  linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
  --radius-full: 9999px;
  --transition-fast: all .15s cubic-bezier(.4,0,.2,1);
  --transition-slow: all .4s cubic-bezier(.4,0,.2,1);
}

/* ---------------------------------------------------------------- GLOBAL SMOOTH SCROLL + SELECTION */
::selection { background: rgba(63,185,80,.25); color: var(--text-white); }

/* ---------------------------------------------------------------- PAGE ENTER ANIMATION */
.page-container {
  animation: pageEnter .35s cubic-bezier(.4,0,.2,1) both;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------- ENHANCED STAT CARDS */
.stat-card {
  position: relative;
  overflow: hidden;
  cursor: default;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-dark);
  opacity: 0;
  transition: opacity .3s;
}
.stat-card:hover::before { opacity: .5; }

.stat-card .stat-icon {
  position: relative;
  z-index: 1;
}
.stat-card .stat-value,
.stat-card .stat-label { position: relative; z-index: 1; }

/* Colored top border per stat type */
.stat-card[data-type="leagues"]  { border-top: 2px solid var(--accent); }
.stat-card[data-type="teams"]    { border-top: 2px solid var(--blue); }
.stat-card[data-type="players"]  { border-top: 2px solid var(--gold); }
.stat-card[data-type="matches"]  { border-top: 2px solid var(--red); }

/* ---------------------------------------------------------------- ENHANCED CARDS */
.card {
  transition: var(--transition);
}
.card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.5); }

.card-header {
  background: linear-gradient(90deg, rgba(255,255,255,.02) 0%, transparent 100%);
}

/* Glow variant */
.card-glow {
  border-color: rgba(63,185,80,.3);
  box-shadow: 0 0 0 1px rgba(63,185,80,.1), inset 0 1px 0 rgba(63,185,80,.05);
}
.card-live {
  border-color: rgba(63,185,80,.4);
  box-shadow: 0 0 20px rgba(63,185,80,.12);
  animation: cardLivePulse 2s ease infinite;
}
@keyframes cardLivePulse {
  0%,100% { box-shadow: 0 0 20px rgba(63,185,80,.12); }
  50%      { box-shadow: 0 0 30px rgba(63,185,80,.22); }
}

/* ---------------------------------------------------------------- ENHANCED BUTTONS */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background .15s;
}
.btn:hover::after  { background: rgba(255,255,255,.05); }
.btn:active::after { background: rgba(0,0,0,.1); }

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

/* Ripple effect on click */
.btn-ripple {
  position: relative; overflow: hidden;
}
.btn-ripple .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleAnim .6s linear;
  background: rgba(255,255,255,.25);
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* Icon buttons */
.btn-icon-only {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------- FORM COMPONENTS — ENHANCED */
.form-group { margin-bottom: 18px; position: relative; }

.form-label {
  display: block;
  font-size: 12px; font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  font-family: 'Tajawal', sans-serif;
  outline: none;
  transition: var(--transition-fast);
  box-sizing: border-box;
}
.form-control:focus {
  border-color: var(--accent);
  background: var(--bg-overlay);
  box-shadow: 0 0 0 3px rgba(63,185,80,.12);
}
.form-control:hover:not(:focus) { border-color: var(--text-muted); }
.form-control::placeholder { color: var(--text-muted); }
.form-control.is-invalid  { border-color: var(--red);    box-shadow: 0 0 0 3px rgba(248,81,73,.1); }
.form-control.is-valid    { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63,185,80,.1); }

.form-helper { font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.form-error  { font-size: 11px; color: var(--red); margin-top: 5px; }

/* Input with icon */
.input-group { position: relative; }
.input-group .input-icon {
  position: absolute;
  top: 50%; right: 13px; transform: translateY(-50%);
  font-size: 14px; color: var(--text-muted);
  pointer-events: none;
}
.input-group .form-control { padding-right: 38px; }

/* Select arrow custom */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B949E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 32px;
}

/* ---------------------------------------------------------------- ENHANCED MATCH CARDS */
.match-card {
  position: relative;
  overflow: hidden;
}
.match-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 2px;
  background: transparent;
  transition: background .3s;
}
.match-card.live::before     { background: var(--accent); }
.match-card.finished::before { background: var(--text-muted); }
.match-card.scheduled::before{ background: var(--blue); }

.match-card .match-time {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: .5px;
}

/* ---------------------------------------------------------------- ENHANCED STATUS BADGES */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700;
  letter-spacing: .3px;
}
.status-live {
  background: rgba(63,185,80,.15);
  color: var(--accent);
  border: 1px solid rgba(63,185,80,.3);
}
.status-live::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: livePulse 1.2s ease infinite;
  flex-shrink: 0;
}
.status-scheduled {
  background: rgba(88,166,255,.1);
  color: var(--blue);
  border: 1px solid rgba(88,166,255,.2);
}
.status-finished {
  background: var(--bg-overlay);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.status-paused {
  background: rgba(227,179,65,.1);
  color: var(--gold);
  border: 1px solid rgba(227,179,65,.2);
}

/* ---------------------------------------------------------------- PLAYER CARDS — ENHANCED */
.player-card-v2 {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.player-card-v2::before {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform .25s;
  transform-origin: bottom;
}
.player-card-v2:hover {
  border-color: rgba(63,185,80,.3);
  background: var(--bg-elevated);
  transform: translateX(-3px);
}
.player-card-v2:hover::before { transform: scaleY(1); }

.player-avatar-v2 {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.player-avatar-v2-placeholder {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-overlay);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.player-info-v2 { flex: 1; min-width: 0; }
.player-name-v2 {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-meta-v2 {
  display: flex; align-items: center; gap: 6px; margin-top: 3px;
}

.pos-tag {
  display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 800;
  letter-spacing: .5px;
}
.pos-tag.GK  { background: rgba(227,179,65,.15); color: var(--gold); }
.pos-tag.DEF { background: rgba(88,166,255,.15);  color: var(--blue); }
.pos-tag.MID { background: rgba(63,185,80,.15);   color: var(--accent); }
.pos-tag.FWD { background: rgba(248,81,73,.15);   color: var(--red); }

/* ---------------------------------------------------------------- EMPTY STATES */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 52px 20px;
  text-align: center;
}
.empty-state-icon {
  font-size: 52px;
  margin-bottom: 16px;
  opacity: .7;
  animation: floatIcon 3s ease infinite;
}
@keyframes floatIcon {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.empty-state-title {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ---------------------------------------------------------------- PROGRESS BAR */
.progress-bar-wrap {
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width .6s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -100%;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  to { left: 100%; }
}
.progress-bar-fill.danger { background: var(--red); }
.progress-bar-fill.warning { background: var(--gold); }

/* ---------------------------------------------------------------- TEAM CODE DISPLAY */
.team-code-display {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(227,179,65,.08);
  border: 1px solid rgba(227,179,65,.2);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: all;
}
.team-code-display:hover {
  background: rgba(227,179,65,.15);
  border-color: var(--gold);
}
.team-code-value {
  font-family: 'Oswald', monospace;
  font-size: 16px; font-weight: 700;
  color: var(--gold);
  letter-spacing: 3px;
}
.team-code-copy-hint {
  font-size: 10px; color: var(--text-muted);
}

/* ---------------------------------------------------------------- ENHANCED TOPBAR */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(22,27,34,.92);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* ---------------------------------------------------------------- NOTIFICATION BADGE */
.notif-badge {
  position: relative;
  display: inline-flex;
}
.notif-badge::after {
  content: '';
  position: absolute;
  top: -2px; left: -2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg-surface);
}

/* ---------------------------------------------------------------- DATA TABLE */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  padding: 10px 14px;
  text-align: right;
  font-size: 11px; font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--border-muted);
  transition: background .12s;
}
.data-table tbody tr:hover { background: var(--bg-elevated); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table td {
  padding: 11px 14px;
  vertical-align: middle;
}
.data-table .rank-col {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  color: var(--text-muted);
  width: 36px;
  text-align: center;
}
.data-table .rank-1 { color: var(--gold); }
.data-table .rank-2 { color: var(--text-secondary); }
.data-table .rank-3 { color: #cd7f32; }
.data-table .pts-col {
  font-family: 'Oswald', sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--accent);
}

/* ---------------------------------------------------------------- TIMELINE / EVENTS */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  right: 34px; top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  position: relative;
  animation: fadeUp .3s ease both;
}
.timeline-minute {
  font-family: 'Oswald', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--accent);
  min-width: 42px;
  text-align: center;
  padding: 4px 0;
  position: relative;
  z-index: 1;
}
.timeline-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  position: relative; z-index: 1;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
}
.timeline-dot.goal     { background: rgba(63,185,80,.15);  border-color: var(--accent); }
.timeline-dot.yellow   { background: rgba(227,179,65,.15); border-color: var(--gold); }
.timeline-dot.red      { background: rgba(248,81,73,.15);  border-color: var(--red); }
.timeline-dot.sub      { background: rgba(88,166,255,.15); border-color: var(--blue); }
.timeline-content {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.timeline-content .player { font-weight: 700; color: var(--text-primary); }
.timeline-content .team   { font-size: 11px; color: var(--text-muted); }

/* ---------------------------------------------------------------- SCORE DISPLAY */
.score-display {
  display: flex;
  align-items: center;
  gap: 16px;
}
.score-digit {
  font-family: 'Oswald', sans-serif;
  font-size: 56px; font-weight: 700;
  color: var(--text-white);
  line-height: 1;
  min-width: 56px;
  text-align: center;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.score-digit.bump {
  animation: scoreBump .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes scoreBump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); color: var(--accent); }
  100% { transform: scale(1); }
}
.score-sep {
  font-family: 'Oswald', sans-serif;
  font-size: 48px; font-weight: 300;
  color: var(--border);
  line-height: 1;
}

/* ---------------------------------------------------------------- REFEREE CONTROLS */
.ref-control-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px;
}
.ref-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 16px 10px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer; transition: var(--transition);
  font-family: 'Tajawal', sans-serif;
  font-size: 13px; font-weight: 700;
}
.ref-btn:active { transform: scale(.96); }
.ref-btn-start  { background: rgba(63,185,80,.1);  border-color: rgba(63,185,80,.3); color: var(--accent); }
.ref-btn-start:hover  { background: rgba(63,185,80,.2); }
.ref-btn-pause  { background: rgba(227,179,65,.1); border-color: rgba(227,179,65,.3); color: var(--gold); }
.ref-btn-pause:hover  { background: rgba(227,179,65,.2); }
.ref-btn-end    { background: rgba(248,81,73,.1);  border-color: rgba(248,81,73,.3); color: var(--red); }
.ref-btn-end:hover    { background: rgba(248,81,73,.2); }
.ref-btn-resume { background: rgba(88,166,255,.1); border-color: rgba(88,166,255,.3); color: var(--blue); }
.ref-btn-resume:hover { background: rgba(88,166,255,.2); }
.ref-btn .icon { font-size: 24px; }

/* ---------------------------------------------------------------- EVENT TYPE SELECTOR */
.event-type-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 8px;
}
.event-type-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: 'Tajawal', sans-serif;
  font-size: 12px; font-weight: 700;
  cursor: pointer; transition: var(--transition-fast);
}
.event-type-btn .ev-icon { font-size: 22px; }
.event-type-btn:hover { border-color: var(--text-muted); color: var(--text-primary); background: var(--bg-overlay); }
.event-type-btn.selected-goal   { border-color: var(--accent); background: rgba(63,185,80,.1); color: var(--accent); }
.event-type-btn.selected-yellow { border-color: var(--gold);   background: rgba(227,179,65,.1); color: var(--gold); }
.event-type-btn.selected-red    { border-color: var(--red);    background: rgba(248,81,73,.1); color: var(--red); }
.event-type-btn.selected-sub    { border-color: var(--blue);   background: rgba(88,166,255,.1); color: var(--blue); }

/* ---------------------------------------------------------------- TEAM SELECTOR PILLS */
.team-pill-group {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.team-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: 'Tajawal', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: var(--transition-fast);
}
.team-pill:hover { border-color: var(--text-muted); color: var(--text-primary); }
.team-pill.selected {
  border-color: var(--accent);
  background: rgba(63,185,80,.1);
  color: var(--accent);
}

/* ---------------------------------------------------------------- TOAST NOTIFICATIONS — IMPROVED */
#toast-container {
  position: fixed;
  bottom: 80px; left: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast-v2 {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  font-family: 'Tajawal', sans-serif;
  min-width: 220px; max-width: 320px;
  pointer-events: all;
  animation: toastSlideIn .3s cubic-bezier(.34,1.56,.64,1) both;
  box-shadow: var(--shadow-md);
  border: 1px solid;
}
.toast-v2.out {
  animation: toastFadeOut .25s ease forwards;
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(-20px) scale(.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastFadeOut {
  to { opacity: 0; transform: translateX(-12px); }
}
.toast-v2.success { background: rgba(22,34,24,.96); border-color: rgba(63,185,80,.4); color: var(--accent); }
.toast-v2.error   { background: rgba(34,14,14,.96); border-color: rgba(248,81,73,.4); color: var(--red); }
.toast-v2.info    { background: rgba(14,22,34,.96); border-color: rgba(88,166,255,.4); color: var(--blue); }
.toast-v2.warning { background: rgba(34,28,14,.96); border-color: rgba(227,179,65,.4); color: var(--gold); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg  { flex: 1; }

/* ---------------------------------------------------------------- SKELETON LOADING */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-overlay) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeletonAnim 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeletonAnim {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text  { height: 14px; }
.skeleton-title { height: 20px; width: 60%; }
.skeleton-avatar{ width: 44px; height: 44px; border-radius: 50%; }
.skeleton-card  { height: 120px; }

/* ---------------------------------------------------------------- LIVE TIMER DISPLAY */
.live-timer {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 18px; font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}
.live-timer .timer-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: livePulse 1s ease infinite;
}

/* ---------------------------------------------------------------- REGISTER ROLE CARDS */
.role-select-card {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.role-select-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-green); }
.role-select-card.active { border-color: var(--accent); background: var(--accent-dim); }
.role-select-card .role-icon { font-size: 36px; margin-bottom: 10px; }
.role-select-card .role-name { font-size: 15px; font-weight: 800; color: var(--text-primary); }
.role-select-card .role-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---------------------------------------------------------------- DIVIDER WITH TEXT */
.divider-text {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-muted); font-size: 12px;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ---------------------------------------------------------------- MATCH MINI CARD */
.match-mini {
  display: flex; align-items: center;
  gap: 10px; padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}
.match-mini:hover { border-color: rgba(63,185,80,.3); background: var(--bg-overlay); }
.match-mini-teams {
  flex: 1; min-width: 0;
  display: flex; align-items: center;
  gap: 6px; font-size: 13px; font-weight: 700;
}
.match-mini-vs {
  font-size: 10px; color: var(--text-muted);
  font-weight: 600;
}
.match-mini-score {
  font-family: 'Oswald', sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--text-white);
  min-width: 50px; text-align: center;
}

/* ---------------------------------------------------------------- ANIMATED COUNTER (JS hook) */
.count-up {
  display: inline-block;
  transition: transform .1s;
}

/* ---------------------------------------------------------------- RESPONSIVE IMPROVEMENTS */
@media (max-width: 768px) {
  #toast-container { bottom: 70px; left: 12px; right: 12px; }
  .toast-v2 { min-width: unset; max-width: 100%; }
  .ref-control-panel { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
  .event-type-grid { grid-template-columns: repeat(2,1fr); }
  .score-digit { font-size: 40px; min-width: 40px; }
  .empty-state { padding: 36px 16px; }
  .empty-state-icon { font-size: 40px; }
  .team-pill-group { gap: 6px; }
  .team-pill { padding: 6px 10px; font-size: 12px; }
}


/* ══════════════════════════════════════════
   📱 GLOBAL MOBILE FIXES — v16
   ══════════════════════════════════════════ */

/* Form containers: responsive max-width */
.form-container {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

/* Auth forms */
.auth-wrap {
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

/* Fix fixed-width inline styles on mobile */
@media (max-width: 600px) {
  /* أي div يحتوي style="max-width:...px" يصبح full-width */
  [style*="max-width:440px"],
  [style*="max-width: 440px"],
  [style*="max-width:480px"],
  [style*="max-width: 480px"],
  [style*="max-width:520px"],
  [style*="max-width: 520px"],
  [style*="max-width:540px"],
  [style*="max-width: 540px"],
  [style*="max-width:560px"],
  [style*="max-width: 560px"],
  [style*="max-width:580px"],
  [style*="max-width: 580px"] {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* كل أزرار الإجراءات تبقى قابلة للنقر */
  .btn { min-height: 36px; }
  .btn-sm { min-height: 30px; padding: 5px 10px !important; }

  /* Fix grid-template-columns 1fr 320px */
  [style*="grid-template-columns:1fr 320px"],
  [style*="grid-template-columns: 1fr 320px"] {
    grid-template-columns: 1fr !important;
  }

  /* منع overflow محتوى على الموبايل */
  .page-container {
    overflow-x: hidden;
  }

  /* Topbar */
  .topbar {
    padding: 8px 12px !important;
  }
  .page-title {
    font-size: 15px !important;
  }

  /* Cards */
  .card {
    border-radius: 12px !important;
  }
  .card-header {
    padding: 10px 12px !important;
    flex-wrap: wrap;
    gap: 6px;
  }
  .card-title {
    font-size: 13px !important;
  }
  .card-body {
    padding: 12px !important;
  }

  /* Buttons text visible */
  .btn {
    white-space: nowrap;
    font-size: 13px !important;
  }
  .btn-sm {
    font-size: 11px !important;
  }

  /* Form controls */
  .form-control, select.form-control, input.form-control {
    font-size: 16px !important; /* prevents zoom on iOS */
  }

  /* Tables scroll */
  .data-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.data-table {
    min-width: 400px;
  }

  /* Fix grid-2 */
  .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* ── Players page fix ── */
@media (max-width: 860px) {
  .players-layout,
  [style*="1fr 320px"] {
    grid-template-columns: 1fr !important;
  }
}


/* ══ EXTRA MOBILE FIXES v16.1 ══ */
@media (max-width: 600px) {

  /* الـ sidebar navigation — icons + labels واضحة */
  .nav-link { font-size: 9px !important; }
  .nav-link .nav-icon { font-size: 20px !important; }

  /* page container padding */
  .content-area { padding: 10px !important; }
  .page-container { padding: 0 !important; }

  /* stat-cards 2x2 */
  .stat-cards { grid-template-columns: repeat(2,1fr) !important; gap: 8px !important; }
  .stat-card { padding: 12px 10px !important; border-radius: 12px !important; }
  .stat-value { font-size: 22px !important; }
  .stat-icon { width: 38px !important; height: 38px !important; font-size: 18px !important; }

  /* card header wrapping */
  .card-header {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center !important;
  }
  .card-title { font-size: 13px !important; }

  /* buttons */
  .btn { font-size: 12px !important; padding: 7px 12px !important; border-radius: 9px !important; }
  .btn-sm { font-size: 11px !important; padding: 4px 9px !important; }
  .btn-lg { font-size: 14px !important; padding: 11px 16px !important; }

  /* form controls bigger touch target */
  .form-control { font-size: 15px !important; padding: 10px 12px !important; min-height: 44px !important; }
  select.form-control { min-height: 44px !important; }

  /* badge */
  .badge { font-size: 9px !important; padding: 2px 7px !important; white-space: nowrap; }

  /* data-table scroll */
  .data-table-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
  
  /* topbar title */
  .topbar { padding: 8px 10px !important; min-height: 48px; }
  .page-title { font-size: 14px !important; font-weight: 800 !important; }

  /* no-team / no-league pages */
  .empty-state { padding: 24px 16px !important; }
  .empty-state-icon { font-size: 40px !important; }
  .empty-state-title { font-size: 15px !important; }

  /* team-code-display */
  .team-code-display { font-size: 12px !important; }
  .team-code-value { font-size: 14px !important; letter-spacing: 1px !important; }

  /* progress bars */
  .progress-bar-wrap { height: 6px !important; border-radius: 6px !important; }

  /* alert */
  .alert { padding: 10px 12px !important; font-size: 13px !important; border-radius: 10px !important; }

  /* timeline */
  .timeline-item { gap: 8px !important; }
  .timeline-minute { font-size: 12px !important; min-width: 24px !important; }

  /* status badges */
  .status-badge { font-size: 10px !important; padding: 3px 8px !important; }
}

/* Very small screens */
@media (max-width: 380px) {
  .content-area { padding: 8px !important; }
  .card-body { padding: 10px 10px !important; }
  .btn { font-size: 11px !important; padding: 6px 10px !important; }
  .stat-value { font-size: 20px !important; }
  .stat-card { padding: 10px 8px !important; gap: 8px !important; }
  .stat-icon { width: 34px !important; height: 34px !important; font-size: 16px !important; }
}

/* ══ ADMIN PAGES — MOBILE LAYOUT FIX ══ */
/* grid-2 للصفحات الإدارية: النموذج أولاً على الـ desktop، القائمة أولاً على الموبايل */
.admin-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 860px) {
  .admin-layout {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  /* النموذج في الأسفل على الموبايل */
  .admin-layout .admin-form-col  { order: 2; position: static !important; }
  .admin-layout .admin-list-col  { order: 1; }
}

/* عكس grid-2 القديم على الموبايل */
@media (max-width: 768px) {
  .grid-2.gap-4 > *:first-child  { order: 2 !important; }
  .grid-2.gap-4 > *:nth-child(2) { order: 1 !important; }
  
  /* table responsive في admin/operators */
  .admin-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: var(--radius);
  }
  .admin-table-wrap .data-table {
    min-width: 520px !important;
  }
  
  /* أزرار approve/reject في operators */
  .op-approve-form {
    min-width: 100% !important;
    width: 100% !important;
  }
  
  /* grid 1fr 1fr في operators form */
  .op-grid-2 {
    grid-template-columns: 1fr !important;
  }
  .op-grid-3 {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* request_league overlay — إصلاح z-index */
.request-league-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9000 !important;
  background: rgba(0,0,0,.85) !important;
  overflow-y: auto !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 16px !important;
}
.request-league-modal-inner {
  width: 100% !important;
  max-width: 560px !important;
  margin: auto !important;
  background: var(--bg-surface) !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.6) !important;
}

/* ══ OPERATOR MATCH — Mobile Controls ══ */
@media (max-width: 768px) {
  /* Match control buttons — always visible on mobile */
  .match-controls-row {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 10px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
  }
  .match-controls-row .btn-lg {
    flex: 1;
    min-width: 100px;
    max-width: 180px;
    justify-content: center;
    font-size: 13px !important;
    padding: 10px 12px !important;
  }

  /* Event panel full width */
  #event-panel .ev-sec { margin-bottom: 10px !important; }
  #event-panel .bfire  { font-size: 14px !important; }

  /* Operator match page: score header compact */
  .score-giant { font-size: 60px !important; }
  .timer-big   { font-size: 28px !important; }
}
