/* =========================================================
   A1 Quest — tasarım sistemi
   ========================================================= */
:root {
  --bg: #f5f2ff;
  --surface: #ffffff;
  --surface-2: #f4f1fb;
  --ink: #1d1838;
  --muted: #7a7499;
  --line: #ebe7f6;

  --brand: #7a5cff;
  --brand-2: #5a3cf0;
  --green: #2fca62;
  --green-d: #1fa24b;
  --red: #ff4d63;
  --red-d: #d83249;
  --blue: #3a9bff;
  --blue-d: #1f78db;
  --orange: #ff8a1f;
  --pink: #ff4f8b;
  --gold: #ffbb1f;
  --gold-d: #e09a00;

  --good-bg: #e3fbe9;
  --bad-bg: #ffe6e9;
  --locked: #d9d5e6;

  --sh-sm: 0 1px 2px rgba(29, 24, 56, .06), 0 2px 6px rgba(29, 24, 56, .05);
  --sh: 0 1px 2px rgba(29, 24, 56, .05), 0 10px 30px -8px rgba(29, 24, 56, .14);
  --sh-lg: 0 20px 50px -12px rgba(29, 24, 56, .28);
  --r: 24px;
  --r-sm: 16px;
  --glass: rgba(255, 255, 255, .72);
  --head: "Fredoka", "Nunito", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0b22; --surface: #1a1638; --surface-2: #231e48; --ink: #f4f2ff; --muted: #a39ec9; --line: #2d2757;
    --good-bg: #133524; --bad-bg: #3d1622; --locked: #39335e; --glass: rgba(20, 17, 44, .72);
    --sh-sm: 0 1px 2px rgba(0, 0, 0, .4); --sh: 0 12px 30px -10px rgba(0, 0, 0, .6); --sh-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  --bg: #0e0b22; --surface: #1a1638; --surface-2: #231e48; --ink: #f4f2ff; --muted: #a39ec9; --line: #2d2757;
  --good-bg: #133524; --bad-bg: #3d1622; --locked: #39335e; --glass: rgba(20, 17, 44, .72);
  --sh-sm: 0 1px 2px rgba(0, 0, 0, .4); --sh: 0 12px 30px -10px rgba(0, 0, 0, .6); --sh-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(42rem 30rem at 115% -8%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 62%),
    radial-gradient(36rem 26rem at -25% 28%, color-mix(in srgb, var(--orange) 14%, transparent), transparent 62%),
    radial-gradient(40rem 30rem at 120% 85%, color-mix(in srgb, var(--pink) 12%, transparent), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input { font: inherit; color: inherit; }
h1, h2, h3, .head { font-family: var(--head); letter-spacing: -.2px; }

.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.view { flex: 1; padding: 8px 16px 120px; animation: viewIn .35s ease both; }
.app.in-game .tabs, .app.in-game .topbar { display: none; }
.app.in-game .view { padding-bottom: 16px; padding-top: 16px; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
.chip {
  display: flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px 0 10px; border-radius: 99px;
  background: var(--surface); box-shadow: var(--sh-sm); font-family: var(--head); font-weight: 700; font-size: 17px;
}
.chip.streak b { color: var(--orange); }
.chip.freeze b { color: var(--blue); }
.flame.off { filter: grayscale(1); opacity: .5; }
.lvl {
  flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; height: 36px; padding: 0 12px 0 4px;
  border-radius: 99px; background: var(--surface); box-shadow: var(--sh-sm);
}
.lvl-badge {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #ffd34d, #ff9f1a); color: #fff; font-family: var(--head); font-weight: 700; font-size: 14px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); text-shadow: 0 1px 0 rgba(0, 0, 0, .15);
}
.lvl-bar { flex: 1; height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.lvl-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd34d, #ff9f1a); border-radius: 99px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.sync { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.sync.ok { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.sync.err { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent); }

/* ---------- floating tab bar ---------- */
.tabs {
  position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 520px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 6px; border-radius: 26px; background: var(--glass); box-shadow: var(--sh-lg);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); z-index: 20;
}
.tabs button {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 4px 6px; border-radius: 20px;
  font-size: 11px; font-weight: 800; color: var(--muted); transition: background .2s, color .2s;
}
.tabs button span { font-size: 22px; line-height: 1.15; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); filter: grayscale(.6); opacity: .8; }
.tabs button.on { color: var(--brand); background: color-mix(in srgb, var(--brand) 13%, transparent); }
.tabs button.on span { transform: translateY(-2px) scale(1.12); filter: none; opacity: 1; }

/* ---------- primitives ---------- */
h1 { font-size: 28px; line-height: 1.15; margin: 4px 0 12px; font-weight: 700; }
h2 { font-size: 20px; margin: 0; font-weight: 700; }
.muted { color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; }
.card {
  background: var(--surface); border-radius: var(--r); padding: 16px; margin-bottom: 14px; box-shadow: var(--sh);
}
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 12px; }
.pill {
  font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand);
}
.ico {
  --c: var(--brand); width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 22px;
  background: color-mix(in srgb, var(--c) 15%, transparent);
}
.pbar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4fe07f, var(--green)); transition: width .7s cubic-bezier(.2, .8, .2, 1); position: relative; }
.pbar i::after { content: ""; position: absolute; left: 6px; right: 6px; top: 2px; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, .35); }

.btn {
  --c: var(--surface); --d: var(--line); --t: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px;
  border-radius: 18px; font-family: var(--head); font-weight: 600; font-size: 17px; letter-spacing: .3px;
  color: var(--t); background: var(--c); box-shadow: 0 5px 0 var(--d); transition: transform .08s, box-shadow .08s, filter .15s;
  position: relative; overflow: hidden;
}
.btn::before { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(rgba(255, 255, 255, .22), transparent); pointer-events: none; }
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--d); }
.btn.block { width: 100%; }
.btn.primary, .btn.green { --c: var(--green); --d: var(--green-d); --t: #fff; }
.btn.blue { --c: var(--blue); --d: var(--blue-d); --t: #fff; }
.btn.red { --c: var(--red); --d: var(--red-d); --t: #fff; }
.btn.ghost { --c: var(--surface); --d: var(--line); box-shadow: 0 5px 0 var(--d), var(--sh-sm); }
.btn[disabled] { --c: var(--surface-2); --d: var(--line); --t: var(--muted); pointer-events: none; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; box-shadow: 0 3px 0 var(--d); }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); }
.speak-btn {
  width: 46px; height: 46px; border-radius: 16px; flex: none; display: inline-grid; place-items: center; font-size: 20px;
  background: linear-gradient(145deg, #59b1ff, var(--blue)); color: #fff; box-shadow: 0 4px 0 var(--blue-d);
  transition: transform .08s, box-shadow .08s;
}
.speak-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-d); }
.speak-btn.sm { width: 36px; height: 36px; font-size: 15px; border-radius: 12px; box-shadow: 0 3px 0 var(--blue-d); }

/* ---------- home ---------- */
.greet { display: flex; align-items: center; gap: 12px; margin: 10px 2px 16px; }
.greet .hello { margin: 0; font-size: 15px; color: var(--muted); font-weight: 700; }
.greet h1 { margin: 0; font-size: 30px; }
.wave { display: inline-block; animation: wave 2.4s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-8deg); } }
.avatar {
  position: relative; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; flex: none;
  background: var(--surface); box-shadow: var(--sh);
}
.avatar i {
  position: absolute; right: -4px; bottom: -2px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 99px; font-style: normal;
  display: grid; place-items: center; font-family: var(--head); font-weight: 700; font-size: 12px; color: #fff;
  background: linear-gradient(145deg, #ffd34d, #ff9f1a); border: 2px solid var(--bg);
}

.hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 18px; margin-bottom: 14px; color: #fff;
  background: linear-gradient(140deg, #8f7cff 0%, #6a4cf5 55%, #5536d8 100%); box-shadow: 0 18px 40px -14px rgba(90, 60, 240, .6);
}
.hero.lit { background: linear-gradient(140deg, #ffb340 0%, #ff7a2f 50%, #ff4f6d 100%); box-shadow: 0 18px 40px -14px rgba(255, 110, 50, .6); }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1); pointer-events: none;
}
.hero::before { width: 220px; height: 220px; right: -70px; top: -90px; }
.hero::after { width: 140px; height: 140px; left: -50px; bottom: -70px; }
.hero-top { position: relative; display: flex; align-items: center; gap: 14px; }
.flame-wrap {
  width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, .18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.flame-big { font-size: 40px; line-height: 1; display: inline-block; }
.hero:not(.lit) .flame-big { filter: grayscale(1) brightness(1.6); opacity: .65; }
.hero.lit .flame-big { animation: flicker 1.8s ease-in-out infinite; filter: drop-shadow(0 4px 10px rgba(255, 220, 120, .7)); }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08) rotate(2deg); } }
.hero-num { font-family: var(--head); font-weight: 700; font-size: 34px; line-height: 1; }
.hero-num small { font-size: 15px; font-weight: 600; opacity: .9; margin-left: 2px; }
.hero-txt { font-size: 14px; font-weight: 700; opacity: .92; margin-top: 4px; }
.hero .ring { background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0); }
.hero .ring > span { background: color-mix(in srgb, #000 12%, transparent); color: #fff; backdrop-filter: blur(6px); }
.ring {
  --p: 0; width: 70px; height: 70px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--surface-2) 0);
}
.ring > span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: var(--surface); line-height: 1; }
.ring b { font-family: var(--head); font-size: 17px; }
.ring small { font-size: 10px; font-weight: 800; opacity: .85; }
.week { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }
.week .d {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 7px; border-radius: 14px;
  background: rgba(255, 255, 255, .12); font-size: 11px; font-weight: 800; opacity: .95;
}
.week .d i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; background: rgba(255, 255, 255, .18); }
.week .d.done { background: #fff; color: #ff6a3d; }
.week .d.done i { background: color-mix(in srgb, #ff8a1f 18%, #fff); }
.week .d.frozen { background: rgba(255, 255, 255, .85); color: var(--blue-d); }
.week .d.today { outline: 2px solid rgba(255, 255, 255, .9); outline-offset: -2px; }

.continue {
  --c: var(--brand); width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px; margin-bottom: 12px;
  border-radius: var(--r); background: var(--surface); box-shadow: var(--sh), 0 5px 0 color-mix(in srgb, var(--c) 45%, var(--line));
  transition: transform .08s, box-shadow .08s;
}
.continue:active { transform: translateY(4px); box-shadow: var(--sh-sm), 0 1px 0 color-mix(in srgb, var(--c) 45%, var(--line)); }
.continue-em {
  width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; font-size: 32px; flex: none;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12);
}
.continue small { display: block; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.continue b { display: block; font-family: var(--head); font-size: 19px; font-weight: 600; margin: 1px 0 7px; }
.continue .pbar { height: 8px; }
.play {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 18px; color: #fff; padding-left: 3px;
  background: linear-gradient(145deg, #4fe07f, var(--green)); box-shadow: 0 4px 0 var(--green-d); animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 4px 0 var(--green-d), 0 0 0 0 color-mix(in srgb, var(--green) 45%, transparent); } 50% { box-shadow: 0 4px 0 var(--green-d), 0 0 0 10px transparent; } }
.review {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; margin-bottom: 4px;
  border-radius: 20px; background: var(--surface); box-shadow: var(--sh-sm);
}
.review b { display: block; font-family: var(--head); font-weight: 600; }
.review small { color: var(--muted); font-weight: 700; font-size: 13px; }
.chev { font-size: 26px; color: var(--muted); line-height: 1; }

.quests { padding: 6px 16px; }
.quest { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.quest + .quest { border-top: 1px solid var(--line); }
.quest .t { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.quest .pbar { height: 8px; }
.quest .pbar i { background: linear-gradient(90deg, #ffd34d, #ff9f1a); }
.quest.done .t { color: var(--green-d); }
.quest.done .pbar i { background: linear-gradient(90deg, #4fe07f, var(--green)); }
.quest .n { font-size: 12px; font-weight: 800; color: var(--muted); white-space: nowrap; text-align: right; }
.quest .n b { display: block; color: var(--gold-d); font-size: 13px; }

.wotd {
  position: relative; overflow: hidden; border-radius: 28px; padding: 20px; color: #fff; margin-bottom: 14px;
  background: linear-gradient(135deg, #2fb4ff 0%, #5a6bff 55%, #9a4dff 100%); box-shadow: 0 18px 40px -16px rgba(80, 100, 255, .6);
}
.wotd::before { content: "Aa"; position: absolute; right: -10px; bottom: -40px; font-family: var(--head); font-weight: 700; font-size: 150px; opacity: .1; line-height: 1; }
.wotd .lbl { font-size: 11px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; opacity: .8; }
.wotd .w { font-family: var(--head); font-size: 36px; font-weight: 700; line-height: 1.1; margin: 4px 0 2px; }
.wotd .tr { font-size: 17px; font-weight: 700; opacity: .92; }
.wotd .ex { position: relative; margin-top: 14px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .14); font-size: 14px; }
.wotd .speak-btn { background: rgba(255, 255, 255, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }

/* ---------- map ---------- */
.map-head { display: flex; align-items: center; gap: 14px; }
.map-head .ring { width: 62px; height: 62px; }
.map-head .ring > span { width: 50px; height: 50px; }
.map { position: relative; margin: 10px auto 10px; }
.map svg { position: absolute; left: 50%; top: 0; transform: translateX(-50%); overflow: visible; }
.map .trail { fill: none; stroke: var(--locked); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 2 18; }
.map .trail.done { stroke: color-mix(in srgb, var(--brand) 60%, transparent); stroke-dasharray: none; stroke-width: 8; }
.node { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 6px; transform: translateX(-50%); width: 140px; }
.node .circle {
  --p: 0; --c: var(--brand); width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); box-shadow: var(--sh);
}
.node .inner {
  width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; position: relative;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 70%);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .16), inset 0 3px 0 rgba(255, 255, 255, .35);
  transition: transform .15s;
}
.node:active .inner { transform: translateY(3px); }
.node.locked .circle { --c: var(--locked); }
.node.locked .inner { background: var(--locked); font-size: 26px; filter: saturate(0); opacity: .8; }
.node.current .circle::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 3px solid var(--c); opacity: .5; animation: ripple 1.8s ease-out infinite;
}
@keyframes ripple { from { transform: scale(.95); opacity: .6; } to { transform: scale(1.22); opacity: 0; } }
.node .bubble {
  position: absolute; top: -34px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 5px 12px; border-radius: 12px;
  background: var(--surface); color: var(--brand); font-family: var(--head); font-weight: 700; font-size: 13px; letter-spacing: .5px;
  box-shadow: var(--sh); animation: bob 1.6s ease-in-out infinite; z-index: 2;
}
.node .bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: var(--surface); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.node .star { position: absolute; top: -4px; right: -4px; font-size: 24px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.node .name { font-family: var(--head); font-weight: 600; font-size: 15px; text-align: center; line-height: 1.2; }
.node .name small { display: block; font-family: "Nunito", sans-serif; font-size: 12px; font-weight: 800; color: var(--muted); margin-top: 2px; }
.node.locked .name { color: var(--muted); }

/* haritadaki el ele yürüyen çift */
.couple {
  position: absolute; width: 96px; height: 112px; transform: translate(-50%, -100%); z-index: 3; cursor: pointer;
  -webkit-tap-highlight-color: transparent; filter: drop-shadow(0 6px 10px rgba(29, 24, 56, .12));
}
.couple svg { width: 100%; height: 100%; overflow: visible; display: block; }
.couple .cp-body { animation: cp-breathe 2.6s ease-in-out infinite; transform-origin: 50% 95%; transform-box: view-box; }
.couple .cp-leg { transform-box: fill-box; transform-origin: 50% 0; }
.couple .cp-eyes { transform-box: fill-box; transform-origin: center; animation: cp-blink 4.8s infinite; }
.couple .cp-heart { transform-box: fill-box; transform-origin: center; animation: cp-heart 2.2s ease-in-out infinite; }
.couple.walking .cp-body { animation: cp-step .42s ease-in-out infinite; }
.couple.walking .cp-leg.a { animation: cp-swing .42s ease-in-out infinite alternate; }
.couple.walking .cp-leg.b { animation: cp-swing .42s ease-in-out infinite alternate-reverse; }
.couple:active .cp-body { transform: scale(.96); }
@keyframes cp-breathe { 50% { transform: translateY(-1.5px) scaleY(1.01); } }
@keyframes cp-step { 50% { transform: translateY(-3px); } }
@keyframes cp-swing { from { transform: rotate(18deg); } to { transform: rotate(-18deg); } }
@keyframes cp-blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes cp-heart { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.15); } }
.cp-say {
  --sx: -50%; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(var(--sx)); white-space: nowrap; z-index: 4;
  padding: 7px 12px; border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--sh);
  font-family: var(--head); font-weight: 600; font-size: 14px; animation: cp-say-in .35s cubic-bezier(.2, 1.4, .4, 1) both;
}
.cp-say::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: var(--surface); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.couple.side-l .cp-say { --sx: 0%; left: 4px; }
.couple.side-r .cp-say { --sx: 0%; left: auto; right: 4px; }
.couple.side-l .cp-say::after { left: 40px; }
.couple.side-r .cp-say::after { left: auto; right: 34px; transform: rotate(45deg); }
.cp-say.out { opacity: 0; transform: translateX(var(--sx)) translateY(-4px); transition: .35s; }
@keyframes cp-say-in { from { opacity: 0; transform: translateX(var(--sx)) translateY(6px) scale(.85); } }
.cp-pop { position: absolute; left: 50%; top: 45%; font-size: 18px; pointer-events: none; animation: cp-pop 1.5s ease-out both; }
@keyframes cp-pop {
  from { opacity: 0; transform: translate(-50%, 0) scale(.4); }
  20% { opacity: 1; }
  to { opacity: 0; transform: translate(calc(-50% + var(--dx)), -90px) scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .couple .cp-body, .couple .cp-eyes, .couple .cp-heart, .couple .cp-leg { animation: none !important; }
}
@keyframes bob { 50% { transform: translate(-50%, -5px); } }

/* ---------- unit ---------- */
.topnav { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; font-weight: 800; color: var(--muted); }
.back { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; line-height: 1; background: var(--surface); box-shadow: var(--sh-sm); color: var(--ink); }
.unit-hero {
  --c: var(--brand); position: relative; overflow: hidden; border-radius: 28px; padding: 22px 20px 20px; color: #fff; margin-bottom: 14px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 80%, #fff), var(--c) 45%, color-mix(in srgb, var(--c) 70%, #000));
  box-shadow: 0 18px 40px -16px color-mix(in srgb, var(--c) 80%, transparent);
}
.unit-hero .wm { position: absolute; right: -24px; top: -18px; font-size: 150px; opacity: .16; transform: rotate(12deg); line-height: 1; }
.unit-hero .em { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; font-size: 34px; background: rgba(255, 255, 255, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.unit-hero h1 { margin: 12px 0 2px; font-size: 30px; }
.unit-hero p { margin: 0 0 14px; font-weight: 700; opacity: .9; font-size: 14px; }
.unit-hero .pbar { background: rgba(0, 0, 0, .18); }
.unit-hero .pbar i { background: #fff; }
.unit-hero .pct { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; margin-top: 6px; opacity: .95; }
.mix-cta {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: var(--r); color: #fff;
  background: linear-gradient(135deg, #3ddc72, #22b357); box-shadow: 0 6px 0 var(--green-d), 0 16px 30px -14px rgba(34, 179, 87, .7);
  transition: transform .08s, box-shadow .08s;
}
.mix-cta:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--green-d); }
.mix-cta .e { font-size: 34px; }
.mix-cta b { display: block; font-family: var(--head); font-size: 20px; font-weight: 600; }
.mix-cta small { font-weight: 700; opacity: .92; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode {
  --c: var(--brand); display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px; border-radius: 20px;
  background: var(--surface); box-shadow: var(--sh-sm), 0 4px 0 color-mix(in srgb, var(--c) 30%, var(--line));
  transition: transform .08s, box-shadow .08s;
}
.mode:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 30%, var(--line)); }
.mode .ico { width: 42px; height: 42px; font-size: 21px; border-radius: 13px; }
.mode b { display: block; font-family: var(--head); font-weight: 600; font-size: 15px; line-height: 1.2; }
.mode small { color: var(--muted); font-weight: 700; font-size: 12px; }
.tip { padding: 0; overflow: hidden; }
.tip summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-weight: 800; }
.tip summary::-webkit-details-marker { display: none; }
.tip summary .chev { margin-left: auto; transition: transform .2s; }
.tip[open] summary .chev { transform: rotate(90deg); }
.tip .tip-body { padding: 0 16px 16px; }
.tip ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.tip li { padding: 9px 12px; border-radius: 12px; background: var(--surface-2); font-weight: 700; font-size: 14px; }
.tip b { color: var(--brand); }

/* ---------- word list ---------- */
.words { padding: 4px 14px; }
.wl { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.wl + .wl { border-top: 1px solid var(--line); }
.wl .en { font-weight: 800; }
.wl .tr { color: var(--muted); font-size: 14px; font-weight: 600; }
.wl .speak-btn { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); box-shadow: none; }
.dots { display: flex; gap: 3px; }
.dots i { width: 7px; height: 16px; border-radius: 4px; background: var(--surface-2); }
.dots i.on { background: linear-gradient(var(--green), var(--green-d)); }
.seg { display: flex; background: var(--surface); box-shadow: var(--sh-sm); border-radius: 18px; padding: 5px; gap: 4px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 9px 6px; border-radius: 14px; font-weight: 800; font-size: 14px; color: var(--muted); transition: .2s; }
.seg button.on { background: var(--brand); color: #fff; box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 80%, transparent); }
.search-wrap { position: relative; margin-bottom: 12px; }
.search-wrap::before { content: "🔎"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; opacity: .6; }
.search {
  width: 100%; padding: 14px 16px 14px 42px; border-radius: 18px; border: 2px solid transparent;
  background: var(--surface); box-shadow: var(--sh-sm); outline: none; transition: border-color .2s;
}
.search:focus { border-color: var(--brand); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 10px 2px 14px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-weight: 700; font-size: 14px; }

/* ---------- profile ---------- */
.p-hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 22px 18px 18px; margin: 8px 0 14px; color: #fff; text-align: center;
  background: linear-gradient(150deg, #8f7cff, #6a4cf5 50%, #ff4f8b 130%); box-shadow: 0 18px 40px -16px rgba(106, 76, 245, .6);
}
.p-hero::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .08); left: -80px; top: -120px; }
.p-avatar {
  --p: 0; position: relative; width: 104px; height: 104px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center;
  background: conic-gradient(#ffd34d calc(var(--p) * 1%), rgba(255, 255, 255, .25) 0);
}
.p-avatar span { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; font-size: 50px; background: rgba(255, 255, 255, .95); }
.p-avatar i {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); padding: 3px 10px; border-radius: 99px; font-style: normal;
  background: linear-gradient(145deg, #ffd34d, #ff9f1a); font-family: var(--head); font-weight: 700; font-size: 13px; white-space: nowrap; box-shadow: var(--sh-sm);
}
.p-hero h1 { margin: 10px 0 0; position: relative; }
.p-hero .sub { font-weight: 800; opacity: .9; position: relative; }
.p-hero .xpline { position: relative; margin-top: 12px; font-size: 13px; font-weight: 700; opacity: .9; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border-radius: 20px; padding: 12px; display: flex; gap: 10px; align-items: center; box-shadow: var(--sh-sm); }
.stat b { display: block; font-family: var(--head); font-size: 21px; font-weight: 700; line-height: 1.1; }
.stat small { color: var(--muted); font-weight: 700; font-size: 12px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.bars span { width: 100%; max-width: 34px; border-radius: 10px 10px 6px 6px; min-height: 6px; background: linear-gradient(var(--brand), color-mix(in srgb, var(--brand) 60%, #fff)); }
.bars span.hit { background: linear-gradient(#ffb340, #ff6a3d); }
.bars span.empty { background: var(--surface-2); }
.bars small { font-size: 11px; font-weight: 800; color: var(--muted); }
.bars em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--muted); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal i {
  aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-style: normal;
  font-size: 12px; font-weight: 800; color: var(--muted);
}
.cal i.h { background: none; font-size: 11px; aspect-ratio: auto; padding-bottom: 2px; }
.cal i.done { background: linear-gradient(145deg, #ffb340, #ff6a3d); color: #fff; }
.cal i.frozen { background: linear-gradient(145deg, #7cc4ff, var(--blue)); color: #fff; }
.cal i.part { background: color-mix(in srgb, var(--orange) 22%, var(--surface-2)); color: var(--orange); }
.cal i.today { box-shadow: 0 0 0 2px var(--brand); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--c); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { text-align: center; background: var(--surface); border-radius: 20px; padding: 14px 6px 12px; box-shadow: var(--sh-sm); }
.badge .medal {
  width: 58px; height: 58px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 30px;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #ffc93d 60%, #f0a500); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12), 0 6px 14px -6px rgba(240, 165, 0, .8);
}
.badge b { display: block; font-size: 13px; font-family: var(--head); font-weight: 600; }
.badge small { color: var(--muted); font-size: 11px; font-weight: 700; display: block; line-height: 1.25; margin-top: 2px; }
.badge.off .medal { background: var(--surface-2); box-shadow: none; filter: grayscale(1); opacity: .5; }
.badge.off b { color: var(--muted); }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg + .msg { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.msg .text { font-weight: 700; padding: 10px 12px; border-radius: 4px 16px 16px 16px; background: color-mix(in srgb, var(--gold) 16%, var(--surface)); }
.msg.off { color: var(--muted); align-items: center; }
.settings .row + .row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.switch { width: 52px; height: 30px; border-radius: 99px; background: var(--surface-2); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); }
.switch.on { background: var(--green); }
.switch.on::after { left: 25px; }

/* ---------- game ---------- */
.game { display: flex; flex-direction: column; min-height: calc(100dvh - 32px); padding-bottom: 110px; }
.game-top { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.game-top .pbar { flex: 1; height: 16px; }
.combo {
  font-family: var(--head); font-weight: 700; color: var(--muted); min-width: 52px; height: 32px; border-radius: 99px; display: grid; place-items: center;
  background: var(--surface); box-shadow: var(--sh-sm); opacity: .5; font-size: 14px;
}
.combo.on { color: #fff; background: linear-gradient(145deg, #ffb340, #ff6a3d); opacity: 1; animation: pop .35s; }
.q { flex: 1; display: flex; flex-direction: column; }
.q-label {
  align-self: flex-start; font-size: 12px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--brand);
  padding: 6px 12px; border-radius: 99px; background: color-mix(in srgb, var(--brand) 12%, transparent); margin-bottom: 16px;
}
.q-prompt { display: flex; align-items: center; gap: 14px; font-family: var(--head); font-size: 34px; font-weight: 600; line-height: 1.2; margin-bottom: 8px; min-height: 50px; }
.q-prompt.sent { font-size: 25px; line-height: 1.45; display: block; padding: 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--sh); }
.blank {
  display: inline-block; min-width: 76px; height: 1.15em; vertical-align: -0.15em; border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 14%, transparent); border-bottom: 3px solid var(--brand);
}
.q-sub { color: var(--muted); font-weight: 700; margin-bottom: 14px; }
.build-sub { font-family: var(--head); font-size: 22px; font-weight: 600; padding: 16px 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--sh); position: relative; }
.build-sub::before { content: "🇹🇷"; margin-right: 8px; }
.hint { margin: 10px 2px 6px; }
.hint-btn { font-size: 14px; font-weight: 800; color: var(--brand); padding: 6px 12px; border-radius: 99px; background: var(--surface); box-shadow: var(--sh-sm); }
.hint-text { display: inline-block; color: var(--muted); font-weight: 700; padding: 4px 0; }
.hint-text[hidden] { display: none; }
.options { display: grid; gap: 10px; margin-top: auto; padding-top: 18px; }
.opt {
  text-align: left; padding: 15px 16px; border: 2px solid transparent; border-radius: 18px; background: var(--surface);
  font-weight: 800; font-size: 17px; box-shadow: var(--sh-sm), 0 4px 0 var(--line); display: flex; align-items: center; gap: 12px;
  transition: transform .08s, box-shadow .08s, border-color .15s, background .15s;
}
.opt:hover { border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.opt .k { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; color: var(--muted); flex: none; background: var(--surface-2); font-family: var(--head); }
.opt.right { border-color: var(--green); background: var(--good-bg); box-shadow: 0 4px 0 var(--green); }
.opt.right .k { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--bad-bg); box-shadow: 0 4px 0 var(--red); animation: shake .35s; }
.opt.wrong .k { background: var(--red); color: #fff; }
.opt[disabled] { cursor: default; }
.listen-box { display: flex; justify-content: center; align-items: flex-end; gap: 16px; margin: 14px 0 8px; }
.listen-box .big {
  width: 128px; height: 128px; border-radius: 38px; font-size: 54px; color: #fff;
  background: linear-gradient(145deg, #59b1ff, var(--blue)); box-shadow: 0 7px 0 var(--blue-d), 0 20px 36px -14px rgba(58, 155, 255, .8);
  transition: transform .08s, box-shadow .08s;
}
.listen-box .big:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--blue-d); }
.listen-box .slow { width: 70px; height: 70px; border-radius: 22px; font-size: 30px; background: var(--surface); box-shadow: var(--sh-sm), 0 5px 0 var(--line); }
.type-in {
  width: 100%; padding: 18px; font-size: 21px; font-weight: 800; border: 2px solid transparent; border-radius: 20px;
  background: var(--surface); box-shadow: var(--sh); outline: none; margin-top: 14px; transition: border-color .2s;
}
.type-in:focus { border-color: var(--brand); }
.build-area {
  min-height: 116px; padding: 12px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; margin: 14px 0 18px; border-radius: 20px;
  background: repeating-linear-gradient(transparent 0 51px, var(--line) 51px 53px); border: 2px dashed var(--line);
}
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tok {
  padding: 10px 15px; border-radius: 14px; background: var(--surface); font-weight: 800; font-size: 17px;
  box-shadow: var(--sh-sm), 0 4px 0 var(--line); transition: transform .08s, box-shadow .08s; animation: pop .2s;
}
.tok:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.tok.used { visibility: hidden; }
.flash { perspective: 900px; height: 260px; margin: 6px 0 18px; cursor: pointer; }
.flash-inner { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.3, 1.3, .5, 1); transform-style: preserve-3d; }
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 28px; background: var(--surface); box-shadow: var(--sh-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center;
}
.flash-face .w { font-family: var(--head); font-size: 38px; font-weight: 700; }
.flash-face small { color: var(--muted); font-weight: 700; }
.flash-face.back { transform: rotateY(180deg); color: #fff; background: linear-gradient(140deg, #8f7cff, #6a4cf5); }
.flash-face.back small { color: rgba(255, 255, 255, .8); }
.flash-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.game-actions { margin-top: auto; padding-top: 18px; }

.feedback {
  position: fixed; left: 50%; bottom: 0; width: 100%; max-width: 560px; transform: translate(-50%, 110%);
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0;
  display: flex; gap: 12px; align-items: center; transition: transform .28s cubic-bezier(.2, 1.2, .4, 1); z-index: 30; box-shadow: var(--sh-lg);
}
.feedback.show { transform: translate(-50%, 0); }
.feedback.good { background: var(--good-bg); color: var(--green-d); }
.feedback.bad { background: var(--bad-bg); color: var(--red-d); }
.fb-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; font-size: 22px; font-weight: 900; }
.good .fb-ic { background: var(--green); }
.bad .fb-ic { background: var(--red); }
.feedback .fb-text { flex: 1; min-width: 0; }
.feedback .fb-text > b { font-family: var(--head); font-size: 20px; font-weight: 700; }
.feedback .fb-sub { font-size: 14px; font-weight: 700; opacity: .9; margin-top: 2px; color: var(--ink); }
.feedback .btn { min-height: 48px; padding: 0 18px; }

/* match */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.match .col { display: grid; gap: 10px; }
.mt {
  padding: 12px 8px; border: 2px solid transparent; border-radius: 16px; background: var(--surface); font-weight: 800;
  box-shadow: var(--sh-sm), 0 4px 0 var(--line); text-align: center; min-height: 54px; font-size: 15px; transition: .15s;
}
.mt.sel { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); box-shadow: 0 4px 0 var(--brand); }
.mt.ok { border-color: var(--green); background: var(--good-bg); transform: scale(.94); opacity: 0; transition: opacity .35s .25s, transform .35s .25s; pointer-events: none; }
.mt.bad { border-color: var(--red); background: var(--bad-bg); animation: shake .35s; }
.timer { font-family: var(--head); font-weight: 700; min-width: 52px; height: 32px; border-radius: 99px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--sh-sm); color: var(--blue); }

/* result */
.result { text-align: center; padding-top: 18px; }
.burst { position: relative; width: 170px; height: 170px; margin: 0 auto; display: grid; place-items: center; }
.burst::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-conic-gradient(color-mix(in srgb, var(--gold) 35%, transparent) 0 12deg, transparent 12deg 30deg);
  mask: radial-gradient(circle, #000 30%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation: spin 14s linear infinite;
}
.burst span { position: relative; font-size: 86px; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .2)); }
@keyframes spin { to { transform: rotate(360deg); } }
.result h1 { margin: 4px 0 2px; font-size: 32px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.result-stats div { --c: var(--brand); border-radius: 20px; padding: 12px 4px; color: #fff; background: linear-gradient(150deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c)); box-shadow: 0 10px 22px -12px var(--c); }
.result-stats b { display: block; font-family: var(--head); font-size: 26px; font-weight: 700; }
.result-stats small { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; opacity: .92; }
.result .card { text-align: left; }
.result .card > b { font-family: var(--head); font-weight: 600; font-size: 17px; }

/* modal / toast / confetti */
.modal { position: fixed; inset: 0; background: rgba(14, 11, 34, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal.show { display: flex; animation: fadeIn .2s; }
.modal-card { position: relative; overflow: hidden; background: var(--surface); border-radius: 32px; padding: 26px 20px 20px; max-width: 400px; width: 100%; text-align: center; animation: pop .4s cubic-bezier(.3, 1.5, .5, 1); box-shadow: var(--sh-lg); }
.modal-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 150px; background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 16%, transparent), transparent); pointer-events: none; }
.modal-card .burst { width: 130px; height: 130px; }
.modal-card .burst span { font-size: 66px; }
.modal-card h2 { position: relative; margin: 4px 0 6px; font-size: 25px; }
.modal-card p { position: relative; margin: 0 0 20px; color: var(--muted); font-weight: 700; }
.modal-card .letter {
  position: relative; text-align: left; border-radius: 20px; padding: 18px; margin: 8px 0 20px; font-size: 17px; font-weight: 700; color: var(--ink);
  background: repeating-linear-gradient(color-mix(in srgb, var(--gold) 12%, var(--surface)) 0 27px, color-mix(in srgb, var(--gold) 30%, var(--surface)) 27px 28px);
  border: 2px solid color-mix(in srgb, var(--gold) 50%, transparent); line-height: 28px;
}
.modal-card .letter .sig { text-align: right; margin-top: 8px; font-style: italic; color: var(--muted); }
.modal-card .btn { width: 100%; }
@keyframes fadeIn { from { opacity: 0; } }
.toast {
  position: fixed; top: 74px; left: 50%; transform: translate(-50%, -20px); opacity: 0; background: var(--ink); color: var(--bg);
  padding: 11px 18px; border-radius: 16px; font-weight: 800; z-index: 60; transition: .3s cubic-bezier(.2, 1.3, .4, 1); pointer-events: none;
  max-width: calc(100% - 32px); text-align: center; box-shadow: var(--sh-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* onboarding */
.onb { text-align: center; padding-top: 34px; }
.onb .mascot { width: 140px; height: 140px; margin: 0 auto 6px; border-radius: 44px; display: grid; place-items: center; font-size: 84px; background: var(--surface); box-shadow: var(--sh-lg); animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-3deg); } }
.onb h1 { font-size: 34px; margin: 18px 0 6px; }
.onb .lead { color: var(--muted); font-weight: 700; margin: 0 0 22px; }
.onb .search { text-align: center; padding-left: 16px; font-size: 18px; font-weight: 800; }
.onb .lbl { text-align: left; font-family: var(--head); font-weight: 600; font-size: 18px; margin: 18px 2px 10px; }
.login { max-width: 400px; margin: 0 auto; }
.login .search { margin-bottom: 12px; color: var(--ink); }
.login .search::placeholder { color: var(--muted); font-weight: 700; }
.login-msg { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--ink); border-radius: 16px; padding: 12px 14px; font-weight: 700; margin-bottom: 14px; }
.login-err { min-height: 22px; color: var(--red); font-weight: 800; margin: -2px 0 10px; }
.login-foot { font-size: 14px; font-weight: 700; margin-top: 18px; }
.goal-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.goal-opts button {
  padding: 14px 12px; border: 2px solid transparent; border-radius: 20px; background: var(--surface); text-align: left;
  box-shadow: var(--sh-sm), 0 4px 0 var(--line); transition: .15s;
}
.goal-opts button .e { font-size: 26px; display: block; }
.goal-opts button b { display: block; font-family: var(--head); font-weight: 600; font-size: 17px; }
.goal-opts button small { color: var(--muted); font-weight: 700; }
.goal-opts button.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); box-shadow: 0 4px 0 var(--brand); }

@media (max-width: 370px) {
  .q-prompt { font-size: 28px; }
  .q-prompt.sent { font-size: 22px; }
  .goal-opts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
