/* ===== Пикселна зимна нощ ===== */
:root {
  --bg: #0b1020; --panel: #141a33; --panel2: #1b2342; --edge: #2c3870; --ink: #e9eef7; --muted: #9aa6c8;
  --cyan: #22d3ee; --cyan2: #b8f7ff; --lamp: #ffcf5a; --snow: #e6eef7; --purple: #c026ff; --green: #4ade80;
  --red: #f43f5e; --gold: #ffc400; --black: #05070e;
  --px: 3px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Pixelify Sans', system-ui, sans-serif; --font-head: 'Press Start 2P', 'Pixelify Sans', monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); color-scheme: dark; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-family: var(--font); font-size: 17px; line-height: 1.35; overscroll-behavior: none; -webkit-font-smoothing: none; -webkit-user-select: none; user-select: none; }
input, textarea, select { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
a { touch-action: manipulation; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; } .gap { gap: 8px; } .wrap { flex-wrap: wrap; }
.err { color: var(--red); min-height: 1.2em; margin: 4px 0; }
.warn-text { color: var(--lamp); } .ok-text { color: var(--green); }
h1, h2, h3 { margin: .3em 0; font-weight: 700; }
h3 { color: var(--lamp); font-size: 1rem; margin-top: 1.2em; }
.px-title { font-family: var(--font-head); font-size: 15px; line-height: 1.6; letter-spacing: .02em; color: var(--snow); text-shadow: 2px 2px 0 #000; }
.kicker { font-family: var(--font-head); font-size: 9px; letter-spacing: .08em; color: var(--cyan); text-transform: uppercase; }

/* пикселни рамки */
.panel { background: var(--panel); border: var(--px) solid var(--black); box-shadow: inset 0 0 0 var(--px) var(--edge), 6px 6px 0 rgba(0,0,0,.55); image-rendering: pixelated; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 16px; border: var(--px) solid var(--black); border-radius: 0;
  background: var(--panel2); color: var(--ink); font-family: var(--font); font-size: 1rem; font-weight: 700; text-decoration: none;
  box-shadow: inset calc(-1 * var(--px)) calc(-1 * var(--px)) 0 rgba(0,0,0,.4), inset var(--px) var(--px) 0 rgba(255,255,255,.14), 4px 4px 0 rgba(0,0,0,.5); }
.btn:active { transform: translate(2px, 2px); box-shadow: inset calc(-1 * var(--px)) calc(-1 * var(--px)) 0 rgba(0,0,0,.4), 2px 2px 0 rgba(0,0,0,.5); }
.btn.primary { background: var(--cyan); color: #04212a; }
.btn.danger { background: var(--red); color: #fff; }
.btn.warn { background: var(--lamp); color: #2a1a00; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--edge); border-color: transparent; }
.btn.small { min-height: 36px; padding: 6px 10px; font-size: .9rem; }
.btn.big { width: 100%; min-height: 58px; font-size: 1.15rem; }
.btn:disabled { opacity: .5; }
.icon-btn { min-width: 40px; height: 40px; border: 2px solid var(--black); background: var(--panel2); box-shadow: inset -2px -2px 0 rgba(0,0,0,.4), inset 2px 2px 0 rgba(255,255,255,.12); font-size: 1rem; }
.icon-btn.danger { background: #4a1020; } .icon-btn.ok { background: #0f3d24; } .icon-btn:disabled { opacity: .3; }
.pill { display: inline-block; background: var(--lamp); color: #231500; padding: 3px 9px; font-weight: 700; border: 2px solid var(--black); white-space: nowrap; }
.pill.big { font-size: 1.2rem; padding: 6px 14px; }
.chip { background: rgba(11,16,32,.88); border: 2px solid var(--black); padding: 3px 8px; font-size: .85rem; }

input, textarea, select { width: 100%; padding: 11px 12px; margin: 6px 0; border: var(--px) solid var(--black); border-radius: 0; background: #0a0e1d; color: var(--ink);
  font-family: var(--font); font-size: 1.05rem; box-shadow: inset 0 0 0 2px var(--edge); outline: none; }
input:focus, textarea:focus, select:focus { box-shadow: inset 0 0 0 2px var(--cyan); }
textarea { resize: vertical; }
input[type=checkbox] { width: 22px; height: 22px; margin: 0; accent-color: var(--cyan); }
.field { display: block; margin: 10px 0; } .field > span { font-size: .9rem; color: var(--muted); }
.field.inline { display: flex; align-items: center; gap: 8px; } .field.inline > span { white-space: nowrap; }
.toggle { display: flex; gap: 10px; align-items: center; margin: 10px 0; }
.num { width: 90px; }

/* ===== карта ===== */
#app { position: fixed; inset: 0; overflow: hidden; }
#mapwrap { position: absolute; inset: 0; }
#map { position: absolute; inset: 0; background: #1a2030; }
.pixelated canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated; z-index: 2; }
.maplibregl-ctrl-attrib { font-family: var(--font); font-size: 10px; background: rgba(0,0,0,.5) !important; color: #aab; }
.maplibregl-ctrl-attrib a { color: #ccd; }
.maplibregl-ctrl-bottom-right { bottom: calc(66px + var(--safe-b)); }

/* маркери */
.mk { width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; }
.mk-icon { position: relative; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center; }
.mk-icon svg { width: 100%; height: 100%; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.6)); }
.mk-light { position: absolute; left: 50%; top: 50%; width: 90px; height: 90px; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; z-index: 1; }
.mk-label { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--snow); background: rgba(5,7,14,.8); border: 2px solid var(--black); padding: 1px 5px; z-index: 3; pointer-events: none; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.zoom-low .mk-label { display: none; }
.zoom-low .mk-next .mk-label, .zoom-low .st-next .mk-label { display: block; }
.mk-num { position: absolute; right: -4px; top: -4px; z-index: 3; background: var(--black); color: var(--lamp); font-family: var(--font-head); font-size: 8px; padding: 2px 3px; border: 2px solid var(--lamp); }
.mk-check { position: absolute; right: -6px; bottom: -2px; width: 18px; height: 14px; z-index: 3; background: var(--black); padding: 1px; }
.mk-star { position: absolute; left: -8px; top: -8px; width: 18px; height: 18px; z-index: 3; }
.mk-star.st-active { animation: blink 1s steps(2) infinite; filter: drop-shadow(0 0 4px #ffd400); }
.mk-star.st-done { filter: drop-shadow(0 0 3px #4ade80); }

.mk-bar .mk-light { background: radial-gradient(circle, rgba(255,207,90,.35) 0, rgba(255,207,90,.08) 45%, transparent 70%); }
.mk-bar.st-next .mk-icon { animation: bob 1.2s ease-in-out infinite; }
.mk-bar.st-next .mk-light { background: radial-gradient(circle, rgba(34,211,238,.55) 0, rgba(34,211,238,.12) 45%, transparent 70%); animation: glowPulse 1.6s ease-in-out infinite; }
.mk-bar.st-visited .mk-icon { opacity: .75; }
.mk-start .mk-light, .mk-finish .mk-light { background: radial-gradient(circle, rgba(34,211,238,.4) 0, transparent 65%); }
.mk-finish .mk-light { background: radial-gradient(circle, rgba(255,196,0,.45) 0, transparent 65%); }
.mk-start.st-next .mk-icon, .mk-finish.st-next .mk-icon { animation: bob 1.2s ease-in-out infinite; }

/* звезда за предизвикателство: жълта, мига силно; при „Готово“ — зелена, спира да мига, по-малка светлина */
.mk-challenge.st-active .mk-icon { animation: starBlink .9s steps(2, jump-none) infinite; }
.mk-challenge.st-active .mk-light { width: 120px; height: 120px; background: radial-gradient(circle, rgba(255,212,0,.6) 0, rgba(255,180,0,.18) 40%, transparent 70%); animation: glowPulse .9s ease-in-out infinite; }
.mk-challenge.st-done .mk-light, .mk-secret.st-done .mk-light { width: 60px; height: 60px; background: radial-gradient(circle, rgba(74,222,128,.55) 0, rgba(74,222,128,.12) 45%, transparent 70%); }
.mk-challenge.st-done .mk-icon svg, .mk-secret.st-done .mk-icon svg { filter: drop-shadow(0 0 3px #4ade80) drop-shadow(2px 2px 0 rgba(0,0,0,.6)); }
/* тайно предизвикателство: лилав „!“ */
.mk-secret.st-active .mk-icon { animation: starBlink .75s steps(2, jump-none) infinite, pop .5s ease-out; }
.mk-secret.st-active .mk-light { width: 130px; height: 130px; background: radial-gradient(circle, rgba(192,38,255,.65) 0, rgba(192,38,255,.2) 40%, transparent 70%); animation: glowPulse .75s ease-in-out infinite; }
.mk-pick .mk-light { background: radial-gradient(circle, rgba(34,211,238,.5), transparent 65%); }

@keyframes starBlink { 0% { filter: drop-shadow(0 0 6px #ffe14a) drop-shadow(0 0 14px #ffb000); transform: scale(1.12); } 100% { filter: none; opacity: .45; transform: scale(.92); } }
.mk-secret .mk-icon { --c: #c026ff; }
.mk-secret.st-active .mk-icon svg { filter: drop-shadow(0 0 6px #e879f9) drop-shadow(0 0 12px #c026ff); }
@keyframes glowPulse { 0%,100% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 50% { opacity: .55; transform: translate(-50%,-50%) scale(.85); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes blink { 50% { opacity: .2; } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.4); } 100% { transform: scale(1); } }

/* играчи */
.pl-mk { display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.pl-av { width: 34px; height: 35px; background: rgba(5,7,14,.65); border: 2px solid var(--black); box-shadow: 0 0 0 2px var(--edge); }
.pl-av svg { width: 100%; height: 100%; }
.pl-mk.me .pl-av { box-shadow: 0 0 0 2px var(--cyan), 0 0 14px var(--cyan); animation: meGlow 1.6s ease-in-out infinite; }
.pl-name { font-size: 11px; font-weight: 700; background: var(--black); color: var(--snow); padding: 0 4px; margin-top: 2px; white-space: nowrap; }
.pl-mk.me .pl-name { color: var(--cyan); }
@keyframes meGlow { 50% { box-shadow: 0 0 0 2px var(--cyan), 0 0 26px var(--cyan); } }

/* ===== горна лента, бутони, раздели ===== */
#hud { position: absolute; z-index: 20; top: calc(8px + var(--safe-t)); left: 8px; right: 8px; display: flex; gap: 10px; padding: 8px 10px; align-items: center; }
.hud-main { flex: 1; min-width: 0; }
#hud-big { font-weight: 700; font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--snow); }
#hud-sub { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.gps { position: absolute; z-index: 15; top: calc(92px + var(--safe-t)); left: 8px; }
.fab { position: absolute; z-index: 15; right: 10px; bottom: calc(84px + var(--safe-b)); width: 52px; height: 52px; border: var(--px) solid var(--black); background: var(--panel); color: var(--cyan); font-size: 1.6rem; box-shadow: inset 0 0 0 2px var(--edge), 4px 4px 0 rgba(0,0,0,.5); }
.here { position: absolute; z-index: 15; left: 8px; bottom: calc(150px + var(--safe-b)); background: rgba(11,16,32,.9); }

#tabs { position: absolute; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; background: var(--panel); border-top: var(--px) solid var(--black); box-shadow: inset 0 var(--px) 0 var(--edge); padding-bottom: var(--safe-b); }
#tabs button { flex: 1; background: none; border: 0; padding: 7px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--muted); }
#tabs button b { font-size: 1.25rem; line-height: 1.2; filter: grayscale(.6); }
#tabs button span { font-size: .72rem; }
#tabs button.on { color: var(--cyan); background: rgba(34,211,238,.08); }
#tabs button.on b { filter: none; }

#sheet { position: absolute; z-index: 25; left: 0; right: 0; bottom: calc(58px + var(--safe-b)); height: 0; overflow: hidden; transition: height .22s steps(6); }
#sheet.open { height: calc(78% - var(--safe-b)); }
.sheet-inner { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--panel); border-top: var(--px) solid var(--black); box-shadow: inset 0 var(--px) 0 var(--edge); }
.sheet-close { position: sticky; top: 0; display: block; width: 100%; background: var(--panel); border: 0; color: var(--muted); font-size: 1.3rem; padding: 2px 0; z-index: 2; }
.tab-body { padding: 4px 14px 30px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--panel2); border: 2px solid var(--black); box-shadow: inset 0 0 0 2px #232c55; }
.li.done { box-shadow: inset 0 0 0 2px #1d5a3a; } .li.next { box-shadow: inset 0 0 0 2px var(--cyan); } .li.me { box-shadow: inset 0 0 0 2px var(--lamp); }
.li-ico { width: 30px; height: 30px; flex: none; } .li-ico svg { width: 100%; height: 100%; }
.av-sm { width: 38px; height: 39px; flex: none; background: #0a0e1d; border: 2px solid var(--black); } .av-sm svg { width: 100%; height: 100%; }
.av-md { width: 64px; height: 92px; flex: none; } .av-md svg { width: 100%; height: 100%; }
.av-lg { width: 120px; height: 172px; margin: 0 auto; } .av-lg svg { width: 100%; height: 100%; }
.rank { width: 30px; height: 30px; display: grid; place-items: center; font-family: var(--font-head); font-size: 11px; background: var(--edge); border: 2px solid var(--black); flex: none; }
.rank.r1 { background: var(--gold); color: #231500; } .rank.r2 { background: #c0c8d8; color: #111; } .rank.r3 { background: #cd7f32; color: #1a0d00; }
.score { font-weight: 700; font-size: 1.15rem; color: var(--lamp); }
.bar-prog { height: 6px; background: #0a0e1d; margin-top: 4px; border: 1px solid var(--black); } .bar-prog i { display: block; height: 100%; background: var(--cyan); }
.prize { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 12px; background: #2a1f05; border: 2px solid var(--black); box-shadow: inset 0 0 0 2px #6b4f00; }
.prize-ico { width: 40px; height: 40px; flex: none; } .prize-ico svg { width: 100%; height: 100%; }
.me-card { display: flex; gap: 12px; align-items: center; padding: 10px; background: var(--panel2); border: 2px solid var(--black); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.photo { position: relative; aspect-ratio: 1; background: #0a0e1d; border: 2px solid var(--black); overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; } .photo span { position: absolute; right: 2px; bottom: 0; font-weight: 700; color: var(--green); text-shadow: 1px 1px 0 #000; }
.photo.err span { color: var(--red); }
.tab-body > .btn { margin: 8px 0; width: 100%; }

/* ===== екрани (меню, аватар, организатор) ===== */
.screen { position: absolute; inset: 0; z-index: 40; overflow-y: auto; -webkit-overflow-scrolling: touch; background: linear-gradient(180deg, rgba(5,7,14,.55), rgba(5,7,14,.82) 55%, rgba(5,7,14,.95)); padding: calc(14px + var(--safe-t)) 16px calc(20px + var(--safe-b)); }
.screen.wiz-mode { background: none; padding: 0; overflow: hidden; pointer-events: none; }
.loading { height: 100%; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--muted); }
.spinner { width: 28px; height: 28px; background: var(--cyan); animation: spin 1s steps(4) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.menu { min-height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 18px; max-width: 460px; margin: 0 auto; }
.menu-logo { text-align: center; }
.logo-icons { display: flex; justify-content: center; gap: 14px; margin-bottom: 8px; }
.logo-icons i { width: 44px; height: 44px; display: block; } .logo-icons i svg { width: 100%; height: 100%; }
.logo-icons i:nth-child(2) { animation: starBlink 1s steps(2, jump-none) infinite; }
.logo { font-family: var(--font-head); font-size: 30px; line-height: 1.2; margin: 6px 0; color: var(--snow); text-shadow: 3px 3px 0 #000, 0 0 18px rgba(34,211,238,.55); letter-spacing: .04em; }
.logo-sub { font-size: 1.15rem; color: var(--lamp); text-shadow: 2px 2px 0 #000; }
.menu-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.menu-count { font-family: var(--font-head); font-size: 14px; line-height: 1.6; text-align: center; color: var(--cyan); }
.menu-note { text-align: center; font-size: .85rem; color: var(--muted); }

.avatar-screen { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.av-stage { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 14px; background: radial-gradient(circle at 50% 70%, rgba(255,207,90,.22), transparent 60%), var(--panel); }
.av-preview { width: 150px; height: 216px; } .av-preview svg { width: 100%; height: 100%; filter: drop-shadow(4px 4px 0 rgba(0,0,0,.6)); }
.arrow { width: 48px; height: 48px; border: var(--px) solid var(--black); background: var(--panel2); font-size: 1.2rem; box-shadow: inset -3px -3px 0 rgba(0,0,0,.4), inset 3px 3px 0 rgba(255,255,255,.12); }
.arrow.sm { width: 36px; height: 36px; font-size: .9rem; }
.dice { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border: 2px solid var(--black); background: var(--panel2); font-size: 1.2rem; }
.av-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.av-label { flex: 1; font-weight: 700; color: var(--snow); }
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.thumb { flex: none; width: 54px; height: 56px; padding: 2px; border: 2px solid var(--black); background: var(--panel2); scroll-snap-align: center; }
.thumb svg { width: 100%; height: 100%; } .thumb.on { background: #123b47; box-shadow: inset 0 0 0 2px var(--cyan); }

/* ===== организатор ===== */
.wizard { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; justify-content: flex-end; }
.wiz-panel { pointer-events: auto; position: relative; height: 100%; display: flex; flex-direction: column; transition: height .2s steps(5); padding-top: var(--safe-t); }
.wizard.with-map .wiz-panel { height: 64%; }
.wizard.peek .wiz-panel { height: 112px; }
.wizard.picking .wiz-panel { height: 0; overflow: hidden; border: 0; }
.wiz-top { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 2px solid var(--black); }
.wiz-dots { flex: 1; display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.dot { width: 28px; height: 28px; border: 2px solid var(--black); background: var(--panel2); font-family: var(--font-head); font-size: 9px; color: var(--muted); }
.dot.on { background: var(--cyan); color: #04212a; } .dot.done { background: #1d3c5a; color: var(--snow); }
.wiz-body { flex: 1; overflow-y: auto; padding: 10px 14px 20px; -webkit-overflow-scrolling: touch; }
.wiz-nav { display: flex; gap: 10px; padding: 10px; padding-bottom: calc(10px + var(--safe-b)); border-top: 2px solid var(--black); }
.wiz-nav .btn { flex: 1; }
.pick-bar { pointer-events: auto; position: absolute; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--cyan); color: #04212a; font-weight: 700; border: var(--px) solid var(--black); box-shadow: 4px 4px 0 rgba(0,0,0,.5); animation: blink 1.4s steps(2) 2; }

.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.choice { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; background: var(--panel2); border: var(--px) solid var(--black); box-shadow: inset 0 0 0 2px #232c55; text-align: center; }
.choice small { color: var(--muted); font-size: .8rem; }
.choice.on { box-shadow: inset 0 0 0 var(--px) var(--cyan), 0 0 16px rgba(34,211,238,.4); background: #10303c; }
.choice-icon { width: 52px; height: 52px; } .choice-icon svg { width: 100%; height: 100%; }
.style-swatch { width: 100%; height: 54px; border: 2px solid var(--black); image-rendering: pixelated; }
.sw-pixel { background: repeating-linear-gradient(90deg, #8a94a3 0 10px, #323b4a 10px 20px), #323b4a; background-size: 20px 100%; box-shadow: inset 0 0 0 100px rgba(0,0,0,.1);
  background-image: radial-gradient(circle at 30% 50%, rgba(255,207,106,.8) 0 4px, rgba(255,207,106,.25) 5px 14px, transparent 15px), radial-gradient(circle at 75% 40%, rgba(255,207,106,.8) 0 4px, rgba(255,207,106,.25) 5px 14px, transparent 15px), linear-gradient(0deg, transparent 40%, #8a94a3 40% 60%, transparent 60%), linear-gradient(90deg, #4a2b25 0 30%, #323b4a 30% 40%, #5a3229 40% 70%, #323b4a 70%); }
.sw-lit { background: radial-gradient(circle at 25% 50%, rgba(255,190,85,.7), transparent 30%), radial-gradient(circle at 70% 50%, rgba(255,190,85,.6), transparent 30%), linear-gradient(0deg, transparent 42%, #5e4c31 42% 58%, transparent 58%), #0a0b12; }
.sw-night { background: linear-gradient(0deg, transparent 42%, #3a4870 42% 58%, transparent 58%), linear-gradient(90deg, transparent 45%, #2c3858 45% 55%, transparent 55%), #0e1526; }
.sw-dark { background: linear-gradient(0deg, transparent 44%, #8395bb 44% 56%, transparent 56%), linear-gradient(90deg, transparent 47%, #46536e 47% 53%, transparent 53%), #030407; }

.wheel { position: relative; height: 240px; width: 140px; margin: 16px auto; }
.wheel-frame { position: absolute; left: 0; right: 0; top: 96px; height: 48px; border: var(--px) solid var(--cyan); box-shadow: 0 0 14px rgba(34,211,238,.5); pointer-events: none; z-index: 2; }
.wheel-list { height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; background: #0a0e1d; border: var(--px) solid var(--black);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.wheel-list::-webkit-scrollbar { display: none; }
.wheel-pad { height: 96px; }
.wheel-item { height: 48px; display: grid; place-items: center; scroll-snap-align: center; font-family: var(--font-head); font-size: 18px; color: var(--muted); }
.wheel-item.on { color: var(--snow); text-shadow: 0 0 10px var(--cyan); }
.wheel-value { display: inline-block; font-family: var(--font-head); color: var(--cyan); }

.sec { margin: 14px 0; } .sec-head { display: flex; justify-content: space-between; align-items: center; }
.place { margin: 8px 0; padding: 8px; background: var(--panel2); border: 2px solid var(--black); }
.place-row { display: flex; gap: 6px; align-items: center; } .place-row input { margin: 0; }
.place-ico { width: 30px; height: 30px; flex: none; } .place-ico svg { width: 100%; height: 100%; }
.search-res { display: flex; flex-direction: column; gap: 4px; }
.search-item { text-align: left; padding: 8px; background: #0a0e1d; border: 2px solid var(--black); }
.weather-box { padding: 10px; background: #0d2330; border: 2px solid var(--black); box-shadow: inset 0 0 0 2px #1b4a5c; margin: 6px 0 10px; }
.big-line { font-weight: 700; color: var(--cyan); font-size: 1.1rem; margin: 4px 0; }
.legs { margin-top: 10px; }
.leg { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 0 2px 38px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.leg.over { color: var(--lamp); } .leg .ok { color: var(--green); }
.leg-item { display: flex; align-items: center; gap: 8px; padding: 6px; background: var(--panel2); border: 2px solid var(--black); }
.clip-slot { margin: 10px 0; padding: 10px; background: var(--panel2); border: 2px solid var(--black); }
.dot-st { width: 12px; height: 12px; flex: none; background: var(--muted); border: 2px solid var(--black); } .dot-st.yes { background: var(--green); } .dot-st.no { background: var(--red); }
.tip { padding: 10px; background: #1d1636; border: 2px solid var(--black); box-shadow: inset 0 0 0 2px #3b2a6b; margin: 8px 0; font-size: .95rem; }
.tr-status { display: block; margin-top: 4px; }
.summary { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--panel2); border: 2px solid var(--black); margin-bottom: 10px; }
.sum-icon { width: 54px; height: 54px; flex: none; } .sum-icon svg { width: 100%; height: 100%; }

/* ===== клипове ===== */
.clip-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: calc(10px + var(--safe-t)) 10px calc(10px + var(--safe-b)); background: rgba(3,5,10,.94); animation: fadeIn .15s steps(3); }
.clip-overlay.closing { opacity: 0; transition: opacity .18s steps(3); }
@keyframes fadeIn { from { opacity: 0; } }
.clip-card { width: 100%; max-width: 460px; max-height: 100%; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.clip-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-right: 26px; }
.clip-head h2 { font-size: 1.25rem; margin: 2px 0 0; }
.clip-stage { position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 66vh; background: #000; border: var(--px) solid var(--black); overflow: hidden; }
.show-after .clip-stage { max-height: 36vh; }
.clip-video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.clip-play { position: absolute; inset: 0; margin: auto; width: 90px; height: 90px; font-size: 2.4rem; background: var(--cyan); color: #04212a; border: var(--px) solid var(--black); box-shadow: 6px 6px 0 rgba(0,0,0,.6); }
.clip-novideo { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; color: var(--muted); gap: 6px; }
.clip-novideo .big { font-size: 3rem; line-height: 1.1; }
.clip-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.1); } .clip-progress i { display: block; height: 100%; width: 0; background: var(--cyan); }
.clip-after { display: none; flex-direction: column; gap: 10px; }
.show-after .clip-after { display: flex; animation: slideUp .25s steps(5); }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } }
.clip-text { font-size: 1.12rem; line-height: 1.45; padding: 12px; background: #0a0e1d; border: 2px solid var(--black); box-shadow: inset 0 0 0 2px var(--edge); white-space: pre-wrap; -webkit-user-select: text; user-select: text; }
.clip-text.empty { color: var(--muted); font-style: italic; }
.clip-actions { display: flex; flex-direction: column; gap: 8px; }
.clip-close { position: fixed; z-index: 101; top: calc(14px + var(--safe-t)); right: 14px; width: 44px; height: 44px; font-size: 1.2rem; background: var(--panel2); border: var(--px) solid var(--black); box-shadow: 3px 3px 0 rgba(0,0,0,.5); }
/* „Изключи ме ако можеш“ — мъничък бутон в горния десен ъгъл (само първото пускане) */
.clip-tiny-wrap { position: fixed; z-index: 101; top: calc(6px + var(--safe-t)); right: 6px; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.clip-tiny-hint { font-size: 11px; color: var(--muted); background: rgba(0,0,0,.6); padding: 1px 4px; animation: nudge 1.2s ease-in-out infinite; }
.clip-tiny-hint b { color: var(--lamp); }
.clip-tiny { pointer-events: auto; width: 7px; height: 7px; padding: 0; border: 0; background: #ff5a5a; box-shadow: 0 0 0 1px #000; }
.show-after .clip-tiny-wrap { display: none; }
@keyframes nudge { 50% { transform: translateX(3px); } }
.after-close { margin-top: 2px; }

/* ===== финал, модални, известия ===== */
.overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b)); background: rgba(3,5,10,.9); overflow-y: auto; }
.final-card { width: 100%; max-width: 460px; padding: 16px; display: flex; flex-direction: column; gap: 10px; text-align: center; max-height: 100%; overflow-y: auto; }
.final-card .list { text-align: left; }
.winner { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; background: radial-gradient(circle at 50% 60%, rgba(255,196,0,.35), transparent 65%); }
.winner-name { font-family: var(--font-head); font-size: 18px; color: var(--gold); text-shadow: 2px 2px 0 #000, 0 0 16px rgba(255,196,0,.6); }
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(3,5,10,.75); }
.modal-card { width: 100%; max-width: 380px; padding: 16px; }
.modal-card .row .btn { flex: 1; }
.toast { position: fixed; z-index: 300; left: 50%; top: calc(96px + var(--safe-t)); transform: translateX(-50%) translateY(-20px); opacity: 0; pointer-events: none; max-width: 92%; padding: 10px 14px; background: var(--snow); color: #0b1020; font-weight: 700; border: var(--px) solid var(--black); box-shadow: 4px 4px 0 rgba(0,0,0,.5); transition: all .2s steps(4); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 700px) {
  .wizard .wiz-panel { width: 460px; margin-left: auto; height: 100% !important; }
  .wizard.peek .wiz-panel { width: 460px; }
  #sheet { left: auto; width: 440px; right: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; } }

/* ===== език, известия, инсталиране ===== */
.lang-switch { display: flex; justify-content: center; gap: 6px; }
.lang-switch button { min-width: 52px; padding: 6px 10px; background: var(--panel2); border: 2px solid var(--black); color: var(--muted); font-family: var(--font-head); font-size: 10px; }
.lang-switch button.on { background: var(--cyan); color: #04212a; }
.notif-card { text-align: center; display: flex; flex-direction: column; gap: 10px; }
.bell { font-size: 3rem; animation: ringBell 1.2s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ringBell { 0%,60%,100% { transform: rotate(0); } 10% { transform: rotate(18deg); } 20% { transform: rotate(-16deg); } 30% { transform: rotate(12deg); } 40% { transform: rotate(-8deg); } }
.ring-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin: 6px 0; }
.chip-btn { padding: 6px 10px; background: var(--panel2); border: 2px solid var(--black); color: var(--ink); font-size: .9rem; }
.chip-btn.on { background: #123b47; box-shadow: inset 0 0 0 2px var(--cyan); }
.guide .steps { text-align: left; padding-left: 22px; line-height: 1.5; }
.guide .steps li { margin: 6px 0; }
.en-text { font-size: .95rem; box-shadow: inset 0 0 0 2px #2b4a6b; }
.clip-stage { min-height: 200px; }
@supports not (aspect-ratio: 1) { .clip-stage { height: 60vh; } }
@supports not (inset: 0) { .screen, #map, #mapwrap, #app, .overlay, .clip-overlay, .modal { top: 0; left: 0; right: 0; bottom: 0; } }
.sw-city { background: radial-gradient(circle at 78% 30%, #1f3a35 0 12px, transparent 13px), linear-gradient(0deg, transparent 42%, #5d6678 42% 58%, transparent 58%), linear-gradient(90deg, transparent 45%, #3a4458 45% 55%, transparent 55%), #1d2533; }
.sw-d3 { background: linear-gradient(160deg, #141a26 0 28%, #3e4b6c 28% 44%, #2e3850 44% 58%, #141a26 58% 64%, #55658f 64% 84%, #141a26 84%); }
.sw-sat { background: radial-gradient(circle at 30% 40%, rgba(255,190,85,.9) 0 2px, transparent 9px), radial-gradient(circle at 70% 62%, rgba(255,190,85,.9) 0 2px, transparent 9px), linear-gradient(0deg, transparent 45%, rgba(255,190,85,.6) 45% 55%, transparent 55%), linear-gradient(90deg, transparent 47%, rgba(255,190,85,.5) 47% 53%, transparent 53%), #20261c; }
