/* Вспомогательные страницы: tg.html, rules.html — те же токены, что и landing.css */
:root {
  --bg: #0b0c10;
  --bg-elevated: #12131c;
  --cyan: #00e5ff;
  --magenta: #ff2a6d;
  --emerald: #05f5b4;
  --text: #c5c6c7;
  --text-bright: #ffffff;
  --line: rgba(0, 229, 255, 0.18);
  --shadow-cyan: 0 0 28px rgba(0, 229, 255, 0.22);
  --radius: 14px;
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  max-width: 100%;
  overscroll-behavior-x: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(0, 229, 255, 0.07), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(255, 42, 109, 0.05), transparent 50%),
    var(--bg);
}

a {
  color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--text-bright);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* Кнопки (классы из tg.html: .button, .button--ghost) */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.55);
  cursor: pointer;
  text-decoration: none;
  color: var(--text-bright);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.22), rgba(5, 245, 180, 0.12));
  box-shadow: var(--shadow-cyan);
  transition:
    transform 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out),
    border-color 0.2s,
    opacity 0.2s;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--cyan);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button--ghost {
  background: transparent;
  border-color: rgba(255, 42, 109, 0.35);
  box-shadow: none;
  color: var(--text);
}

.button--ghost:hover:not(:disabled) {
  border-color: var(--magenta);
  color: var(--text-bright);
  box-shadow: 0 0 20px rgba(255, 42, 109, 0.15);
}

/* ---------- tg.html ---------- */
.tg-bridge__wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2rem);
  padding-top: max(1.25rem, env(safe-area-inset-top));
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

.tg-bridge__back {
  align-self: flex-start;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}

.tg-bridge__back:hover {
  color: var(--cyan);
}

.tg-bridge__card {
  width: 100%;
  max-width: 26rem;
  padding: clamp(1.35rem, 4vw, 2rem);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.tg-bridge__avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.25);
}

.tg-bridge__title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1rem + 1.5vw, 1.65rem);
  font-weight: 600;
  color: var(--text-bright);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.tg-bridge__bot-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--emerald);
  margin-bottom: 1rem;
  word-break: break-word;
}

.tg-bridge__status {
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 1.25rem;
  min-height: 1.35em;
}

.tg-bridge__status--error {
  color: var(--magenta);
}

.tg-bridge__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tg-bridge__actions .button {
  width: 100%;
}

.tg-bridge__mirrors {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(197, 198, 199, 0.12);
}

.tg-bridge__mirrors-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.65rem;
}

.tg-bridge__mirror-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tg-bridge__mirror-link {
  display: block;
  font-size: 0.8125rem;
  word-break: break-all;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.15);
  color: var(--cyan);
  text-decoration: none;
}

.tg-bridge__mirror-link:hover {
  border-color: var(--cyan);
  color: var(--text-bright);
}

.tg-bridge__manual {
  margin-top: 1rem;
}

.tg-bridge__manual-label {
  font-size: 0.8125rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.tg-bridge__manual code {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.9rem;
  color: var(--text-bright);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(197, 198, 199, 0.15);
  word-break: break-all;
}

/* ---------- rules.html ---------- */
.is-rules-page .container {
  width: 100%;
  max-width: 48rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 1.75rem);
  padding-block: clamp(1.5rem, 4vw, 2.5rem);
}

.rules-back {
  margin-bottom: 1.25rem;
}

.rules-back a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}

.rules-back a:hover {
  color: var(--cyan);
}

.rules-wrap {
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.rules-wrap h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2rem);
  font-weight: 600;
  color: var(--text-bright);
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.rules-wrap h2 {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.35rem);
  font-weight: 600;
  color: var(--text-bright);
  margin: 1.75rem 0 0.65rem;
  letter-spacing: -0.02em;
}

.rules-wrap > p {
  margin: 0 0 1rem;
}

.rules-wrap ul,
.rules-wrap ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.rules-wrap li {
  margin-bottom: 0.45rem;
}

.rules-wrap li::marker {
  color: var(--cyan);
}

.rules-wrap strong {
  color: var(--text-bright);
}

.rules-wrap a {
  font-weight: 500;
}
