/* ============ Study Stars — kid-friendly design system ============ */
:root {
  --primary: #7c4dff; --primary-dark: #5a2ee0; --primary-light: #b388ff;
  --accent: #ffca28; --accent-dark: #ffa000;
  --pink: #ff4d94; --teal: #00c9a7; --blue: #29b6f6;
  --bg1: #f3e8ff; --bg2: #e8f7ff; --bg3: #fff8e1;
  --ink: #2d2150; --ink-soft: #6a5aa8; --card: #ffffff;
  --good: #2ecc71; --warn: #ff9800; --bad: #ef5350;
  --radius: 24px; --radius-sm: 16px;
  --shadow: 0 8px 24px rgba(90, 40, 180, .16);
  --shadow-sm: 0 4px 12px rgba(90, 40, 180, .12);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Baloo 2', 'Baloo Bhaijaan 2', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1), var(--bg2) 50%, var(--bg3));
  background-attachment: fixed;
  font-size: 17px; line-height: 1.35;
  overscroll-behavior: none;
}
[dir="rtl"] { font-family: 'Baloo Bhaijaan 2', 'Baloo 2', system-ui, sans-serif; }

.app-frame { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; position: relative; }
.screen { flex: 1; padding: 12px 16px 96px; animation: slideUp .35s var(--pop); }
[dir="rtl"] .screen { text-align: right; }

/* ============ TOP HEADER ============ */
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 0 6px; }
.topbar .avatar { width: 46px; height: 46px; font-size: 26px; }
.whoami { flex: 1; min-width: 0; }
.whoami .hi { font-weight: 800; font-size: 19px; }
.whoami .lvl { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.starpill {
  background: linear-gradient(135deg, #fff, #fff3cd); border: 2.5px solid var(--accent);
  border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; gap: 6px; box-shadow: var(--shadow-sm);
  animation: popIn .3s var(--pop);
}
.iconbtn {
  width: 44px; height: 44px; border-radius: 50%; border: none; background: #fff;
  box-shadow: var(--shadow-sm); font-size: 21px; cursor: pointer; display: grid; place-items: center;
  transition: transform .12s;
}
.iconbtn:active { transform: scale(.88); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit; font-weight: 800;
  border-radius: 999px; padding: 14px 24px; font-size: 18px; color: #fff;
  background: linear-gradient(180deg, var(--primary-light), var(--primary) 55%, var(--primary-dark));
  box-shadow: 0 6px 0 var(--primary-dark), var(--shadow-sm);
  transition: transform .1s, box-shadow .1s, filter .2s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--primary-dark); }
.btn:disabled { filter: grayscale(.6); opacity: .6; }
.btn.big { width: 100%; padding: 18px 24px; font-size: 21px; }
.btn.accent { background: linear-gradient(180deg, #ffe082, var(--accent) 55%, var(--accent-dark)); box-shadow: 0 6px 0 var(--accent-dark), var(--shadow-sm); color: #5d4037; }
.btn.green { background: linear-gradient(180deg, #7BE495, var(--good) 60%, #219653); box-shadow: 0 6px 0 #219653, var(--shadow-sm); }
.btn.pink { background: linear-gradient(180deg, #ff8ab5, var(--pink) 60%, #d81b6a); box-shadow: 0 6px 0 #d81b6a, var(--shadow-sm); }
.btn.ghost { background: #fff; color: var(--primary-dark); border: 3px solid var(--primary-light); box-shadow: 0 4px 0 rgba(92, 51, 173, .18); }
.btn.small { padding: 8px 16px; font-size: 15px; }
.btn.stack { margin-bottom: 14px; }

/* ============ CARDS ============ */
.card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm); margin-bottom: 14px; position: relative;
}
.card.bounce { animation: popIn .35s var(--pop); }
.section-title { font-size: 20px; font-weight: 800; margin: 18px 2px 10px; display: flex; align-items: center; gap: 8px; }

/* home action tiles */
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.tile {
  background: #fff; border-radius: var(--radius); padding: 20px 14px 16px; text-align: center;
  box-shadow: var(--shadow-sm); border: 3px solid transparent; cursor: pointer;
  transition: transform .12s var(--pop), border-color .15s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.tile:active { transform: scale(.93); }
.tile .emoji { font-size: 44px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.15)); }
.tile .label { font-weight: 800; font-size: 17px; }
.tile .sub { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.tile.c1 { border-color: #e1d4ff; } .tile.c1 .label { color: var(--primary-dark); }
.tile.c2 { border-color: #ffd6e8; } .tile.c2 .label { color: var(--pink); }
.tile.c3 { border-color: #c9f3ea; } .tile.c3 .label { color: #0e9d7a; }
.tile.c4 { border-color: #ffe9b3; } .tile.c4 .label { color: #c07f00; }

/* ============ MASCOT ============ */
.mascot-row { display: flex; align-items: flex-end; gap: 8px; margin: 10px 0 4px; }
.mascot { width: 64px; height: 64px; flex: 0 0 auto; animation: floaty 3s ease-in-out infinite; }
.bubble {
  background: #fff; border-radius: 18px 18px 18px 4px; padding: 10px 14px; font-weight: 700;
  box-shadow: var(--shadow-sm); font-size: 15.5px; max-width: 78%; animation: popIn .4s var(--pop);
}
[dir="rtl"] .bubble { border-radius: 18px 18px 4px 18px; text-align: right; }

/* ============ PROGRESS ============ */
.progressbar { height: 16px; background: #ede7f6; border-radius: 99px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.08); }
.progressbar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #ff7043); transition: width .6s var(--pop); }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--ink-soft); margin: 4px 2px 0; }

/* ============ WELCOME ============ */
.logo-hero { text-align: center; padding: 26px 0 8px; }
.logo-hero .logo-stars { font-size: 58px; animation: floaty 3s ease-in-out infinite; }
.logo-hero h1 { font-size: 34px; margin: 4px 0 2px; font-weight: 800; background: linear-gradient(90deg, var(--primary), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-hero p { margin: 0; color: var(--ink-soft); font-weight: 700; }
.profile-card {
  background: #fff; border-radius: 28px; padding: 22px 18px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow); border: 3px solid transparent; transition: transform .12s var(--pop);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.profile-card:active { transform: scale(.95); }
.profile-card.layla { border-color: #e1bee7; } .profile-card.alya { border-color: #b2ebf2; }
.avatar {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 44px;
  background: linear-gradient(135deg, #f3e5f5, #e1bee7); box-shadow: var(--shadow-sm);
}
.profile-card .pname { font-size: 23px; font-weight: 800; }
.profile-card .pstars { color: var(--ink-soft); font-weight: 800; font-size: 15px; }
.parent-corner { text-align: center; margin: 26px 0 10px; }
.parent-corner button { background: none; border: none; color: #9e93c4; font-weight: 800; font-size: 14px; cursor: pointer; padding: 10px; font-family: inherit; }

/* avatar/theme pickers */
.pick-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pick {
  width: 64px; height: 64px; border-radius: 20px; border: 3px solid #ede7f6; background: #fff;
  font-size: 32px; display: grid; place-items: center; cursor: pointer; transition: transform .12s var(--pop);
}
.pick.sel { border-color: var(--primary); transform: scale(1.12); box-shadow: var(--shadow-sm); }
.pick.color { border: none; } .pick.color.sel { outline: 4px solid #fff; outline-offset: -7px; }

/* ============ PIN PAD ============ */
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 16px 0 22px; }
.pin-dot { width: 18px; height: 18px; border-radius: 50%; background: #d7ccf5; transition: all .15s var(--pop); }
.pin-dot.filled { background: var(--primary); transform: scale(1.25); }
.pin-dot.shake { animation: shake .4s; background: var(--bad); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 300px; margin: 0 auto; }
.key {
  height: 68px; border-radius: 22px; border: none; background: #fff; box-shadow: var(--shadow-sm);
  font-size: 27px; font-weight: 800; color: var(--ink); cursor: pointer; font-family: inherit;
  transition: transform .1s var(--pop);
}
.key:active { transform: scale(.88); background: var(--primary-light); color: #fff; }
.key.erase { font-size: 20px; color: var(--ink-soft); }

/* ============ BOTTOM NAV ============ */
.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px;
  display: flex; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
  border-radius: 26px 26px 0 0; box-shadow: 0 -6px 24px rgba(90, 40, 180, .15);
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); z-index: 40;
}
.navbtn {
  flex: 1; border: none; background: none; font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
  border-radius: 18px; color: #9e93c4; font-weight: 800; font-size: 11.5px; transition: all .15s;
}
.navbtn .ico { font-size: 26px; transition: transform .15s var(--pop); }
.navbtn.active { color: var(--primary-dark); background: #f3eaff; }
.navbtn.active .ico { transform: scale(1.2) translateY(-2px); }

/* ============ SUBJECT PICKER ============ */
.subject-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.subj {
  background: #fff; border-radius: 22px; padding: 16px 8px; text-align: center; cursor: pointer;
  border: 3px solid transparent; transition: all .12s var(--pop); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.subj:active { transform: scale(.92); }
.subj.sel { border-color: var(--primary); }
.subj .emoji { font-size: 34px; } .subj .label { font-weight: 800; font-size: 14.5px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: #fff; border-radius: 99px;
  padding: 6px 14px; font-weight: 800; font-size: 14.5px; box-shadow: var(--shadow-sm);
}
.chip.subject { border: 2.5px solid var(--primary-light); color: var(--primary-dark); }
select.lesson-select {
  width: 100%; padding: 14px 16px; border-radius: 18px; border: 3px solid var(--primary-light);
  font-family: inherit; font-size: 16px; font-weight: 700; color: var(--ink); background: #fff;
  appearance: none; margin-top: 10px;
}

/* ============ SCAN / ANALYZE ============ */
.camera-btn {
  width: 100%; border: none; background: #fff; border-radius: var(--radius); padding: 34px 20px;
  box-shadow: var(--shadow-sm); font-family: inherit; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px; transition: transform .12s var(--pop);
}
.camera-btn:active { transform: scale(.96); }
.camera-btn .cam-emoji { font-size: 64px; animation: floaty 2.4s ease-in-out infinite; }
.camera-btn .cam-title { font-size: 21px; font-weight: 800; }
.camera-btn .cam-sub { color: var(--ink-soft); font-weight: 700; font-size: 14.5px; }
.photo-preview { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); display: block; }
.analyzing { text-align: center; padding: 40px 0; }
.analyzing .mascot { width: 110px; height: 110px; animation: spinWobble 1.6s ease-in-out infinite; margin: 0 auto 14px; }
.analyzing .msg { font-size: 19px; font-weight: 800; min-height: 30px; }
.analyzing .dots { margin-top: 6px; font-size: 26px; letter-spacing: 4px; }

/* question cards */
.qcard {
  background: #fff; border-radius: 20px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm); cursor: pointer; border-left: 6px solid #d7ccf5;
  display: flex; gap: 12px; align-items: center; transition: transform .12s var(--pop);
}
.qcard:active { transform: scale(.97); }
.qcard.correct { border-left-color: var(--good); }
.qcard.wrong { border-left-color: var(--warn); }
.qcard.done { opacity: .75; }
.qcard .qnum {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 14px; background: #f3eaff; color: var(--primary-dark);
  display: grid; place-items: center; font-weight: 800; font-size: 17px;
}
.qcard .qtext { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qcard .qbadge { font-size: 22px; }
.status-chip { font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.status-chip.correct { background: #e8f8f0; color: #1d8a55; }
.status-chip.wrong { background: #fff3e0; color: #b26a00; }
.status-chip.unanswered { background: #f3eaff; color: var(--primary-dark); }

/* teaching flow */
.step-box { border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; font-weight: 700; animation: popIn .3s var(--pop); }
.step-box.hint { background: #fff8e1; border: 2.5px solid #ffe082; }
.step-box.explain { background: #e8f4fd; border: 2.5px solid #90caf9; }
.step-box.answer { background: #fce4ec; border: 2.5px solid #f8bbd0; }
.step-box.check-good { background: #e8f8f0; border: 2.5px solid #a5d6a7; }
.step-box.check-try { background: #fff3e0; border: 2.5px solid #ffcc80; }
.step-box .step-tag { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; opacity: .65; display: block; margin-bottom: 4px; }
.answer-input {
  width: 100%; border: 3px solid var(--primary-light); border-radius: 18px; padding: 14px 16px;
  font-family: inherit; font-size: 18px; font-weight: 700; color: var(--ink); background: #fff; outline: none;
}
.answer-input:focus { border-color: var(--primary); }
.try-actions { display: flex; gap: 10px; margin-top: 10px; }
.try-actions .btn { flex: 1; }

/* ============ TRANSLATE ============ */
.lang-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.lang-pill {
  flex: 1; background: #fff; border-radius: 18px; padding: 10px; text-align: center; font-weight: 800;
  font-size: 17px; box-shadow: var(--shadow-sm); border: 3px solid transparent; cursor: pointer;
}
.lang-pill.sel { border-color: var(--primary); color: var(--primary-dark); }
.swap-btn { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--primary); color: #fff; font-size: 20px; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .2s var(--pop); }
.swap-btn.spun { transform: rotate(180deg); }
.translate-input {
  width: 100%; min-height: 110px; border: 3px solid var(--primary-light); border-radius: var(--radius);
  padding: 16px; font-family: inherit; font-size: 20px; font-weight: 700; color: var(--ink);
  background: #fff; outline: none; resize: none;
}
.mic-btn {
  position: relative; border: none; background: #fff; border-radius: 18px; padding: 12px 16px;
  font-size: 24px; cursor: pointer; box-shadow: var(--shadow-sm); font-family: inherit;
}
.mic-cost {
  position: absolute; top: -10px; right: -6px; background: var(--bad); color: #fff; border-radius: 99px;
  font-size: 11.5px; font-weight: 800; padding: 2px 8px;
}
.result-word { font-size: 30px; font-weight: 800; color: var(--primary-dark); }
.result-sub { font-size: 16px; color: var(--ink-soft); font-weight: 700; }
.lang-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 2px dashed #eee; }
.lang-line:last-child { border-bottom: none; }
.lang-line .lcode {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; flex: 0 0 auto;
}
.lcode.ar { background: #26a69a; } .lcode.en { background: #7e57c2; } .lcode.fr { background: #ff7043; }
.speak-btn { margin-left: auto; border: none; background: #f3eaff; width: 40px; height: 40px; border-radius: 50%; font-size: 19px; cursor: pointer; }
.suggestion-ghost { color: var(--primary); font-weight: 800; text-decoration: underline wavy var(--accent); }

/* ============ WORDS ============ */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; border: none; background: #fff; border-radius: 16px; padding: 10px; font-family: inherit;
  font-weight: 800; font-size: 15px; color: var(--ink-soft); cursor: pointer; box-shadow: var(--shadow-sm);
}
.tab.active { background: var(--primary); color: #fff; }
.wordcard {
  background: #fff; border-radius: 18px; padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 12px;
}
.wordcard .w-main { flex: 1; min-width: 0; }
.wordcard .w-word { font-size: 19px; font-weight: 800; }
.wordcard .w-trans { color: var(--ink-soft); font-weight: 700; font-size: 15px; }
.mastery-dot { font-size: 20px; }
.lookups-badge { font-size: 12px; font-weight: 800; background: #fff3cd; color: #996600; padding: 3px 8px; border-radius: 99px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); font-weight: 700; }
.empty-state .big-emoji { font-size: 56px; display: block; margin-bottom: 10px; }

/* ============ GAMES ============ */
.game-card {
  width: 100%; background: #fff; border-radius: var(--radius); padding: 22px; margin-bottom: 14px;
  border: none; box-shadow: var(--shadow-sm); font-family: inherit; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 16px; transition: transform .12s var(--pop);
}
.game-card:active { transform: scale(.96); }
.game-card .g-emoji { font-size: 44px; }
.game-card .g-name { font-size: 20px; font-weight: 800; }
.game-card .g-desc { color: var(--ink-soft); font-weight: 700; font-size: 14px; }
.flash-word { font-size: 34px; font-weight: 800; text-align: center; padding: 18px 8px; min-height: 90px; }
.option-btn {
  width: 100%; background: #fff; border: 3px solid #ede7f6; border-radius: 18px; padding: 15px;
  font-family: inherit; font-size: 18px; font-weight: 800; color: var(--ink); cursor: pointer; margin-bottom: 10px;
  transition: all .12s var(--pop); text-align: center;
}
.option-btn:active { transform: scale(.96); }
.option-btn.good { border-color: var(--good); background: #e8f8f0; }
.option-btn.bad { border-color: var(--bad); background: #fdecea; }
.match-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.match-tile {
  aspect-ratio: 1; border-radius: 18px; border: none; background: linear-gradient(135deg, var(--primary), var(--pink));
  color: #fff; font-family: inherit; font-weight: 800; font-size: 15px; cursor: pointer;
  display: grid; place-items: center; padding: 6px; text-align: center; transition: all .2s var(--pop);
  box-shadow: var(--shadow-sm);
}
.match-tile.flipped { background: #fff; color: var(--ink); border: 3px solid var(--primary-light); }
.match-tile.matched { background: #e8f8f0; color: #1d8a55; border: 3px solid var(--good); pointer-events: none; }
.match-tile.wrongflash { animation: shake .4s; background: #fdecea; }
.game-progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.game-progress .pip { width: 14px; height: 14px; border-radius: 50%; background: #e0d7f5; }
.game-progress .pip.good { background: var(--good); } .game-progress .pip.bad { background: var(--bad); }
.streak-flame { position: absolute; top: 12px; right: 14px; font-size: 22px; font-weight: 800; }

/* ============ STARS SCREEN ============ */
.level-ring { text-align: center; padding: 22px 0 8px; }
.level-ring .big-stars { font-size: 46px; font-weight: 800; color: var(--primary-dark); }
.level-ring .lvl-label { font-size: 18px; font-weight: 800; color: var(--ink-soft); }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.badge-cell {
  background: #fff; border-radius: 20px; padding: 14px 8px; text-align: center; box-shadow: var(--shadow-sm);
}
.badge-cell.locked { opacity: .45; filter: grayscale(.9); }
.badge-cell .b-icon { font-size: 34px; }
.badge-cell .b-name { font-weight: 800; font-size: 13.5px; }
.badge-cell .b-desc { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }
.week-strip { display: flex; justify-content: space-between; margin-top: 8px; }
.day-cell { text-align: center; font-size: 12px; font-weight: 800; }
.day-cell .d-dot { width: 34px; height: 34px; border-radius: 50%; background: #ede7f6; display: grid; place-items: center; font-size: 17px; margin-bottom: 3px; }
.day-cell.hit .d-dot { background: var(--accent); box-shadow: 0 0 0 4px #fff3cd; }
.day-cell.today .d-dot { outline: 3px solid var(--primary); }

/* ============ PARENT ============ */
.parent-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-box { background: #fff; border-radius: 18px; padding: 14px; box-shadow: var(--shadow-sm); }
.stat-box .s-val { font-size: 26px; font-weight: 800; color: var(--primary-dark); }
.stat-box .s-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 10px; }
.bar-chart .bar { flex: 1; background: linear-gradient(180deg, var(--primary-light), var(--primary)); border-radius: 6px 6px 0 0; min-height: 3px; position: relative; }
.bar-chart .bar span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 9.5px; color: var(--ink-soft); font-weight: 800; }
.bar-chart .bar.today { background: linear-gradient(180deg, #ffe082, var(--accent)); }
.feed-item { padding: 10px 4px; border-bottom: 2px dashed #eee; font-size: 14.5px; font-weight: 700; }
.feed-item .f-time { color: #9e93c4; font-size: 12px; font-weight: 700; display: block; }
.hw-thumb { width: 100%; border-radius: 14px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.method-chip { font-size: 11.5px; font-weight: 800; border-radius: 99px; padding: 2px 9px; margin: 2px; display: inline-block; }
.method-chip.m-hint, .method-chip.m-direct { background: #e8f8f0; color: #1d8a55; }
.method-chip.m-fix_self { background: #e3f2fd; color: #1565c0; }
.method-chip.m-explain { background: #fff8e1; color: #b26a00; }
.method-chip.m-revealed { background: #fdecea; color: #c62828; }
.method-chip.m-already { background: #f3e5f5; color: #7b1fa2; }

/* ============ MODALS ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(30, 15, 70, .55); z-index: 90; display: grid;
  place-items: end center; animation: fadeIn .2s;
}
.modal-sheet {
  background: #fff; width: 100%; max-width: 520px; border-radius: 28px 28px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 88dvh; overflow-y: auto; animation: slideUp .3s var(--pop);
}
.modal-handle { width: 44px; height: 5px; background: #e0d7f5; border-radius: 99px; margin: 0 auto 16px; }
.modal-title { font-size: 22px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* toast */
.toast {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 12px 22px; border-radius: 99px; font-weight: 800; z-index: 99; box-shadow: var(--shadow);
  animation: popIn .25s var(--pop); max-width: 86%; text-align: center; font-size: 15.5px;
}

/* confetti canvas */
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 95; }

/* stars fly animation */
.star-fly {
  position: fixed; font-size: 30px; z-index: 96; pointer-events: none;
  animation: flyUp 1.1s ease-out forwards;
}

/* ============ ANIMATIONS ============ */
@keyframes popIn { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes slideUp { 0% { transform: translateY(24px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes spinWobble { 0% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.08); } 100% { transform: rotate(-8deg) scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes flyUp { 0% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(-240px) scale(1.7); opacity: 0; } }
@keyframes celebrate { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.15) rotate(-6deg); } 75% { transform: scale(1.15) rotate(6deg); } }
.celebrating { animation: celebrate .6s ease-in-out 3; }

/* utility */
.hidden { display: none !important; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; }
.center { text-align: center; } .flex { display: flex; gap: 10px; align-items: center; }
.flex1 { flex: 1; }
.small-note { font-size: 13.5px; color: var(--ink-soft); font-weight: 700; }
.spin-star { display: inline-block; animation: spinWobble 1.4s infinite; }

/* girl themes */
body[data-theme="pink"] { --primary: #ff4d94; --primary-dark: #d81b6a; --primary-light: #ff8ab5; --bg1: #ffe3ef; --bg3: #fff0f5; }
body[data-theme="teal"] { --primary: #00b894; --primary-dark: #00947a; --primary-light: #55efc4; --bg1: #def7f0; --bg2: #e8f7ff; --bg3: #f0fffa; }
body[data-theme="purple"] { --primary: #7c4dff; --primary-dark: #5a2ee0; --primary-light: #b388ff; }
body[data-theme="orange"] { --primary: #ff8f00; --primary-dark: #e65100; --primary-light: #ffbd45; --bg1: #fff3e0; --bg3: #fffaf3; }
