/* Secret Ballot: a calm, app-like style. Talkmasters yellow is kept for the main action and selections only. */
:root {
  --navy: #0B1B2B; --ink: #0B1B2B; --muted: #6A7581; --soft: #4A5562;
  --bg: #F6F5F0; --card: #FFFFFF; --line: #ECE9DD; --line-2: #E2DED0;
  --yellow: #FFD400; --yellow-deep: #F2B600; --yellow-glow: #FFE98A; --yellow-wash: #FFFAE0;
  --green: #1F9D4C; --green-wash: #EEF6F0; --green-ink: #1D5A33; --danger: #B3261E;
  --radius: 20px; --ease: cubic-bezier(.2, .8, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.narrow { max-width: 720px; margin: 0 auto; }
.ballot-w { max-width: 560px; margin: 0 auto; }

/* Header */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 17px; }
.logo img { height: 30px; width: auto; }
.logo .sep { width: 1px; height: 22px; background: var(--line-2); }
.toplink { font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.club-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.club-head .av { width: 34px; height: 34px; border-radius: 10px; background: var(--navy); color: var(--yellow); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: none; }

.main { padding: 26px 0 70px; min-height: 70vh; }
.view { animation: viewIn .35s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Type */
.eyebrow { display: inline-flex; align-items: center; gap: 6px; background: #FFF3B0; color: #6B5200; font-weight: 700; font-size: 13px; border-radius: 999px; padding: 5px 12px; }
.h1 { font-size: clamp(28px, 4.4vw, 44px); font-weight: 800; letter-spacing: -.025em; line-height: 1.12; margin: 12px 0 8px; }
.h1.sm { font-size: clamp(24px, 3.4vw, 32px); }
.lead { color: var(--soft); font-size: 17px; line-height: 1.55; max-width: 36em; }
.muted { color: var(--muted); font-size: 14px; }
.note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 12px; line-height: 1.5; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 2px rgba(11,27,43,.04), 0 10px 30px rgba(11,27,43,.05); margin-top: 16px; }
.card h2 { font-size: 17px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.step { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* Templates */
.tpl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 720px) { .tpl { grid-template-columns: repeat(4, 1fr); } }
.tpl button { text-align: left; border: 1.5px solid #E6E2D4; border-radius: 14px; padding: 12px; background: #fff; font-weight: 700; font-size: 15px; transition: border-color .2s, background .2s, box-shadow .2s, transform .15s; }
.tpl button:active { transform: scale(.98); }
.tpl button .i { display: block; font-size: 22px; margin-bottom: 4px; }
.tpl button small { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.tpl button[aria-pressed="true"] { border-color: var(--yellow-deep); background: var(--yellow-wash); box-shadow: 0 0 0 3px var(--yellow-glow); }

/* Fields */
.lbl { display: block; font-size: 13px; font-weight: 700; color: var(--soft); margin: 12px 0 6px; }
.lbl span { font-weight: 500; }
.in { width: 100%; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 12px 14px; font-size: 16px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.in:focus { outline: none; border-color: var(--yellow-deep); box-shadow: 0 0 0 3px var(--yellow-glow); }
.in::placeholder { color: #9AA3AD; }
.in.code { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
select.in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.tip { background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--soft); line-height: 1.45; margin-bottom: 6px; }

/* Questions and name tags */
.q-block { border-top: 1px solid #F0EDE3; padding-top: 12px; margin-top: 12px; animation: viewIn .3s var(--ease) both; }
.q-head { display: flex; align-items: center; gap: 8px; }
.q-title { flex: 1; border: 0; border-bottom: 1.5px dashed transparent; font-weight: 700; font-size: 15px; color: var(--soft); padding: 4px 2px; background: transparent; border-radius: 0; }
.q-title:hover, .q-title:focus { border-bottom-color: var(--line-2); outline: none; color: var(--ink); }
.linkbtn { font-size: 13px; color: #8A939D; font-weight: 600; padding: 4px; }
.linkbtn:hover { color: var(--danger); }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0; }
.tags:empty { margin: 4px 0; }
.tag { display: inline-flex; align-items: center; gap: 7px; background: var(--yellow-wash); border: 1.5px solid #F2D768; border-radius: 999px; padding: 5px 6px 5px 12px; font-weight: 600; font-size: 15px; animation: pop .25s var(--ease) both; }
.tag button { width: 22px; height: 22px; border-radius: 50%; background: #fff; color: var(--muted); font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.tag button:hover { color: var(--danger); }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.adder { display: flex; gap: 8px; }
.adder .in { padding: 10px 12px; }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border-radius: 14px; padding: 15px 18px; font-weight: 800; font-size: 17px; text-decoration: none; border: 0; transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.primary { background: var(--yellow); color: var(--navy); box-shadow: 0 6px 16px rgba(242,182,0,.35); }
.btn.primary:hover { box-shadow: 0 8px 22px rgba(242,182,0,.45); }
.btn.dark { background: var(--navy); color: #fff; }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line-2); }
.btn.wa { background: #25D366; color: #fff; }
.btn.sm { width: auto; padding: 10px 14px; font-size: 14px; border-radius: 12px; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Settings */
.settings-sum { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 16px; font-size: 14px; }
.settings-sum b { font-size: 15px; }
.u { font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.opt { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid #E6E2D4; border-radius: 14px; padding: 12px 14px; margin-top: 10px; background: #fff; cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; }
.opt > input { margin-top: 4px; accent-color: var(--navy); width: 18px; height: 18px; flex: none; }
.opt strong { display: block; font-size: 15px; }
.opt small { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; }
.opt:has(input:checked) { border-color: var(--yellow-deep); background: var(--yellow-wash); box-shadow: 0 0 0 3px var(--yellow-glow); }
.sub { margin-top: 8px; }

/* Ballot */
.secret { display: flex; gap: 10px; align-items: flex-start; background: var(--green-wash); border-radius: 14px; padding: 12px 14px; color: var(--green-ink); font-size: 14px; line-height: 1.45; margin-top: 14px; }
.qq { font-weight: 800; font-size: 17px; }
.choice { display: flex; align-items: center; gap: 12px; border: 1.5px solid #E6E2D4; border-radius: 14px; padding: 14px; margin-top: 9px; font-weight: 600; font-size: 16px; background: #fff; cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s, transform .15s var(--ease); -webkit-tap-highlight-color: transparent; }
.choice:active { transform: scale(.985); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .r { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #B9B4A3; flex: none; position: relative; transition: border-color .2s; }
.choice .r::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--navy); transform: scale(0); transition: transform .25s var(--ease); }
.choice:has(input:checked) { border-color: var(--yellow-deep); background: var(--yellow-wash); box-shadow: 0 0 0 3px var(--yellow-glow); }
.choice:has(input:checked) .r { border-color: var(--navy); }
.choice:has(input:checked) .r::after { transform: scale(1); }
.choice:has(input:focus-visible) { outline: 3px solid var(--navy); outline-offset: 2px; }
.credit { text-align: center; font-size: 12px; color: #8A939D; margin-top: 28px; line-height: 1.6; }
.credit a { color: var(--soft); font-weight: 700; }

/* Thank you */
.done { text-align: center; padding-top: 30px; }
.tick { width: 96px; height: 96px; margin: 0 auto 16px; }
.tick circle { fill: var(--green-wash); }
.tick .ring { fill: var(--green); transform-origin: center; animation: ring .45s var(--ease) both; }
.tick path { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s .3s var(--ease) forwards; }
@keyframes ring { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.promo { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 30px; font-size: 14px; color: var(--soft); text-align: left; display: flex; gap: 12px; align-items: center; }
.promo .e { font-size: 26px; }

/* Ready and sharing */
.save { background: var(--yellow-wash); border: 1.5px solid #F2D768; border-radius: 18px; padding: 18px; margin-top: 18px; }
.save h2 { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.share { display: flex; gap: 14px; align-items: center; }
.qr { width: 104px; height: 104px; flex: none; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.url { font-size: 13px; background: var(--bg); border-radius: 10px; padding: 9px 11px; font-weight: 600; word-break: break-all; }
.btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; }
.codes span { background: var(--bg); border-radius: 10px; padding: 8px; text-align: center; font-weight: 800; letter-spacing: .1em; font-size: 15px; }

/* Results */
.grid { display: grid; gap: 22px; }
@media (min-width: 900px) { .grid { grid-template-columns: 1.1fr .9fr; align-items: start; } .grid .first { margin-top: 0; } }
.live { display: inline-flex; align-items: center; gap: 7px; color: var(--green-ink); background: var(--green-wash); border-radius: 999px; padding: 5px 11px; font-weight: 700; font-size: 13px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.8s ease-out infinite; }
.live.off { color: var(--soft); background: #EEF1F6; }
.live.off i { background: #8A939D; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31,157,76,.45); } 100% { box-shadow: 0 0 0 9px rgba(31,157,76,0); } }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat b { font-size: 26px; font-weight: 800; display: block; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.pie { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut { width: 132px; height: 132px; flex: none; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 6; transition: stroke-dasharray .8s var(--ease), stroke-dashoffset .8s var(--ease); }
.donut .bg { stroke: #F0EDE3; }
.legend { flex: 1; min-width: 170px; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 6px 0; border-bottom: 1px solid #F0EDE3; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--soft); font-size: 14px; font-variant-numeric: tabular-nums; }
.bar { margin-top: 10px; }
.bar .t { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.bar .t em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar .b { height: 10px; border-radius: 999px; background: #F0EDE3; margin-top: 5px; overflow: hidden; }
.bar .b i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--navy); transition: width .8s var(--ease), background .3s; }
.bar.lead .b i { background: var(--yellow-deep); }
.badge { display: inline-flex; gap: 6px; align-items: center; background: #FFF3B0; color: #6B5200; border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 13px; margin-top: 12px; }
.badge.tie { background: #EEF1F6; color: #24364B; }
.badge.none { background: var(--bg); color: var(--muted); }

/* Reveal on a big screen */
.reveal { position: fixed; inset: 0; z-index: 50; background: radial-gradient(circle at 50% 30%, #1B3350, var(--navy) 70%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; animation: viewIn .3s var(--ease) both; }
.reveal .x { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 22px; }
.reveal .award { font-size: clamp(20px, 3vw, 30px); font-weight: 700; color: var(--yellow); }
.reveal .count { font-size: clamp(90px, 18vw, 200px); font-weight: 800; line-height: 1; margin: 18px 0; animation: beat 1s var(--ease) both; }
@keyframes beat { from { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
.reveal .winner { font-size: clamp(44px, 9vw, 110px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: 18px 0 8px; animation: rise .7s var(--ease) both; }
.reveal .meta { font-size: clamp(16px, 2vw, 22px); color: rgba(255,255,255,.75); animation: rise .7s .2s var(--ease) both; }
@keyframes rise { from { transform: translateY(30px) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.reveal .next { margin-top: 36px; width: auto; padding: 14px 26px; }
.reveal canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* My polls */
.poll-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F0EDE3; text-decoration: none; }
.poll-row:last-child { border-bottom: 0; }

/* About section (start page) */
.uses { display: grid; gap: 12px; }
@media (min-width: 720px) { .uses { grid-template-columns: repeat(3, 1fr); } }
.uses div { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.uses span { font-size: 26px; display: block; }
.uses b { display: block; margin: 6px 0 4px; }
.uses p { color: var(--soft); font-size: 15px; }
.why { display: grid; gap: 8px; padding-left: 0; list-style: none; }
.why li { color: var(--soft); padding-left: 28px; position: relative; }
.why li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--yellow); color: var(--navy); font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.why b { color: var(--ink); }
.about { margin-top: 46px; max-width: 760px; }
.about h2 { font-size: 22px; font-weight: 800; margin: 26px 0 12px; letter-spacing: -.01em; }
.how { padding-left: 22px; display: grid; gap: 8px; color: var(--soft); }
.how b { color: var(--ink); }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { color: var(--soft); margin-top: 8px; }
.madeby { margin-top: 22px; color: var(--muted); font-size: 14px; }

/* Messages */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); z-index: 60; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--danger); }
.err { color: var(--danger); font-weight: 600; font-size: 14px; margin-top: 10px; }
.center { text-align: center; }
.mt { margin-top: 16px; }

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