/* IQI AG Warriors — shared mobile-first stylesheet
   Theme: AG shield palette (red + gold + silver on charcoal/black). */

:root {
  --color-primary:      #C8102E; /* primary red — buttons, active states, accents */
  --color-primary-dark: #8C0000; /* pressed states, gradients */
  --color-gold:         #C8A064; /* gold trim — badges, highlights, streak/rewards */
  --color-silver:       #C0C0C0; /* secondary text/icons on dark */
  --color-charcoal:     #181818; /* dark-theme background */
  --color-black:        #000000; /* deepest background / headers */
  --color-surface:      #FFFFFF; /* card surfaces in light mode */
  --color-text:         #1A1A1A; /* body text on light surfaces */

  --bg:        var(--color-charcoal);
  --bg-deep:   var(--color-black);
  --card:      #232323;
  --card-line: #333;
  --on-dark:   #F2F2F2;
  --muted:     var(--color-silver);
  --radius:    14px;
  --gap:       16px;
  --header-h:  56px;
  --nav-h:     62px;
  --safe-b:    env(safe-area-inset-bottom, 0px);
  --maxw:      640px;
  font-size: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-deep);
  color: var(--on-dark);
  line-height: 1.45;
  overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: var(--color-gold); }

/* ---- App frame ---- */
#app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.appbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: linear-gradient(180deg, var(--color-black), var(--color-charcoal));
  border-bottom: 1px solid var(--card-line);
}
.appbar__logo { height: 34px; width: auto; }
.appbar__title { font-weight: 700; font-size: 1rem; letter-spacing: .3px; }
.appbar__title b { color: var(--color-primary); }
.appbar__spacer { flex: 1; }
.iconbtn {
  background: transparent; border: 0; color: var(--on-dark);
  width: 40px; height: 40px; border-radius: 10px; font-size: 1.15rem;
  display: grid; place-items: center; position: relative;
}
.iconbtn:active { background: #ffffff14; }
.badge-dot {
  position: absolute; top: 6px; right: 6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--color-primary); color: #fff;
  font-size: .65rem; font-weight: 700;
  border-radius: 9px; display: grid; place-items: center;
}
.lang-toggle {
  border: 1px solid var(--color-gold); color: var(--color-gold);
  background: transparent; border-radius: 999px;
  padding: 5px 10px; font-size: .72rem; font-weight: 700;
}

/* ---- Screen + scroll ---- */
.screen {
  flex: 1; overflow-y: auto;
  padding: var(--gap) var(--gap) calc(var(--nav-h) + var(--safe-b) + 20px);
}
.screen__title { font-size: 1.35rem; font-weight: 800; margin: 4px 0 2px; }
.screen__sub { color: var(--muted); margin: 0 0 16px; font-size: .9rem; }

/* ---- Bottom nav (Get Started / My Tools + Home/Profile) ---- */
.bottomnav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: var(--maxw);
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex; background: var(--color-black);
  border-top: 1px solid var(--card-line); z-index: 30;
}
.bottomnav button {
  flex: 1; background: transparent; border: 0; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: .68rem; font-weight: 600;
}
.bottomnav button .ico { font-size: 1.25rem; line-height: 1; }
.bottomnav button.active { color: var(--color-primary); }

/* ---- Cards / list ---- */
.card {
  background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.card--gold { border-color: var(--color-gold); }
.card__title { font-weight: 700; margin: 0 0 6px; }
.card__meta { color: var(--muted); font-size: .82rem; }

.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius); padding: 16px 14px; text-align: left;
  color: var(--on-dark); position: relative; min-height: 104px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.tile:active { border-color: var(--color-primary); }
.tile__ico { font-size: 1.6rem; }
.tile__name { font-weight: 700; font-size: .95rem; }
.tile__step { color: var(--muted); font-size: .72rem; }
.tile__lock { position: absolute; top: 12px; right: 12px; color: var(--muted); }
.tile.done .tile__ico { color: var(--color-gold); }
.tile.locked { opacity: .55; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 18px; border: 0; border-radius: 12px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark));
  color: #fff; font-weight: 700; font-size: 1rem;
}
.btn:active { filter: brightness(.92); }
.btn[disabled] { opacity: .45; }
.btn--ghost { background: transparent; border: 1px solid var(--card-line); color: var(--on-dark); }
.btn--gold { background: linear-gradient(180deg, var(--color-gold), #a87f3f); color: #1a1407; }
.btn--sm { width: auto; padding: 9px 14px; font-size: .85rem; border-radius: 10px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }

/* ---- Forms ---- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.input, .select, textarea.input {
  width: 100%; padding: 13px 14px; border-radius: 11px;
  border: 1px solid var(--card-line); background: #1c1c1c; color: var(--on-dark);
  font-size: 1rem;
}
.input:focus { outline: 2px solid var(--color-primary); border-color: transparent; }

/* ---- Confirm gate ---- */
.gate { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.gate__check {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  border: 1px solid var(--card-line); border-radius: 11px; background: #1c1c1c;
}
.gate__check input { width: 20px; height: 20px; accent-color: var(--color-primary); }

/* ---- Pills / status ---- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.pill--done { background: #14391f; color: #6fe39a; }
.pill--notdone { background: #3a1414; color: #ff8a8a; }
.pill--carried { background: #3a2f12; color: var(--color-gold); }
.pill--gold { background: #3a2f12; color: var(--color-gold); }

/* ---- Dashboard ---- */
.dash-row { display: flex; gap: 12px; }
.stat {
  flex: 1; background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius); padding: 14px; text-align: center;
}
.stat__num { font-size: 1.5rem; font-weight: 800; color: var(--color-gold); }
.stat__lbl { font-size: .72rem; color: var(--muted); }
.ring { display: grid; place-items: center; }

/* ---- Leaderboard ---- */
.lb-item { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--card-line); }
.lb-rank { width: 26px; font-weight: 800; color: var(--color-gold); text-align: center; }
.lb-name { flex: 1; font-weight: 600; }
.lb-score { font-weight: 800; color: var(--color-primary); }

/* ---- Mascot / empty states ---- */
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty img { width: 120px; margin: 0 auto 12px; }

/* ---- Splash / login ---- */
.splash {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; padding: 28px;
  background: radial-gradient(120% 120% at 50% 0%, #2a0a0f 0%, var(--color-black) 60%);
  text-align: center;
}
.splash img { width: 160px; }
.splash h1 { font-size: 1.4rem; margin: 0; }
.splash p { color: var(--muted); margin: 0; }
.splash .auth-card { width: 100%; max-width: 360px; }

/* ---- Walkthrough slides ---- */
.slide { background: var(--card); border-radius: var(--radius); padding: 22px; min-height: 280px; }
.slide__count { color: var(--muted); font-size: .8rem; }
.lockbar { height: 4px; background: #333; border-radius: 4px; overflow: hidden; margin: 14px 0; }
.lockbar > i { display: block; height: 100%; background: var(--color-gold); width: 0; transition: width .2s linear; }

/* ---- Notifications ---- */
.notif { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid var(--card-line); }
.notif.unread { background: #ffffff08; }
.notif__ico { font-size: 1.3rem; }
.notif__time { color: var(--muted); font-size: .72rem; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 18px); left: 50%; transform: translateX(-50%);
  background: #000; border: 1px solid var(--color-gold); color: #fff;
  padding: 12px 18px; border-radius: 12px; z-index: 60; font-size: .9rem;
  max-width: 90%; text-align: center;
}

/* ---- Misc ---- */
.row-split { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--muted); }
.section-h { font-weight: 800; margin: 18px 0 10px; font-size: 1rem; }
.hr { height: 1px; background: var(--card-line); border: 0; margin: 16px 0; }
.center { text-align: center; }
.hidden { display: none !important; }
