/* Hovli ol shahri — 3D site. Direction: dusk Samarkand — deep indigo glass, gold, koshin turquoise. */
:root {
  --ink: #1b1640;
  --glass: rgba(22, 16, 54, 0.72);
  --glass-strong: rgba(22, 16, 54, 0.9);
  --line: rgba(255, 255, 255, 0.12);
  --gold: #ffcf3f;
  --gold-deep: #e0a000;
  --koshin: #2bb5c8;
  --paper: #fffaf0;
  --muted: #b9b0e6;
  --sky: #1b1640;
  --font: Montserrat, "Segoe UI", system-ui, sans-serif;
  --safe-t: max(10px, env(safe-area-inset-top));
  --safe-b: max(10px, env(safe-area-inset-bottom));
  --dock: 128px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* author display rules must not resurrect hidden sheets */
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sky); font-family: var(--font); color: #fff; touch-action: none; -webkit-tap-highlight-color: transparent; }
#gl, #tags { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#tags { pointer-events: none; }
button { font-family: var(--font); cursor: pointer; }
.glass { background: var(--glass); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }

/* ── top bar ── */
.topbar { position: fixed; top: var(--safe-t); left: 10px; right: 10px; max-width: 620px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 10px 8px 8px; border-radius: 20px; border: 1px solid var(--line); pointer-events: none;
  background: var(--glass); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.brandbox { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--gold); object-fit: cover; flex: none; }
.brandbox b { display: block; font-weight: 900; font-size: 16px; color: var(--gold); letter-spacing: .01em; white-space: nowrap; }
.brandbox small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.stats { display: flex; gap: 6px; }
.stat { min-width: 62px; text-align: center; padding: 4px 8px; border-radius: 12px; background: rgba(255,255,255,.06); }
.stat b { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 18px; font-weight: 900; color: #fff; line-height: 1.15; }
.stat small { font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat.live b { color: #7dff9e; }
.stat.live i { width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; animation: live 1.8s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(46,204,113,.7); } 70% { box-shadow: 0 0 0 7px rgba(46,204,113,0); } 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); } }

.chip { position: fixed; top: calc(var(--safe-t) + 66px); left: 50%; transform: translateX(-50%); border: 0; border-radius: 999px; padding: 9px 16px;
  font: 800 13px var(--font); color: var(--ink); background: linear-gradient(90deg, var(--gold), #ffb347); box-shadow: 0 8px 22px rgba(224,160,0,.35); white-space: nowrap; animation: chip 2.4s ease-in-out infinite; }
.chip em { font-style: normal; font-weight: 900; }
@keyframes chip { 50% { box-shadow: 0 8px 26px rgba(255,207,63,.65); } }

.side { position: fixed; right: 10px; top: 42%; display: grid; gap: 8px; }
.side button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; font-size: 20px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.side button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }

/* ── loading ── */
.loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; z-index: 30; transition: opacity .6s;
  background: radial-gradient(120% 80% at 50% 100%, #e0875e 0%, #6b3f8f 45%, #1b1640 100%); }
.loading.done { opacity: 0; pointer-events: none; }
.loading img { border-radius: 24px; border: 3px solid var(--gold); box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.loading p { margin: 10px 0 0; font-weight: 900; font-size: 18px; }
.loading small { color: var(--muted); font-weight: 700; }
.pulse { animation: lp 1.4s ease-in-out infinite; }
@keyframes lp { 50% { transform: scale(1.06); } }

/* ── bottom dock: search + tabs ── */
.dock { position: fixed; left: 10px; right: 10px; bottom: var(--safe-b); max-width: 620px; margin: 0 auto; padding: 8px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--glass); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 -6px 30px rgba(0,0,0,.25); }
.find { position: relative; display: flex; gap: 6px; align-items: center; background: var(--paper); border-radius: 16px; padding: 4px 4px 4px 12px; }
.find .lens { color: #8a83b3; font-size: 20px; line-height: 1; }
.find input { flex: 1; min-width: 0; font: 600 16px var(--font); padding: 10px 4px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.find button { font: 900 14px var(--font); padding: 11px 14px; border-radius: 12px; border: 0; background: var(--gold); color: var(--ink); white-space: nowrap; }
.find button:active, .tab:active, .side button:active, .chip:active { transform: scale(.96); }
.sugg { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; background: var(--paper); border-radius: 14px; color: var(--ink); max-height: 40vh; overflow: auto; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.sugg li { padding: 10px 12px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.sugg li:hover, .sugg li[aria-selected="true"] { background: #f3e7c4; }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 6px; }
.tab { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 4px; border: 0; border-radius: 12px; background: transparent; color: #e9e4ff; text-decoration: none; font: 800 11px var(--font); }
.tab span { font-size: 20px; line-height: 1.1; }
.tab:hover { background: rgba(255,255,255,.08); }
#saylovBtn.live { color: var(--gold); }
#saylovBtn.live span { animation: lp 1.6s ease-in-out infinite; }

/* ── house card ── */
.card { position: fixed; left: 10px; right: 10px; bottom: calc(var(--safe-b) + var(--dock) + 8px); max-width: 620px; margin: 0 auto; background: var(--paper); color: var(--ink);
  border-radius: 22px; padding: 16px 18px 14px; box-shadow: 0 14px 40px rgba(0,0,0,.4); animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(16px); opacity: 0; } }
.card h2 { margin: 0 34px 4px 0; font-size: 22px; font-weight: 900; overflow-wrap: anywhere; }
.card p { margin: 2px 0; font-weight: 600; color: #4a4470; }
.card .wish { color: #8a5a00; font-weight: 800; }
.card .row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.card .row a, .card .row button { flex: 1; text-align: center; text-decoration: none; font: 800 14px var(--font); padding: 12px 8px; border-radius: 14px; border: 0; background: #ece6fa; color: var(--ink); }
.card .row a.primary { background: var(--gold); }
.card .x { position: absolute; top: 10px; right: 12px; border: 0; background: #f1ecfb; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; color: #6b6390; }

.hint { position: fixed; left: 0; right: 0; bottom: calc(var(--safe-b) + var(--dock) + 10px); text-align: center; margin: 0; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.9); text-shadow: 0 1px 4px rgba(0,0,0,.7); pointer-events: none; transition: opacity .6s; }
.hint.gone { opacity: 0; }

/* ── welcome ── */
.welcome { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(12, 8, 32, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.wbox { width: min(440px, 100%); max-height: 100%; overflow: auto; background: var(--paper); color: var(--ink); border-radius: 26px; padding: 22px 20px 16px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: up .35s ease-out; }
.wbox img { border-radius: 20px; border: 3px solid var(--gold); }
.wbox h1 { margin: 10px 0 12px; font-size: 24px; line-height: 1.15; font-weight: 900; }
.wbox ul { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; text-align: left; }
.wbox li { display: flex; gap: 10px; align-items: center; background: #f4effc; border-radius: 14px; padding: 10px 12px; font-weight: 700; font-size: 14px; color: #3d3566; }
.wbox li span { font-size: 22px; }
.wbox form { display: flex; gap: 6px; }
.wbox input { flex: 1; min-width: 0; font: 600 16px var(--font); padding: 13px 14px; border-radius: 14px; border: 2px solid #ece6fa; color: var(--ink); }
.wbox form button { border: 0; border-radius: 14px; padding: 0 16px; font: 900 15px var(--font); background: var(--gold); color: var(--ink); }
.wbox .link { margin-top: 12px; border: 0; background: none; color: #6b6390; font: 800 14px var(--font); text-decoration: underline; }

@media (min-width: 900px) {
  .side { top: 50%; right: 18px; }
  .hint { font-size: 13px; }
}
/* ── saylov ── */


@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255,207,63,.45); } }
.saylov { position: fixed; left: 10px; right: 10px; top: max(10px, env(safe-area-inset-top)); bottom: max(10px, env(safe-area-inset-bottom)); max-width: 540px; margin: 0 auto; overflow: auto; background: #fffaf0; color: var(--ink); border-radius: 22px; padding: 18px; box-shadow: 0 16px 44px rgba(0,0,0,.45); z-index: 10; }
.saylov h2 { margin: 0 34px 4px 0; font-size: 22px; font-weight: 900; }
.saylov .sub { margin: 0 0 12px; color: #4a4470; font-weight: 600; }
.saylov .x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 26px; color: #6b6390; }
.ptabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ptabs button { flex: 1; border: 0; border-radius: 12px; padding: 10px 8px; font: 800 13px var(--font); background: #ece6fa; color: var(--ink); }
.ptabs button.on { background: var(--ink); color: var(--gold); }
.win { background: var(--gold); border-radius: 12px; padding: 10px 12px; font-weight: 900; margin-bottom: 10px; }
.cands { display: grid; gap: 10px; }
.cand { border: 2px solid #ece6fa; border-radius: 16px; padding: 12px; }
.cand.won { border-color: var(--gold); background: #fff4cf; }
.cand .top { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; }
.cand .top span { font-weight: 800; color: #6b6390; white-space: nowrap; }
.cand .slogan { margin: 4px 0 6px; color: #4a4470; font-weight: 600; font-style: italic; overflow-wrap: anywhere; }
.cand .bar { height: 8px; background: #ece6fa; border-radius: 6px; overflow: hidden; }
.cand .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffcf3f, #e0872f); }
.cand .vote { margin-top: 8px; width: 100%; border: 0; border-radius: 12px; padding: 10px; font: 900 14px var(--font); background: #0095f6; color: #fff; }
.saylov .me, .sform label { display: grid; gap: 4px; margin-top: 12px; font-weight: 700; font-size: 13px; color: #4a4470; }
.saylov input, .saylov select { font: 600 16px var(--font); padding: 11px 12px; border-radius: 12px; border: 2px solid #ece6fa; background: #fff; color: var(--ink); }
.saylov .row { display: flex; gap: 8px; margin-top: 12px; }
.saylov .row button { flex: 1; border: 0; border-radius: 12px; padding: 12px; font: 900 14px var(--font); background: #ece6fa; color: var(--ink); }
.saylov .row button.primary { background: var(--gold); }
.saylov .rules { font-size: 12px; color: #6b6390; margin: 10px 0 0; }
.saylov .msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #1b1640; color: #fff; font-weight: 700; }
.saylov .empty { color: #6b6390; font-weight: 700; }
.saylov .conds { margin-top: 12px; background: #f3ecff; border-radius: 12px; padding: 10px 12px; font-size: 13px; color: #3d3566; }
.saylov .conds ol { margin: 6px 0 4px 18px; padding: 0; font-weight: 700; }
.saylov .conds p { margin: 4px 0 0; }
.saylov .agree { display: flex !important; flex-direction: row; align-items: center; gap: 8px; margin-top: 10px; font-weight: 800 !important; color: var(--ink) !important; }
.saylov .agree input { width: 22px; height: 22px; }
.saylov .howvote { margin-top: 12px; background: #e9f6ff; border-radius: 12px; padding: 10px 12px; font-size: 13px; color: #1d3f6e; font-weight: 600; }
.saylov .postlink { display: block; margin-top: 8px; font-weight: 900; color: #0077cc; text-decoration: none; }
.cand .vote b { font-weight: 900; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(46,204,113,0); } 100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); } }
.cand.topc { border-color: #e0a000; background: linear-gradient(135deg, #fff6d6, #ffe9a8); box-shadow: 0 4px 14px rgba(224,160,0,.25); }
.saylov .campaign { display: block; margin-top: 10px; padding: 11px 12px; border-radius: 12px; background: #229ED9; color: #fff; font-weight: 800; font-size: 13px; text-decoration: none; text-align: center; }
.card .vipbadge { display: inline-block; margin: 0 0 6px; padding: 5px 10px; border-radius: 999px; background: linear-gradient(90deg, #ffcf3f, #ffb347); color: #1b1640 !important; font-weight: 900 !important; font-size: 12px; box-shadow: 0 4px 12px rgba(224,160,0,.35); }
.card .vipbadge.oltin { background: linear-gradient(90deg, #ffb81f, #ff8a00); box-shadow: 0 4px 14px rgba(255,140,0,.45); }
.card .vipbadge.olmos { background: linear-gradient(90deg, #b07cff, #6fd3ff); color: #fff !important; box-shadow: 0 4px 16px rgba(150,100,255,.5); }
.card .story { display: block; width: 100%; margin-top: 8px; padding: 12px; border: 0; border-radius: 14px; font: 900 14px var(--font); color: #fff; background: linear-gradient(90deg, #f58529, #dd2a7b 50%, #8134af); box-shadow: 0 6px 16px rgba(221,42,123,.35); }
.card .story:disabled { opacity: .7; }
.card .klub { margin: 8px 0 4px; padding: 10px 12px; border-radius: 14px; background: #eef8f0; }
.card .klub label { display: block; font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.card .klub .krow { display: flex; gap: 6px; }
.card .klub select { flex: 1; min-width: 0; font: 700 15px var(--font); padding: 9px 8px; border-radius: 10px; border: 2px solid #cfe8d4; background: #fff; color: var(--ink); }
.card .klub button { border: 0; border-radius: 10px; padding: 0 12px; font: 900 13px var(--font); background: #0a7d3b; color: #fff; }
.card .klub .kmsg { margin: 6px 0 0; font-size: 13px; font-weight: 700; }
.card .kr { margin: 8px 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.card .kr li { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr auto; gap: 8px; align-items: center; font-weight: 800; font-size: 14px; }
.card .kr .kn { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .kr .kn i { flex: none; width: 18px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.card .kr .kb { height: 10px; border-radius: 6px; background: #ece6fa; overflow: hidden; }
.card .kr .kb i { display: block; height: 100%; border-radius: 6px; }
