/* Happy Bowl design survey: shares its look with the usability test (usability-test/style.css),
   plus the screen viewer, word chips and the final pick at the end of this file.
   Its own indigo palette on purpose, so it looks like none of the designs being compared. */
:root {
  --bg: #F3F4FA;
  --card: #FFFFFF;
  --ink: #1C1D29;
  --muted: #5D6075;
  --line: #E3E5EF;
  --accent: #5145E5;
  --accent-ink: #FFFFFF;
  --accent-soft: #ECEBFF;
  --good: #1E9E7A;
  --warm: #FFB547;
  --pink: #FF7AA2;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(28, 29, 41, 0.04), 0 10px 28px rgba(28, 29, 41, 0.07);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Vazirmatn", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { line-height: 1.5; -webkit-text-size-adjust: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
svg { display: block; }

/* ---------- header + paw trail ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 640px; margin: 0 auto; padding: 14px 16px 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 15px; white-space: nowrap; }
.logo { width: 34px; height: 34px; border-radius: 11px; background: var(--accent); color: #FFFFFF; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 14px rgba(81, 69, 229, 0.3); }
.brand-sub { font-weight: 500; color: var(--muted); }
.langs { display: flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }
.langs button { min-height: 34px; padding: 0 11px; border: 0; border-radius: 999px; background: transparent; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: background 0.2s, color 0.2s; }
.langs button[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; }

.trail { display: flex; align-items: flex-start; max-width: 640px; margin: 0 auto; padding: 10px 16px 0; list-style: none; }
.trail li { position: relative; flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.trail li::before { content: ""; position: absolute; top: 14px; inset-inline-end: 50%; width: 100%; height: 3px; border-radius: 3px; background: var(--line); z-index: 0; }
.trail li:first-child::before { display: none; }
.trail li.done::before, .trail li.now::before { background: var(--accent); }
.trail .dot { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); transition: background 0.3s, border-color 0.3s, transform 0.3s; }
.trail li.done .dot { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.trail li.now .dot { border-color: var(--accent); color: var(--accent); transform: scale(1.12); box-shadow: 0 0 0 5px var(--accent-soft); }
.trail li.now { color: var(--ink); }

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 56px; outline: none; }
main:focus, main:focus-visible { outline: none; }

/* ---------- cards + type ---------- */
.card { position: relative; background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
h1 { margin: 0 0 10px; font-size: 27px; line-height: 1.2; letter-spacing: -0.4px; font-weight: 780; }
h2 { margin: 0 0 8px; font-size: 17px; line-height: 1.3; font-weight: 720; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }

/* view entrance: children rise in one after another */
.enter > * { animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.enter > *:nth-child(2) { animation-delay: 0.08s; }
.enter > *:nth-child(3) { animation-delay: 0.16s; }
.enter > *:nth-child(4) { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- pet duo with floating hearts ---------- */
.duo { position: relative; display: flex; justify-content: center; margin: 4px 0 16px; height: 104px; }
.duo img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 4px solid #FFFFFF; box-shadow: 0 8px 20px rgba(28, 29, 41, 0.14); }
.duo img:first-child { animation: bob 3.2s ease-in-out infinite; }
.duo img:nth-child(2) { margin-inline-start: -18px; animation: bob 3.2s ease-in-out 0.6s infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
.hearts { position: absolute; left: 50%; top: 6px; width: 0; height: 0; }
.hearts span { position: absolute; color: var(--pink); opacity: 0; animation: float-up 3.6s ease-in infinite; }
.hearts span:nth-child(2) { left: -26px; color: var(--warm); animation-delay: 1.2s; }
.hearts span:nth-child(3) { left: 20px; animation-delay: 2.4s; }
@keyframes float-up { 0% { opacity: 0; transform: translateY(20px) scale(0.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-46px) scale(1.1); } }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0 4px; padding: 0; list-style: none; }
.facts li { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 16px; background: var(--bg); text-align: center; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.facts .ico { width: 38px; height: 38px; border-radius: 12px; background: var(--card); color: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.callout { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px; border-radius: 16px; background: var(--accent-soft); color: #2E2799; font-size: 14.5px; }
.callout .ico { flex-shrink: 0; color: var(--accent); }
.callout.code { margin-top: 16px; }
.connect { text-align: center; }
.connect .paw { display: inline-block; color: var(--accent); animation: bob 1.2s ease-in-out infinite; }
.connect h1 { margin-top: 10px; }
.connect .btn { margin-top: 18px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
@media (prefers-reduced-motion: reduce) { .connect .paw { animation: none; } }

/* ---------- consent checkbox ---------- */
.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { flex-shrink: 0; width: 26px; height: 26px; margin-top: 1px; border-radius: 8px; border: 2px solid #C9CBDA; background: var(--card); display: flex; align-items: center; justify-content: center; color: #FFFFFF; transition: background 0.2s, border-color 0.2s, transform 0.2s; }
.check .box path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 0.3s ease 0.05s; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.check input:checked + .box path { stroke-dashoffset: 0; }
.check input:focus-visible + .box { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 24px; border: 0; border-radius: 18px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16.5px; box-shadow: 0 8px 18px rgba(81, 69, 229, 0.28); transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s; }
.btn:active { transform: scale(0.98); }
.btn .arrow { transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(3px); }
.btn[disabled] { opacity: 0.38; cursor: not-allowed; box-shadow: none; }
.btn.block { display: flex; width: 100%; margin-top: 18px; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn.dark { background: var(--ink); box-shadow: none; }
.btn.pulse:not([disabled])::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(81, 69, 229, 0.45); animation: pulse 2s ease-out 0.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(81, 69, 229, 0.45); } 70%, 100% { box-shadow: 0 0 0 14px rgba(81, 69, 229, 0); } }

/* ---------- about you: chips ---------- */
fieldset { border: 0; margin: 0 0 20px; padding: 0; }
legend { padding: 0; margin-bottom: 10px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); font-weight: 600; transition: border-color 0.2s, background 0.2s, color 0.2s; }
.chips button .ico { color: var(--muted); }
.chips button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: #2E2799; animation: pop 0.3s ease; }
.chips button[aria-pressed="true"] .ico { color: var(--accent); }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.07); } 100% { transform: scale(1); } }

/* ---------- intro: pet cards + rules ---------- */
.pets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 6px 0 16px; }
.pet { padding: 10px 10px 14px; border-radius: 20px; background: var(--bg); text-align: center; }
.pet img { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; object-fit: cover; }
.pet b { display: block; margin-top: 10px; font-size: 17px; }
.pet span { display: block; font-size: 13px; color: var(--muted); }
.pet:first-child { animation: in-start 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.pet:last-child { animation: in-end 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both; }
@keyframes in-start { from { opacity: 0; transform: translateX(-24px) rotate(-3deg); } to { opacity: 1; transform: none; } }
@keyframes in-end { from { opacity: 0; transform: translateX(24px) rotate(3deg); } to { opacity: 1; transform: none; } }
.rules { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rules li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; }
.rules .ico { flex-shrink: 0; width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }

/* ---------- task card ---------- */
.mission { overflow: hidden; }
.mission .band { display: flex; align-items: center; gap: 14px; margin: -22px -22px 18px; padding: 18px 22px; background: var(--accent-soft); }
.mission .num { width: 52px; height: 52px; flex-shrink: 0; border-radius: 16px; background: var(--accent); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; animation: pop 0.5s ease 0.15s both; }
.mission .lbl b { display: block; font-size: 13px; color: var(--accent); }
.mission .lbl span { display: block; font-size: 15px; font-weight: 700; }
.mission .who { margin-inline-start: auto; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 3px solid #FFFFFF; box-shadow: 0 4px 12px rgba(28, 29, 41, 0.15); animation: bob 3.2s ease-in-out infinite; }
.task-text { font-size: 21px; line-height: 1.42; font-weight: 650; }
.hint { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }

/* ---------- doing a task: task bar + the phone (calm on purpose) ---------- */
body.doing { overflow: hidden; }
body.doing .top, body.doing .trail { display: none; }
body.doing main { max-width: none; padding: 0; }
.doing-wrap { position: fixed; inset: 0; display: flex; flex-direction: column; background: #E7E8F0; }
.taskbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "pet n btns" "pet text btns"; column-gap: 12px; row-gap: 2px; align-items: center; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--card); box-shadow: 0 2px 10px rgba(28, 29, 41, 0.08); position: relative; z-index: 2; }
.taskbar .tb-pet { grid-area: pet; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.taskbar .tb-n { grid-area: n; font-size: 12.5px; color: var(--accent); }
.taskbar .tb-text { grid-area: text; min-width: 0; padding: 0; border: 0; background: none; text-align: start; font-size: 14px; line-height: 1.35; }
.taskbar .tb-text span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.taskbar .tb-text.open span { display: block; }
.taskbar .tb-btns { grid-area: btns; display: flex; gap: 6px; }
.taskbar .btn { min-height: 40px; padding: 0 14px; border-radius: 14px; font-size: 14px; box-shadow: none; }
.stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.phone-box { position: relative; flex-shrink: 0; }
.phone { position: absolute; left: 0; top: 0; width: 390px; height: 844px; transform-origin: 0 0; border-radius: 44px; overflow: hidden; background: #FFFFFF; box-shadow: 0 0 0 10px #1C1D29, 0 24px 60px rgba(0, 0, 0, 0.28); }
.phone iframe { display: block; width: 390px; height: 844px; border: 0; }
.stage.bare .phone { border-radius: 0; box-shadow: none; }
.loading { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.loading .paw { color: var(--accent); animation: bob 1.2s ease-in-out infinite; }

/* ---------- success ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(28, 29, 41, 0.45); z-index: 10; animation: fade 0.25s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.overlay .card { width: 100%; max-width: 360px; text-align: center; animation: pop-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.8) translateY(10px); } to { opacity: 1; transform: none; } }
.tick { width: 68px; height: 68px; margin: 0 auto 12px; border-radius: 50%; background: var(--good); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(30, 158, 122, 0.35); }
.tick path { stroke-dasharray: 26; stroke-dashoffset: 26; animation: draw 0.45s ease 0.25s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 11; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall 1.7s cubic-bezier(0.25, 0.6, 0.4, 1) forwards; }
@keyframes fall { to { transform: translate3d(var(--dx), 105vh, 0) rotate(var(--rot)); opacity: 0.2; } }

/* ---------- rating ---------- */
.face { display: flex; justify-content: center; margin: 4px 0 6px; color: var(--accent); }
.face.bump svg { animation: pop 0.35s ease; }
.scale { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 10px; direction: ltr; }
.scale button { min-height: 50px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); font-weight: 700; font-size: 17px; transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s; }
.scale button:active { transform: scale(0.94); }
.scale button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #FFFFFF; animation: pop 0.3s ease; }
.scale-ends { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--muted); direction: ltr; }
.note { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; padding: 12px 14px; border-radius: 14px; background: #FFF4E0; color: #7A4A00; font-size: 14.5px; }
textarea { display: block; width: 100%; min-height: 88px; margin-top: 8px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); resize: vertical; transition: border-color 0.2s, box-shadow 0.2s; }
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
label.q { display: block; margin-top: 20px; font-weight: 650; }

/* ---------- thanks ---------- */
.thanks { text-align: center; }
.thanks .duo { margin-top: 10px; }

/* ---------- design viewer ---------- */
.viewer { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0 10px; touch-action: pan-y; }
.viewer .arrowbtn { width: 46px; height: 46px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink); display: flex; align-items: center; justify-content: center; transition: background 0.2s, opacity 0.2s; }
.viewer .arrowbtn:hover { background: var(--accent-soft); color: var(--accent); }
.viewer .arrowbtn[disabled] { opacity: 0.3; cursor: default; }
.shot { position: relative; display: block; width: min(300px, 64vw); aspect-ratio: 390 / 844; padding: 0; border: 0; border-radius: 30px; overflow: hidden; background: #FFFFFF; box-shadow: 0 0 0 7px #1C1D29, 0 20px 44px rgba(28, 29, 41, 0.25); cursor: zoom-in; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.shot, .zoom { -webkit-user-select: none; user-select: none; }
.shot img.in { animation: shot-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes shot-in { from { opacity: 0; transform: translateX(var(--from, 24px)); } to { opacity: 1; transform: none; } }
.shot .zoomhint { position: absolute; inset-inline-end: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; background: rgba(28, 29, 41, 0.7); color: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.tabs { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 650; color: var(--muted); transition: all 0.2s; }
.tabs button[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); color: #2E2799; }
.tabs .seen { width: 16px; height: 16px; border-radius: 50%; background: var(--line); color: #FFFFFF; display: flex; align-items: center; justify-content: center; transition: background 0.25s; }
.tabs .seen.yes { background: var(--good); animation: pop 0.3s ease; }
.gate { margin: 10px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }

/* full-screen look */
.zoom { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: rgba(20, 21, 31, 0.92); animation: fade 0.2s ease both; }
.zoom img { -webkit-user-drag: none; display: block; max-width: 100%; max-height: calc(100dvh - 120px); border-radius: 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4); }
.zoom .zbar { display: flex; align-items: center; gap: 10px; color: #FFFFFF; font-weight: 650; }
.zoom .zbar button { min-height: 44px; min-width: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: #FFFFFF; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 650; }

/* rating: the design being rated */
.rated { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rated img { width: 44px; height: 95px; object-fit: cover; object-position: top; border-radius: 10px; box-shadow: 0 0 0 3px #1C1D29; }
.rated b { display: block; font-size: 17px; }
.words { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.words button { min-height: 42px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); font-weight: 600; transition: border-color 0.2s, background 0.2s, color 0.2s, opacity 0.2s; }
.words button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #FFFFFF; animation: pop 0.3s ease; }
.words button[disabled] { opacity: 0.4; cursor: not-allowed; }
.count { margin-inline-start: 8px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 700; }

/* final pick */
.picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.pickcard { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 2px solid var(--line); border-radius: 20px; background: var(--card); transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s; }
.pickcard[data-on="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); transform: translateY(-2px); }
.pickcard .choose { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: center; }
.pickcard .choose img { display: block; width: 100%; aspect-ratio: 390 / 600; object-fit: cover; object-position: top; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.pickcard .choose b { display: block; margin-top: 8px; font-size: 16px; }
.pickcard .again { min-height: 38px; border: 0; border-radius: 12px; background: var(--bg); font-size: 13.5px; font-weight: 650; color: var(--accent); }
.pickcard .badge { position: absolute; top: -10px; inset-inline-end: -10px; display: none; align-items: center; gap: 4px; padding: 5px 10px 5px 8px; border-radius: 999px; background: var(--accent); color: #FFFFFF; font-size: 12.5px; font-weight: 700; box-shadow: 0 6px 14px rgba(81, 69, 229, 0.35); }
.pickcard[data-on="true"] .badge { display: flex; animation: pop 0.35s ease; }

/* ---------- trying a design: letter, guided steps ---------- */
.taskbar .tb-letter { grid-area: pet; width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; }
.taskbar .tb-n { display: flex; align-items: center; gap: 8px; }
.dots { display: flex; gap: 4px; }
.dots i { width: 18px; height: 18px; border-radius: 50%; background: var(--line); color: #FFFFFF; display: flex; align-items: center; justify-content: center; transition: background 0.25s, box-shadow 0.25s; }
.dots i.now { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.dots i.on { background: var(--good); animation: pop 0.35s ease; }
.taskbar .tb-text.prompt { font-size: 15px; font-weight: 650; }
.taskbar .tb-text.prompt span { animation: rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.taskbar .tb-text.alldone { color: var(--good); }
.taskbar .btn.go { background: var(--accent); color: #FFFFFF; }
.taskbar .btn.go[disabled] { background: var(--line); color: var(--muted); opacity: 1; }
[hidden] { display: none !important; }

/* Farsi: the layout stays the same as in English; only the text runs right to left */
[dir="rtl"] { unicode-bidi: isolate; }
p[dir="rtl"], h1[dir="rtl"], h2[dir="rtl"], legend[dir="rtl"], label[dir="rtl"], .tb-text[dir="rtl"] { text-align: right; }
textarea[dir="auto"] { unicode-bidi: plaintext; }
.code-input { display: block; width: 100%; margin-top: 18px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); font-size: 22px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; text-align: center; transition: border-color 0.2s, box-shadow 0.2s; }
.code-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.code-input::placeholder { font-weight: 500; letter-spacing: 0.04em; text-transform: none; opacity: 0.55; }
.connect .callout { text-align: left; }
.err { margin-top: 10px; color: #B3261E; font-size: 14.5px; }
.btn.busy { opacity: 0.85; cursor: progress; box-shadow: none; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #FFFFFF; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.6s; } }

@media (max-width: 600px) {
  /* phones: the dots show the step; the words stay for screen readers */
  .taskbar .stepn { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .taskbar { grid-template-areas: "pet n btns" "text text text"; row-gap: 8px; }
}
@media (max-width: 420px) {
  .brand-sub { display: none; }
  .langs button { padding: 0 8px; font-size: 13px; }
  h1 { font-size: 24px; }
  .task-text { font-size: 19px; }
  .taskbar .btn { padding: 0 11px; }
  .facts li { font-size: 12.5px; padding: 12px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .check .box path, .tick path { stroke-dashoffset: 0; }
  .confetti { display: none; }
}

/* ---------- leaving a design before the steps are done: "are you sure?" ---------- */
.taskbar .btn.go.soft { background: var(--accent-soft); color: #2E2799; }
.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 21, 31, 0.55); animation: fade 0.2s ease both; }
.modal .sheet { width: 100%; max-width: 400px; padding: 24px 22px 20px; border-radius: var(--radius); background: var(--card); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); text-align: center; animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.modal .sheet-ico { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.modal h2 { margin: 0; font-size: 20px; }
.modal p { margin: 8px 0 0; line-height: 1.5; }
.modal h2[dir="rtl"], .modal p[dir="rtl"] { text-align: center; }
.modal .sheet-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.modal .sheet-btns .btn { min-height: 50px; padding: 0 12px; font-size: 15.5px; }
@media (max-width: 600px) {
  /* phones: the popup sits at the bottom, near the thumb */
  .modal { align-items: flex-end; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* final pick: what's still missing before "Finish" works */
.need { margin: 8px 0 0; min-height: 1.4em; font-size: 13.5px; color: var(--muted); }
p.need[dir="rtl"] { text-align: right; }

/* Arriving from the archive's "Take part": its circle fills the screen in --bg, then the page fades in on it. */
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
body { animation: page-in .38s cubic-bezier(.2, .7, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { body { animation: none; } }
