@font-face {
  font-family: 'Cherry Bomb One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/cherry-bomb-one-latin.woff2') format('woff2');
}
:root {
  --font-display: 'Cherry Bomb One', 'Baloo 2', system-ui, sans-serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pink: #ff7eb6;
  --pink-d: #ff5c8a;
  --key-top: #ff8fbb;  /* numpad key face (top of gradient) */
  --key: #ff689f;      /* numpad key face (bottom of gradient) */
  --key-lip: #d9427c;  /* darker 3D bottom lip */
  --accent: #7c5cff;
  --accent-d: #5f3ff0;
  --ink: #3a2b3f;
  --cream: #fff7fb;
  --card: #ffffff;
  --ok: #2fbf71;
  --bad: #ff5470;
  --shadow: 0 8px 24px rgba(122, 60, 110, 0.16);
  --r: 20px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }  /* beat component display rules like .result{display:flex} */
/* keep digits, tiny labels and body copy in a clean sans — Cherry Bomb One is
   the display/brand face and stays chunky-cute for headings & buttons */
.phone-display, .field input, .mini-info small, .stat-head .num, .numpad button small,
.hint, .conf-row, .stat-nums, .about-body, .about-body p, .tagline { font-family: var(--font-ui); }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-display);
  font-synthesis: none; /* Cherry Bomb One has one weight — never fake-bold it */
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 20% -10%, #ffe3f1 0%, transparent 60%),
    radial-gradient(1000px 600px at 110% 10%, #e6e0ff 0%, transparent 55%),
    var(--cream);
  overscroll-behavior: none;
}
#app { max-width: 460px; margin: 0 auto; min-height: 100%; padding: env(safe-area-inset-top) 0 0; }

/* ---- screens ---- */
.screen { display: none; padding: 18px 18px 40px; animation: pop .25s ease; }
.screen.active { display: block; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- buttons ---- */
.btn {
  border: none; border-radius: 999px; font: inherit; font-weight: 800;
  padding: 14px 22px; cursor: pointer; color: #fff; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  box-shadow: var(--shadow); transition: transform .08s ease, filter .15s ease;
}
/* icon helper */
.ico { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.ico svg { width: 1.15em; height: 1.15em; display: block; }
.icon-btn svg, .btn-del svg, .btn-hint svg { width: 1.1em; height: 1.1em; }
.btn:active { transform: translateY(2px) scale(.99); }
.btn.big { font-size: 20px; padding: 18px; }
.btn-primary { background: linear-gradient(135deg, var(--pink), var(--pink-d)); }
.btn-accent { background: linear-gradient(135deg, #9d7bff, var(--accent-d)); }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px #f0dced; }
.btn-stop { width: auto; background: #fff; color: var(--bad); box-shadow: inset 0 0 0 2px #ffd3db; padding: 8px 14px; font-size: 14px; }
.icon-btn { border: none; background: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 22px; box-shadow: var(--shadow); cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }

/* ---- home ---- */
.hero { text-align: center; margin: 24px 0 30px; }
.logo { font-size: 40px; line-height: 1.05; margin: 0; letter-spacing: -.5px; }
.logo span { background: linear-gradient(135deg, var(--pink-d), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo .logo-ico { color: var(--pink-d); -webkit-text-fill-color: currentColor; background: none; }
.logo-ico svg { width: .82em; height: .82em; vertical-align: -.06em; }
.tagline { color: #a07f95; margin: 12px 0 0; font-weight: 600; }
.home-actions { display: grid; gap: 14px; margin-bottom: 14px; }
.home-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- top bar ---- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.bar h2 { margin: 0; font-size: 22px; }
.bar span { width: 40px; }

/* ---- add contact ---- */
.pad { display: grid; gap: 14px; }
.preview-portrait, .mini-av, .stat-av, .big-portrait { border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.preview-portrait { width: 150px; height: 150px; margin: 0 auto; border: 4px solid #fff; }
.preview-portrait svg, .mini-av svg, .stat-av svg, .big-portrait svg { display: block; width: 100%; height: 100%; }
.field { display: grid; gap: 6px; font-weight: 700; }
.field span { font-size: 14px; color: #9a7a8d; padding-left: 6px; }
.field input {
  font: inherit; font-size: 18px; padding: 14px 16px; border-radius: 16px;
  border: 2px solid #f0dced; background: #fff; color: var(--ink); outline: none;
}
.field input:focus { border-color: var(--pink); }
.hint { min-height: 18px; margin: -4px 0 0; color: var(--bad); font-weight: 700; padding-left: 6px; }

.contact-list { margin-top: 22px; display: grid; gap: 10px; }
.contact-list h3 { margin: 6px 0; color: #9a7a8d; }
.mini-row { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 8px; box-shadow: var(--shadow); }
.mini-av { width: 52px; height: 52px; border-radius: 14px; flex: none; }
.mini-info { flex: 1; display: grid; }
.mini-info small { color: #a07f95; font-variant-numeric: tabular-nums; }
.mini-del { border: none; background: #fff0f3; border-radius: 12px; padding: 8px 10px; cursor: pointer; font-size: 16px; }
.empty { color: #b49aa9; text-align: center; padding: 20px; }

/* ---- play ---- */
.play-body { display: grid; gap: 14px; }
.challenge { text-align: center; background: #fff; border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.call-label { display: block; color: #a07f95; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: 13px; }
.call-name { font-size: 30px; font-weight: 900; }
.phone-display {
  min-height: 54px; background: #201628; color: #fff; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  letter-spacing: 3px; font-variant-numeric: tabular-nums; padding: 6px 16px;
  word-break: break-all; text-align: center;
}
.phone-display.empty { color: #6c5b74; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 12px; }
/* 3D pressable keys: rose face + darker bottom lip + a sharp drop shadow.
   On :active the key sinks (translateY) as the lip collapses — like a real key. */
.numpad button {
  aspect-ratio: 1.25 / 1; border: none; border-bottom: 6px solid var(--key-lip);
  border-radius: 18px; background: linear-gradient(180deg, var(--key-top), var(--key));
  box-shadow: 0 7px 7px rgba(60, 20, 45, .22);
  font-size: 30px; font-weight: 800; color: #fff; text-shadow: 0 3px 2px rgba(150, 25, 70, .32);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1; -webkit-user-select: none; user-select: none;
  transition: transform .06s ease, box-shadow .06s ease, border-bottom-width .06s ease, filter .12s;
}
.numpad button small { font-size: 11px; font-weight: 700; letter-spacing: 3px; color: #fff; opacity: .92; margin-top: 5px; min-height: 11px; text-shadow: 0 1px 1px rgba(150, 25, 70, .3); }
.numpad button:active {
  transform: translateY(5px); border-bottom-width: 2px;
  box-shadow: 0 2px 4px rgba(60, 20, 45, .2); filter: brightness(.96);
}
.dial-actions { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 12px; align-items: center; }
.btn-del, .btn-hint { border: none; background: #fff; border-radius: 18px; height: 58px; font-size: 22px; cursor: pointer; box-shadow: var(--shadow); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.btn-call { border: none; border-radius: 18px; height: 58px; font-size: 20px; font-weight: 900; color: #fff; cursor: pointer; background: linear-gradient(135deg, #35d07f, #17b45f); box-shadow: var(--shadow); display: inline-flex; align-items: center; justify-content: center; gap: .4em; }
.btn-stop { display: inline-flex; align-items: center; justify-content: center; gap: .35em; }
.btn-call:active { transform: scale(.97); }
.locked .numpad button, .locked .btn-del, .locked .btn-call, .locked .btn-hint { opacity: .5; pointer-events: none; }

/* ---- result overlay ---- */
.result {
  position: fixed; inset: 0; z-index: 40; background: rgba(40, 20, 40, .5);
  backdrop-filter: blur(6px); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 18px; padding: 24px; animation: pop .2s ease;
}
.result-card { background: #fff; border-radius: 28px; padding: 22px; text-align: center; width: 100%; max-width: 360px; box-shadow: var(--shadow); }
.result-card .big-portrait { width: 180px; height: 180px; margin: 0 auto 12px; border-radius: 24px; }
.result-card .say { font-size: 22px; font-weight: 800; margin: 6px 0; }
.result-card .heart-ico { color: var(--pink-d); }
.result-card .heart-ico svg { width: .95em; height: .95em; vertical-align: -.12em; }
.result-card .meta { color: #a07f95; font-weight: 700; margin: 4px 0 0; }
.result-card.win { animation: bounce .5s ease; }
.result-card.lose .shark { animation: shake .4s ease; }
.say.shout { color: var(--bad); font-size: 26px; font-weight: 900; letter-spacing: 1px; }
.result #next-btn { max-width: 360px; }
@keyframes bounce { 0% { transform: scale(.7); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-8px) rotate(-4deg); } 75% { transform: translateX(8px) rotate(4deg); } }

/* ---- stats ---- */
.stats-list { display: grid; gap: 12px; }
.stat-card { display: flex; gap: 12px; background: #fff; border-radius: 20px; padding: 12px; box-shadow: var(--shadow); }
.stat-av { width: 66px; height: 66px; border-radius: 16px; flex: none; }
.stat-main { flex: 1; min-width: 0; }
.stat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stat-head .num { color: #a07f95; font-size: 13px; font-variant-numeric: tabular-nums; }
.conf-bar { height: 10px; background: #f1e4ee; border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.conf-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ff9db3, #35d07f); transition: width .4s ease; }
.conf-row { display: flex; justify-content: space-between; font-size: 13px; color: #a07f95; }
.conf-row strong { color: var(--ink); }
.stat-nums { display: flex; gap: 14px; margin-top: 6px; font-weight: 800; font-size: 14px; }
.stat-nums span { display: inline-flex; align-items: center; gap: 4px; }
.stat-nums .ok { color: var(--ok); }
.stat-nums .bad { color: var(--bad); }
.stat-nums .streak { color: #ff8a3d; }

/* ---- toasts ---- */
.toaster {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60;
  background: #201628; color: #fff; border-radius: 999px; padding: 12px 12px 12px 20px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); font-weight: 700;
  animation: pop .25s ease;
}
.toaster button { border: none; background: var(--pink); color: #fff; font: inherit; font-weight: 800; border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.toaster span { display: inline-flex; align-items: center; gap: 8px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); z-index: 55;
  background: rgba(32, 22, 40, .95); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-weight: 700; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- about ---- */
.about-body { display: grid; gap: 16px; padding: 4px 2px 40px; font-size: 15px; }
.privacy-hero { text-align: center; display: grid; gap: 10px; justify-items: center; margin-top: 6px; }
.privacy-badge { width: 66px; height: 66px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #7ee0b8, #35c9b0); color: #fff; box-shadow: var(--shadow); }
.privacy-badge svg { width: 34px; height: 34px; }
.privacy-hero h3 { margin: 0; font-size: 22px; font-family: var(--font-display); font-weight: 400; }
.about-body p { margin: 0; line-height: 1.55; }
.privacy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.privacy-list li { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: 16px; padding: 13px 15px; box-shadow: var(--shadow); line-height: 1.45; }
.privacy-list li .ico { flex: none; color: var(--accent); margin-top: 1px; }
.privacy-list li .ico svg { width: 22px; height: 22px; }
.qr-card { display: grid; justify-items: center; gap: 8px; background: #fff; color: #3a2b3f; border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.qr-img { width: 190px; height: 190px; background: #fff; border-radius: 10px; padding: 6px; }
.qr-img svg { width: 100%; height: 100%; display: block; }
.qr-cap { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 18px; color: inherit; }
.qr-url { font-family: var(--font-ui); font-size: 13px; color: var(--accent-d); text-decoration: none; word-break: break-all; text-align: center; }
.about-foot { text-align: center; color: #a07f95; font-size: 13px; margin-top: 4px; }

@media (prefers-color-scheme: dark) {
  :root { --cream: #1a1220; --card: #241a2e; --ink: #f3e9f2; }
  body { background:
    radial-gradient(1200px 600px at 20% -10%, #3a1f34 0%, transparent 60%),
    radial-gradient(1000px 600px at 110% 10%, #241a4a 0%, transparent 55%), var(--cream); }
  .btn-ghost, .icon-btn, .challenge, .mini-row, .btn-del, .btn-hint,
  .stat-card, .preview-portrait, .result-card, .field input, .privacy-list li { background: var(--card); color: var(--ink); }
  .privacy-list li .ico { color: #b49af0; }
  .field input { border-color: #3a2c44; }
  .mini-del { background: #33223a; }
  .conf-bar { background: #33223a; }
  .btn-ghost { box-shadow: inset 0 0 0 2px #3a2c44; }
}
