:root {
  --bg: #000;
  --card: #111;
  --card2: #1c1c1e;
  --line: #2c2c2e;
  --volt: #d4ff00;
  --text: #fff;
  --mute: #8e8e93;
  --red: #ff3b30;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  --head: "Inter Tight", -apple-system, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
/* приложение на весь экран, как нативное: ничего не прокручивается */
.app { position: fixed; inset: 0; overflow: hidden; user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
.hidden { display: none !important; }
.volt { color: var(--volt); }

/* шапка */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(18px, env(safe-area-inset-top)) 20px 18px;
}
.logo {
  font-family: var(--head); font-weight: 900; font-size: 22px; letter-spacing: -.04em;
  display: flex; align-items: baseline; gap: 2px;
}
.logo i { width: 7px; height: 7px; border-radius: 50%; background: var(--volt); display: inline-block; }
.top-r { display: flex; align-items: center; gap: 14px; }
.online { font-size: 13px; color: var(--mute); display: flex; align-items: center; gap: 7px; font-weight: 500; }
.led { width: 7px; height: 7px; border-radius: 50%; background: #30d158; }
.me {
  height: 34px; padding: 0 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--card2);
}

/* экраны */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 16px max(28px, env(safe-area-inset-bottom));
}

/* реклама */
.ad {
  width: min(calc(100vw - 32px), 728px); height: 60px;
  display: grid; place-items: center; overflow: hidden; border-radius: 12px;
}
.ad-top { position: absolute; left: 50%; transform: translateX(-50%); z-index: 5; top: calc(max(18px, env(safe-area-inset-top)) + 52px); }
.ad.empty { border: 1px dashed var(--line); color: #48484a; font-size: 12px; font-weight: 500; }
.bottom-bar {
  position: absolute; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none;
}
.bottom-bar > * { pointer-events: auto; }
.live { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--mute); font-weight: 500; }
.live span { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.live i { font-style: normal; color: var(--line); }
.live a { color: var(--mute); text-decoration: none; }
.cookie {
  display: flex; align-items: center; gap: 12px; width: min(calc(100vw - 32px), 520px);
  padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--card2);
}
.cookie p { flex: 1; font-size: 13px; line-height: 1.35; color: var(--mute); }
.cookie a { color: var(--text); }
.cookie button { height: 36px; padding: 0 18px; border-radius: 999px; background: var(--text); color: #000; font-weight: 700; font-size: 14px; }
.legal { position: absolute; bottom: max(20px, env(safe-area-inset-bottom)); display: flex; gap: 18px; }
.legal a { color: var(--mute); font-size: 13px; text-decoration: none; }
#main { padding-top: 140px; padding-bottom: 124px; }
@media (min-width: 768px) {
  .ad { height: 90px; }
  #main { padding-top: 170px; padding-bottom: 154px; }
}
@media (max-height: 700px) {
  #adBottom { display: none; }
  #main { padding-bottom: 56px; }
}

/* жалоба и бан */
.ctl.report svg { width: 22px; height: 22px; fill: var(--mute); }
.reasons { display: flex; flex-direction: column; gap: 8px; }
.reasons button {
  height: 54px; padding: 0 18px; border-radius: 14px; text-align: left; font-size: 17px; font-weight: 600;
  background: var(--card2); transition: background .15s;
}
.reasons button:active { background: var(--red); }
.ban { position: fixed; z-index: 20; background: var(--bg); text-align: center; }
.ban .red { color: var(--red); }
.ban-text { color: var(--mute); font-size: 16px; line-height: 1.5; margin-bottom: 28px; }
.ban-text b { color: var(--text); }
.ban .btn-main { width: 100%; max-width: 360px; }

/* вход */
.mega {
  font-family: var(--head); font-weight: 900; text-align: center; text-transform: uppercase;
  font-size: clamp(48px, 12vw, 128px); line-height: .88; letter-spacing: -.05em;
  margin-bottom: 44px;
}
#gateForm { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
#gateForm input:not([type=checkbox]) {
  width: 100%; height: 56px; padding: 0 18px;
  background: var(--card2); border: 0; border-radius: 14px; outline: none;
  font-size: 17px; transition: box-shadow .15s;
}
#gateForm input:focus { box-shadow: 0 0 0 2px var(--text); }
#gateForm input::placeholder { color: var(--mute); }
#gateForm input::-webkit-outer-spin-button, #gateForm input::-webkit-inner-spin-button { -webkit-appearance: none; }
.row { display: flex; gap: 10px; }
.row input { flex: 1; min-width: 0; }

.seg { display: flex; padding: 3px; background: var(--card2); border-radius: 14px; }
.seg button {
  min-width: 56px; height: 50px; border-radius: 11px; font-weight: 700; font-size: 15px; color: var(--mute);
  transition: background .2s, color .2s;
}
.seg button.on { background: var(--text); color: #000; }
.seg.small { border-radius: 999px; }
.seg.small button { min-width: 52px; height: 40px; font-size: 14px; border-radius: 999px; }

.check { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--mute); cursor: pointer; padding: 8px 2px; }
.check input { display: none; }
.check em { font-style: normal; line-height: 1.35; }
.check a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.check span { flex: none; width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 50%; display: grid; place-items: center; transition: all .15s; }
.check input:checked + span { background: var(--volt); border-color: var(--volt); }
.check input:checked + span::after { content: ""; width: 6px; height: 10px; border: solid #000; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }

.btn-main {
  height: 58px; border-radius: 999px; background: var(--text); color: #000;
  font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .1s, opacity .15s;
}
.btn-main:hover { opacity: .9; }
.btn-main:active { transform: scale(.97); }
.err { color: var(--red); font-size: 13px; min-height: 18px; text-align: center; }

/* сцена */
.stage { position: relative; width: min(70vw, 320px); aspect-ratio: 1; display: grid; place-items: center; }
.orb {
  position: relative; z-index: 2; width: 72%; aspect-ratio: 1; border-radius: 50%;
  background: var(--volt); color: #000; display: grid; place-items: center;
  transition: transform .18s ease, background .25s, color .25s;
  --lvl: 0;
  transform: scale(calc(1 + var(--lvl) * .1));
}
.orb:active { transform: scale(.96); }
.orb-label {
  font-family: var(--head); font-weight: 900; text-transform: uppercase;
  font-size: clamp(22px, 6vw, 30px); letter-spacing: -.03em;
}

.rings { position: absolute; inset: 0; pointer-events: none; }
.rings i {
  position: absolute; inset: 14%; border-radius: 50%; border: 1.5px solid var(--volt);
  opacity: 0; animation: ring 3s cubic-bezier(.2,.6,.3,1) infinite;
}
.rings i:nth-child(2) { animation-delay: 1s; }
.rings i:nth-child(3) { animation-delay: 2s; }
@keyframes ring { 0%{transform:scale(1);opacity:.5} 100%{transform:scale(1.45);opacity:0} }
body:not(.searching) .rings i { animation: none; }

/* состояние: поиск */
body.searching .orb { background: var(--card2); color: var(--text); }
body.searching .orb::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--volt);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* состояние: звонок */
body.call .rings { display: none; }
body.call .orb { background: var(--volt); color: #000; cursor: default; }
body.call .orb-label { font-size: clamp(40px, 12vw, 64px); font-variant-numeric: tabular-nums; letter-spacing: -.04em; }

.peer { text-align: center; margin-top: 28px; }
.peer-name { font-family: var(--head); font-weight: 800; font-size: 32px; letter-spacing: -.03em; }
.peer-meta { color: var(--mute); font-size: 15px; margin-top: 4px; font-weight: 500; }

.status { min-height: 20px; margin-top: 18px; font-size: 15px; color: var(--mute); font-weight: 500; }
.status .ell::after { content: ""; animation: ell 1.2s steps(4) infinite; }
@keyframes ell { 0%{content:""} 25%{content:"."} 50%{content:".."} 75%{content:"..."} }

.filters { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; justify-content: center; }
.chip {
  height: 46px; padding: 0 20px; border-radius: 999px; font-size: 15px; font-weight: 600;
  background: var(--card2); max-width: 240px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.searching .filters { opacity: .3; pointer-events: none; }
body.call .filters { display: none; }

.controls { display: flex; gap: 16px; margin-top: 30px; align-items: center; }
.ctl {
  width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card2); transition: transform .1s, background .15s;
}
.ctl:active { transform: scale(.92); }
.ctl svg { width: 26px; height: 26px; fill: var(--text); }
.ctl .slash { stroke: #000; stroke-width: 2.4; stroke-linecap: round; fill: none; opacity: 0; }
.ctl.muted { background: var(--text); }
.ctl.muted svg { fill: #000; }
.ctl.muted .slash { opacity: 1; }
.ctl.end { background: var(--red); }
.ctl.end svg { fill: #fff; width: 30px; height: 30px; }
.ctl.next {
  width: auto; padding: 0 28px; border-radius: 999px; background: var(--text);
  color: #000; font-weight: 700; font-size: 17px; display: flex; gap: 8px;
}
body.searching .ctl.next { display: none; }
@media (max-width: 400px) {
  .controls { gap: 10px; }
  .ctl { width: 58px; height: 58px; }
  .ctl.next { padding: 0 22px; font-size: 16px; }
  .peer { margin-top: 20px; }
  .peer-name { font-size: 28px; }
}

/* шторка гео */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fade .2s; }
.sheet-card {
  position: relative; width: 100%; max-width: 520px; max-height: 86vh; overflow: auto;
  background: var(--card); border-radius: 28px 28px 0 0;
  padding: 10px 16px max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px;
  animation: up .3s cubic-bezier(.2,.8,.3,1);
}
.sheet-card::before { content: ""; width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet-h { font-family: var(--head); font-weight: 800; font-size: 24px; letter-spacing: -.02em; display: flex; justify-content: space-between; align-items: center; }
.x { width: 32px; height: 32px; border-radius: 50%; background: var(--card2); color: var(--mute); font-size: 14px; }
.countries { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.countries button {
  height: 48px; padding: 0 14px; border-radius: 14px; text-align: left; font-size: 15px; font-weight: 500;
  background: var(--card2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .15s, color .15s;
}
.countries button.on { background: var(--text); color: #000; font-weight: 700; }
.city-wrap input {
  width: 100%; height: 54px; padding: 0 18px; border-radius: 14px; outline: none; font-size: 17px;
  background: var(--card2); border: 0;
}
.city-wrap input:focus { box-shadow: 0 0 0 2px var(--text); }
.city-wrap input::placeholder { color: var(--mute); }
.city-wrap input::-webkit-search-cancel-button { -webkit-appearance: none; }
.city-results { display: flex; flex-direction: column; margin-top: 6px; }
.city-results button {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 13px 4px; text-align: left; border-bottom: 1px solid var(--card2);
}
.city-results b { font-size: 17px; font-weight: 600; }
.city-results span { font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-results button:active b { color: var(--volt); }
.city-results .none { color: var(--mute); font-size: 15px; padding: 14px 4px; }
.city-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.city-quick button {
  height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--text);
  background: var(--card2);
}
.city-quick button.on { color: #000; background: var(--volt); font-weight: 700; }

/* тост */
.toast {
  position: fixed; left: 50%; top: max(70px, calc(env(safe-area-inset-top) + 56px)); z-index: 40;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 999px; background: var(--card2); color: var(--text);
  font-size: 15px; font-weight: 600; transition: all .3s cubic-bezier(.2,.8,.3,1); white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-height: 700px) {
  .stage { width: min(58vw, 250px); }
  .mega { margin-bottom: 26px; }
}

