/* =========================================================
   Uganda Cranes Hub - stylesheet
   (consolidated from the original single-file prototype)
   ========================================================= */
:root {
  --bg: #05080f;
  --panel: #141b2d;
  --line: #26314d;
  --tx: #eef2ff;
  --mut: #8f9bbd;
  --gold: #fcdc04;
  --red: #d90000;
  --ok: #2ecc71;
  --danger: #ff6b5e;
  --danger-bg: #3a1614;
  --ok-bg: #12301f;
  --font-display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(5,8,18,.55), rgba(5,8,18,.9)),
              url(/assets/img/background.jpg) center top / cover no-repeat;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .sat, .btn, th, .tag, .est, .hero small, .site-nav a, .fm a,
.card .ovr, .card .pos, .card .nm, .tl b, .ph { font-family: var(--font-display); }

h2 { font-size: 19px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
.panel h2 { font-size: 16px; letter-spacing: 1.8px; margin-bottom: 10px; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.main-content { padding-top: 16px; padding-bottom: 32px; }
.scroll-x { overflow-x: auto; }
.mut { color: var(--mut); font-size: 13px; }

/* ---------- Header / nav / footer ---------- */
.site-header {
  background: rgba(6,9,20,.7);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 3px solid; border-image: linear-gradient(90deg,#000 0 33%,#fcdc04 33% 66%,#d90000 66%) 1;
  color: #fff;
}
.header-inner { display: flex; align-items: center; gap: 14px; padding: 12px 18px; }
.hl { width: 46px; height: 46px; border-radius: 50%; flex: none; display: block; }
.brand { color: #fff; text-decoration: none !important; }
.brand h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: 5px; text-transform: uppercase; }
.brand p { margin: 2px 0 0; font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: 2.5px; text-transform: uppercase; color: var(--gold); }
.est { margin-left: auto; font-size: 13px; font-weight: 600; letter-spacing: 2.5px; border: 1px solid #fff5; border-radius: 20px; padding: 4px 12px; color: #fff; }

.site-nav {
  display: flex; gap: 8px; overflow-x: auto;
  background: rgba(6,9,20,.78);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 10px 12px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
}
.site-nav a {
  border: 1px solid var(--line); border-radius: 999px; color: var(--tx);
  padding: 8px 16px; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: 1.5px; white-space: nowrap;
}
.site-nav a:hover { text-decoration: none; border-color: var(--gold); }
.site-nav a.on { background: var(--gold); color: #111; border-color: var(--gold); }
.site-nav a.admin-link { margin-left: auto; border-style: dashed; color: var(--mut); }

.site-footer { border-top: 1px solid var(--line); padding: 18px 0 28px; color: var(--mut); font-size: 12px; text-align: center; }

.alert { border-radius: 8px; padding: 10px 14px; margin-top: 12px; font-size: 14px; }
.alert-success { background: var(--ok-bg); color: #8ff0b0; border: 1px solid #1f5c36; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #6b2620; }

/* ---------- Buttons, tags, forms ---------- */
.btn { background: var(--gold); color: #111; border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 700; letter-spacing: 1.5px; font-size: 15px; cursor: pointer; display: inline-block; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.alt { background: var(--line); color: var(--tx); }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.rate { width: 100%; padding: 10px; font-size: 15px; letter-spacing: 2px; text-transform: uppercase; border-radius: 999px; box-shadow: 0 4px 14px #fcdc0433; }
.tag { display: inline-block; background: var(--line); border-radius: 20px; padding: 2px 10px; font-size: 13px; font-weight: 700; margin-right: 4px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }

select, input[type=text], input[type=email], input[type=password], input[type=number], input[type=file], textarea {
  background: var(--panel); color: var(--tx); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; max-width: 100%;
}
textarea { width: 100%; min-height: 80px; }
.form-grid { display: grid; gap: 12px; max-width: 560px; }
.form-grid label { display: grid; gap: 4px; font-size: 13px; color: var(--mut); }
.form-grid input[type=text], .form-grid input[type=email], .form-grid input[type=password], .form-grid input[type=number], .form-grid select { width: 100%; }
.stat-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* ---------- Panels, tables, timeline ---------- */
.panel { background: rgba(14,20,38,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.panel h3 { margin: 0 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--mut); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.tl { border-left: 3px solid var(--gold); padding-left: 14px; }
.tl div { margin-bottom: 14px; }
.tl b { color: var(--gold); }
.note { font-size: 12px; color: var(--mut); border: 1px dashed var(--line); border-radius: 8px; padding: 8px; margin-top: 16px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions form { margin: 0; }

/* ---------- Player cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card { background: linear-gradient(160deg,#fcdc04,#b8860b 60%,#7a5a00); color: #1a1300; border-radius: 14px; padding: 10px; cursor: pointer; position: relative; transition: transform .15s; border: 2px solid #fff3; }
.card:hover { transform: translateY(-4px) scale(1.03); }
.card .ovr { font-size: 38px; font-weight: 800; line-height: 1; }
.card .pos { font-size: 12px; font-weight: 800; }
.card .av { height: 70px; display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 900; opacity: .35; }
.card .nm { text-align: center; font-weight: 700; font-size: 16px; border-top: 1px solid #0003; padding-top: 6px; }
.card.gk { background: linear-gradient(160deg,#c9d1e8,#7d8bb0 60%,#4a5578); }

.bar { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.bar b { width: 34px; }
.bar input { flex: 1; accent-color: var(--gold); }
.bar span { width: 28px; text-align: right; font-weight: 800; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: #000b; display: none; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.modal.on { display: flex; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; max-width: 420px; width: 100%; max-height: 90%; overflow: auto; }

/* ---------- Games ---------- */
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { display: block; width: 100%; text-align: left; margin: 6px 0; background: var(--line); color: var(--tx); border: 2px solid transparent; border-radius: 8px; padding: 10px; font-size: 14px; cursor: pointer; font-family: inherit; }
.opt.good { border-color: var(--ok); }
.opt.bad { border-color: var(--red); }

/* ---------- Home ---------- */
.homegrid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: center; }
@media (min-width: 760px) { .homegrid { grid-template-columns: 1.1fr 1fr; } }
.homegrid .panel { margin: 0; padding-bottom: 12px; align-self: center; }
.hero small { display: block; font-size: 14px; font-weight: 600; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); }
.hero h2 { font-size: 40px; font-weight: 800; letter-spacing: 3px; line-height: 1; color: #fff; margin: 4px 0 8px; }
.hub { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1; margin: 0 auto; }
.hub::before { content: ""; position: absolute; inset: 12%; border: 1px solid #fcdc0455; border-radius: 50%; }
.sat {
  position: absolute; transform: translate(-50%,-50%); width: 25%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid #fcdc04; color: #fff; font-weight: 700; font-size: 14px; letter-spacing: 2px; text-transform: uppercase;
  background: radial-gradient(circle at 30% 25%,#26345c,#0a0f20 75%);
  box-shadow: 0 6px 18px #0009, inset 0 0 12px #fcdc0422;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  transition: transform .15s, background .15s;
}
.sat:hover { text-decoration: none; transform: translate(-50%,-50%) scale(1.1); box-shadow: 0 0 22px #fcdc0488, inset 0 0 12px #fcdc0433; }
.sat svg { width: 34%; fill: none; stroke: var(--gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ctr {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 40%; aspect-ratio: 1; border-radius: 50%;
  border: 4px solid #fcdc04; background: radial-gradient(circle,#1d2a4d,#0b0f1a);
  box-shadow: 0 0 0 7px #fcdc0422, 0 0 50px #fcdc0466, inset 0 0 30px #000;
  display: flex; align-items: center; justify-content: center;
}
.lg { aspect-ratio: 1; border-radius: 50%; background: #fff; object-fit: cover; display: block; }
.ctr .lg { width: 78%; box-shadow: 0 0 0 2px #fcdc04; }
.hl .lg { width: 100%; }
@media (max-width: 480px) { .sat { font-size: 11px; letter-spacing: 1px; } .brand h1 { font-size: 18px; letter-spacing: 3px; } .hero h2 { font-size: 30px; } }

/* Top-3 leaderboard */
.lh, .lr { display: grid; grid-template-columns: 22px 40px minmax(0,1fr) 46px; gap: 10px; align-items: center; }
.lh { padding: 0 10px 4px; font-family: var(--font-display); font-weight: 600; font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--mut); }
.lh span:first-child, .lh span:last-child { text-align: center; }
.lr { padding: 8px 10px; margin-bottom: 6px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.lr.top { border-color: var(--gold); background: linear-gradient(90deg,#fcdc0426,rgba(255,255,255,.03)); }
.rk { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--gold); text-align: center; }
.mn { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mn b { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn .mut { font-size: 11px; }
.sc { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.sc b { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--gold); }
.sc span { font-size: 9px; letter-spacing: 1.5px; color: var(--mut); margin-top: 3px; }
.tt { text-align: right; font-size: 11px; color: var(--mut); margin: 0 2px 8px; }
.track { height: 5px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 3px 0 0; }
.track i { display: block; height: 100%; background: linear-gradient(90deg,var(--gold),var(--red)); transition: width .5s; }
.live { font-size: 11px; color: var(--ok); }
.live::before { content: "●"; margin-right: 4px; animation: bl 1.2s infinite; }
@keyframes bl { 50% { opacity: .2; } }

.ph { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(160deg,var(--gold),#b8860b); color: #1a1300; font-weight: 900; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 14px; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.lr .ph { width: 40px; height: 40px; box-shadow: 0 0 0 1.5px var(--gold); }
@media (max-width: 480px) { .sc b { font-size: 22px; } .mn b { font-size: 15px; } }

/* ---------- Squad / pitch ---------- */
.sqh { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.fm { display: flex; gap: 6px; }
.fm a { border: 1px solid var(--line); background: rgba(14,20,38,.7); color: var(--tx); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 15px; letter-spacing: 1px; }
.fm a:hover { text-decoration: none; border-color: var(--gold); }
.fm a.on { background: var(--gold); color: #111; border-color: var(--gold); }
.pitch {
  position: relative; max-width: 560px; margin: 14px auto 0; aspect-ratio: 100/130; border-radius: 16px; overflow: hidden;
  background: repeating-linear-gradient(180deg,#2a8239 0 7.69%,#35a045 7.69% 15.38%);
  border: 4px solid #0c2a16; box-shadow: 0 14px 44px #000c, inset 0 0 40px #0006;
}
.pitch::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 40%,rgba(255,255,255,.14),transparent 55%), radial-gradient(ellipse at 50% 50%,transparent 55%,rgba(0,0,0,.5)); }
.pitch > svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.pn { position: absolute; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; width: 64px; cursor: pointer; z-index: 2; }
.pa { position: relative; width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(160deg,var(--gold),#b8860b); border: 2px solid #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; font-size: 16px; color: #1a1300; box-shadow: 0 7px 10px -3px #000b; transition: transform .15s; }
.pa img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pn:hover .pa { transform: scale(1.12); }
.pa em { position: absolute; top: -7px; right: -10px; font-style: normal; background: #0b0f1a; color: var(--gold); font-family: var(--font-display); font-weight: 700; font-size: 12px; line-height: 1; border-radius: 8px; padding: 2px 5px; border: 1px solid var(--gold); }
.pn b { margin-top: 4px; font-family: var(--font-display); font-size: 14px; font-weight: 600; color: #fff; letter-spacing: .5px; white-space: nowrap; background: #000b; padding: 0 7px; border-radius: 6px; }
.pn small { font-size: 9px; letter-spacing: 1px; color: #fffc; margin-top: 1px; }
@media (max-width: 480px) { .pn { width: 52px; } .pa { width: 34px; height: 34px; font-size: 13px; } .pn b { font-size: 12px; padding: 0 5px; } .pa em { font-size: 10px; right: -12px; } }

.coach { display: flex; gap: 14px; align-items: center; }
.cph { width: 64px; height: 64px; font-size: 24px; flex: none; box-shadow: 0 0 0 2px var(--gold); }
.ci { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ci b { font-family: var(--font-display); font-size: 24px; letter-spacing: .5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* ---------- Admin ---------- */
.admin-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-bar a { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; color: var(--tx); font-weight: 600; font-size: 14px; }
.admin-bar a.on { background: var(--gold); color: #111; border-color: var(--gold); }
.admin-bar a:hover { text-decoration: none; border-color: var(--gold); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile { background: rgba(14,20,38,.72); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat-tile b { display: block; font-family: var(--font-display); font-size: 34px; color: var(--gold); line-height: 1; }
.thumb { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.login-box { max-width: 380px; margin: 40px auto; }
