@font-face {
  font-family: "Rubik One";
  src:
    local("Rubik One"),
    url("/_frontend/67fb4e859bd738dcccd0723e07ea02ee1b8ac71d3bf3027f07df091c8d331567/assets/fonts/rubik-one/RubikOne-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0d0d0d;
  --bg-soft: #171717;
  --panel: #1b1b1b;
  --panel-2: #202020;
  --line: rgba(255, 197, 26, 0.2);
  --line-strong: rgba(255, 197, 26, 0.5);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.74);
  --muted-2: rgba(255, 255, 255, 0.56);
  --yellow: #ffc517;
  --yellow-deep: #f0ad00;
  --yellow-soft: #ffdd69;
  --white-panel: #f4f2ed;
  --danger: #ff7e7e;
  --success: #98f39f;
  --shadow-heavy: 0 24px 44px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 18px 32px rgba(0, 0, 0, 0.48);
  --outline: 0 0 0 2px rgba(0, 0, 0, 0.9), 0 0 0 3px rgba(255, 197, 26, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  background: #080808;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top center, rgba(255, 197, 26, 0.14), transparent 24%),
    radial-gradient(circle at 50% 32%, rgba(255, 197, 26, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(24, 24, 24, 0.92), rgba(8, 8, 8, 0.98)),
    #080808;
  color: var(--text);
  font: 16px/1.48 "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  padding:
    calc(18px + env(safe-area-inset-top))
    calc(16px + env(safe-area-inset-right))
    calc(30px + env(safe-area-inset-bottom))
    calc(16px + env(safe-area-inset-left));
  position: relative;
}

/* Vignette/edge framing only. The decorative dot layer (tiled 1px
   radial-gradients, background-size 20px/24px, opacity .28, screen blend)
   is deliberately removed: it rendered as permanent "snow" over the whole
   UI on Telegram Desktop Linux. Do not re-add it. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.26)),
    radial-gradient(circle at center, transparent 58%, rgba(0, 0, 0, 0.34) 100%);
}

body.locked {
  overflow: hidden;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at top center, rgba(255, 197, 26, 0.2), transparent 26%),
    rgba(8, 8, 8, 0.84);
  backdrop-filter: blur(18px);
}

/* The opaque boot cover hides the gate; restore blur when the cover is hidden. */
#app-boot-cover:not([hidden]) ~ .gate {
  backdrop-filter: none;
}

.gate-panel,
.panel,
.step,
.support-card,
.admin-mobile-bar,
.admin-sidebar {
  background:
    linear-gradient(180deg, rgba(40, 40, 40, 0.96), rgba(22, 22, 22, 0.98)),
    var(--panel);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  box-shadow: var(--shadow-card), var(--outline);
  position: relative;
}

.gate-panel::before,
.panel::before,
.step::before,
.support-card::before,
.admin-mobile-bar::before,
.admin-sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 197, 26, 0.16));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.gate-panel {
  width: min(480px, 100%);
  padding: 26px 22px 22px;
  text-align: center;
}

/* Do not paint the password screen before session and role detection finish. */
body.startup-pending .gate-panel {
  visibility: hidden;
}

.gate-title,
.brand,
.title,
.step h2,
.button,
.admin-title,
.admin-section-title,
.admin-sidebar-name,
.admin-mobile-title,
.admin-row-title,
.support-name {
  font-family: "Rubik One", "Arial Black", "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.gate-kicker {
  font-family: "Rubik One", "Arial Black", "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--yellow);
  text-align: left;
}

.gate-title {
  margin: 0;
  font-size: clamp(34px, 15vw, 64px);
  line-height: 0.86;
  color: #fff;
  text-shadow:
    0 4px 0 #000,
    0 10px 0 rgba(0, 0, 0, 0.86),
    0 18px 24px rgba(0, 0, 0, 0.58);
  overflow-wrap: anywhere;
  text-align: center;
}

.gate-title span {
  display: block;
  margin-top: 8px;
  color: var(--yellow);
  text-shadow:
    0 4px 0 #7a5200,
    0 8px 0 #000,
    0 14px 22px rgba(0, 0, 0, 0.5);
}

.gate-text {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
}

.gate-form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.gate-input,
.admin-textarea {
  width: 100%;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(245, 244, 239, 0.98);
  color: #171717;
  padding: 14px 16px;
  font: inherit;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.56), inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.gate-input {
  min-height: 58px;
}

.gate-input:focus,
.admin-textarea:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.56),
    inset 0 -2px 0 rgba(0, 0, 0, 0.08),
    0 0 0 3px rgba(255, 197, 26, 0.18);
}

/* Специальные стили для кнопок входа в воротах Mini App */
.gate .button {
  min-height: 60px;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  padding: 14px 18px;
  font-size: 16px;
  color: #161616;
  background: linear-gradient(180deg, #ffe17e, var(--yellow));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.56),
    inset 0 -3px 0 rgba(122, 82, 0, 0.35),
    0 18px 30px rgba(0, 0, 0, 0.34);
  font-family: "Rubik One", "Arial Black", "Segoe UI", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#startup-retry-button[hidden] {
  display: none;
}

.gate .button:hover {
  background: linear-gradient(180deg, #ffe794, #ffd34a);
}

.gate .button:disabled {
  cursor: wait;
  opacity: 0.82;
}

.gate-error {
  min-height: 20px;
  color: #ffb2b2;
  font-size: 13px;
}

.app-shell {
  display: none;
}

body.unlocked .app-shell {
  display: block;
}

body.unlocked .gate {
  display: none;
}

.hero {
  width: min(560px, 100%);
  max-width: 100%;
  margin: 0 auto 20px;
  text-align: center;
}

.brand {
  margin: 0;
  font-size: clamp(34px, 15vw, 76px);
  line-height: 0.86;
  color: #fff;
  overflow-wrap: anywhere;
  text-shadow:
    0 4px 0 #000,
    0 10px 0 rgba(0, 0, 0, 0.85),
    0 16px 24px rgba(0, 0, 0, 0.58);
}

.brand .miniapp-only-inline,
.brand .browser-only-inline {
  display: block;
  font-size: 1.16em;
  line-height: 0.96;
  margin-top: 8px;
  color: var(--yellow);
  text-shadow:
    0 4px 0 #7a5200,
    0 8px 0 #000,
    0 14px 22px rgba(0, 0, 0, 0.55);
}

.title {
  margin: 16px 0 0;
  max-width: 100%;
  padding: 0 8px;
  font-size: clamp(16px, 4.2vw, 26px);
  line-height: 1.05;
  color: var(--yellow);
  text-shadow: 0 3px 0 #000, 0 8px 18px rgba(0, 0, 0, 0.52);
  overflow-wrap: anywhere;
}

body.is-admin-miniapp .hero {
  display: none;
}
