/* Blue Army: white and blue, light only (his brand is blue and white). */

@font-face {
  font-family: "Vazirmatn";
  src: url("../assets/fonts/Vazirmatn-wght.woff2") format("woff2-variations"),
       url("../assets/fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f3f7ff;
  --surface: #ffffff;
  --sky: #e3edff;
  --sky-2: #c9dbff;
  --ink: #0b1b3f;
  --ink-soft: #55648a;
  --line: rgba(11, 27, 63, .1);
  --blue: #1f5eff;
  --blue-deep: #0a2a8a;
  --blue-light: #5aa2ff;
  --ok: #0f9d63;
  --warn: #c77700;
  --grad: linear-gradient(135deg, #0a2a8a 0%, #1f5eff 58%, #5aa2ff 100%);
  --shadow: 0 1px 2px rgba(11, 27, 63, .06), 0 8px 24px rgba(31, 94, 255, .08);
  --shadow-lg: 0 2px 4px rgba(11, 27, 63, .06), 0 18px 48px rgba(31, 94, 255, .16);
  --radius: 18px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.75 "Vazirmatn", Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.35; margin: 0; font-weight: 900; }
p { margin: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.num { font-feature-settings: "tnum"; }
:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 2px; border-radius: 10px; }

/* ---------- chrome ---------- */

.demo-banner {
  display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 7px 16px; font-size: .8rem; text-align: center;
  background: var(--ink); color: #fff;
}
.demo-banner a { color: #9cc3ff; font-weight: 700; text-decoration: none; white-space: nowrap; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, calc((100vw - 1080px) / 2));
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: none; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--grad); font-size: 1.2rem; box-shadow: 0 6px 16px rgba(31, 94, 255, .3);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-weight: 900; }
.brand-text small { color: var(--ink-soft); font-size: .75rem; }
.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-inline-start: auto;
  padding: 4px; background: var(--sky); border-radius: 14px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; padding: 7px 14px; border-radius: 10px; text-decoration: none;
  color: var(--ink-soft); font-weight: 700; font-size: .9rem; white-space: nowrap;
  transition: background .2s, color .2s;
}
.tabs a.on { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(11, 27, 63, .1); }

@media (max-width: 720px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 16px 8px; }
  .tabs { margin: 0 -16px; padding: 4px 16px; border-radius: 0; background: transparent; }
  .tabs a { background: var(--sky); }
  .tabs a.on { background: var(--blue); color: #fff; }
}

main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 140px; outline: none; }
main.narrow { max-width: 760px; }
.stack > * + * { margin-top: 16px; }
.view-in { animation: viewIn .45s var(--ease-out) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.hero {
  position: relative; overflow: hidden; color: #fff; background: var(--grad); border: 0;
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: ""; position: absolute; inset: auto -60px -90px auto; width: 260px; height: 260px;
  border-radius: 50%; background: rgba(255, 255, 255, .1); pointer-events: none;
}
.hero h1 { font-size: clamp(1.45rem, 4.5vw, 2.2rem); }
.hero p { color: rgba(255, 255, 255, .88); }
.eyebrow { font-size: .8rem; font-weight: 800; color: var(--blue); margin-bottom: 4px; }
.hero .eyebrow { color: #cfe0ff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: var(--sky); color: var(--blue-deep); font-size: .8rem; font-weight: 700;
}
.hero .chip { background: rgba(255, 255, 255, .16); color: #fff; }
.chip.request { background: #e3edff; color: var(--blue-deep); }
.chip.love { background: #ffe6ef; color: #b0245a; }
.chip.concern { background: #fff3dc; color: #8a5300; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--blue); color: #fff; font-weight: 800; text-decoration: none;
  box-shadow: 0 6px 18px rgba(31, 94, 255, .28);
  transition: transform .16s var(--ease-out), box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: default; box-shadow: none; }
.btn.ghost { background: var(--sky); color: var(--blue-deep); box-shadow: none; }
.btn.white { background: #fff; color: var(--blue); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .88rem; border-radius: 11px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.sec-head h2 { font-size: 1.25rem; }

/* ---------- avatars ---------- */

.av {
  --h: 220; display: grid; place-items: center; flex: none;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(140deg, hsl(var(--h) 92% 62%), hsl(calc(var(--h) + 18) 88% 42%));
  color: #fff; font-weight: 900; font-size: 1.3rem; line-height: 1;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.av.sm { width: 34px; height: 34px; font-size: .9rem; }

/* ---------- vote ---------- */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.step {
  position: relative; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .12); font-size: .8rem; line-height: 1.5;
}
.step b { display: block; font-size: .92rem; }
.step.on { background: #fff; color: var(--blue-deep); }
.step.on small { color: var(--ink-soft); }
.countdown { margin-top: 14px; font-size: .88rem; color: #dfe9ff; }
.countdown b { color: #fff; font-feature-settings: "tnum"; }

.vote-tools { display: flex; gap: 10px; align-items: center; margin: 22px 0 12px; }
.search {
  flex: 1; min-height: 46px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; outline: none;
}
.search:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 94, 255, .12); }
.picked-count { font-weight: 800; color: var(--blue); white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
.cand {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px 8px 14px; border-radius: 16px; cursor: pointer; text-align: center;
  background: #fff; border: 2px solid transparent; box-shadow: var(--shadow);
  transition: transform .18s var(--ease-out), border-color .18s, background .18s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.cand:active { transform: scale(.96); }
.cand .nm { font-weight: 800; font-size: .92rem; line-height: 1.4; }
.cand .badge {
  position: absolute; top: 8px; inset-inline-start: 8px;
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: .8rem; font-weight: 900;
  transform: scale(0); transition: transform .3s var(--ease-pop);
}
.cand.on { border-color: var(--blue); background: #f0f5ff; }
.cand.on .badge { transform: scale(1); }
.cand.shake { animation: shake .35s; }
.cand[hidden] { display: none; }
@keyframes shake { 25% { transform: translateX(5px); } 50% { transform: translateX(-5px); } 75% { transform: translateX(3px); } }
@media (max-width: 520px) { .cand { padding: 12px 4px 10px; } .cand .av { width: 46px; height: 46px; font-size: 1.1rem; } .cand .nm { font-size: .8rem; } }

.dock {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(11, 27, 63, .08);
  transform: translateY(110%); transition: transform .4s var(--ease-out);
}
.dock.show { transform: none; }
.dock-in { max-width: 1080px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.dock-picks { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.dock-picks .chip { flex: none; }
.dock .btn { flex: none; }

.voted { display: flex; gap: 14px; align-items: center; border: 2px solid #bfe9d5; background: #f2fbf6; }
.voted .tick { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 1.4rem; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }
.compare h3 { font-size: 1rem; margin-bottom: 8px; }
.compare ul { margin: 0; padding-inline-start: 18px; }
.compare li + li { margin-top: 4px; }
.compare .now { background: #fafbfe; }
.compare .new { border: 2px solid var(--sky-2); }

/* ---------- replay ---------- */

.stage-label { display: flex; align-items: center; gap: 10px; font-weight: 800; min-height: 32px; }
.stage-label .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px rgba(31, 94, 255, .15); }
.pool { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; min-height: 120px; }
.pchip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: .88rem;
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out), background .4s, color .4s, border-color .4s;
}
@media (max-width: 520px) {
  .pool { gap: 6px; }
  .pchip { padding: 2px 4px 2px 10px; gap: 6px; font-size: .78rem; }
  .pchip .av.sm { width: 26px; height: 26px; font-size: .75rem; }
}
.pchip.out { opacity: .18; transform: scale(.92); }
.pchip.adv { border-color: var(--blue); background: #eef4ff; }
.pchip.win { background: var(--blue); color: #fff; border-color: var(--blue); transform: scale(1.06); box-shadow: 0 8px 20px rgba(31, 94, 255, .3); }

.gfx-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.gfx-tabs button { border: 0; cursor: pointer; padding: 7px 14px; border-radius: 10px; background: var(--sky); color: var(--blue-deep); font-weight: 700; font-size: .88rem; }
.gfx-tabs button.on { background: var(--blue); color: #fff; }
.gfx-wrap { margin-top: 14px; display: grid; place-items: center; background: repeating-conic-gradient(#eef2fa 0 25%, #fff 0 50%) 0 0 / 22px 22px; border-radius: 14px; padding: 14px; }
.gfx-wrap canvas { display: block; max-width: 100%; height: auto; max-height: 70vh; border-radius: 10px; box-shadow: var(--shadow-lg); }

/* ---------- comments ---------- */

.theme { display: grid; gap: 10px; }
.theme-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.theme h3 { font-size: 1.08rem; }
.stats { font-size: .8rem; color: var(--ink-soft); font-weight: 700; }
.quote {
  position: relative; padding: 10px 14px; border-radius: 14px 14px 14px 4px;
  background: var(--bg); font-size: .92rem;
}
.quote small { display: block; color: var(--ink-soft); font-size: .75rem; margin-top: 2px; }
.ideas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .ideas { grid-template-columns: 1fr; } }
.idea { border: 2px dashed var(--sky-2); background: #fbfdff; }
.idea b { display: block; color: var(--blue); font-size: .8rem; margin-bottom: 4px; }

.bars { display: grid; gap: 10px; margin-top: 12px; }
.bar { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; }
.bar .track { position: relative; height: 34px; border-radius: 10px; background: var(--bg); overflow: hidden; }
.bar .fill {
  position: absolute; inset: 0 0 0 auto; width: var(--w); border-radius: 10px; background: var(--sky-2);
  transform-origin: right; animation: grow .9s var(--ease-out) both;
}
.bar.won .fill { background: linear-gradient(270deg, #8db4ff, #b9d1ff); }
.bar .label { position: absolute; inset: 0 12px; display: flex; align-items: center; font-weight: 800; font-size: .88rem; white-space: nowrap; }
.bar.won .label { color: var(--blue-deep); }
.bar .val { font-size: .8rem; color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- card ---------- */

.card-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .card-layout { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; margin-top: 14px; }
.field label { font-weight: 800; font-size: .88rem; }
.field input, .field select {
  min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(31, 94, 255, .12); }
.card-preview { display: grid; place-items: center; }
.card-preview canvas { width: min(100%, 360px); height: auto; border-radius: 22px; box-shadow: var(--shadow-lg); }

/* ---------- proposal ---------- */

.prop h2 { font-size: 1.3rem; margin-bottom: 10px; }
.prop .lead { font-size: 1.05rem; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
@media (max-width: 720px) { .facts { grid-template-columns: repeat(2, 1fr); } }
.fact { background: var(--bg); border-radius: 14px; padding: 12px; }
.fact b { display: block; font-size: 1.6rem; color: var(--blue); line-height: 1.3; }
.fact span { font-size: .8rem; color: var(--ink-soft); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } }
.tile { display: grid; gap: 6px; text-decoration: none; color: inherit; transition: transform .2s var(--ease-out); }
.tile:hover { transform: translateY(-2px); }
.tile .em { font-size: 1.6rem; }
.tile .go { color: var(--blue); font-weight: 800; font-size: .88rem; }
dl.rows { margin: 0; display: grid; gap: 12px; }
dl.rows div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; }
@media (max-width: 560px) { dl.rows div { grid-template-columns: 1fr; gap: 0; } }
dl.rows dt { font-weight: 900; color: var(--blue-deep); }
dl.rows dd { margin: 0; }
.sign { display: flex; align-items: center; gap: 14px; margin-top: 16px; }

/* ---------- toast / modal / splash ---------- */

.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 60; transform: translate(-50%, 20px);
  padding: 10px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--ease-out); max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(11, 27, 63, .45); }
.modal[hidden] { display: none; }
.modal-box {
  width: min(440px, 100%); background: #fff; border-radius: 22px; padding: 26px 22px 20px; text-align: center;
  box-shadow: var(--shadow-lg); animation: pop .4s var(--ease-pop) both;
}
.modal-box h2 { font-size: 1.35rem; margin: 10px 0 6px; }
.modal-box .big { font-size: 3rem; line-height: 1; }
@keyframes pop { from { opacity: 0; transform: scale(.9); } }

.hearts { position: fixed; inset: 0; pointer-events: none; z-index: 55; overflow: hidden; }
.hearts i {
  position: absolute; bottom: -40px; font-style: normal; font-size: 26px;
  animation: rise var(--d, 1.8s) var(--ease-out) forwards;
}
@keyframes rise { to { transform: translate(var(--x, 0), -105vh) rotate(var(--r, 0deg)); opacity: 0; } }

.splash {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px;
  background: var(--grad); color: #fff; text-align: center;
}
.splash[hidden] { display: none; }
.splash.out { animation: splashOut .6s var(--ease-out) forwards; }
@keyframes splashOut { to { opacity: 0; transform: scale(1.04); visibility: hidden; } }
.splash-in { max-width: 560px; }
.splash .line { opacity: 0; transform: translateY(14px); animation: lineIn .7s var(--ease-out) forwards; }
.splash .l1 { font-size: clamp(2.2rem, 9vw, 3.6rem); font-weight: 900; line-height: 1.25; }
.splash .l2 { font-size: clamp(1.1rem, 4.5vw, 1.45rem); font-weight: 700; margin-top: 18px; color: #dfe9ff; }
.splash .l3 { font-size: clamp(1.1rem, 4.5vw, 1.45rem); font-weight: 900; margin-top: 6px; }
.splash .btn { margin-top: 30px; }
.splash .skip { position: absolute; top: 16px; inset-inline-end: 16px; background: rgba(255, 255, 255, .16); color: #fff; border: 0; border-radius: 10px; padding: 6px 14px; cursor: pointer; font-weight: 700; }
@keyframes lineIn { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
