@font-face { font-family: Cairo; font-weight: 400; font-display: swap; src: url(/fonts/cairo-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; font-weight: 600; font-display: swap; src: url(/fonts/cairo-arabic-600-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; font-weight: 700; font-display: swap; src: url(/fonts/cairo-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; font-weight: 800; font-display: swap; src: url(/fonts/cairo-arabic-800-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: Cairo; font-weight: 400; font-display: swap; src: url(/fonts/cairo-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }
@font-face { font-family: Cairo; font-weight: 600; font-display: swap; src: url(/fonts/cairo-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }
@font-face { font-family: Cairo; font-weight: 700; font-display: swap; src: url(/fonts/cairo-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }
@font-face { font-family: Cairo; font-weight: 800; font-display: swap; src: url(/fonts/cairo-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF; }

:root {
  --red: #C8102E; --red-deep: #7A0A1C; --red-soft: #FBE9EC;
  --ink: #17171B; --muted: #6E6E78; --line: #ECE7E2; --bg: #F7F4F0; --card: #FFFFFF; --gold: #D9A441; --green: #1E8E5A;
  --radius: 20px; --shadow: 0 6px 22px rgba(30, 10, 14, .08);
  --card-bg: linear-gradient(140deg, #D3132F 0%, #9C0B22 55%, #5E0613 100%);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Cairo, system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; }
body { min-height: 100vh; padding-bottom: calc(84px + var(--safe-b)); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }

/* ---------- header: big logo overlapping the bottom edge ---------- */
.topbar { position: sticky; top: 0; z-index: 20; height: calc(70px + var(--safe-t)); padding-top: var(--safe-t);
  background: linear-gradient(180deg, #B00D26, #8E0A1F); box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.brand { position: absolute; left: 50%; transform: translateX(-50%); top: calc(10px + var(--safe-t)); height: 96px; display: flex; align-items: center; justify-content: center; }
.brand img { height: 96px; width: auto; filter: drop-shadow(0 4px 8px rgba(0,0,0,.25)); }
.wordmark { font-weight: 800; font-size: 26px; color: #fff; background: var(--red-deep); padding: 6px 20px; border-radius: 40px; border: 3px solid #fff; letter-spacing: .5px; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.avatar-btn { position: absolute; inset-inline-start: 14px; top: calc(9px + var(--safe-t)); width: 54px; height: 54px; border: 0; background: none; padding: 0; cursor: pointer; }
.avatar { display: block; width: 54px; height: 54px; border-radius: 50%; border: 3px solid #fff; background: #f1d9dd center/cover no-repeat; color: var(--red-deep); font-weight: 800; font-size: 22px; line-height: 48px; text-align: center; overflow: hidden; }
.avatar.sm { width: 40px; height: 40px; line-height: 36px; font-size: 16px; border-width: 2px; border-color: var(--line); flex: none; }
.avatar.lg { width: 96px; height: 96px; line-height: 90px; font-size: 36px; margin: 0 auto; border-color: var(--red); }
.dot { position: absolute; top: 1px; inset-inline-end: 1px; width: 16px; height: 16px; border-radius: 50%; background: #FF1E3C; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(255,30,60,.35); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255,30,60,0); } }

.view { padding: 44px 14px 20px; max-width: 720px; margin: 0 auto; }
.page-title { text-align: center; font-size: 22px; font-weight: 800; margin: 8px 0 14px; }
.section-title { text-align: center; font-size: 18px; font-weight: 800; margin: 22px 0 10px; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-around; background: #fff;
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); box-shadow: 0 -4px 18px rgba(0,0,0,.06); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border-radius: 14px; color: var(--muted); font-size: 12px; font-weight: 700; }
.tabbar .ico { font-size: 27px; line-height: 1.15; filter: grayscale(.35); transition: transform .15s; }
.tabbar a.on { color: var(--red); }
.tabbar a.on .ico { filter: none; transform: scale(1.12); }

/* ---------- sliding cards ---------- */
.slider { position: relative; margin: 0 -14px; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; padding: 4px 14px 8px; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 88%; scroll-snap-align: center; min-height: 206px; border-radius: 24px; padding: 18px; color: #fff; position: relative; overflow: hidden;
  background: var(--photo, none) center/cover, var(--card-bg); box-shadow: 0 10px 26px rgba(120, 8, 28, .28); cursor: pointer; display: flex; flex-direction: column; }
.slide::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(40,0,8,.15), rgba(40,0,8,.62)); pointer-events: none; }
.slide > * { position: relative; }
.slide .kicker { text-align: center; font-weight: 800; font-size: 15px; opacity: .95; letter-spacing: .3px; }
.slide .big { text-align: center; font-size: 40px; font-weight: 800; line-height: 1.1; margin: 6px 0; }
.slide .sub { text-align: center; font-size: 14px; opacity: .92; }
.slide .grow { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 4px; background: #D8CFC8; transition: all .25s; }
.dots i.on { width: 22px; background: var(--red); }

.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.vs .t { text-align: center; font-weight: 800; font-size: 16px; line-height: 1.3; }
.vs .crest { width: 54px; height: 54px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800;
  background: rgba(255,255,255,.95); color: var(--red-deep); box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); }
.vs .score { font-size: 42px; font-weight: 800; min-width: 96px; text-align: center; }
.sc { display: inline-flex; align-items: center; gap: .28em; }
.sc i { font-style: normal; opacity: .7; }
.vs .t { font-size: 18px; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--red); font-weight: 800; font-size: 13px; padding: 2px 12px; border-radius: 20px; }
.live-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.center { text-align: center; }

/* ---------- strip (horizontal moving list) ---------- */
.strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 14px 10px; margin: 0 -14px; scroll-snap-type: x proximity; }
.strip::-webkit-scrollbar { display: none; }
.mini { flex: 0 0 170px; scroll-snap-align: start; background: var(--card); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); border-top: 4px solid var(--red); cursor: pointer; }
.mini .when { text-align: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.mini .teams { text-align: center; font-weight: 800; font-size: 14px; margin-top: 6px; line-height: 1.5; }

/* ---------- generic cards / lists ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.match-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; cursor: pointer; }
.match-row .side { font-weight: 800; font-size: 15px; text-align: center; }
.match-row .side.ours { color: var(--red); }
.match-row .mid { text-align: center; min-width: 86px; }
.match-row .res { font-size: 24px; font-weight: 800; }
.match-row .time { font-size: 13px; font-weight: 700; color: var(--muted); }
.meta { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 1px 10px; border-radius: 12px; background: var(--red-soft); color: var(--red); }
.badge.green { background: #E3F4EC; color: var(--green); }
.badge.gold { background: #FBF0DA; color: #9A6B10; }

.tabs { display: flex; background: #EFE9E3; border-radius: 16px; padding: 4px; margin: 0 0 14px; gap: 4px; }
.tabs button { flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 12px; font-weight: 800; font-size: 15px; color: var(--muted); cursor: pointer; }
.tabs button.on { background: #fff; color: var(--red); box-shadow: 0 2px 8px rgba(0,0,0,.08); }

table.league { width: 100%; border-collapse: collapse; font-size: 14px; }
table.league th { color: var(--muted); font-weight: 700; padding: 8px 4px; font-size: 12px; }
table.league td { padding: 9px 4px; text-align: center; border-top: 1px solid var(--line); font-weight: 600; }
table.league td.tm { text-align: start; font-weight: 800; }
table.league tr.ours td { background: var(--red-soft); color: var(--red-deep); }
table.league td.pts { font-weight: 800; }

/* ---------- forms ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 5px; text-align: start; }
.input, select.input, textarea.input { width: 100%; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .15s; }
.input:focus { border-color: var(--red); }
textarea.input { min-height: 90px; resize: vertical; }
.pw { position: relative; }
.pw .input { padding-inline-end: 52px; }
.eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 22px; width: 42px; height: 42px; cursor: pointer; border-radius: 10px; }
.btn { display: block; width: 100%; border: 0; border-radius: 16px; padding: 13px; font-weight: 800; font-size: 17px; cursor: pointer; background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(200,16,46,.28); transition: transform .1s; text-align: center; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: #fff; color: var(--red); border: 2px solid var(--red); box-shadow: none; }
.btn.dark { background: var(--ink); box-shadow: none; }
.btn.sm { width: auto; display: inline-block; padding: 8px 16px; font-size: 14px; border-radius: 12px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.linkbtn { border: 0; background: none; color: var(--red); font-weight: 800; cursor: pointer; padding: 8px; display: block; margin: 6px auto; font-size: 15px; }
.err { color: var(--red); font-weight: 700; text-align: center; min-height: 22px; margin: 4px 0 8px; font-size: 14px; }

/* auth */
.auth { max-width: 420px; margin: 0 auto; }
.auth .hero { border-radius: 26px; min-height: 150px; margin-bottom: 18px; background: var(--photo, none) center/cover, var(--card-bg); display: grid; place-items: center; color: #fff; text-align: center; padding: 20px; position: relative; overflow: hidden; }
.auth .hero::before { content: ''; position: absolute; inset: 0; background: rgba(40,0,8,.35); }
.auth .hero > * { position: relative; }
.auth .hero h1 { margin: 0; font-size: 30px; font-weight: 800; }
.auth .hero p { margin: 4px 0 0; font-weight: 600; opacity: .9; }

/* score stepper (no typing needed) */
.stepper { display: flex; align-items: center; justify-content: center; gap: 10px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--red-soft); color: var(--red); font-size: 26px; font-weight: 800; cursor: pointer; line-height: 1; }
.stepper .val { font-size: 34px; font-weight: 800; min-width: 40px; text-align: center; }
.predict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.predict-grid .tname { text-align: center; font-weight: 800; margin-bottom: 6px; }

/* leaderboard */
.lb-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line); }
.lb-row:first-child { border-top: 0; }
.lb-row .rk { width: 34px; text-align: center; font-weight: 800; font-size: 18px; }
.lb-row .nm { flex: 1; font-weight: 700; }
.lb-row .pt { font-weight: 800; color: var(--red); }
.lb-row.me { background: var(--red-soft); border-radius: 12px; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 6px 0 4px; }
.podium .p { text-align: center; }
.podium .p .avatar { margin: 0 auto 4px; }
.podium .n { font-weight: 800; font-size: 14px; }
.podium .medal { font-size: 26px; }

/* community */
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.post-head .who { flex: 1; }
.post-head .nm { font-weight: 800; }
.post-head .tm { font-size: 12px; color: var(--muted); }
.post-body { white-space: pre-wrap; line-height: 1.7; font-size: 16px; overflow-wrap: anywhere; }
.post-img { border-radius: 16px; margin-top: 10px; width: 100%; max-height: 420px; object-fit: cover; }
.post-actions { display: flex; gap: 6px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.post-actions button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 12px; font-weight: 700; cursor: pointer; color: var(--muted); font-size: 14px; }
.post-actions button.on { color: var(--red); }
.opt { position: relative; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 8px; cursor: pointer; overflow: hidden; font-weight: 700; display: flex; justify-content: space-between; }
.opt .bar { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--red-soft); z-index: 0; transition: width .4s; }
.opt > span { position: relative; z-index: 1; }
.opt.mine { border-color: var(--red); }
.composer-tools { display: flex; gap: 8px; margin-top: 8px; }
.composer-tools .btn { flex: 1; }
.chip { display: inline-block; border: 0; background: #EFE9E3; padding: 8px 14px; border-radius: 14px; font-weight: 700; cursor: pointer; font-size: 14px; }
.chip.on { background: var(--red); color: #fff; }
.comment { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.comment .b { flex: 1; background: #F4EFEA; border-radius: 14px; padding: 8px 12px; }
.comment .b .nm { font-weight: 800; font-size: 14px; }

/* more */
.menu { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.menu > * { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-top: 1px solid var(--line); width: 100%; background: none; border-inline: 0; border-bottom: 0; text-align: start; font-weight: 700; font-size: 16px; cursor: pointer; }
.menu > *:first-child { border-top: 0; }
.menu .ico { font-size: 24px; width: 30px; text-align: center; }
.menu .grow { flex: 1; }
.menu .danger { color: var(--red); }
.switch { width: 52px; height: 30px; border-radius: 16px; background: #D8D2CC; position: relative; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.switch.on { background: var(--red); }
.switch.on::after { inset-inline-start: 25px; }
.profile-card { text-align: center; padding: 20px 14px; }
.profile-card .nm { font-size: 20px; font-weight: 800; margin-top: 8px; }
.profile-card .stat { display: flex; justify-content: center; gap: 26px; margin-top: 10px; }
.profile-card .stat b { display: block; font-size: 22px; color: var(--red); }

/* notifications */
.notif { display: flex; gap: 10px; padding: 12px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.notif:first-child { border-top: 0; }
.notif .ic { font-size: 24px; }
.notif .tt { font-weight: 800; }
.notif .bd { color: var(--muted); font-size: 14px; }
.notif.unread .tt::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-inline-start: 6px; vertical-align: middle; }

/* match sheet */
.sheet { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-bar { position: relative; height: calc(58px + var(--safe-t)); padding-top: var(--safe-t); display: flex; align-items: center; justify-content: center; background: #fff; border-bottom: 1px solid var(--line); flex: none; }
.sheet-title { margin: 0; font-size: 18px; font-weight: 800; text-align: center; padding: 0 60px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-close { position: absolute; inset-inline-end: 10px; top: calc(9px + var(--safe-t)); width: 40px; height: 40px; border-radius: 50%; border: 0; background: #F1ECE7; font-size: 18px; cursor: pointer; font-weight: 800; }
.sheet-body { flex: 1; overflow-y: auto; padding: 14px 14px calc(30px + var(--safe-b)); max-width: 720px; width: 100%; margin: 0 auto; }
.scoreboard { border-radius: 24px; padding: 18px 14px; color: #fff; background: var(--photo, none) center/cover, var(--card-bg); position: relative; overflow: hidden; margin-bottom: 14px; }
.scoreboard::before { content: ''; position: absolute; inset: 0; background: rgba(40,0,8,.35); }
.scoreboard > * { position: relative; }
.ev { display: grid; grid-template-columns: 1fr 50px 1fr; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ev:first-child { border-top: 0; }
.ev .m { text-align: center; font-weight: 800; color: var(--red); }
.ev .h { text-align: end; }
.ev .a { text-align: start; }
.ev .who { font-weight: 700; }
.ev .ty { font-size: 12px; color: var(--muted); }
.stat-row { margin: 12px 0; }
.stat-row .lab { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; }
.stat-row .lab span:nth-child(2) { color: var(--muted); font-weight: 700; }
.stat-row .bars { display: flex; gap: 4px; margin-top: 5px; }
.stat-row .bars i { height: 8px; border-radius: 4px; background: var(--red); }
.stat-row .bars i + i { background: #CFC6BF; }
.lineup { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lineup h4 { margin: 0 0 6px; text-align: center; }
.lineup .pl { font-size: 14px; padding: 5px 0; border-top: 1px solid var(--line); display: flex; gap: 6px; }
.lineup .pl b { width: 24px; color: var(--red); text-align: center; }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--safe-b)); z-index: 80; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 16px; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 92%; text-align: center; animation: up .2s; }

.empty { text-align: center; color: var(--muted); font-weight: 700; padding: 26px 10px; }
.skeleton { height: 206px; border-radius: 24px; background: linear-gradient(90deg, #EEE7E1, #F7F2EE, #EEE7E1); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* admin */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: #fff; border-radius: 18px; padding: 14px; box-shadow: var(--shadow); text-align: center; border-top: 4px solid var(--red); }
.kpi b { display: block; font-size: 28px; color: var(--red); }
.kpi span { font-size: 13px; font-weight: 700; color: var(--muted); }
.admin-list .item { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.admin-list .item:first-child { border-top: 0; }
.admin-list .item .grow { flex: 1; min-width: 140px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
