/* ═══════════════════════════════════════════════════════════════
   CHLOÉ AVENTURE v0.9 – style.css
═══════════════════════════════════════════════════════════════ */

:root {
  --violet: #6C63FF;
  --violet-dark: #4A43D4;
  --violet-light: #A89FFF;
  --amber: #F5A623;
  --amber-dark: #D4891A;
  --green: #2ECC71;
  --green-dark: #27AE60;
  --blue: #3A9AD9;
  --red: #E74C3C;
  --pink: #FF6B9D;

  --bg: #F7F5FF;
  --bg-card: #FFFFFF;
  --bg-card-2: #F0EEFF;
  --bg-nav: #FFFFFF;
  --text: #1A1733;
  --text-secondary: #625E7D;
  --text-muted: #85819E;
  --border: #E8E5FF;
  --shadow: rgba(108, 99, 255, 0.12);
  --shadow-strong: rgba(108, 99, 255, 0.25);

  --grad-hero: linear-gradient(135deg, #6C63FF 0%, #A855F7 50%, #3A9AD9 100%);
  --grad-amber: linear-gradient(135deg, #F5A623, #FF6B35);
  --grad-green: linear-gradient(135deg, #2ECC71, #1ABC9C);

  --font-display: 'Fredoka', 'Nunito Sans', sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;

  --header-h: 60px;
  --nav-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --ease: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-dark {
  --bg: #0F0D1A;
  --bg-card: #1A1733;
  --bg-card-2: #221F3D;
  --bg-nav: #12102A;
  --text: #F0EEFF;
  --text-secondary: #BBB7D3;
  --text-muted: #918DAA;
  --border: #2A2550;
  --shadow: rgba(0,0,0,0.4);
  --shadow-strong: rgba(108,99,255,0.3);
}
.offline-page{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:24px;background:var(--bg,#f7f5ff);color:var(--text,#1a1733);text-align:center}.offline-page>div{width:min(430px,100%);display:grid;gap:16px;padding:28px;border-radius:28px;background:var(--bg-card,#fff);box-shadow:0 20px 70px rgba(30,22,75,.2)}.offline-page span{font-size:4rem}.offline-page p{color:var(--text-secondary)}.success-card{animation:celebration-pop .45s var(--ease)}.success-icon{animation:celebration-bounce .8s var(--ease)}@keyframes celebration-pop{from{opacity:0;transform:scale(.72) rotate(-2deg)}to{opacity:1;transform:scale(1)}}@keyframes celebration-bounce{0%,100%{transform:translateY(0) scale(1)}45%{transform:translateY(-14px) scale(1.16)}}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  height: 100%;
  height: -webkit-fill-available;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  height: 100%;
  height: -webkit-fill-available;
  overflow: hidden;
  transition: background 0.3s, color 0.3s;
}

.account-gate { position: fixed; inset: 0; z-index: 1200; overflow-y: auto; padding: max(24px, var(--safe-top)) 16px max(24px, var(--safe-bottom)); background: var(--grad-hero); display: grid; place-items: center; }
.account-card { width: min(100%, 430px); border-radius: var(--radius-xl); background: var(--bg-card); color: var(--text); padding: 24px; box-shadow: 0 24px 70px rgba(30, 22, 75, 0.3); }
.account-logo { font-size: 3rem; text-align: center; }
.account-card h1, .account-card h2 { font-family: var(--font-display); text-align: center; }
.account-context { width: fit-content; margin: 0 auto 10px; padding: 6px 11px; border-radius: 99px; background: color-mix(in srgb, var(--violet) 10%, var(--bg-card)); color: var(--violet); font-size: .74rem; font-weight: 900; }
.account-card > p, #account-child-step > p, #account-family-step > p, #account-starter-ready-step > p { color: var(--text-secondary); text-align: center; margin: 6px 0 18px; }
.starter-ready-list { display: grid; gap: 10px; margin: 0 0 18px; }
.starter-ready-list article { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card-2); }
.starter-ready-list article > span { font-size: 1.55rem; }
.starter-ready-list strong, .starter-ready-list small { display: block; }
.starter-ready-list strong { font-family: var(--font-display); font-weight: 900; }
.starter-ready-list small { margin-top: 2px; color: var(--text-muted); line-height: 1.35; }
.account-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; background: var(--bg-card-2); padding: 5px; border-radius: var(--radius-md); margin-bottom: 16px; }
.account-tab { padding: 10px 6px; border-radius: 10px; color: var(--text-secondary); font-weight: 800; font-size: 0.75rem; }
.account-tab.active { background: var(--bg-card); color: var(--violet); box-shadow: var(--shadow-sm); }
.account-form { display: grid; gap: 12px; }
.account-form label { display: grid; gap: 6px; color: var(--text-secondary); font-size: 0.82rem; font-weight: 700; }
.account-form input, .account-form select { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card-2); color: var(--text); }
.account-form small { color: var(--text-muted); }
.account-help-link { border: 0; background: transparent; color: var(--primary); font: inherit; font-weight: 800; cursor: pointer; padding: 6px; }
.account-dialog { width: min(430px, calc(100% - 24px)); border: 0; border-radius: var(--radius-xl); padding: 24px; background: var(--bg-card); color: var(--text); box-shadow: 0 24px 70px rgba(30,22,75,.35); }
.account-dialog::backdrop { background: rgba(24,18,58,.72); }
.account-dialog .account-form { margin: 0; }
.account-dialog h2 { font-family: var(--font-display); text-align: center; }
.account-dialog p { color: var(--text-secondary); text-align: center; }
.account-dialog-message { min-height: 1.3em; font-weight: 700; }
.account-message { padding: 10px 12px; margin: 12px 0; border-radius: var(--radius-md); background: rgba(231, 76, 60, 0.12); color: var(--red); font-size: 0.85rem; }
.account-message.success { background: rgba(46, 204, 113, 0.12); color: var(--green); }
.account-children { display: grid; gap: 8px; margin-bottom: 16px; }
.account-families { display: grid; gap: 8px; margin-bottom: 16px; }
.account-family { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); text-align: left; }
.account-family span { font-size: 1.7rem; }
.account-family small { color: var(--text-muted); font-weight: 700; }
.account-family.active { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 7%, var(--bg-card)); }
.account-child-card { display: grid; gap: 11px; width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); background: var(--bg-card); box-shadow: 0 5px 18px var(--shadow); }
.account-child-main { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 10px; }
.account-child-main > span { font-size: 1.7rem; }
.account-child-main strong, .account-child-main small { display: block; }
.account-child-main small { margin-top: 2px; color: var(--violet); font-weight: 800; }
.account-child-actions { display: grid; grid-template-columns: 1fr 1.15fr; gap: 8px; }
.account-child-actions .btn-primary, .account-child-actions .btn-secondary { min-height: 40px; padding: 9px 10px; font-size: .76rem; }
.account-empty { padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius-md); text-align: center; color: var(--text-muted); }
#account-logout, #account-family-logout { margin-top: 12px; }
#open-child-form { margin-top: 4px; }
#account-pin-cancel { margin-top: 10px; }
.child-check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.child-check { min-width: 0; display: flex; align-items: center; gap: 6px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-card-2); font-size: .78rem; font-weight: 700; line-height: 1.15; }
.child-check span { min-width: 0; overflow-wrap: anywhere; }
.child-check input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--violet); }
.weekday-check-list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.weekday-check-list label { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 1px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-card-2); font-size: 0.66rem; font-weight: 800; }
.weekday-check-list input { width: 14px; height: 14px; accent-color: var(--violet); }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 1rem; border: none; outline: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }

/* ── SPLASH ─────────────────────────────────────────────────── */
.splash {
  position: fixed; inset: 0;
  background: var(--grad-hero);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.splash.fade-out { opacity: 0; transform: scale(1.04); pointer-events: none; }
.splash-content { text-align: center; color: #fff; padding: 0 32px; }
.splash-logo { font-size: 72px; display: block; animation: float 3s ease-in-out infinite; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.3)); }
.splash-title { font-family: var(--font-display); font-size: 2.2rem; font-weight: 900; margin-top: 16px; }
.splash-tagline { font-size: 1rem; opacity: 0.85; margin-top: 8px; font-style: italic; }
.splash-loader { width: 180px; height: 4px; background: rgba(255,255,255,0.3); border-radius: 99px; margin: 32px auto 0; overflow: hidden; }
.loader-bar { height: 100%; width: 0%; background: #fff; border-radius: 99px; animation: loadBar 2s var(--ease-out) forwards; }

/* ── APP LAYOUT ──────────────────────────────────────────────── */
.app {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  height: 100vh;
  height: -webkit-fill-available;
  height: var(--real-vh, 100vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-header {
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header-content { height: var(--header-h); padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.header-left { display: flex; align-items: center; gap: 8px; }
.app-logo { font-size: 1.3rem; }
.app-logo-button { min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; }
.app-logo-button:hover { background: var(--bg-card-2); }
.app-logo-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--violet) 35%, transparent); outline-offset: 2px; }
.mode-indicator { width: fit-content; color: var(--violet); font-size: .62rem; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.header-right { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-card-2); display: flex; align-items: center; justify-content: center; font-size: 0.95rem; transition: transform 0.2s var(--ease); }
.icon-btn:active { transform: scale(0.9); }
.profile-switch-btn { min-height: 44px; padding: 7px 10px; border-radius: 99px; background: var(--bg-card-2); color: var(--violet); display: flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 800; white-space: nowrap; transition: transform 0.2s var(--ease), background 0.2s ease; }
.profile-switch-btn:hover { background: color-mix(in srgb, var(--violet) 12%, var(--bg-card)); }
.profile-switch-btn:active { transform: scale(0.96); }
.profile-switch-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--violet) 35%, transparent); outline-offset: 2px; }
.profile-switch-icon { font-size: 1rem; }
.xp-pill { display: flex; align-items: center; gap: 4px; background: var(--grad-hero); color: #fff; padding: 5px 10px; border-radius: 99px; font-family: var(--font-display); font-weight: 800; font-size: 0.82rem; }

.mode-child {
  --violet: #168B9A;
  --violet-dark: #0E6B78;
  --violet-light: #75D7DE;
  --bg: #F1FCFC;
  --bg-card-2: #E3F8F8;
  --border: #CDEEEF;
  --shadow: rgba(22, 139, 154, 0.14);
  --shadow-strong: rgba(22, 139, 154, 0.26);
  --grad-hero: linear-gradient(135deg, #168B9A 0%, #25B6A5 52%, #49A2E8 100%);
}
.mode-child .app-header { background: color-mix(in srgb, #DDF8F6 94%, transparent); border-bottom-color: #AEE3E2; }
.mode-child .mode-indicator { color: #08717E; }
.mode-child .profile-switch-btn { background: #fff; border: 1px solid #9EDCDD; color: #08717E; }
.theme-dark.mode-child { --bg:#0F0D1A;--bg-card:#1A1733;--bg-card-2:#221F3D;--bg-nav:#12102A;--text:#F0EEFF;--text-secondary:#BBB7D3;--text-muted:#918DAA;--border:#2A2550;--shadow:rgba(0,0,0,.4);--shadow-strong:rgba(22,139,154,.32); }
.theme-dark.mode-child .app-header { background:color-mix(in srgb,var(--bg-card) 94%,transparent);border-bottom-color:var(--border) }
.theme-dark.mode-child .profile-switch-btn { background:var(--bg-card-2);border-color:var(--border);color:var(--text) }
.profile-switch-label{display:none}.profile-switch-btn{width:44px;padding:0;justify-content:center}

.app-main { flex: 1; overflow: hidden; position: relative; min-height: 0; }

/* ── PAGES ───────────────────────────────────────────────────── */
.page {
  position: absolute;
  inset: 0;
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.page.active { opacity: 1; pointer-events: all; transform: none; }

.page-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 32px;
  scrollbar-width: none;
}
.page-scroll::-webkit-scrollbar { display: none; }

/* ── BOTTOM NAV ──────────────────────────────────────────────── */
.bottom-nav {
  flex-shrink: 0;
  padding-bottom: 4px;
  padding-top: 10px;
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-around;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 6px; border-radius: var(--radius-sm); min-width: 44px; transition: transform 0.2s var(--ease); position: relative; }
.nav-btn:active { transform: scale(0.9); }
.nav-icon { font-size: 1.25rem; line-height: 1; transition: transform 0.3s var(--ease); }
.nav-label { font-size: 0.58rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.02em; }
.nav-btn.active .nav-label { color: var(--violet); }
.nav-btn.active .nav-icon { transform: scale(1.15) translateY(-2px); }
.nav-btn.active::after { content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); width: 18px; height: 3px; background: var(--violet); border-radius: 99px; }
.nav-count { position: absolute; top: 1px; right: max(3px, calc(50% - 25px)); min-width: 18px; height: 18px; padding: 1px 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: .6rem; font-weight: 900; line-height: 16px; box-shadow: 0 0 0 2px var(--bg-nav); }

/* ── HERO CARD ───────────────────────────────────────────────── */
.hero-card { position: relative; border-radius: var(--radius-xl); overflow: hidden; margin-bottom: 16px; background: var(--bg-card); box-shadow: 0 8px 32px var(--shadow-strong); }
.hero-bg { position: absolute; inset: 0; background: var(--grad-hero); opacity: 0.12; }
.theme-dark .hero-bg { opacity: 0.25; }
.hero-content { padding: 20px 18px; display: flex; align-items: center; gap: 16px; position: relative; }
.avatar-wrapper { position: relative; flex-shrink: 0; }
.avatar-frame { width: 76px; height: 76px; border-radius: 50%; background: var(--grad-hero); display: flex; align-items: center; justify-content: center; font-size: 2.3rem; box-shadow: 0 4px 20px var(--shadow-strong); }
.level-badge { position: absolute; bottom: -4px; right: -4px; background: var(--amber); color: #fff; font-size: 0.62rem; font-weight: 800; font-family: var(--font-display); padding: 3px 7px; border-radius: 99px; white-space: nowrap; }
.hero-info { flex: 1; min-width: 0; }
.hero-info h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 900; }
.hero-title { font-size: 0.78rem; color: var(--violet); font-weight: 600; margin-bottom: 8px; }
.xp-bar-track { height: 8px; background: var(--bg-card-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.xp-bar-fill { height: 100%; background: var(--grad-hero); border-radius: 99px; width: 0%; transition: width 0.8s var(--ease-out); }
.xp-label { font-size: 0.68rem; color: var(--text-muted); margin-top: 3px; display: block; font-weight: 600; }

/* ── STATS ───────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 18px; }
.stat-chip { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 6px; display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 8px var(--shadow); }
.stat-icon { font-size: 1.2rem; }
.stat-value { font-family: var(--font-display); font-size: 0.95rem; font-weight: 900; line-height: 1; }
.stat-name { font-size: 0.58rem; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

/* ── SECTION HEADERS ─────────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; margin-top: 4px; }
.section-header h3 { font-family: var(--font-display); font-size: 0.95rem; font-weight: 800; }
.see-all-btn { min-height: 44px; padding: 8px 4px; font-size: 0.78rem; color: var(--violet); font-weight: 700; }
.section-title { font-family: var(--font-display); font-size: 0.95rem; font-weight: 800; margin: 14px 0 8px; }

/* ── PAGE HERO ───────────────────────────────────────────────── */
.page-hero { text-align: center; padding: 20px 16px 16px; }
.page-hero h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 900; background: var(--grad-hero); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.page-hero p { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }

/* ── MISSION CARDS ───────────────────────────────────────────── */
.missions-grid { display: flex; flex-direction: column; gap: 10px; }
.missions-preview { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.mission-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: 0 2px 10px var(--shadow);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
  cursor: pointer; position: relative;
}
.mission-card:active { transform: scale(0.98); }
.mission-card.done { opacity: 0.6; border-color: var(--green); background: color-mix(in srgb, var(--green) 5%, var(--bg-card)); }
.mission-card.pending { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 5%, var(--bg-card)); }
.mission-card.secret-card { border-style: dashed; border-color: var(--violet-light); opacity: 0.7; }

.mission-icon-wrap { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--bg-card-2); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; position: relative; }
.diff-dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--bg-card); }
.diff-facile { background: var(--green); }
.diff-moyen { background: var(--amber); }
.diff-difficile { background: var(--red); }
.diff-epique { background: var(--violet); }

.mission-body { flex: 1; min-width: 0; }
.mission-title { font-family: var(--font-display); font-size: 0.9rem; font-weight: 800; white-space: normal; word-break: break-word; }
.mission-desc { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; white-space: normal; line-height: 1.4; }
.mission-meta { display: flex; align-items: center; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.mission-tag { font-size: 0.62rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--bg-card-2); color: var(--text-secondary); }
.mission-xp { font-size: 0.7rem; font-weight: 800; color: var(--violet); font-family: var(--font-display); }

.complete-btn { width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid var(--border); background: transparent; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: all 0.25s var(--ease); color: var(--text-muted); flex-shrink: 0; }
.complete-btn:hover { border-color: var(--green); }
.complete-btn.done-btn { border-color: var(--green); background: var(--green); color: #fff; }
.complete-btn.pending-btn { border-color: var(--amber); color: var(--amber); }

/* ── BADGES ──────────────────────────────────────────────────── */
.badges-progress-bar { height: 6px; background: var(--bg-card-2); border-radius: 99px; overflow: hidden; margin: 4px 0 6px; }
.badges-progress-fill { height: 100%; background: var(--grad-amber); border-radius: 99px; width: 0%; transition: width 1s var(--ease-out); }
.badges-progress-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 14px; text-align: center; }
.badges-grid { display: flex; flex-direction: column; gap: 20px; }
.badge-group { display: grid; gap: 10px; }
.badge-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.badge-group-heading h3 { font-family: var(--font-display); font-size: 0.95rem; }
.badge-group-heading span { padding: 4px 8px; border-radius: 99px; background: var(--bg-card-2); color: var(--text-secondary); font-size: 0.68rem; font-weight: 800; }
.badge-group-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.badges-preview { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; margin-bottom: 14px; }
.badges-preview::-webkit-scrollbar { display: none; }
.badge-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; box-shadow: 0 2px 8px var(--shadow); }
.badge-card.unlocked { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 6%, var(--bg-card)); box-shadow: 0 4px 16px rgba(245,166,35,0.2); }
.badge-card.locked { opacity: 0.4; filter: grayscale(1); }
.badge-icon { font-size: 1.9rem; line-height: 1; }
.badge-name { font-family: var(--font-display); font-size: 0.68rem; font-weight: 800; line-height: 1.2; }
.badge-desc { font-size: 0.6rem; color: var(--text-muted); line-height: 1.3; }
.badge-card-mini { min-width: 86px; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; text-align: center; }
.badge-card-mini .badge-icon { font-size: 1.4rem; }
.badge-card-mini .badge-name { font-size: 0.6rem; }

/* ── RÉCOMPENSES ─────────────────────────────────────────────── */
.xp-balance-card { background: var(--grad-hero); border-radius: var(--radius-xl); padding: 18px; display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: #fff; }
.balance-icon { font-size: 2.2rem; }
.balance-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 900; }
.balance-label { font-size: 0.78rem; opacity: 0.8; }
.rewards-grid { display: flex; flex-direction: column; gap: 10px; }
.rewards-preview { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; margin-bottom: 8px; }
.rewards-preview::-webkit-scrollbar { display: none; }
.reward-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 14px; display: flex; align-items: center; gap: 14px; box-shadow: 0 2px 10px var(--shadow); }
.reward-icon-wrap { width: 52px; height: 52px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--violet) 10%, var(--bg-card-2)); display: flex; align-items: center; justify-content: center; font-size: 1.7rem; flex-shrink: 0; }
.reward-body { flex: 1; min-width: 0; }
.reward-title { font-family: var(--font-display); font-size: 0.9rem; font-weight: 800; }
.reward-desc { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.reward-cost { font-family: var(--font-display); font-size: 0.78rem; font-weight: 800; color: var(--violet); margin-top: 5px; }
.reward-buy-btn { min-height: 44px; padding: 10px 14px; background: var(--grad-hero); color: #fff; border-radius: var(--radius-md); font-family: var(--font-display); font-size: 0.78rem; font-weight: 800; white-space: nowrap; flex-shrink: 0; transition: transform 0.2s var(--ease); }
.reward-buy-btn:active { transform: scale(0.95); }
.reward-buy-btn:disabled { opacity: 0.4; }
.reward-card-mini { min-width: 100px; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 5px; flex-shrink: 0; text-align: center; }
.reward-card-mini .reward-icon-wrap { width: 40px; height: 40px; font-size: 1.3rem; }
.reward-card-mini .reward-title { font-size: 0.68rem; }
.reward-card-mini .reward-cost { font-size: 0.68rem; }


/* ── FILTER BAR ──────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; margin-bottom: 4px; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn { flex-shrink: 0; padding: 7px 13px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text-secondary); font-size: 0.75rem; font-weight: 700; transition: all 0.2s; }
.filter-btn.active { background: var(--violet); border-color: var(--violet); color: #fff; }

/* ── PARENTS ─────────────────────────────────────────────────── */
.locked-screen { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 40px 32px; }
.lock-icon { font-size: 3.5rem; margin-bottom: 8px; }
.locked-screen h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 900; }
.locked-screen p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.5; }
.parent-child-switch-label { display: block; margin: 14px auto 5px; color: var(--text-secondary); font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.parent-child-switch { width: min(100%, 280px); min-height: 42px; padding: 8px 34px 8px 12px; border: 1.5px solid var(--violet); border-radius: 12px; background: var(--bg-card); color: var(--text); font-weight: 800; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-actions { margin-bottom: 12px; }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.parent-dashboard-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 18px; border-radius: var(--radius-lg); color: #fff; background: var(--grad-hero); box-shadow: 0 8px 24px var(--shadow-strong); }
.parent-dashboard-avatar { width: 58px; height: 58px; flex: 0 0 58px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.2); font-size: 1.9rem; }
.parent-dashboard-hero span { font-size: .7rem; opacity: .84; text-transform: uppercase; font-weight: 800; }
.parent-dashboard-hero h3 { font-family: var(--font-display); font-size: 1.25rem; }
.parent-dashboard-hero p { margin-top: 2px; font-size: .76rem; line-height: 1.35; opacity: .9; }
.parent-dashboard-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.parent-dashboard-stat { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1px 9px; padding: 13px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: 0 4px 14px var(--shadow); }
.parent-dashboard-stat > span { grid-row: 1 / 3; font-size: 1.45rem; }
.parent-dashboard-stat strong { font-family: var(--font-display); font-size: 1.15rem; line-height: 1; color: var(--violet); }
.parent-dashboard-stat small { color: var(--text-secondary); font-size: .65rem; line-height: 1.25; }
.parent-dashboard-highlight { display: flex; align-items: center; gap: 13px; margin-top: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: color-mix(in srgb, var(--amber) 8%, var(--bg-card)); }
.parent-dashboard-pending { background: color-mix(in srgb, var(--violet) 6%, var(--bg-card)); }
.parent-highlight-icon { flex: 0 0 auto; font-size: 2rem; }
.parent-dashboard-highlight div { min-width: 0; }
.parent-dashboard-highlight small, .parent-dashboard-highlight strong { display: block; }
.parent-dashboard-highlight small { color: var(--text-muted); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.parent-dashboard-highlight strong { margin-top: 1px; font-family: var(--font-display); font-size: .9rem; }
.parent-dashboard-highlight p { margin-top: 2px; color: var(--text-secondary); font-size: .7rem; line-height: 1.35; }
.reward-suggestions { margin-bottom: 18px; }
.about-section .settings-desc + .settings-desc { margin-top: 10px; }
.support-card { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: start; margin-top: 16px; padding: 16px; border-radius: 18px; background: color-mix(in srgb, var(--violet) 8%, var(--bg-card)); border: 1px solid var(--border); }
.support-card-icon { font-size: 1.8rem; }
.support-card h4, .support-card p { margin: 0; }
.support-card h4 { color: var(--text); font-family: var(--font-display); font-weight: 900; }
.support-card p { margin-top: 4px; color: var(--text-muted); line-height: 1.45; }
.support-card .btn-primary, .support-card > .settings-desc { grid-column: 1 / -1; text-align: center; }
.reward-suggestions > p { margin: 5px 0 12px; color: var(--text-muted); font-size: .84rem; }
.reward-suggestion-list { display: grid; gap: 10px; }
.reward-suggestion-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); }
.reward-suggestion-card > span { font-size: 1.7rem; }
.reward-suggestion-card strong, .reward-suggestion-card small { display: block; }
.reward-suggestion-card small { margin-top: 3px; color: var(--text-muted); line-height: 1.35; }
@media (max-width: 600px) {
  .reward-suggestion-card { grid-template-columns: auto 1fr; }
  .reward-suggestion-card button { grid-column: 1 / -1; width: 100%; }
}
.admin-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.admin-item-info { flex: 1; min-width: 0; }
.admin-item-title { font-family: var(--font-display); font-size: 0.85rem; font-weight: 800; }
.admin-item-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.admin-item-btns { display: flex; gap: 6px; }
.archived-child-item { align-items: flex-start; padding: 14px; }
.archived-child-icon { flex: 0 0 auto; font-size: 1.35rem; line-height: 1.2; }
.archived-child-item .admin-item-title { font-size: .95rem; color: var(--text); }
.archived-child-item .admin-item-meta { display: grid; gap: 2px; margin-top: 5px; }
.archived-child-item .admin-item-meta strong { color: var(--violet); font-size: .74rem; }
.archived-child-item .admin-item-meta span { color: var(--text-secondary); }
.restore-child-btn { width: auto; flex: 0 0 auto; padding: 9px 12px; font-size: .76rem; }
@media (max-width: 420px) {
  .archived-child-item { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .archived-child-item .restore-child-btn { grid-column: 1 / -1; width: 100%; margin-top: 4px; }
}
.validation-item { background: var(--bg-card); border: 1px solid var(--amber); border-radius: var(--radius-md); padding: 14px; }
.validation-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.validation-title { font-family: var(--font-display); font-size: 0.85rem; font-weight: 800; }
.validation-date { font-size: 0.68rem; color: var(--text-muted); }
.validation-desc { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 10px; }
.validation-btns { display: flex; gap: 8px; }
.settings-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px; }
.settings-section h3 { font-family: var(--font-display); font-weight: 800; font-size: 0.92rem; margin-bottom: 12px; }
.settings-desc { font-size: 0.78rem; color: var(--text-secondary); }
.settings-section > .form-group, .settings-section > .form-row { margin-top: 12px; }
.settings-section > .btn-primary, .settings-section > .btn-secondary, .settings-section > .btn-danger { margin-top: 12px; }
.settings-section .form-row + button, .settings-section .form-group + button { margin-top: 12px; }
.pin-settings-form { display: grid; gap: 12px; }
.pin-input { width: min(100%, 220px); margin: 8px auto 14px; padding: 14px; border: 2px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text); font-size: 1.65rem; font-weight: 900; text-align: center; letter-spacing: .7rem; }
.pin-input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px color-mix(in srgb, var(--violet) 14%, transparent); }
.pin-label { display: block; margin-top: 18px; color: var(--text-secondary); font-size: .82rem; font-weight: 800; }
.pin-status { min-height: 1.3em; margin: 10px 0; color: var(--red); font-size: .8rem; font-weight: 700; }
.invitation-code-result { margin-top: 12px; padding: 14px; border: 2px dashed var(--violet); border-radius: var(--radius-md); text-align: center; background: color-mix(in srgb, var(--violet) 8%, var(--bg-card)); }
.invitation-code-result strong { display: block; font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.12em; color: var(--violet); user-select: all; }
.invitation-qr { display: block; width: min(220px, 100%); height: auto; margin: 0 auto 12px; border-radius: 12px; }
.invitation-share-link { display: block; width: 100%; margin: 0 0 10px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-secondary); background: var(--bg-card); font-size: 0.75rem; }

/* ── MODALS ──────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 500; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-card { position: relative; background: var(--bg-card); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 28px 22px calc(28px + var(--safe-bottom)); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; scrollbar-width: none; text-align: center; animation: slideUp 0.35s var(--ease) forwards; }
.modal-card::-webkit-scrollbar { display: none; }
.form-card { text-align: left; }
.form-card h2 { text-align: center; margin-bottom: 18px; }
.modal-icon { font-size: 2.3rem; margin-bottom: 10px; }
.modal-card h2 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 900; margin-bottom: 6px; }
.modal-card > p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn-primary, .modal-actions .btn-secondary { flex: 1; }

/* PIN */
.pin-display { display: flex; gap: 14px; justify-content: center; margin: 14px 0; }
.pin-dot { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--border); background: transparent; transition: all 0.2s var(--ease); }
.pin-dot.filled { background: var(--violet); border-color: var(--violet); transform: scale(1.15); }
.pin-keypad { display: grid; grid-template-columns: repeat(3, minmax(58px, 78px)); justify-content: center; gap: 10px; margin: 14px auto; }
.register-pin-fieldset { margin: 8px 0; padding: 12px; border: 1px solid var(--border); border-radius: 16px; }
.register-pin-fieldset legend { padding: 0 7px; font-weight: 800; color: var(--text-primary); }
.register-pin-fieldset small { display: block; text-align: center; color: var(--text-muted); line-height: 1.4; }
.register-pin-fieldset .pin-display { margin: 12px 0; }
.register-pin-fieldset .pin-keypad { margin-bottom: 2px; }
.pin-key { min-height: 54px; border-radius: var(--radius-md); background: var(--bg-card-2); color: var(--text); font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; border: 1px solid var(--border); transition: all 0.15s var(--ease); }
.pin-key:active { transform: scale(0.92); background: var(--violet); color: #fff; }
.pin-clear { color: var(--red); font-size: 0.95rem; }
.pin-error { color: var(--red); font-size: 0.8rem; font-weight: 700; margin-bottom: 8px; }

/* SUCCESS */
.success-card { text-align: center; position: relative; overflow: hidden; }
.success-icon { font-size: 3.8rem; animation: pop 0.5s var(--ease) 0.2s backwards; display: block; }
.badge-unlock-icon { animation: pop 0.6s var(--ease) 0.1s backwards; }
.success-points { display: inline-block; background: var(--grad-hero); color: #fff; font-family: var(--font-display); font-size: 1.3rem; font-weight: 900; padding: 9px 24px; border-radius: var(--radius-xl); margin: 14px 0; animation: pop 0.4s var(--ease) 0.4s backwards; }
.confetti-container { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti-piece { position: absolute; width: 8px; height: 8px; border-radius: 2px; animation: confettiFall linear forwards; }

/* ── BOUTONS ─────────────────────────────────────────────────── */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; background: var(--grad-hero); color: #fff; border-radius: var(--radius-md); font-family: var(--font-display); font-size: 0.88rem; font-weight: 800; transition: transform 0.2s var(--ease), box-shadow 0.2s; box-shadow: 0 4px 16px var(--shadow-strong); width: 100%; }
.btn-primary:active { transform: scale(0.97); }
.btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; background: var(--bg-card-2); color: var(--text); border: 1.5px solid var(--border); border-radius: var(--radius-md); font-family: var(--font-display); font-size: 0.88rem; font-weight: 700; transition: all 0.2s; width: 100%; }
.btn-secondary:active { transform: scale(0.97); }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; padding: 7px 14px; color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; border: 1px solid var(--border); border-radius: 99px; margin-top: 6px; }
.btn-danger { padding: 7px 12px; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 700; border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }
.btn-icon { padding: 7px 11px; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 700; background: var(--bg-card-2); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-approve { flex: 1; padding: 9px; background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green-dark); border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 700; border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); }
.btn-refuse { flex: 1; padding: 9px; background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 700; border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }

/* ── FORMULAIRES ─────────────────────────────────────────────── */
.app-form { display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-row { display: flex; gap: 10px; }
.form-checks { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); letter-spacing: 0.02em; text-transform: uppercase; }
.req { color: var(--red); }
.form-group input, .form-group textarea, .form-group select { background: var(--bg-card-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; color: var(--text); font-size: 0.88rem; transition: border-color 0.2s; width: 100%; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--violet); }
.form-help { color: var(--text-muted); font-size: 0.68rem; line-height: 1.35; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--violet); flex-shrink: 0; }
.form-check label { font-size: 0.82rem; color: var(--text); cursor: pointer; }

.emoji-input { font-size: 1.6rem !important; text-align: center; padding: 6px 4px !important; cursor: pointer; border-radius: var(--radius-md) !important; }
.emoji-picker-wrap { position: relative; }
.emoji-hint { position: absolute; bottom: -16px; left: 0; font-size: 0.58rem; color: var(--text-muted); white-space: nowrap; }

/* ── ÉTATS VIDES ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 36px 20px; color: var(--text-muted); font-size: 0.85rem; }
.empty-state-action { display: block; margin: 12px auto 0; padding: 8px 12px; border-radius: var(--radius-md); background: var(--violet); color: #fff; font-weight: 800; font-size: .74rem; }
.empty-state-icon { font-size: 2.8rem; margin-bottom: 10px; display: block; }

/* ── HISTORIQUE ──────────────────────────────────────────────── */
.history-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 11px 13px; display: flex; align-items: center; gap: 10px; }
.history-icon { font-size: 1.2rem; flex-shrink: 0; }
.history-body { flex: 1; }
.history-title { font-size: 0.82rem; font-weight: 700; }
.history-date { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }
.history-xp { font-family: var(--font-display); font-weight: 800; font-size: 0.82rem; color: var(--violet); }

/* ── TOASTS ──────────────────────────────────────────────────── */
.toast-container { position: fixed; top: calc(var(--header-h) + var(--safe-top) + 10px); left: 50%; transform: translateX(-50%); z-index: 800; display: flex; flex-direction: column; gap: 7px; pointer-events: none; width: calc(100% - 32px); max-width: 380px; }
.toast { background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: var(--radius-md); font-size: 0.85rem; font-weight: 600; box-shadow: 0 4px 20px rgba(0,0,0,0.3); animation: toastIn 0.35s var(--ease) forwards; text-align: center; }
.toast.success { background: var(--green); color: #fff; }
.toast.error { background: var(--red); color: #fff; }
.toast.info { background: var(--violet); color: #fff; }
.toast.fade-out { animation: toastOut 0.3s ease forwards; }
.network-status { position: fixed; z-index: 1000; top: max(8px, var(--safe-top)); left: 50%; transform: translateX(-50%); width: min(440px, calc(100% - 24px)); padding: 10px 14px; border-radius: var(--radius-md); background: var(--green); color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.24); font-size: .8rem; font-weight: 800; text-align: center; }
.network-status.offline { background: var(--red); }

/* ── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes loadBar { from { width: 0%; } to { width: 100%; } }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes toastIn { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }
@keyframes confettiFall { 0% { transform: translateY(-20px) rotate(0deg); opacity: 1; } 100% { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

@media (max-width: 400px) {
  .header-content { padding: 0 12px; }
  .header-right { gap: 6px; }
  .profile-switch-btn { padding-inline: 8px; }
}

@media (min-width: 520px) {
  /* La grille de badges reste à trois colonnes. */
  .modal-card { border-radius: var(--radius-xl); margin: auto; }
  .modal { align-items: center; }
}
@media (min-width: 768px) {
  .app { max-width: 430px; margin: 0 auto; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  body { background: #0A0910; }
}

/* ── Date limite mission ─────────────────────────────────────── */
.mission-due { font-size: 0.65rem; font-weight: 700; }

/* ── Compteur quotidien accueil ──────────────────────────────── */
.daily-counter { font-size: 0.82rem; font-weight: 600; margin-bottom: 10px; margin-top: -4px; }

/* ── Historique malus (rouge) ────────────────────────────────── */
.history-xp.malus { color: var(--red); }

/* ── Mission action flex column ──────────────────────────────── */
.mission-action { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 2px; }

/* ── Badge XP reward ─────────────────────────────────────────── */
.badge-xp { font-size: 0.65rem; font-weight: 800; color: var(--amber); font-family: var(--font-display); margin-top: 3px; }
.badge-card.unlocked .badge-xp { color: var(--green); }

/* ── Raffinement visuel bêta ────────────────────────────────── */
h1, h2, h3, h4, .nav-label, button { letter-spacing: -.012em; }
.app-header { background: color-mix(in srgb, var(--bg-card) 92%, transparent); }
.header-content { padding-inline: 18px; }
.page-scroll { padding: 18px 18px 36px; }
.page-hero { padding: 22px 12px 20px; }
.page-hero h2 { font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.page-hero p { max-width: 30rem; margin: 7px auto 0; line-height: 1.45; }
.hero-card { border: 1px solid color-mix(in srgb, var(--violet) 18%, var(--border)); box-shadow: 0 12px 32px color-mix(in srgb, var(--violet) 16%, transparent); }
.hero-info h2 { font-weight: 700; letter-spacing: -.02em; }
.section-header h3, .section-title { font-size: 1.03rem; font-weight: 700; }
.mission-card, .reward-card, .admin-item, .validation-item, .settings-section { box-shadow: 0 5px 18px color-mix(in srgb, var(--shadow) 72%, transparent); }
.mission-card { padding: 15px; gap: 13px; }
.mission-title, .reward-title, .admin-item-title { font-weight: 700; line-height: 1.25; }
.mission-desc, .reward-desc, .admin-item-meta, .settings-desc { line-height: 1.5; }
.btn-primary { min-height: 46px; box-shadow: 0 7px 18px color-mix(in srgb, var(--violet) 25%, transparent); font-weight: 700; }
.btn-secondary { min-height: 43px; font-weight: 700; }
.filter-btn { min-height: 38px; padding: 8px 15px; font-weight: 800; }
.filter-btn.active { box-shadow: 0 5px 13px color-mix(in srgb, var(--violet) 20%, transparent); }
.bottom-nav { padding-top: 8px; min-height: var(--nav-h); }
.nav-btn { gap: 4px; padding-inline: 8px; }
.nav-icon { font-size: 1.35rem; }
.nav-label { font-family: var(--font-display); font-size: .61rem; font-weight: 600; }
.reward-suggestions > h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.starter-pack-card { align-items: start; gap: 15px; padding: 18px; border-radius: 20px; box-shadow: 0 7px 24px color-mix(in srgb, var(--shadow) 75%, transparent); }
.starter-pack-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--bg-card-2); }
.starter-pack-content h4 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.starter-pack-content p { line-height: 1.45; }
.starter-pack-button { align-self: center; }
.account-card { border: 1px solid color-mix(in srgb, #fff 60%, transparent); }
.account-card h1 { font-size: 1.8rem; font-weight: 700; }
.account-form input, .account-form select, .form-group input, .form-group textarea, .form-group select { min-height: 44px; }
.form-group .child-check input, .form-group .weekday-check-list input { width: 16px; min-height: 16px; height: 16px; padding: 0; }
@media (max-width: 768px) {
  .account-form input, .account-form select,
  .form-group input, .form-group textarea, .form-group select { font-size: 16px; }
}
.form-group .child-check { min-height: 34px; }
.form-group .weekday-check-list label { min-height: 38px; }
.empty-state { line-height: 1.55; border: 1px dashed var(--border); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--bg-card) 70%, transparent); }

@media (max-width: 520px) {
  .starter-pack-preview { grid-template-columns: 1fr; gap: 8px; }
  .starter-pack-card { grid-template-columns: 46px minmax(0, 1fr); padding: 16px; }
  .starter-pack-icon { width: 46px; height: 46px; }
  .page-scroll { padding-inline: 14px; }
  .stats-row { gap: 6px; }
  .stat-chip { padding-inline: 5px; }
}

@media (max-width: 380px) {
  .profile-switch-label { display: none; }
  .form-row { flex-direction: column; }
  .validation-btns { flex-direction: column; }
  .reward-card { align-items: flex-start; flex-wrap: wrap; }
  .reward-buy-btn { width: 100%; }
  .account-child-actions { grid-template-columns: 1fr; }
}

/* ── Séparateur récompenses obtenues ─────────────────────────── */
.rewards-separator { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
.rewards-separator::before, .rewards-separator::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Récompense obtenue ───────────────────────────────────────── */
.reward-obtained { opacity: 0.6; background: color-mix(in srgb, var(--green) 5%, var(--bg-card)); border-color: var(--green) !important; }
.reward-check { font-size: 1.3rem; flex-shrink: 0; }

/* ── Modal Pendant ton absence ───────────────────────────────── */
.absence-card {
  text-align: left;
  max-height: 80vh;
}
.absence-header {
  text-align: center;
  margin-bottom: 16px;
}
.absence-emoji {
  font-size: 2.5rem;
  margin-bottom: 6px;
}
.absence-header h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
}
.absence-header p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.absence-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 50vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.absence-body::-webkit-scrollbar { display: none; }
.absence-section {
  background: var(--bg-card-2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid var(--border);
}
.absence-section-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.absence-item {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}
.absence-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ── Bouton refresh header ───────────────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
#refresh-btn {
  font-size: 1rem;
  transition: transform 0.2s;
}
#refresh-btn:active { transform: scale(0.9); }
