:root {
  --bg: #111214; --card: #1b1c20; --card2: #24262b; --line: #2e3036;
  --text: #f4f4f5; --muted: #9a9ca5; --accent: #ffc83d; --accent-ink: #1a1400;
  --ok: #3ddc84; --bad: #ff5c5c; --radius: 18px;
}
html.light {
  --bg: #f3f3f1; --card: #ffffff; --card2: #f0efe9; --line: #e3e2dc;
  --text: #16171a; --muted: #6d6f76; --accent: #ffbf1f; --accent-ink: #1a1400;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); min-height: 100vh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h2 { font-size: 22px; margin: 6px 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* логотип-шмель: полоски и крылья на CSS, без картинок */
.bee-logo { width: 30px; height: 30px; border-radius: 50%; position: relative;
  background: repeating-linear-gradient(115deg, var(--accent) 0 7px, #16171a 7px 12px); box-shadow: 0 0 0 2px #16171a inset; }
.bee-logo::before, .bee-logo::after { content: ""; position: absolute; top: -7px; width: 15px; height: 12px; border-radius: 50%;
  background: rgba(190, 225, 255, .75); }
.bee-logo::before { left: 0; transform: rotate(-25deg); }
.bee-logo::after { right: 0; transform: rotate(25deg); }
.bee-logo.big { width: 84px; height: 84px; background: repeating-linear-gradient(115deg, var(--accent) 0 18px, #16171a 18px 30px); animation: buzz .9s ease-in-out infinite; }
.bee-logo.big::before, .bee-logo.big::after { top: -20px; width: 42px; height: 32px; }
@keyframes buzz { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }

.loader { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; transition: opacity .3s; }
.loader.hide { opacity: 0; pointer-events: none; }
.loader-text { color: var(--muted); }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.brand-vpn { background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.top-right { display: flex; gap: 8px; align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--card2); color: var(--muted); }

main { padding: 6px 16px 16px; max-width: 560px; margin: 0 auto; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card.accent { background: linear-gradient(135deg, #2b2410, #1b1c20 70%); border: 1px solid #4a3c10; }
html.light .card.accent { background: linear-gradient(135deg, #fff1c4, #fff 70%); border-color: #f2d98a; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border-radius: 14px; font-weight: 600; background: var(--card2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.small { width: auto; padding: 8px 14px; font-size: 14px; border-radius: 11px; }
.btn:disabled { opacity: .45; }
.btn + .btn, .grid2 + .btn, .btn + .grid2 { margin-top: 10px; }
.grid2 > .btn { margin-top: 0; }

.tariff-name { font-size: 24px; font-weight: 800; margin: 2px 0; }
.bar { height: 8px; background: var(--card2); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding: 4px 0; }
.tabs button.on { color: var(--accent); }
.ic { width: 24px; height: 24px; display: block; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.ic-home { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 3 10.5V21h6v-6h6v6h6V10.5z'/%3E%3C/svg%3E"); }
.ic-shop { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h16l-1.5 13h-13zM8 7a4 4 0 0 1 8 0h-2a2 2 0 0 0-4 0z'/%3E%3C/svg%3E"); }
.ic-dev { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm0 3v13h10V5zm5 14.2a1 1 0 1 0 0 .1z'/%3E%3C/svg%3E"); }
.ic-more { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h7v7H4zm9 0h7v7h-7zM4 13h7v7H4zm9 0h7v7h-7z'/%3E%3C/svg%3E"); }

.seg { display: flex; background: var(--card2); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 9px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.seg .off { font-size: 11px; background: var(--ok); color: #062; padding: 1px 5px; border-radius: 6px; margin-left: 4px; }

.plan { position: relative; }
.plan.hit { border: 1.5px solid var(--accent); }
.plan .hit-label { position: absolute; top: -9px; right: 14px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.price { font-size: 26px; font-weight: 800; }
.price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.feat { list-style: none; padding: 0; margin: 10px 0 14px; }
.feat li { padding: 3px 0 3px 24px; position: relative; }
.feat li::before { content: "✓"; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }

.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.li-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--card2); display: grid; place-items: center; font-size: 20px; flex: none; }
.li-main { flex: 1; min-width: 0; }
.li-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.del { color: var(--bad); padding: 8px; font-size: 13px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 16px 14px; text-align: left; min-height: 116px; display: flex; flex-direction: column; justify-content: space-between; }
.tile .em { font-size: 30px; }
.tile b { font-size: 15px; }
.tile span { color: var(--muted); font-size: 12px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); padding: 4px 0 8px; }

.linkbox { display: flex; gap: 8px; align-items: center; background: var(--card2); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.linkbox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat { background: var(--card2); border-radius: 14px; padding: 12px; }
.stat b { font-size: 22px; display: block; }

.lead { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.lead:first-child { border-top: 0; }
.lead .pl { width: 28px; text-align: center; font-weight: 700; color: var(--muted); }
.lead.me { color: var(--accent); }
.lead .n { flex: 1; }

.prize-hero { text-align: center; padding: 22px 16px; }
.prize-hero .em { font-size: 64px; line-height: 1; }
.timer { display: flex; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.timer div { background: var(--card2); border-radius: 12px; padding: 8px 10px; min-width: 58px; }
.timer b { font-size: 22px; display: block; }
.timer span { font-size: 11px; color: var(--muted); }

.case-box { font-size: 56px; text-align: center; padding: 6px 0; }
.chances { display: grid; gap: 6px; margin: 10px 0 14px; }
.chances div { display: flex; justify-content: space-between; font-size: 13px; background: var(--card2); border-radius: 10px; padding: 7px 10px; }
.chances .phys { color: var(--accent); }

.roll { overflow: hidden; border-radius: 14px; background: var(--card2); position: relative; height: 84px; margin: 8px 0 14px; }
.roll::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--accent); transform: translateX(-1px); }
.roll-strip { display: flex; gap: 8px; padding: 10px 0; transition: transform 4.2s cubic-bezier(.1, .7, .1, 1); will-change: transform; }
.roll-strip div { flex: none; width: 110px; height: 64px; border-radius: 10px; background: var(--card); display: grid; place-items: center; text-align: center; font-size: 12px; padding: 4px; }

.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet-back { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; background: var(--card); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; max-width: 560px; margin: 0 auto; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.qr-box { background: #fff; border-radius: 16px; padding: 14px; width: min(290px, 80vw); margin: 6px auto 12px; }
.qr-box canvas { width: 100%; display: block; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #000c; color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 60; max-width: 90vw; text-align: center; }
.task { flex-wrap: wrap; }
.task .task-btns { display: flex; gap: 8px; width: 100%; padding-left: 52px; }
.task .task-btns .btn { flex: 1; }
.nowrap { white-space: nowrap; }
.dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 12px; }
.dot { background: var(--card2); border-radius: 10px; text-align: center; font-size: 11px; padding: 7px 0; color: var(--muted); font-weight: 600; }
.dot.on { background: var(--accent); color: var(--accent-ink); }
.dot.last { font-size: 14px; padding: 5px 0; }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; position: relative; padding-right: 22px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: -2px; font-size: 20px; color: var(--muted); }
.faq[open] summary::after { content: "−"; }
.faq p { margin: 10px 0 0; }
.toggle { cursor: pointer; position: relative; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .sw { flex: none; width: 46px; height: 28px; border-radius: 99px; background: var(--card2); position: relative; transition: background .2s; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle input:checked + .sw { background: var(--accent); }
.toggle input:checked + .sw::after { transform: translateX(18px); }
.seg .off { display: block; width: max-content; margin: 2px auto 0; }
