/* ═══════════ RobloWorld — стили ═══════════ */

:root {
  --bg: #0a0e1a;
  --bg-soft: #0d1226;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover: rgba(255, 255, 255, 0.07);
  --text: #f1f3ff;
  --text-2: #9aa3c7;
  --text-3: #5b6485;
  --violet: #7b6cff;
  --pink: #ff6ba9;
  --cyan: #3fd0ff;
  --gold: #ffd166;
  --green: #46de80;
  --red: #ff5a6e;
  --grad: linear-gradient(135deg, #7b6cff 0%, #ff6ba9 100%);
  --grad-soft: linear-gradient(135deg, rgba(123,108,255,.18), rgba(255,107,169,.14));
  --radius: 18px;
  --shadow: 0 16px 40px rgba(0, 0, 0, .35);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px 400px at 90% -10%, rgba(123,108,255,.16), transparent 60%),
    radial-gradient(500px 380px at -10% 40%, rgba(255,107,169,.10), transparent 60%),
    radial-gradient(600px 500px at 50% 110%, rgba(63,208,255,.08), transparent 60%);
}

/* ── экраны ── */
.screen, .app { position: fixed; inset: 0; z-index: 1; display: none; }
.screen.active, .app.active { display: flex; }
.screen { flex-direction: column; overflow-y: auto; }

/* ── бренд ── */
.brand-mark {
  width: 76px; height: 76px;
  border-radius: 22px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 40px rgba(123, 108, 255, .4);
}
.brand-mark svg { width: 44px; height: 44px; }
.brand-mark.small { width: 40px; height: 40px; border-radius: 13px; box-shadow: 0 8px 20px rgba(123,108,255,.35); }
.brand-mark.small svg { width: 24px; height: 24px; }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── кнопки ── */
.btn {
  font-family: 'Manrope';
  font-weight: 800;
  font-size: 15px;
  border: none;
  cursor: pointer;
  border-radius: 15px;
  padding: 16px 22px;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 28px rgba(123, 108, 255, .35);
}
.btn-primary:hover { box-shadow: 0 16px 36px rgba(123, 108, 255, .5); }
.btn-ghost {
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
}
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.icon-btn:active { background: var(--card-hover); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── онбординг ── */
.onboarding { justify-content: center; padding: 28px 24px calc(40px + var(--safe-bottom)); background: var(--bg-soft); }
.ob-hero { text-align: center; }
.ob-hero .brand-mark { margin: 0 auto 28px; }
.ob-title { font-family: 'Unbounded'; font-size: 28px; line-height: 1.25; letter-spacing: .2px; }
.ob-sub { margin-top: 14px; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.ob-feats { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.ob-feat {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: left;
}
.ob-feat-ic {
  width: 44px; height: 44px; flex: none;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  background: rgba(123, 108, 255, .14);
  border: 1px solid rgba(123, 108, 255, .25);
}
.ob-feat:nth-child(2) .ob-feat-ic { background: rgba(255,107,169,.12); border-color: rgba(255,107,169,.25); }
.ob-feat:nth-child(3) .ob-feat-ic { background: rgba(63,208,255,.10); border-color: rgba(63,208,255,.25); }
.ob-feat b { font-size: 14.5px; display: block; margin-bottom: 2px; }
.ob-feat span { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.ob-tos { margin: 20px 0 8px; font-size: 11.5px; color: var(--text-3); text-align: center; line-height: 1.6; }
.ob-tos a { color: var(--cyan); text-decoration: none; }

.ob-form { width: 100%; max-width: 400px; margin: 0 auto; }
.ob-nav { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.ob-progress { flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.ob-progress i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .35s ease; }
.ob-counter { font-size: 13px; font-weight: 800; color: var(--text-2); }
.ob-step { display: none; }
.ob-step.active { display: block; }
.ob-step-title { font-family: 'Unbounded'; font-size: 19px; line-height: 1.35; }
.ob-step-sub { color: var(--text-2); font-size: 13.5px; margin-top: 8px; margin-bottom: 24px; line-height: 1.5; }

/* ── поля ── */
.field { margin-bottom: 22px; }
.field-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 9px; text-transform: uppercase; letter-spacing: .4px; }
.input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  font-family: 'Manrope';
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  resize: none;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(123,108,255,.15); }
.input-lg { font-size: 17px; font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 16px;
  border-radius: 99px;
  background: var(--card);
  border: 1px solid var(--card-border);
  font-family: 'Manrope';
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  transition: all .18s;
}
.chip.on {
  background: rgba(123, 108, 255, .18);
  border-color: var(--violet);
  color: #fff;
}

.avatar-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.av-opt {
  width: 54px; height: 54px;
  border-radius: 16px;
  border: 2px solid transparent;
  background-color: var(--card);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .18s;
  padding: 0;
  overflow: hidden;
}
.av-opt.ready { box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.av-opt.on { border-color: var(--violet); box-shadow: 0 0 0 2px rgba(123,108,255,.3); }
.av-opt.img-failed { background-color: rgba(123,108,255,.12); }
.av-opt.img-failed::after { content: '🙂'; font-size: 24px; }

.avatar-img-wrap { overflow: hidden; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chip, .av-opt, .btn, .tab-btn, .send-btn, .icon-btn { touch-action: manipulation; }
.muted { color: var(--text-3); font-weight: 500; text-transform: none; letter-spacing: 0; }

/* ── шапка приложения ── */
.app { flex-direction: column; }
.app-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.app-name { font-family: 'Unbounded'; font-size: 14px; font-weight: 700; }
.app-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.online-pill {
  margin-left: auto;
  display: flex; align-items: center; gap: 7px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 99px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.online-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.ver-badge {
  font-size: 10px; font-weight: 800;
  color: var(--text-3);
  border: 1px solid var(--card-border);
  background: var(--card);
  border-radius: 99px;
  padding: 3px 8px;
}

.app-main { flex: 1; overflow-y: auto; padding: 18px 18px calc(100px + var(--safe-bottom)); }
.tab { display: none; }
.tab.active { display: block; }
.tab-head { margin-bottom: 18px; }
.tab-title { font-family: 'Unbounded'; font-size: 18px; }
.tab-sub { color: var(--text-2); font-size: 13px; margin-top: 4px; }

/* ── чат ── */
.chat-list { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 90%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-av {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.msg-bubble {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  border-top-left-radius: 5px;
  padding: 10px 14px;
}
.msg.mine .msg-bubble {
  background: linear-gradient(135deg, rgba(123,108,255,.22), rgba(255,107,169,.14));
  border-color: rgba(123,108,255,.3);
  border-radius: 16px;
  border-top-right-radius: 5px;
}
.msg-name { font-size: 11.5px; font-weight: 800; color: var(--violet); margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.msg.mine .msg-name { color: var(--pink); }
.msg-tag { font-size: 9px; font-weight: 800; background: var(--gold); color: #1a1508; padding: 2px 7px; border-radius: 99px; }
.msg-text { font-size: 14px; line-height: 1.5; word-break: break-word; }
.msg-time { font-size: 10.5px; color: var(--text-3); margin-top: 4px; text-align: right; }

.chat-input {
  position: fixed;
  left: 0; right: 0; bottom: var(--tabbar-h, 64px);
  z-index: 10;
  margin: 0 auto;
  max-width: 560px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  margin: 0 14px calc(86px + var(--safe-bottom));
  background: rgba(13, 18, 38, .92);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  backdrop-filter: blur(14px);
}
.chat-input input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: 'Manrope'; font-size: 14.5px; }
.chat-input input::placeholder { color: var(--text-3); }
.send-btn {
  width: 42px; height: 42px; flex: none;
  border: none; border-radius: 13px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(123,108,255,.35);
}
.send-btn:active { transform: scale(.94); }
.send-btn svg { width: 18px; height: 18px; fill: #fff; }

/* ── розыгрыши ── */
.ga-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 14px;
  transition: border-color .2s;
}
.ga-card.featured {
  background: linear-gradient(135deg, rgba(123,108,255,.16), rgba(255,107,169,.10));
  border-color: rgba(123,108,255,.35);
}
.ga-card:last-child { margin-bottom: 0; }
.ga-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.ga-icon {
  width: 52px; height: 52px; flex: none;
  border-radius: 16px;
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-soft);
  border: 1px solid rgba(123,108,255,.3);
}
.ga-title { font-family: 'Unbounded'; font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.ga-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 5px; font-size: 12px; color: var(--text-2); }
.ga-meta span { display: flex; align-items: center; gap: 4px; }
.ga-desc { font-size: 13px; color: var(--text-2); line-height: 1.55; margin-bottom: 14px; }
.ga-cond {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 90, 110, .08);
  border: 1px solid rgba(255, 90, 110, .2);
  border-radius: 13px;
  padding: 10px 13px;
  font-size: 12.5px;
  color: #ffb9c2;
  margin-bottom: 12px;
}
.ga-cond b { color: #fff; }
.ga-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ga-progress .bar { flex: 1; height: 5px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.ga-progress .bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.ga-progress span { font-size: 12px; font-weight: 700; color: var(--text-2); }
.btn-ga { width: 100%; padding: 13px; font-size: 14px; border-radius: 14px; }
.btn-ga.default { background: var(--grad); color: #fff; box-shadow: 0 10px 22px rgba(123,108,255,.32); }
.btn-ga.entered { background: rgba(70,222,128,.12); border: 1px solid rgba(70,222,128,.35); color: var(--green); }
.btn-ga.finished { background: var(--card); border: 1px solid var(--card-border); color: var(--text-3); }

/* ── профиль ── */
.profile-hero {
  display: flex; align-items: center; gap: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 14px;
}
.profile-av {
  width: 68px; height: 68px; flex: none;
  border-radius: 20px;
  font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad);
  box-shadow: 0 12px 28px rgba(123,108,255,.35);
}
.profile-nick { font-family: 'Unbounded'; font-size: 15px; font-weight: 700; word-break: break-all; }
.profile-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.badge { font-size: 10.5px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: rgba(255,209,102,.14); border: 1px solid rgba(255,209,102,.35); color: var(--gold); }
.badge.violet { background: rgba(123,108,255,.14); border-color: rgba(123,108,255,.35); color: #b3a8ff; }

.stats-row { display: flex; gap: 10px; margin-bottom: 14px; }
.stat { flex: 1; background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 13px 8px; text-align: center; }
.stat b { display: block; font-family: 'Unbounded'; font-size: 16px; }
.stat span { font-size: 10.5px; color: var(--text-2); }

.panel { background: var(--card); border: 1px solid var(--card-border); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.panel-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 13.5px; }
.panel-row:last-child { border-bottom: none; }
.panel-row .k { color: var(--text-2); }
.panel-row .v { font-weight: 700; }
.panel-text { font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.verify-note {
  display: flex; align-items: center; gap: 12px;
  background: rgba(70,222,128,.06);
  border: 1px solid rgba(70,222,128,.22);
  border-radius: 15px;
  padding: 13px;
  font-size: 12.5px;
  color: #b9f6cd;
  line-height: 1.5;
  margin-bottom: 14px;
}

/* ── таббар ── */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  background: rgba(10, 14, 26, .9);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 8px 10px calc(8px + var(--safe-bottom));
  --tabbar-h: 64px;
}
.tab-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  color: var(--text-3);
  font-family: 'Manrope';
  font-size: 10.5px;
  font-weight: 700;
  padding: 6px 0;
  border-radius: 13px;
  transition: color .2s;
  position: relative;
}
.tab-ic { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.tab-ic svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-btn.on { color: var(--text); }
.tab-btn.on::before {
  content: '';
  position: absolute;
  top: -8px;
  width: 34px; height: 3px;
  border-radius: 99px;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(123,108,255,.6);
}
.tab-btn.on .tab-ic { color: var(--violet); }

/* ── шит ── */
.sheet { position: fixed; inset: 0; z-index: 50; display: none; background: rgba(4,6,14,.65); backdrop-filter: blur(4px); align-items: flex-end; justify-content: center; }
.sheet.open { display: flex; }
.sheet-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, #131a30, #0d1226);
  border: 1px solid var(--card-border);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 14px 20px calc(26px + var(--safe-bottom));
  animation: slideUp .3s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-grab { width: 44px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.15); margin: 0 auto 18px; }
.sheet-title { font-family: 'Unbounded'; font-size: 16px; margin-bottom: 6px; }
.sheet-sub { font-size: 13px; color: var(--text-2); line-height: 1.55; margin-bottom: 16px; }
.cond-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.cond-icon { width: 38px; height: 38px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: rgba(63,208,255,.1); border: 1px solid rgba(63,208,255,.25); }
.cond-name { font-size: 13.5px; font-weight: 800; }
.cond-desc { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.cond-check {
  width: 24px; height: 24px; flex: none;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #0a0e1a;
  transition: all .25s;
}
.cond-check.ok { background: var(--green); border-color: var(--green); box-shadow: 0 0 14px rgba(70,222,128,.5); }

/* ── тост/лоадер ── */
.toast {
  position: fixed;
  top: 18px; left: 50%;
  transform: translateX(-50%) translateY(-90px);
  z-index: 80;
  background: #1b2340;
  border: 1px solid rgba(123,108,255,.4);
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
  transition: transform .3s ease;
  pointer-events: none;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.loading { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; background: rgba(10,14,26,.5); backdrop-filter: blur(2px); }
.loading.show { display: flex; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(123,108,255,.2); border-top-color: var(--violet); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── скроллбар ── */
.app-main::-webkit-scrollbar { width: 0; }

/* ── адаптив ── */
@media (min-width: 560px) {
  .app-main { padding-left: 24px; padding-right: 24px; }
  .screen { align-items: center; }
  .ob-hero, .ob-feats, .ob-tos, .ob-form { max-width: 400px; }
}
