:root {
  color-scheme: light;
  --brown: #3b2513;
  --brown-soft: #68431f;
  --line: rgba(126, 81, 31, 0.18);
  --cream: rgba(255, 248, 229, 0.88);
  --cream-deep: rgba(255, 236, 196, 0.76);
  --green: #8fd84a;
  --green-deep: #62b92f;
  --green-text: #203a11;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--brown);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 245, 196, 0.95), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(121, 190, 48, 0.22), transparent 28%),
    linear-gradient(145deg, #ffe8ad 0%, #f2be72 44%, #d99044 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.06) 45%, rgba(103, 60, 25, 0.08)),
    radial-gradient(ellipse at 50% 105%, rgba(111, 72, 29, 0.18), transparent 54%);
}

a {
  color: inherit;
  text-decoration: none;
}

.coconut-float {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.coco {
  position: absolute;
  bottom: -12vh;
  font-size: clamp(22px, 3.2vw, 42px);
  opacity: 0.13;
  filter: saturate(0.9);
  animation: cocoFloat 26s linear infinite;
  will-change: transform;
  contain: layout style paint;
}

.coco:nth-child(1) { left: 7%; animation-duration: 28s; animation-delay: -3s; }
.coco:nth-child(2) { left: 18%; animation-duration: 34s; animation-delay: -16s; font-size: 30px; }
.coco:nth-child(3) { left: 29%; animation-duration: 25s; animation-delay: -10s; }
.coco:nth-child(4) { left: 41%; animation-duration: 32s; animation-delay: -22s; font-size: 24px; }
.coco:nth-child(5) { left: 54%; animation-duration: 29s; animation-delay: -6s; }
.coco:nth-child(6) { left: 67%; animation-duration: 36s; animation-delay: -20s; font-size: 36px; }
.coco:nth-child(7) { left: 78%; animation-duration: 27s; animation-delay: -13s; }
.coco:nth-child(8) { left: 90%; animation-duration: 33s; animation-delay: -27s; font-size: 26px; }
.coco:nth-child(9) { left: 4%; animation-duration: 37s; animation-delay: -31s; font-size: 34px; }
.coco:nth-child(10) { left: 13%; animation-duration: 30s; animation-delay: -24s; font-size: 27px; }
.coco:nth-child(11) { left: 24%; animation-duration: 39s; animation-delay: -34s; font-size: 38px; }
.coco:nth-child(12) { left: 36%; animation-duration: 31s; animation-delay: -28s; font-size: 25px; }
.coco:nth-child(13) { left: 48%; animation-duration: 41s; animation-delay: -38s; font-size: 33px; }
.coco:nth-child(14) { left: 60%; animation-duration: 35s; animation-delay: -17s; font-size: 24px; }
.coco:nth-child(15) { left: 71%; animation-duration: 38s; animation-delay: -30s; font-size: 39px; }
.coco:nth-child(16) { left: 83%; animation-duration: 30s; animation-delay: -21s; font-size: 28px; }
.coco:nth-child(17) { left: 94%; animation-duration: 42s; animation-delay: -36s; font-size: 32px; }
.coco:nth-child(18) { left: 52%; animation-duration: 33s; animation-delay: -26s; font-size: 29px; }

@keyframes cocoFloat {
  from { transform: translate3d(0, 10vh, 0) rotate(0deg); }
  to { transform: translate3d(26px, -120vh, 0) rotate(36deg); }
}

.burst-emoji {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.86;
  filter: saturate(0.95);
  transform: translate3d(-50%, -50%, 0);
  animation: cocoBurst 0.86s ease-out forwards;
  will-change: transform, opacity;
  contain: layout style paint;
}

@keyframes cocoBurst {
  from { opacity: 0.92; transform: translate3d(-50%, -50%, 0) scale(0.72) rotate(0deg); }
  to { opacity: 0; transform: translate3d(calc(-50% + var(--x)), calc(-50% + var(--y)), 0) scale(1.35) rotate(var(--r)); }
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.shell {
  position: relative;
  width: min(760px, 100%);
  padding: 34px;
}

.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 48px;
  pointer-events: none;
  opacity: 0.9;
  filter: blur(26px);
  background:
    radial-gradient(circle at 22% 88%, rgba(88, 151, 31, 0.18), transparent 32%),
    radial-gradient(circle at 80% 12%, rgba(255, 255, 255, 0.42), transparent 30%);
}

.telegram-card {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(26px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(180deg, var(--cream), var(--cream-deep));
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 70px rgba(112, 68, 24, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}

.telegram-mark {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  overflow: hidden;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 14px 36px rgba(104, 63, 28, 0.18);
}

.mark-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  filter: none;
}

.telegram-card p {
  max-width: 520px;
  margin: 0 auto 28px;
  color: var(--brown-soft);
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.45;
  font-weight: 600;
  text-align: center;
}

.bot-button,
.proxy-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 25px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease, background 160ms ease;
}

.bot-button {
  min-height: 76px;
  gap: 12px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  color: var(--green-text);
  font-size: clamp(23px, 3.4vw, 34px);
  letter-spacing: -0.04em;
  box-shadow: 0 16px 42px rgba(83, 158, 38, 0.28);
}

.bot-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.bot-button svg {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.proxy-button {
  min-height: 62px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  background: rgba(255, 248, 225, 0.72);
  color: var(--brown-soft);
  font-size: 20px;
  box-shadow: 0 10px 24px rgba(119, 74, 29, 0.08);
}

.proxy-button:hover {
  transform: translateY(-1px);
  border-color: rgba(104, 169, 40, 0.42);
  background: #fff6da;
  color: #3f2914;
}

.proxy-button.is-loading {
  pointer-events: none;
  opacity: 0.58;
}

.proxy-button span {
  line-height: 1.15;
  text-align: center;
}

.proxy-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(112, 68, 24, 0.28);
  backdrop-filter: blur(10px);
}

.proxy-modal.is-open {
  display: grid;
}

.proxy-modal__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100svh - 36px);
  overflow-y: auto;
  padding: 30px 26px 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, #fff7df, #f5d89e);
  box-shadow: 0 24px 70px rgba(94, 55, 19, 0.22);
}

.proxy-modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff0c6;
  color: var(--brown-soft);
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.proxy-modal h2 {
  margin: 0 54px 16px 0;
  color: #3d2512;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.proxy-modal__lead {
  margin: 0 0 18px;
  color: var(--brown-soft);
  font-size: 17px;
  line-height: 1.5;
}

.proxy-fields {
  display: grid;
  gap: 12px;
}

.proxy-fields label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  color: var(--brown-soft);
  font-size: 13px;
  font-weight: 700;
}

.proxy-fields input {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 233, 0.76);
  color: var(--brown);
  font: inherit;
}

.proxy-fields button,
.connect-button {
  border: 1px solid rgba(80, 146, 28, 0.45);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  color: var(--green-text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.proxy-fields button {
  min-height: 28px;
  padding: 0 10px;
}

.connect-button {
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  font-size: 18px;
}

@media (max-width: 680px) {
  .page { padding: 10px; place-items: center; }
  .shell { padding: 10px; }
  .shell::before { inset: -3px; border-radius: 32px; filter: blur(20px); opacity: 0.75; }
  .telegram-card { padding: 24px 16px; border-radius: 24px; }
  .telegram-mark { width: 82px; height: 82px; margin-bottom: 20px; }
  .telegram-card p { margin-bottom: 20px; font-size: 18px; }
  .bot-button { min-height: 62px; border-radius: 20px; font-size: 24px; }
  .proxy-button { min-height: 52px; border-radius: 18px; font-size: 18px; }
  .proxy-modal__panel { padding: 24px 18px 18px; border-radius: 22px; }
  .proxy-modal h2 { font-size: 29px; }
  .coco { opacity: 0.11; }
}

@media (prefers-reduced-motion: reduce) {
  .coco { display: none; animation: none; }
  .bot-button:hover,
  .proxy-button:hover { transform: none; }
}
