:root{
  --bg: #0b1711;
  --bg-2: #0f2318;
  --panel: #122a1d;
  --panel-2: #163523;
  --gold: #f6c945;
  --gold-2: #ffe08a;
  --green: #1f7a4d;
  --green-2: #2fae6e;
  --text: #f2f6f1;
  --muted: #9fb3a6;
  --danger: #e2574c;
  --radius: 16px;
  font-size: 16px;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  background: radial-gradient(1200px 600px at 50% -10%, #18371f 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font-family: "Tajawal", "system-ui", sans-serif;
  line-height: 1.7;
  min-height: 100vh;
  display:flex; flex-direction:column;
}
a{ color: inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
button{ font-family:inherit; cursor:pointer; }
.muted{ color: var(--muted); }
.small{ font-size: 0.85rem; }
bdi, .ltr{ direction: ltr; unicode-bidi: isolate; }

/* ===== topbar ===== */
.topbar{
  position: sticky; top:0; z-index: 40;
  background: rgba(11,23,17,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(246,201,69,0.15);
}
.topbar-inner{
  max-width: 1150px; margin:0 auto; padding: 12px 20px;
  display:flex; align-items:center; justify-content:space-between; gap: 16px;
}
.brand{ display:flex; align-items:center; gap:10px; font-weight:900; font-size:1.3rem; letter-spacing: 0.5px; }
.brand-ball{ width:36px; height:36px; filter: drop-shadow(0 0 6px rgba(246,201,69,0.5)); }
.top-actions{ display:flex; align-items:center; gap:10px; flex-wrap: wrap; }

.btn{
  display:inline-flex; align-items:center; gap:8px; justify-content:center;
  padding: 10px 20px; border-radius: 999px; border: none;
  font-weight:800; font-size: 0.95rem;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active{ transform: scale(0.97); }
.btn-primary{ background: linear-gradient(135deg, var(--gold-2), var(--gold)); color:#1a1304; box-shadow: 0 6px 20px rgba(246,201,69,0.25); }
.btn-primary:hover{ box-shadow: 0 8px 26px rgba(246,201,69,0.4); }
.btn-outline{ background: transparent; color: var(--text); border: 1.5px solid rgba(255,255,255,0.25); }
.btn-outline:hover{ border-color: var(--gold); color: var(--gold); }
.btn-ghost{ background: rgba(255,255,255,0.06); color: var(--text); }
.btn-danger{ background: rgba(226,87,76,0.15); color: #ff8b80; border: 1px solid rgba(226,87,76,0.4); }
.btn-block{ width:100%; }
.btn[disabled]{ opacity:0.6; cursor:not-allowed; }

.user-chip{ display:flex; align-items:center; gap:8px; background: rgba(255,255,255,0.06); padding:6px 12px 6px 6px; border-radius:999px; }
.user-avatar{ width:28px; height:28px; border-radius:50%; background: linear-gradient(135deg, var(--green-2), var(--green)); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:0.85rem; }
.role-badge{ font-size:0.72rem; background: rgba(246,201,69,0.18); color: var(--gold); padding: 2px 8px; border-radius: 999px; font-weight:700; }

/* ===== main / hero ===== */
#app{ flex:1; }
.hero{
  position: relative; overflow:hidden;
  min-height: 70vh; display:flex; align-items:center; justify-content:center; text-align:center;
  padding: 90px 20px 70px;
}
.hero::before{
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(8,18,13,0.55), rgba(8,18,13,0.92)), var(--hero-img) center/cover no-repeat;
  z-index:0;
}
.hero-content{ position:relative; z-index:1; max-width: 720px; }
.hero h1{ font-size: clamp(2.1rem, 5vw, 3.4rem); margin:0 0 14px; font-weight:900; text-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.hero h1 span{ color: var(--gold); }
.hero p{ font-size: 1.15rem; color: #dce8df; margin: 0 auto 28px; max-width: 560px; }
.hero-actions{ display:flex; gap:14px; justify-content:center; flex-wrap:wrap; }

.section{ max-width: 1150px; margin: 0 auto; padding: 50px 20px; }
.section-head{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom: 24px; flex-wrap:wrap; }
.section-head h2{ font-size: 1.6rem; margin:0; font-weight:900; }

/* ===== field cards ===== */
.fields-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.field-card{
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius); overflow:hidden;
  display:flex; flex-direction:column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.field-card:hover{ transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.35); }
.field-card .thumb{ aspect-ratio: 16/10; width:100%; object-fit:cover; }
.field-card .body{ padding: 16px 18px 20px; display:flex; flex-direction:column; gap: 8px; flex:1; min-width:0; }
.field-card h3{ margin:0; font-size: 1.15rem; }
.field-meta{ display:flex; align-items:center; gap:6px; color: var(--muted); font-size: 0.88rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.field-desc{ color:#cfe0d4; font-size:0.9rem; flex:1; }
.field-price{ font-weight:900; color: var(--gold); font-size:1.05rem; }
.field-owner{ font-size:0.8rem; color: var(--muted); }
.field-card .actions{ display:flex; gap:10px; margin-top:6px; }
.empty-state{ text-align:center; padding: 50px 20px; color: var(--muted); border: 1.5px dashed rgba(255,255,255,0.15); border-radius: var(--radius); }

/* ===== modals ===== */
.modal-backdrop{
  position: fixed; inset:0; background: rgba(4,10,7,0.72); backdrop-filter: blur(4px);
  display:flex; align-items:center; justify-content:center; z-index: 60; padding: 20px;
  animation: fadeIn .2s ease;
}
.modal{
  background: linear-gradient(180deg, #13301f, #0e2117);
  border: 1px solid rgba(246,201,69,0.25);
  border-radius: 20px; padding: 28px; width: 100%; max-width: 520px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  animation: popIn .25s cubic-bezier(.2,.9,.3,1.2);
}
.modal h2{ margin: 0 0 6px; font-size: 1.5rem; }
.modal-close{ position:absolute; }
@keyframes fadeIn{ from{opacity:0} to{opacity:1} }
@keyframes popIn{ from{opacity:0; transform: scale(.92) translateY(10px)} to{opacity:1; transform:scale(1) translateY(0)} }

.role-grid{ display:grid; grid-template-columns: 1fr 1fr; gap:14px; margin-top:20px; }
.role-card{
  background: rgba(255,255,255,0.04); border: 1.5px solid rgba(255,255,255,0.1); border-radius: 16px;
  padding: 24px 14px; display:flex; flex-direction:column; align-items:center; gap:6px; text-align:center;
  color: var(--text); transition: all .2s ease;
}
.role-card:hover{ border-color: var(--gold); background: rgba(246,201,69,0.08); transform: translateY(-3px); }
.role-icon{ font-size: 2.2rem; }

.field{ margin-bottom: 16px; }
.field label{ display:block; margin-bottom: 6px; font-weight:700; font-size:0.92rem; }
.field input, .field textarea, .field select{
  width:100%; padding: 11px 14px; border-radius: 10px; border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25); color: var(--text); font-family: inherit; font-size: 0.95rem;
}
.field input:focus, .field textarea:focus, .field select:focus{ outline:none; border-color: var(--gold); }
.field textarea{ resize: vertical; min-height: 80px; }
.field-row{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint{ font-size: 0.8rem; color: var(--muted); margin-top:4px; }
.error-text{ color: #ff8b80; font-size: 0.85rem; margin-top: 10px; }

/* ===== team logo picker ===== */
.logo-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:12px; margin: 14px 0 20px; }
.logo-option{ background: transparent; border: 2px solid transparent; border-radius: 14px; padding: 6px; }
.logo-option svg{ width:100%; aspect-ratio:1; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.4)); }
.logo-option.selected{ border-color: var(--gold); background: rgba(246,201,69,0.1); }

/* ===== dashboards ===== */
.dash-grid{ display:grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items:start; }
@media (max-width: 860px){ .dash-grid{ grid-template-columns: 1fr; } }
.panel{ background: linear-gradient(180deg, var(--panel), var(--panel-2)); border:1px solid rgba(255,255,255,0.06); border-radius: var(--radius); padding: 22px; }
.panel h3{ margin-top:0; }
.stat{ display:flex; justify-content:space-between; padding: 10px 0; border-bottom: 1px dashed rgba(255,255,255,0.1); }
.stat:last-child{ border-bottom:none; }
.team-banner{ display:flex; align-items:center; gap: 14px; }
.team-banner svg{ width:64px; height:64px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4)); }

.booking-row{ display:flex; gap:12px; align-items:center; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.booking-row:last-child{ border-bottom:none; }
.booking-row img{ width:62px; height:46px; object-fit:cover; border-radius: 8px; flex-shrink:0; }
.booking-info{ flex:1; min-width:0; }
.booking-info strong{ display:block; }
.status-pill{ font-size:0.75rem; padding: 3px 10px; border-radius:999px; font-weight:800; white-space:nowrap; }
.status-paid{ background: rgba(47,174,110,0.2); color: var(--green-2); }
.status-pending{ background: rgba(246,201,69,0.18); color: var(--gold); }
.status-cancelled{ background: rgba(226,87,76,0.18); color:#ff8b80; }

.tabs{ display:flex; gap:8px; margin-bottom: 20px; flex-wrap:wrap; }
.tab-btn{ padding: 9px 18px; border-radius:999px; background: rgba(255,255,255,0.05); border:1.5px solid transparent; color:var(--muted); font-weight:700; }
.tab-btn.active{ background: rgba(246,201,69,0.14); color: var(--gold); border-color: rgba(246,201,69,0.4); }

.banner{ max-width:1150px; margin: 18px auto 0; padding: 14px 20px; border-radius: 12px; font-weight:700; }
.banner-success{ background: rgba(47,174,110,0.15); color:#8be8b6; border: 1px solid rgba(47,174,110,0.4); }
.banner-fail{ background: rgba(226,87,76,0.15); color:#ff9c92; border: 1px solid rgba(226,87,76,0.4); }

.center-box{ max-width: 460px; margin: 90px auto; text-align:center; padding: 30px; }
.center-box .big-ball{ width: 110px; margin: 0 auto 20px; }

/* ===== ball transition overlay ===== */
.ball-overlay{
  position: fixed; inset:0; z-index: 999; display:none;
  align-items:center; justify-content:center;
  background: radial-gradient(circle at 50% 50%, rgba(15,40,25,0.95), rgba(4,10,7,0.98));
}
.ball-overlay.show{ display:flex; }
.ball-wrap{ text-align:center; }
.ball-spin{ width: 160px; height:160px; animation: spinBall 1s linear infinite, pulseGlow 1.4s ease-in-out infinite; }
.ball-caption{ margin-top: 18px; color: var(--gold); font-weight:800; letter-spacing: 1px; font-size: 1.05rem; }
@keyframes spinBall{ from{ transform: rotate(0deg);} to{ transform: rotate(360deg);} }
@keyframes pulseGlow{ 0%,100%{ filter: drop-shadow(0 0 10px rgba(246,201,69,0.4)); } 50%{ filter: drop-shadow(0 0 32px rgba(246,201,69,0.85)); } }

/* ===== footer ===== */
.site-footer{ border-top: 1px solid rgba(255,255,255,0.08); padding: 24px 20px; text-align:center; color: var(--muted); font-size: 0.85rem; }
.footer-inner p{ margin: 4px 0; }
.credits{ font-size: 0.72rem; opacity: 0.7; }

/* ===== loading/skeleton ===== */
.loading{ text-align:center; padding: 60px 20px; color: var(--muted); }
.spinner{ width:34px; height:34px; border-radius:50%; border:3px solid rgba(255,255,255,0.15); border-top-color: var(--gold); animation: spin .8s linear infinite; margin: 0 auto 14px; }
@keyframes spin{ to{ transform: rotate(360deg); } }

@media (max-width: 640px){
  .role-grid{ grid-template-columns: 1fr; }
  .logo-grid{ grid-template-columns: repeat(3, 1fr); }
  .field-row{ grid-template-columns: 1fr; }
  .hero{ padding: 70px 16px 50px; }
}
