/* «Обыграй Акинатора» — Mini App. Тема: тёмно-фиолетовый мистик + золото (как Акинатор). */
:root {
  --bg-0: #0f0620;
  --bg-1: #1a0b2e;
  --bg-2: #2d1b4e;
  --violet: #8B5CF6;
  --violet-hi: #A78BFA;
  --gold: #FFD24C;
  --gold-hi: #FFE08A;
  --gold-deep: #E9A400;
  --text: #F5F3FF;
  --muted: #B3A9D9;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --green: #34D399;
  --teal: #22C6C6;
  --grey: #8A85A8;
  --orange: #F59E0B;
  --red: #FB7185;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --r: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(1100px 600px at 50% -8%, rgba(139, 92, 246, .30), transparent 60%),
    radial-gradient(800px 500px at 90% 110%, rgba(255, 210, 76, .10), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100%; display: flex; flex-direction: column; }

/* ─── экраны ─── */
.screen { display: none; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; text-align: center; padding: 24px 20px calc(24px + var(--safe-b)); animation: fadeIn .35s ease; }
.screen.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.wrap { width: 100%; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column;
  align-items: center; }

h1 { font-size: clamp(22px, 6vw, 30px); font-weight: 800; margin: 0 0 10px; letter-spacing: -.4px;
  background: linear-gradient(180deg, #fff, var(--violet-hi)); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text; }
h2 { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
p.lead { color: var(--muted); font-size: 15px; margin: 0 0 8px; }

/* ─── джинн ─── */
.genie { width: 168px; height: 168px; margin: 6px auto 18px; position: relative;
  animation: float 3.6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.genie svg { width: 100%; height: 100%; filter: drop-shadow(0 12px 26px rgba(139, 92, 246, .5)); }
.genie.small { width: 96px; height: 96px; margin: 0 0 10px; }
.genie .aura { position: absolute; inset: -14% -14% 6%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 76, .28), transparent 62%); z-index: -1;
  animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .55; transform: scale(1); } 50% { opacity: .9; transform: scale(1.06); } }

/* ─── кнопки ─── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 14px; font-size: 17px; font-weight: 700; cursor: pointer;
  padding: 16px 22px; width: 100%; color: #2a1600; transition: transform .12s, filter .12s, box-shadow .2s;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold), var(--gold-deep));
  box-shadow: 0 12px 30px rgba(233, 164, 0, .35); }
.btn:active { transform: translateY(1px) scale(.99); filter: brightness(.96); }
.btn.violet { color: #fff; background: linear-gradient(135deg, var(--violet-hi), var(--violet));
  box-shadow: 0 12px 30px rgba(139, 92, 246, .4); }
.btn.ghost { color: var(--text); background: var(--card); border: 1px solid var(--card-border);
  box-shadow: none; font-weight: 600; }
.btn.big { font-size: 19px; padding: 18px 24px; }
.btn-row { display: flex; gap: 10px; width: 100%; }

/* ─── карточка вопроса / игра ─── */
.q-counter { color: var(--muted); font-size: 13px; letter-spacing: .3px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px; }
.q-progress { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.10); overflow: hidden; }
.q-progress > i { display: block; height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, var(--violet), var(--gold)); transition: width .4s ease; }
.q-card { width: 100%; background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--r); padding: 22px 20px; box-shadow: var(--shadow); backdrop-filter: blur(8px);
  min-height: 96px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; margin-bottom: 16px; animation: pop .3s ease; }
.q-card.swap { animation: qswap .32s ease; }
@keyframes qswap { 0% { opacity: 0; transform: translateX(24px); } 100% { opacity: 1; transform: none; } }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ans { border: none; border-radius: 13px; padding: 15px 12px; font-size: 15px; font-weight: 700;
  color: #fff; cursor: pointer; transition: transform .12s, filter .12s; }
.ans:active { transform: scale(.97); filter: brightness(.94); }
.ans.yes { background: linear-gradient(135deg, #4ade80, var(--green)); color: #06301d; }
.ans.pyes { background: linear-gradient(135deg, #4fd8d8, var(--teal)); color: #043434; }
.ans.idk { background: linear-gradient(135deg, #a5a1bd, var(--grey)); grid-column: 1 / -1; }
.ans.pno { background: linear-gradient(135deg, #fbbf5a, var(--orange)); color: #3a2500; }
.ans.no { background: linear-gradient(135deg, #fb8ea0, var(--red)); color: #3a0a14; }
.undo { margin-top: 12px; background: none; border: none; color: var(--muted); font-size: 14px;
  cursor: pointer; text-decoration: underline; }
.undo[disabled] { opacity: .35; text-decoration: none; cursor: default; }

/* ─── догадка / результат — карточка блогера ─── */
.blogger-card { width: 100%; background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); margin: 4px 0 18px; animation: pop .35s ease; }
.blogger-ava { width: 92px; height: 92px; border-radius: 24px; margin: 0 auto 12px; display: grid;
  place-items: center; font-size: 44px; background: linear-gradient(135deg, var(--violet), #5b2ea6);
  box-shadow: 0 10px 24px rgba(139,92,246,.45); overflow: hidden; }
.blogger-ava img { width: 100%; height: 100%; object-fit: cover; }
.blogger-name { font-size: 22px; font-weight: 800; }
.blogger-note { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ─── оффер (модалка) ─── */
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center;
  padding: 22px; background: rgba(6, 2, 16, .74); backdrop-filter: blur(4px); animation: fadeIn .25s ease; }
.modal.active { display: flex; }
.offer { width: 100%; max-width: 400px; background: linear-gradient(180deg, #241338, #17092b);
  border: 1px solid var(--card-border); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden;
  animation: pop .3s ease; }
.offer-hero { position: relative; height: 150px; display: grid; place-items: center; font-size: 64px;
  background: radial-gradient(circle at 50% 30%, rgba(255,210,76,.25), transparent 60%),
    linear-gradient(135deg, #3a2160, #23113f); overflow: hidden; }
.offer-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.offer-badge { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 700;
  letter-spacing: .4px; color: var(--muted); background: rgba(0,0,0,.4); border: 1px solid var(--card-border);
  padding: 3px 8px; border-radius: 999px; text-transform: uppercase; }
.offer-body { padding: 18px 18px 20px; text-align: center; }
.offer-title { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.offer-sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.offer-close { display: block; margin: 12px auto 0; background: none; border: none; color: var(--muted);
  font-size: 14px; cursor: pointer; }
.offer-timer { display: inline-block; min-width: 22px; }

/* ─── клейм-воронка ─── */
.steps { display: flex; gap: 6px; width: 100%; max-width: 320px; margin: 0 auto 16px; }
.steps > i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); }
.steps > i.on { background: linear-gradient(90deg, var(--violet), var(--gold)); }
.claim-step { width: 100%; }
.chan-list { display: flex; flex-direction: column; gap: 10px; width: 100%; margin: 4px 0 16px; }
.chan { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--card-border); text-align: left; }
.chan .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(135deg, var(--violet), #5b2ea6); flex: none; }
.chan .lbl { flex: 1; font-weight: 600; font-size: 15px; }
.chan .sub-btn { flex: none; border: none; border-radius: 10px; padding: 9px 14px; font-weight: 700;
  font-size: 14px; color: #2a1600; background: linear-gradient(135deg, var(--gold-hi), var(--gold)); cursor: pointer; }
.chan.done .sub-btn { background: rgba(52,211,153,.2); color: var(--green); }
.chan .check { color: var(--green); font-size: 20px; display: none; }
.chan.done .check { display: block; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 14px; }
.robux-pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px;
  color: var(--gold); background: rgba(255,210,76,.12); border: 1px solid rgba(255,210,76,.3);
  padding: 8px 14px; border-radius: 999px; margin-bottom: 12px; }
input.field { width: 100%; border-radius: 13px; border: 1px solid var(--card-border); background: rgba(0,0,0,.25);
  color: var(--text); font-size: 16px; padding: 15px 16px; margin-bottom: 12px; outline: none; }
input.field:focus { border-color: var(--violet-hi); }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%);
  background: #2a1846; border: 1px solid var(--card-border); color: var(--text); padding: 12px 18px;
  border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); z-index: 80; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; max-width: 90%; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

.spinner { width: 44px; height: 44px; border: 4px solid rgba(255,255,255,.14); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sparkles::before, .sparkles::after { content: "✨"; position: absolute; font-size: 22px; opacity: .8;
  animation: twinkle 2.2s ease-in-out infinite; }
.sparkles::before { top: 6px; left: 12%; }
.sparkles::after { top: 20px; right: 14%; animation-delay: .8s; }
@keyframes twinkle { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

.footnote { color: var(--muted); font-size: 12px; margin-top: 14px; line-height: 1.5; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .w100 { width: 100%; }
