/* vote.slgeek.lk — SL Geek Vote */
:root {
  --bg: #09090b;
  --panel: #131318;
  --panel-2: #1b1b22;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --dim: #71717a;
  --yellow: #F5B624;
  --yellow-2: #ffcf4d;
  --green: #22c55e;
  --brand-green: #1B5C33;
  --red: #ef4444;
  --radius: 20px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 15px/1.5 'Inter', system-ui, -apple-system, sans-serif;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 85% -10%, rgba(245,182,36,.16), transparent 70%),
    radial-gradient(500px 420px at -10% 110%, rgba(34,197,94,.10), transparent 70%);
}
.bg-glow::after {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 65%);
}

/* ── Top bar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; padding-top: max(14px, env(safe-area-inset-top));
  max-width: 1180px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 24px; width: auto; }
.brand span {
  font-family: var(--head); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: #111; background: var(--yellow); padding: 3px 8px; border-radius: 6px;
}
.user-chip {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px;
  max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-chip b { color: var(--text); }
.wave { display: inline-block; animation: wave 2.4s ease-in-out 1s 2; transform-origin: 70% 70%; }
@keyframes wave { 0%,60%,100% { transform: rotate(0); } 10%,30% { transform: rotate(16deg); } 20%,40% { transform: rotate(-8deg); } }

.wrap { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 8px 20px 40px; }
.foot { text-align: center; color: var(--dim); font-size: 12px; padding: 20px 20px max(20px, env(safe-area-inset-bottom)); }
.foot a { color: var(--muted); text-decoration: none; font-weight: 600; }
.foot i { color: var(--red); }

/* ── Type ── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--yellow); background: rgba(245,182,36,.1); border: 1px solid rgba(245,182,36,.25);
  padding: 5px 11px; border-radius: 999px;
}
.display { font-family: var(--head); font-weight: 700; font-size: clamp(34px, 7vw, 64px); line-height: 1.02; letter-spacing: -.03em; margin: 18px 0 14px; }
.display.sm { font-size: clamp(28px, 5vw, 40px); }
.hl { background: linear-gradient(100deg, var(--yellow), #ffe08a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: clamp(15px, 2.2vw, 18px); max-width: 560px; margin: 0 0 24px; white-space: pre-line; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; cursor: pointer; text-decoration: none; font-weight: 700; font-size: 15px;
  padding: 15px 26px; border-radius: 14px; transition: transform .15s var(--ease), box-shadow .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--yellow); color: #111; box-shadow: 0 10px 30px -10px rgba(245,182,36,.6); }
.btn-primary:hover { background: var(--yellow-2); box-shadow: 0 14px 36px -10px rgba(245,182,36,.75); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-block { width: 100%; }
.btn .fa-arrow-right { transition: transform .2s var(--ease); }
.btn:hover .fa-arrow-right { transform: translateX(4px); }

/* ── Home ── */
.home { padding-top: 6vh; }
.home-list { display: grid; gap: 12px; max-width: 640px; }
.home-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px;
  transition: border-color .2s, transform .2s var(--ease);
}
.home-card:hover { border-color: rgba(245,182,36,.5); transform: translateY(-2px); }
.home-card h3 { margin: 0 0 3px; font-family: var(--head); font-size: 18px; }
.home-card p { margin: 0; color: var(--dim); font-size: 13px; }
.home-card .go { width: 40px; height: 40px; border-radius: 12px; background: var(--yellow); color: #111; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.empty-card { max-width: 640px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line-2); border-radius: 18px; padding: 40px 20px; }
.empty-card i { font-size: 32px; color: var(--dim); margin-bottom: 10px; }
.center-card { text-align: center; padding-top: 12vh; display: flex; flex-direction: column; align-items: center; }
.big-ico { width: 84px; height: 84px; border-radius: 26px; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--yellow); }

/* ── Screen transitions ── */
.screen { animation: in .45s var(--ease) both; }
.screen.out-left { animation: outL .28s ease-in both; }
.screen.out-right { animation: outR .28s ease-in both; }
.screen.from-left { animation: inL .45s var(--ease) both; }
@keyframes in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes inL { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes outL { to { opacity: 0; transform: translateX(-40px); } }
@keyframes outR { to { opacity: 0; transform: translateX(40px); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ── Intro ── */
.intro { max-width: 720px; padding-top: 5vh; }
.intro .hi { font-family: var(--head); font-size: 20px; color: var(--muted); margin-top: 18px; }
.intro .hi b { color: var(--text); }
.intro .display { margin-top: 10px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
.meta { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); padding: 9px 14px; border-radius: 12px; font-size: 13px; color: var(--muted); }
.meta i { color: var(--yellow); }
.meta b { color: var(--text); font-weight: 700; }
.fineprint { color: var(--dim); font-size: 12px; margin-top: 14px; display: flex; align-items: center; gap: 6px; }
.preview-bar { background: rgba(245,182,36,.12); border: 1px solid rgba(245,182,36,.35); color: var(--yellow); font-size: 13px; font-weight: 600; padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; display: flex; gap: 8px; align-items: center; }

/* ── Question ── */
.q-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.back-btn {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.back-btn:hover { color: var(--text); border-color: var(--line-2); }
.back-btn:disabled { opacity: .3; cursor: default; }
.prog { flex: 1; }
.prog-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--dim); margin-bottom: 7px; letter-spacing: .02em; }
.prog-label b { color: var(--yellow); }
.segs { display: flex; gap: 5px; }
.seg { flex: 1; height: 5px; border-radius: 99px; background: var(--panel-2); overflow: hidden; position: relative; }
.seg::after { content: ''; position: absolute; inset: 0; background: var(--yellow); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.seg.done::after { transform: scaleX(1); }
.seg.cur { background: rgba(245,182,36,.25); }

.q-title { font-family: var(--head); font-weight: 700; font-size: clamp(22px, 4.2vw, 34px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 6px; }
.q-sub { color: var(--dim); font-size: 13px; margin: 0 0 20px; display: flex; align-items: center; gap: 6px; }

/* Image options */
.img-grid { display: grid; gap: 14px; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.img-opt {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  background: #000; border: 1px solid var(--line); isolation: isolate;
  transition: transform .25s var(--ease), box-shadow .25s, opacity .3s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
  animation: rise .5s var(--ease) both;
}
.img-opt:nth-child(2) { animation-delay: .06s; } .img-opt:nth-child(3) { animation-delay: .12s; } .img-opt:nth-child(4) { animation-delay: .18s; }
.img-box { height: min(64vh, 680px); display: flex; align-items: center; justify-content: center; position: relative; }
.img-box img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .4s; }
.img-box img.ok { opacity: 1; }
.img-box::before { /* loading shimmer */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.05) 50%, transparent 70%) var(--panel);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
.img-box.loaded::before { display: none; }
@keyframes shimmer { to { background-position: -200% 0; } }
.opt-tag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-weight: 700; font-size: 20px; color: #111; background: var(--yellow);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.zoom-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 42px; height: 42px; border-radius: 13px; cursor: pointer;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.zoom-btn:hover { background: rgba(0,0,0,.8); }
.pick-bar {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 14px; font-weight: 700; font-size: 14px;
  background: rgba(10,10,12,.7); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .2s, color .2s, transform .25s var(--ease);
}
@media (hover: hover) {
  .img-opt:hover { transform: translateY(-3px); border-color: rgba(245,182,36,.55); box-shadow: 0 20px 50px -20px rgba(245,182,36,.35); }
  .img-opt:hover .pick-bar { background: var(--yellow); color: #111; border-color: transparent; }
}

/* Text options */
.txt-list { display: grid; gap: 12px; max-width: 680px; }
.txt-opt {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 18px; padding: 16px 18px; overflow: hidden;
  font-size: 17px; font-weight: 600; transition: transform .2s var(--ease), border-color .2s, background .2s, opacity .3s;
  -webkit-tap-highlight-color: transparent; animation: rise .45s var(--ease) both;
}
.txt-opt:nth-child(2) { animation-delay: .05s; } .txt-opt:nth-child(3) { animation-delay: .1s; } .txt-opt:nth-child(4) { animation-delay: .15s; } .txt-opt:nth-child(5) { animation-delay: .2s; }
.txt-opt .k {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-weight: 700; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); transition: all .2s;
}
.txt-opt .chk { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: transparent; transition: all .2s; }
@media (hover: hover) {
  .txt-opt:hover { border-color: rgba(245,182,36,.5); transform: translateX(4px); }
  .txt-opt:hover .k { background: var(--yellow); color: #111; border-color: transparent; }
}

/* Chosen state (shared) */
.picking .img-opt, .picking .txt-opt { pointer-events: none; }
.is-picked { border-color: var(--yellow) !important; box-shadow: 0 0 0 3px var(--yellow), 0 24px 60px -18px rgba(245,182,36,.55) !important; }
.img-opt.is-picked { transform: scale(1.015); }
.img-opt.is-picked .pick-bar { background: var(--yellow); color: #111; border-color: transparent; }
.txt-opt.is-picked { background: rgba(245,182,36,.1); }
.txt-opt.is-picked .k { background: var(--yellow); color: #111; border-color: transparent; }
.txt-opt.is-picked .chk { background: var(--yellow); border-color: var(--yellow); color: #111; }
.is-dim { opacity: .38; transform: scale(.985); }
.burst { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.burst span {
  width: 76px; height: 76px; border-radius: 50%; background: var(--yellow); color: #111; font-size: 32px;
  display: flex; align-items: center; justify-content: center; animation: pop .5s var(--ease) both; box-shadow: 0 0 0 0 rgba(245,182,36,.6);
}
@keyframes pop { 0% { transform: scale(.2); opacity: 0; box-shadow: 0 0 0 0 rgba(245,182,36,.6); } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); box-shadow: 0 0 0 26px rgba(245,182,36,0); } }

/* ── Review ── */
.review { max-width: 680px; margin: 0 auto; padding-top: 3vh; }
.review-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 20px 0 24px; }
.rv-row {
  display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px 10px 10px;
  cursor: pointer; text-align: left; width: 100%; transition: border-color .2s; animation: rise .4s var(--ease) both;
}
.rv-row:hover { border-color: var(--line-2); }
.rv-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--panel-2); }
.rv-key { width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0; background: rgba(245,182,36,.12); color: var(--yellow); font-family: var(--head); font-weight: 700; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.rv-txt { flex: 1; min-width: 0; }
.rv-txt small { display: block; color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-txt b { font-size: 15px; }
.rv-edit { color: var(--dim); font-size: 13px; flex-shrink: 0; }

/* ── Summary ── */
.summary { max-width: 760px; margin: 0 auto; }
.done-hero { text-align: center; padding: 3vh 0 10px; }
.done-badge {
  width: 88px; height: 88px; border-radius: 28px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--yellow), #ffdf80); color: #111; font-size: 38px;
  box-shadow: 0 20px 60px -15px rgba(245,182,36,.7); animation: pop .6s var(--ease) both;
}
.done-badge.closed { background: var(--panel-2); color: var(--muted); box-shadow: none; }
.done-hero .display { margin: 0 0 8px; }
.done-hero .lead { margin: 0 auto 6px; }
.count-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.count-pill b { color: var(--text); font-variant-numeric: tabular-nums; }
.locked-note { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin: 22px 0 6px; color: var(--muted); font-size: 14px; }
.locked-note i { color: var(--yellow); font-size: 18px; margin-top: 2px; }
.locked-note b { color: var(--text); }

.res-list { display: grid; gap: 14px; margin: 22px 0; }
.res-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; animation: rise .5s var(--ease) both; }
.res-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.res-num { font-family: var(--head); font-weight: 700; font-size: 12px; color: #111; background: var(--yellow); padding: 2px 8px; border-radius: 6px; flex-shrink: 0; }
.res-q { font-weight: 700; font-size: 16px; line-height: 1.3; }
.res-verdict { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.res-verdict b { color: var(--yellow); }
.res-opts { display: grid; gap: 10px; }
.res-opt { display: flex; align-items: center; gap: 12px; }
.res-thumb { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: #000; cursor: zoom-in; border: 2px solid transparent; }
.res-key { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; background: var(--panel-2); color: var(--muted); }
.res-body { flex: 1; min-width: 0; }
.res-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.res-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-name .rev { color: var(--green); font-weight: 600; }
.res-pct { font-family: var(--head); font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.bar { height: 10px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: #3f3f46; transition: width 1.1s var(--ease); }
.res-opt.is-lead .bar > i { background: linear-gradient(90deg, var(--yellow), #ffd666); }
.res-opt.mine .res-thumb { border-color: var(--yellow); }
.res-opt.mine .res-key { background: var(--yellow); color: #111; }
.you { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #111; background: var(--yellow); padding: 2px 7px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ── Lightbox ── */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.96); display: flex; flex-direction: column; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.lb-top, .lb-bot { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-shrink: 0; }
.lb-top { padding-top: max(12px, env(safe-area-inset-top)); }
.lb-bot { justify-content: center; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.lb-tag { font-family: var(--head); font-weight: 700; font-size: 18px; color: #111; background: var(--yellow); padding: 4px 12px; border-radius: 10px; }
.lb-hint { color: var(--dim); font-size: 12px; flex: 1; }
.lb-x, .lb-nav { width: 46px; height: 46px; border-radius: 14px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.lb-x:hover, .lb-nav:hover { background: rgba(255,255,255,.14); }
.lb-stage { flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: pan-y; cursor: zoom-in; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-stage.zoomed { overflow: auto; display: block; touch-action: auto; cursor: zoom-out; -webkit-overflow-scrolling: touch; }
.lb-stage.zoomed img { max-width: none; max-height: none; }

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200;
  background: #fff; color: #111; font-weight: 600; font-size: 14px; padding: 12px 18px; border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,.4); animation: rise .3s var(--ease) both; max-width: calc(100vw - 32px); text-align: center;
}
.toast.err { background: var(--red); color: #fff; }

/* ── Mobile ── */
@media (max-width: 720px) {
  .wrap { padding: 4px 14px 28px; }
  .topbar { padding: 12px 14px; }
  .img-grid { grid-template-columns: 1fr; gap: 12px; }
  .img-grid.cols-2 .img-box { height: 34vh; height: 34dvh; }
  .img-grid .img-box { height: 46vh; }
  .opt-tag { min-width: 38px; height: 38px; font-size: 17px; border-radius: 12px; top: 10px; left: 10px; }
  .zoom-btn { top: 10px; right: 10px; width: 38px; height: 38px; }
  .pick-bar { left: auto; right: 10px; bottom: 10px; padding: 9px 14px; font-size: 13px; }
  .txt-opt { padding: 14px; font-size: 16px; }
  .intro { padding-top: 2vh; }
  .btn-lg-m { width: 100%; }
  .res-card { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
