:root {
  --black: #0a0a0a;
  --navy: #1a1a2e;
  --gold: #f5a623;
  --gold-light: #ffcf6e;
  --gold-dark: #b87a12;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #facc15;
  --glass: rgba(26, 26, 46, 0.55);
  --border: rgba(245, 166, 35, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--black);
  color: #f0f0f5;
  min-height: 100vh;
  overflow-x: hidden;
}
.num { font-family: 'Inter', 'Vazirmatn', sans-serif; font-feature-settings: 'tnum'; letter-spacing: -0.01em; }

.app-shell {
  min-height: 100vh;
  background: linear-gradient(180deg, #0a0a0a 0%, #14142a 45%, #0a0a0a 100%);
  position: relative;
  padding-bottom: 90px;
}
.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px circle at 20% 10%, rgba(245,166,35,0.08), transparent 60%),
    radial-gradient(500px circle at 90% 80%, rgba(245,166,35,0.06), transparent 55%);
}

/* ---------- Header ---------- */
.app-header {
  position: relative; z-index: 2;
  padding: 18px 16px 14px;
  background: linear-gradient(180deg, rgba(26,26,46,0.85), rgba(10,10,10,0.2));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-top { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo-ball { font-size: 26px; filter: drop-shadow(0 0 8px rgba(245,166,35,.6)); animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.logo-text {
  font-weight: 900; font-size: 20px; font-family: 'Inter', sans-serif;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.conn { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 20px; }
.conn.on { color: var(--green); background: rgba(16,185,129,.12); }
.conn.off { color: var(--red); background: rgba(239,68,68,.12); }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.header-date { margin-top: 8px; font-size: 13px; color: #b8b8c8; }

/* ---------- Main ---------- */
.main-content { position: relative; z-index: 1; padding: 16px; max-width: 1100px; margin: 0 auto; }
.screen { animation: slideUp .4s ease; }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.stat-card {
  padding: 16px 10px; border-radius: 18px; text-align: center;
  background: rgba(26,26,46,0.6); border: 1px solid rgba(255,255,255,.06);
  border-top: 2px solid; box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.gold-stat { border-color: var(--gold) !important; background: linear-gradient(160deg, rgba(245,166,35,.14), rgba(26,26,46,.7)); box-shadow: 0 6px 24px rgba(245,166,35,.18); }
.stat-icon { font-size: 20px; margin-bottom: 4px; }
.stat-val { font-size: 30px; font-weight: 800; font-family: 'Inter', sans-serif; line-height: 1; }
.gold-text { background: linear-gradient(90deg, var(--gold), var(--gold-light)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-lbl { font-size: 11px; color: #9a9ab0; margin-top: 6px; }

/* ---------- Section head ---------- */
.section-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.section-head h2 { font-size: 18px; font-weight: 700; color: #fff; }
.count-pill { background: rgba(245,166,35,.15); color: var(--gold); font-size: 13px; padding: 2px 12px; border-radius: 20px; font-weight: 700; }

/* ---------- Card grid ---------- */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .card-grid { grid-template-columns: 1fr 1fr 1fr; } }

/* ---------- Match card ---------- */
.match-card {
  position: relative; padding: 18px 14px 16px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border); transition: transform .25s, box-shadow .25s;
}
.match-card:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(245,166,35,.15); }
.match-status-chip { position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 14px; }
.match-teams { display: flex; align-items: center; justify-content: space-around; margin: 14px 0 10px; }
.team-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
.team-avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-family: 'Inter', sans-serif; text-transform: uppercase;
}
.team-name { font-size: 13px; font-weight: 600; text-align: center; max-width: 90px; }
.vs-block { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 8px; }
.vs-text {
  font-weight: 900; font-size: 18px; font-family: 'Inter', sans-serif;
  background: linear-gradient(90deg, var(--gold), var(--gold-light)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.vs-text.big { font-size: 28px; }
.score-mini { font-size: 15px; font-weight: 800; color: #fff; background: rgba(0,0,0,.35); padding: 2px 8px; border-radius: 8px; }
.match-time { text-align: center; font-size: 12px; color: #9a9ab0; margin-bottom: 10px; }
.pred-badge {
  display: inline-block; background: linear-gradient(90deg, rgba(245,166,35,.2), rgba(245,166,35,.08));
  border: 1px solid rgba(245,166,35,.4); color: var(--gold-light);
  font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 12px;
  margin: 0 auto 12px; text-align: center; width: 100%;
}
.center-badge { display: block; }

/* ---------- Confidence ---------- */
.conf-wrap { display: flex; align-items: center; gap: 8px; }
.conf-track { flex: 1; height: 8px; background: rgba(255,255,255,.08); border-radius: 20px; overflow: hidden; }
.conf-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light)); border-radius: 20px; box-shadow: 0 0 10px rgba(245,166,35,.5); transition: width 1s ease; }
.conf-label { font-size: 12px; font-weight: 700; color: var(--gold); min-width: 38px; text-align: left; }

.result-btn {
  width: 100%; margin-top: 12px; padding: 9px; border: none; border-radius: 12px; cursor: pointer;
  background: rgba(245,166,35,.15); color: var(--gold); font-family: inherit; font-weight: 700; font-size: 13px;
  border: 1px solid rgba(245,166,35,.35); transition: .2s;
}
.result-btn:hover { background: rgba(245,166,35,.28); }

/* ---------- Empty ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: #8a8aa0; }
.empty-emoji { font-size: 56px; margin-bottom: 12px; }
.empty-state p { font-size: 17px; font-weight: 700; color: #c0c0d0; }
.empty-state span { font-size: 13px; display: block; margin-top: 8px; }

/* ---------- Gold button ---------- */
.gold-btn {
  position: relative; border: none; cursor: pointer; padding: 0; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  box-shadow: 0 6px 22px rgba(245,166,35,.35); font-family: inherit; overflow: hidden;
}
.gold-btn-inner {
  display: block; padding: 13px 22px; color: #1a1200; font-weight: 800; font-size: 15px; position: relative; z-index: 2;
}
.gold-btn::after {
  content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.35);
  transform: translateX(-120%) skewX(-20deg); transition: transform .6s;
}
.gold-btn:hover::after { transform: translateX(120%) skewX(-20deg); }
.gold-btn.ripple:active { transform: scale(.97); }
.gold-btn.full { width: 100%; }
.gold-btn.disabled { opacity: .4; pointer-events: none; }

.floating-add-wrap { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 20; width: min(90%, 360px); }
.floating-add { width: 100%; box-shadow: 0 8px 30px rgba(245,166,35,.5); }

/* ---------- Login ---------- */
.login-box, .form-box, .detail-box, .admin-panel { max-width: 460px; margin: 20px auto; padding: 26px 22px; border-radius: 22px; }
.login-logo { font-size: 46px; text-align: center; margin-bottom: 8px; }
.login-box h2, .form-title { text-align: center; font-size: 20px; font-weight: 800; margin-bottom: 6px; color: #fff; }
.muted { text-align: center; color: #8a8aa0; font-size: 13px; margin-bottom: 18px; }
.field {
  width: 100%; padding: 13px 14px; border-radius: 12px; margin-bottom: 4px;
  background: rgba(10,10,20,.6); border: 1px solid rgba(255,255,255,.1); color: #fff;
  font-family: inherit; font-size: 14px; outline: none; transition: border .2s;
}
.field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,166,35,.15); }
.field::placeholder { color: #66667a; }
.field.area { resize: vertical; min-height: 70px; }
.pw-field { text-align: center; letter-spacing: 8px; font-size: 20px; margin: 14px 0; }
.field-label { display: block; font-size: 13px; color: #b8b8c8; margin: 14px 0 6px; font-weight: 600; }
.err-txt { color: var(--red); text-align: center; font-size: 13px; margin-bottom: 10px; }
.link-btn { display: block; margin: 14px auto 0; background: none; border: none; color: #8a8aa0; font-family: inherit; cursor: pointer; font-size: 13px; }
.hint { text-align: center; margin-top: 14px; font-size: 12px; color: #66667a; }

/* ---------- Form ---------- */
.date-preview { font-size: 12px; color: var(--gold-light); margin: 4px 0 4px; background: rgba(245,166,35,.08); padding: 6px 10px; border-radius: 8px; }
.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.slider { flex: 1; -webkit-appearance: none; appearance: none; height: 8px; border-radius: 20px; background: rgba(255,255,255,.1); outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-light)); cursor: pointer; box-shadow: 0 2px 10px rgba(245,166,35,.6); border: 2px solid #1a1200; }
.slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); cursor: pointer; border: 2px solid #1a1200; }
.slider-val { min-width: 48px; text-align: center; font-weight: 800; font-size: 15px; }
.form-actions { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.ghost-btn { padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.15); background: transparent; color: #c0c0d0; font-family: inherit; font-weight: 600; cursor: pointer; transition: .2s; }
.ghost-btn:hover { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.3); }
.ghost-btn.full-w { width: 100%; margin-top: 14px; }

/* ---------- Result recording ---------- */
.result-teams { text-align: center; font-size: 17px; font-weight: 700; margin: 8px 0 12px; color: #fff; }
.winner-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.winner-btn { padding: 16px 6px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(10,10,20,.5); color: #c0c0d0; font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer; transition: .2s; }
.winner-btn.active { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: #1a1200; border-color: var(--gold); box-shadow: 0 4px 16px rgba(245,166,35,.4); }
.steppers-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.stepper-block { text-align: center; }
.stepper-label { font-size: 13px; color: #b8b8c8; display: block; margin-bottom: 8px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 12px; }
.step-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(245,166,35,.35); background: rgba(245,166,35,.1); color: var(--gold); font-size: 22px; font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.step-btn:active { transform: scale(.92); }
.step-val { font-size: 26px; font-weight: 800; min-width: 30px; }
.auto-guess { margin-top: 20px; text-align: center; font-size: 14px; background: rgba(0,0,0,.25); padding: 14px; border-radius: 14px; }
.toggle-correct { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.toggle-btn { flex: 1; max-width: 120px; padding: 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: transparent; color: #c0c0d0; font-family: inherit; font-weight: 700; cursor: pointer; }
.toggle-btn.on-correct { background: rgba(16,185,129,.2); border-color: var(--green); color: var(--green); }
.toggle-btn.on-wrong { background: rgba(239,68,68,.2); border-color: var(--red); color: var(--red); }

/* ---------- Detail ---------- */
.detail-status { display: inline-block; font-size: 13px; font-weight: 700; padding: 5px 14px; border-radius: 16px; margin-bottom: 16px; }
.detail-teams { display: flex; align-items: center; justify-content: space-around; margin-bottom: 20px; }
.detail-vs { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.detail-score { font-size: 20px; font-weight: 800; color: #fff; background: rgba(0,0,0,.35); padding: 4px 12px; border-radius: 10px; }
.detail-team-name { font-size: 15px; font-weight: 700; text-align: center; }
.detail-row { text-align: center; color: #9a9ab0; font-size: 14px; margin-bottom: 18px; }
.detail-section { margin-bottom: 18px; }
.detail-lbl { display: block; font-size: 12px; color: #8a8aa0; margin-bottom: 8px; font-weight: 600; }
.big-badge { font-size: 15px; padding: 10px 14px; }
.detail-desc { color: #d0d0dc; font-size: 14px; line-height: 1.9; background: rgba(0,0,0,.2); padding: 12px; border-radius: 12px; }
.final-result { font-size: 24px; font-weight: 800; color: #fff; }
.winner-tag { font-size: 14px; color: var(--gold); font-weight: 600; }
.detail-admin-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

/* ---------- History ---------- */
.filter-row { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 4px; }
.filter-btn { flex-shrink: 0; padding: 8px 18px; border-radius: 20px; border: 1px solid rgba(255,255,255,.12); background: rgba(26,26,46,.5); color: #b8b8c8; font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; transition: .2s; }
.filter-btn.active { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: #1a1200; border-color: var(--gold); }
.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist-card { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-radius: 16px; background: rgba(26,26,46,.55); border: 1px solid rgba(255,255,255,.06); }
.hist-main { flex: 1; cursor: pointer; }
.hist-teams { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.hist-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hist-pred { font-size: 12px; color: var(--gold-light); background: rgba(245,166,35,.12); padding: 2px 8px; border-radius: 8px; }
.hist-date { font-size: 11px; color: #8a8aa0; }
.hist-right { display: flex; align-items: center; gap: 10px; }
.hist-status { font-size: 16px; }
.trash-btn { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25); border-radius: 10px; padding: 6px 10px; cursor: pointer; font-size: 15px; }
.confirm-del { display: flex; gap: 6px; }
.del-yes { background: var(--red); color: #fff; border: none; border-radius: 8px; padding: 6px 10px; font-family: inherit; font-weight: 700; font-size: 12px; cursor: pointer; }
.del-no { background: rgba(255,255,255,.1); color: #fff; border: none; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.clear-all-wrap { margin-top: 24px; text-align: center; }
.danger-btn { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.4); color: var(--red); padding: 12px 20px; border-radius: 12px; font-family: inherit; font-weight: 700; cursor: pointer; }
.confirm-all { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); padding: 16px; border-radius: 14px; }
.confirm-all span { display: block; margin-bottom: 12px; font-weight: 700; }
.confirm-all button { margin: 0 4px; }

/* ---------- Admin panel ---------- */
.admin-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 16px 0; }
.astat { text-align: center; padding: 12px 4px; background: rgba(10,10,20,.5); border-radius: 12px; }
.astat b { display: block; font-size: 22px; font-weight: 800; }
.astat span { font-size: 10px; color: #9a9ab0; }
@media (max-width: 480px) { .admin-stats { grid-template-columns: repeat(3, 1fr); } }
.best-pred { background: rgba(245,166,35,.1); border: 1px solid rgba(245,166,35,.3); border-radius: 12px; padding: 12px; font-size: 13px; margin-bottom: 18px; color: #d0d0dc; }
.best-pred b { color: var(--gold-light); }
.admin-actions-grid { display: flex; flex-direction: column; gap: 10px; }
.panel-btn { padding: 13px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: rgba(26,26,46,.6); color: #e0e0ec; font-family: inherit; font-weight: 600; font-size: 14px; cursor: pointer; transition: .2s; }
.panel-btn:hover { background: rgba(245,166,35,.1); border-color: rgba(245,166,35,.3); }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: rgba(15,15,28,0.92); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border); padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; color: #7a7a92; font-family: inherit; cursor: pointer; padding: 4px 22px; transition: .2s; }
.nav-item.active { color: var(--gold); }
.nav-icon { font-size: 20px; }
.nav-lbl { font-size: 11px; font-weight: 600; }

/* ---------- Footer ---------- */
.app-footer { position: relative; z-index: 1; text-align: center; padding: 24px 16px 20px; margin-top: 20px; border-top: 1px solid rgba(255,255,255,.06); }
.disclaimer { font-size: 12px; color: #7a7a92; line-height: 1.7; max-width: 400px; margin: 0 auto 8px; }
.last-upd { font-size: 11px; color: #66667a; margin-bottom: 6px; }
.copyright { font-size: 11px; color: #8a8aa0; }
.remix-link { color: var(--gold); text-decoration: none; }
.remix-link:hover { text-decoration: underline; }

/* ---------- 404 Not Found ---------- */
.notfound-box { max-width: 460px; margin: 30px auto; padding: 40px 24px; border-radius: 22px; text-align: center; }
.notfound-code {
  font-size: 72px; font-weight: 900; line-height: 1;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 20px rgba(245,166,35,.35));
}
.notfound-ball { font-size: 46px; margin: 6px 0 14px; animation: spin 6s linear infinite; }
.notfound-title { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.notfound-text { font-size: 14px; color: #a0a0b4; line-height: 1.9; margin-bottom: 24px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); z-index: 100;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: #1a1200;
  padding: 12px 24px; border-radius: 30px; font-weight: 800; font-size: 14px;
  box-shadow: 0 8px 30px rgba(245,166,35,.5); animation: toastIn .3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Animations ---------- */
.fade-up { animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* date input color fix */
input[type="datetime-local"] { color-scheme: dark; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(245,166,35,.3); border-radius: 10px; }