:root{
  --accent: #3390ec;

  --r-card: 18px;
  --r-item: 14px;

  --b: rgba(0,0,0,0.10);
  --shadow: 0 14px 36px rgba(0,0,0,0.18);

  /* компактность */
  --page-pad-x: 12px;
  --page-pad-top: 12px;
  --page-pad-bottom: 18px;
}

/* ====== Page background ====== */
html, body{ height: 100%; }

html{
  background:
    radial-gradient(
      1200px 800px at 50% -20%,
      rgba(56, 168, 255, 0.32),
      rgba(56, 168, 255, 0.00) 60%
    ),
    var(--tg-theme-bg-color, #0b0f17);
}

body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    linear-gradient(
      180deg,
      rgba(56, 168, 255, 0.12),
      rgba(56, 168, 255, 0.00) 55%
    ),
    var(--tg-theme-bg-color, #0b0f17);
  color: var(--tg-theme-text-color, #e9eef7);
  margin: 0;

  padding: var(--page-pad-top) var(--page-pad-x) var(--page-pad-bottom);
  min-height: 100vh;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.hidden{ display: none; }

/* ====== Loader ====== */
.loader{
  border: 4px solid rgba(0,0,0,0.08);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1.1s linear infinite;
  margin: 28px auto 0;
}

@keyframes spin{
  0%{ transform: rotate(0deg); }
  100%{ transform: rotate(360deg); }
}

/* ====== Common card ====== */
.card{
  width: min(92vw, 380px);
  margin: clamp(18px, 10vh, 90px) auto 0;

  background: var(--tg-theme-secondary-bg-color, rgba(255,255,255,0.06));
  border: 1px solid var(--b);
  border-radius: var(--r-card);

  padding: 14px 14px;

  box-shadow: var(--shadow);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

h3{
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.2px;
}

p{
  margin: 0 0 12px 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--tg-theme-hint-color, rgba(233,238,247,0.75));
}

/* ====== Language options (base) ====== */
.lang-option{
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 10px 12px;
  margin-top: 10px;

  border-radius: var(--r-item);
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.10);

  cursor: pointer;
  user-select: none;
  font-weight: 800;

  transition: transform .08s ease, border-color .12s ease, background .12s ease;
}

.lang-option > span:first-child{
  width: 100%;
  text-align: center;
}

#lang-ru{
  border-color: rgba(51,144,236,0.40);
  background: rgba(51,144,236,0.06);
}

.lang-option:active{ transform: scale(0.99); }

.lang-option.disabled{
  opacity: 0.52;
  cursor: not-allowed;
}

/* Убираем бейджи “сейчас/в разработке” полностью */
.badge{ display: none !important; }

/* ====== Menu ====== */
.menu-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;

  width: 100%;
  max-width: 560px;
  margin: 14px auto 0;
}

.menu-item{
  background: var(--tg-theme-secondary-bg-color, rgba(255,255,255,0.06));
  padding: 16px;
  border-radius: 14px;
  text-align: center;

  cursor: pointer;
  border: 1px solid var(--b);

  font-weight: 850;
  box-shadow: 0 10px 26px rgba(0,0,0,0.16);

  transition: transform .08s ease;
}

.menu-item:active{ transform: scale(0.99); }

/* ====== Language screen overrides ====== */
#lang-screen h3{ text-align: center; }
#lang-screen p{ text-align: center; }

/* smaller language pills (no font changes) */
#lang-screen .lang-option{
  width: min(66vw, 280px);
  height: 44px;
  padding: 0 14px;
  margin: 10px auto 0;
}

/* accent background only for the Language screen card */
#lang-screen .card{
  margin-left: auto;
  margin-right: auto;

  width: min(72vw, 300px) !important;

  background:
    linear-gradient(
      135deg,
      rgba(23, 195, 178, 0.18),
      rgba(255, 138, 0, 0.16)
    ),
    var(--tg-theme-secondary-bg-color, rgba(255,255,255,0.06));

  border-color: rgba(23, 195, 178, 0.22);
}

/* Policy modal (Telegram-like) */
/* Policy modal (Telegram-like) */
#policy-screen{
  position: fixed;
  inset: 0;
  padding: clamp(18px, 10vh, 90px) 16px 24px;
  z-index: 50;
  display: none;
}

/* важно: hidden остаётся рабочим, поэтому включаем только когда не hidden */
#policy-screen:not(.hidden){
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#policy-screen .up-dialog{
  width: min(92vw, 360px);
  background: var(--tg-theme-bg-color, #ffffff);
  color: var(--tg-theme-text-color, #111);
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
  text-align: center;
  border: 1px solid rgba(0,0,0,0.08);
}

#policy-screen .up-title{
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
}

#policy-screen .up-about{
  display: inline-block;
  margin-top: 6px;
  font-size: 15px;
  color: var(--tg-theme-link-color, #3390ec);
  text-decoration: none;
}

#policy-screen .up-text{
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--tg-theme-hint-color, rgba(0,0,0,0.62));
}

#policy-screen .up-linklike{
  color: var(--tg-theme-link-color, #3390ec);
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}

#policy-screen .up-actions{
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#policy-screen .up-btn{
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.10);
  font-weight: 800;
  cursor: pointer;
}

#policy-screen .up-btn-ghost{
  background: rgba(0,0,0,0.04);
  color: var(--tg-theme-text-color, #111);
}

#policy-screen .up-btn-primary{
  background: var(--tg-theme-button-color, #3390ec);
  color: var(--tg-theme-button-text-color, #fff);
  border-color: rgba(0,0,0,0.06);
}

/* POLICY: ширина как у Language + круглый аватар */
#policy-screen .up-dialog{
  width: min(72vw, 300px);
  max-width: 300px;
  box-sizing: border-box;
}

#policy-screen .up-avatar{
  width: 88px;
  height: 88px;
  margin: 6px auto 10px;
  border-radius: 50%;
  overflow: hidden;

  background: url('/IMG_3034.jpeg') center/cover no-repeat;
  background-size: 110%;
  background-position: 50% 45%;

  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

/* Policy: clickable rows + checkbox gate */
#policy-screen .up-rows{
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

#policy-screen .up-row{
  width: 100%;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.04);
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

#policy-screen .up-row::after{
  content: "›";
  font-size: 20px;
  opacity: 0.45;
}

#policy-screen .up-check{
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  font-size: 13px;
  line-height: 1.25;
  color: var(--tg-theme-hint-color, rgba(0,0,0,0.62));
}

#policy-screen .up-check input{
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

#policy-screen .up-btn-primary:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}


/* Toast (UI message) */
.up-toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: min(92vw, 420px);
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.78);
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
  text-align: center;
  z-index: 120;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  pointer-events: none;
}



/* Profile (registration) form */
#profile-screen .up-form{
  margin-top: 12px;
  display: grid;
  gap: 10px;
}
#profile-screen .up-label{
  font-size: 13px;
  font-weight: 800;
  opacity: 0.85;
  text-align: left;
}
#profile-screen .up-input{
  width: 100%;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.04);
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}
#profile-screen .up-input:focus{
  border-color: rgba(23, 195, 178, 0.45);
}


/* === UP Profile banner === */
#up-profile-banner{
  margin: 10px 0 14px;
  padding: 14px 14px 12px;
  border-radius: 22px;
  border: 1px solid rgba(0,0,0,0.06);
  background: linear-gradient(135deg, rgba(47,128,237,0.18), rgba(155,81,224,0.18));
}

#up-profile-banner .up-profile-banner-head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

#up-profile-banner .up-profile-banner-title{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.2px;
}

#up-profile-banner .up-profile-banner-progress{
  font-weight: 900;
  opacity: 0.75;
}

#up-profile-banner .up-profile-banner-sub{
  margin-top: 8px;
  font-weight: 650;
  color: var(--tg-theme-hint-color, rgba(0,0,0,0.62));
  line-height: 1.25;
}

#up-profile-banner .up-profile-banner-btn{
  margin-top: 12px;
  width: 100%;
  height: 48px;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.80);
  font-weight: 900;
}


/* === mira-home === */
/* мягкий фон как в Mira */
body{
  background:
    radial-gradient(1200px 700px at 50% 10%, rgba(191, 220, 255, .55), rgba(255,255,255,0) 55%),
    linear-gradient(#f6fbff, #ffffff);
}

#main-menu{ min-height: 100vh; }

.up-home{
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.up-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-top: 6px;
}

.up-pill{
  background: rgba(255,255,255,.92);
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  display:flex;
  align-items:center;
  gap: 10px;
  border: 1px solid rgba(0,0,0,.04);
}

.up-pill-icon{
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content:center;
  font-size: 18px;
}

.up-pill-plan{
  flex: 1;
  justify-content:flex-start;
  font-weight: 700;
}

.up-pill-stars{
  min-width: 92px;
  justify-content:center;
  font-weight: 800;
}

.up-star{ font-size: 16px; }

.up-hero{
  text-align:center;
  padding: 22px 0 10px;
}

.up-h1{
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 36px 0 18px;
  font-weight: 900;
  color: #0b0f17;
}

.up-search{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.70);
  box-shadow: 0 18px 40px rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.04);
  margin: 0 auto 14px;
}

.up-search-input{
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  padding: 6px 6px;
}

.up-search-send{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
  font-size: 18px;
}

.up-hero-actions{
  display:flex;
  flex-direction:column;
  gap: 10px;
  align-items:center;
  margin-top: 10px;
}

.up-action{
  width: min(520px, 100%);
  border-radius: 999px;
  padding: 14px 16px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.92);
  box-shadow: 0 14px 34px rgba(0,0,0,.06);
  font-size: 18px;
  font-weight: 800;
  cursor:pointer;
}

.up-section{ margin-top: 18px; }

.up-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin: 6px 2px 10px;
}

.up-section-title{
  font-size: 22px;
  font-weight: 900;
  color:#0b0f17;
}

.up-section-link{
  font-size: 16px;
  font-weight: 700;
  color: #2a7bd6;
  text-decoration: none;
}

.up-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.up-card{
  background: rgba(245,246,248,.95);
  border-radius: 18px;
  padding: 16px 14px;
  border: 1px solid rgba(0,0,0,.04);
  cursor:pointer;
  min-height: 96px;
}

.up-card-emoji{
  font-size: 26px;
  margin-bottom: 10px;
}

.up-card-title{
  font-size: 18px;
  font-weight: 900;
  color:#0b0f17;
}

.up-list{ display:flex; flex-direction:column; gap: 10px; }

.up-banner{
  margin-top: 18px;
  background: rgba(255,255,255,.92);
  border-radius: 22px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(0,0,0,.04);
  box-shadow: 0 18px 42px rgba(0,0,0,.06);
}

.up-banner-title{
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 6px;
  color:#0b0f17;
}

.up-banner-sub{
  font-size: 14px;
  color: rgba(11,15,23,.70);
  margin-bottom: 12px;
}

.up-banner-progress{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-bottom: 12px;
}

.up-progress-track{
  flex: 1;
  height: 10px;
  background: rgba(11,15,23,.10);
  border-radius: 999px;
  overflow:hidden;
}

.up-progress-bar{
  height: 100%;
  background: rgba(42,123,214,.95);
  border-radius: 999px;
  width: 0%;
}

.up-progress-text{
  width: 48px;
  text-align:right;
  font-weight: 900;
  color:#0b0f17;
}

.up-banner-btn{
  width: 100%;
  border-radius: 999px;
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.92);
  font-weight: 900;
  cursor:pointer;
}

