:root {
  /* Keep everything vibrant (avoid near-black). */
  --bg: #2a0f2e;
  --bg-2: #4a1b45;
  --accent: #ff4d6d;
  --accent-2: #ff8fa3;
  --accent-3: #ffd166;
  --text: #f7f7fb;
  --muted: #c9cbe3;
  --glass: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 20px 60px rgba(40, 0, 28, 0.28);
}

@font-face {
  font-family: "Poiret One";
  src: url("assets/fonts/PoiretOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Stengazeta";
  src: url("assets/fonts/Stengazeta-Regular_5.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

img,
video {
  max-width: 100%;
  height: auto;
}

/* iOS: предотвращаем автозум при фокусе на полях (нужно font-size >= 16px) */
@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

body {
  margin: 0;
  font-family: "Poiret One", "Segoe UI", system-ui, sans-serif;
  background-color: var(--bg);
  /* Hot, saturated "Nunzi-like" backdrop */
  background:
    radial-gradient(900px 520px at 15% 18%, rgba(255, 0, 214, 0.55), rgba(255, 0, 214, 0) 62%),
    radial-gradient(780px 520px at 88% 18%, rgba(0, 255, 209, 0.30), rgba(0, 255, 209, 0) 60%),
    radial-gradient(820px 560px at 55% 88%, rgba(255, 209, 0, 0.25), rgba(255, 209, 0, 0) 64%),
    linear-gradient(135deg, #ff22c6 0%, #ff4d6d 38%, #00e3ff 100%);
  background-attachment: fixed;
  animation: bg-shift 18s ease-in-out infinite;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body.chat-open {
  overflow: hidden;
}

body.about-page {
  background: radial-gradient(circle at 18% 18%, rgba(255, 120, 198, 0.55), transparent 45%),
    radial-gradient(circle at 82% 20%, rgba(255, 200, 120, 0.5), transparent 45%),
    linear-gradient(135deg, #ff7ab8 0%, #ff9fce 45%, #ffb66b 100%);
  background-attachment: fixed;
  animation: none;
}

/* ===== Register landing overrides (bright template style) ===== */
body.lp-register {
  --lp-pink: #FF2D9B;
  --lp-hot-pink: #FF0080;
  --lp-yellow: #FFE600;
  --lp-cyan: #00E5FF;
  --lp-purple: #7B2FFF;
  --lp-dark: #1A0033;
  --lp-white: #FFFFFF;

  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--lp-dark);
  background: var(--lp-white);
  background-attachment: scroll;
  animation: none;
}

body.lp-register .brand-title,
body.lp-register .lp-h1,
body.lp-register .lp-h2,
body.lp-register .lp-ref-title {
  font-family: "Bangers", cursive;
  letter-spacing: 1px;
}

body.lp-register .bg-orbit {
  display: none;
}

body.lp-register .topbar {
  background: linear-gradient(180deg, rgba(255, 45, 155, 0.98), rgba(255, 0, 128, 0.82));
}

body.lp-register .topbar {
  padding-top: 14px;
  padding-bottom: 14px;
}

@media (max-width: 600px) {
  body.lp-register .topbar {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

/* Center hero and tighten spacing (user request). */
body.lp-register .lp-hero-grid {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  gap: 12px;
}

body.lp-register .lp-hero {
  /* Give hero a clear colored backdrop; otherwise white page makes white text look like "empty gap". */
  background: var(--lp-pink);
  padding-top: 12px;
  padding-bottom: 18px;
}

body.lp-register .lp-hero-card {
  max-width: 560px;
  margin: 0 auto;
}

body.lp-register .lp-cover {
  margin-top: 6px;
}

@media (max-width: 600px) {
  body.lp-register .lp-section {
    padding: 26px 0;
  }
  body.lp-register .lp-hero {
    padding-top: 8px;
    padding-bottom: 12px;
  }
}

body.lp-register .lp-lead {
  margin-left: auto;
  margin-right: auto;
}

/* Remove text drop shadows everywhere on register (readability). */
body.lp-register .brand-title,
body.lp-register .lp-h1,
body.lp-register .lp-h2,
body.lp-register .lp-ref-title {
  text-shadow: none !important;
}

.bg-orbit {
  position: fixed;
  inset: -20% 10% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 77, 109, 0.28), transparent 60%);
  filter: blur(10px);
  z-index: -1;
  animation: orbit-float 10s ease-in-out infinite;
}

@keyframes bg-shift {
  0% {
    background-position: 0% 0%, 100% 0%, 50% 100%, 0% 0%;
  }
  50% {
    background-position: 10% 10%, 90% 10%, 50% 90%, 0% 0%;
  }
  100% {
    background-position: 0% 0%, 100% 0%, 50% 100%, 0% 0%;
  }
}

@keyframes orbit-float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
  100% {
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  body {
    background: radial-gradient(circle at 18% 22%, rgba(255, 77, 109, 0.3), transparent 45%),
      radial-gradient(circle at 82% 18%, rgba(255, 143, 163, 0.28), transparent 40%),
      linear-gradient(135deg, #1a0f1f 0%, #2a1532 50%, #1a0f1f 100%);
    background-attachment: scroll;
    animation: none;
  }

  /* Keep the landing (register) as saturated as desktop on mobile. */
  body.lp-register {
    background: var(--lp-white);
    background-attachment: scroll;
    animation: none;
  }

  .bg-orbit,
  .orb,
  .ref-glow,
  .card3d,
  .hero-visual {
    display: none;
  }

  body:not(.lp-register) * {
    box-shadow: none !important;
    filter: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}

@media (max-width: 900px) {
  body {
    background-attachment: scroll;
    animation: none;
  }

  .bg-orbit {
    display: none;
  }

  .topbar {
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }

  .bg-orbit {
    animation: none;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 5vw;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(255, 34, 198, 0.55), rgba(255, 77, 109, 0.25));
  backdrop-filter: blur(12px);
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  background: transparent;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 800;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.brand-title {
  font-weight: 700;
  font-size: 18px;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.cta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: auto;
}

.btn {
  border: none;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn.pulse {
  transform: scale(0.98);
  box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.4);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
}

.btn.gradient-flow {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #ff5f7a, #ffb36b, #ff5f7a);
  background-size: 200% 200%;
  border: none;
  animation: gradient-flow 6s ease-in-out infinite;
}

.btn.gradient-flow:hover {
  box-shadow: var(--shadow);
}

.btn.glass {
  background: rgba(255, 255, 255, 0.1);
}

.btn.ghost {
  background: transparent;
}

/* Register: make "Отправить код" button visible */
.lp-register .email-row .btn.ghost {
  background: linear-gradient(135deg, rgba(255, 230, 0, 0.95), rgba(255, 45, 155, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: rgba(26, 0, 51, 0.92);
  font-weight: 900;
  box-shadow:
    0 10px 22px rgba(255, 230, 0, 0.18),
    0 6px 16px rgba(255, 45, 155, 0.16);
}
.lp-register .email-row .btn.ghost:hover {
  filter: saturate(1.08) brightness(1.03);
}

.btn.small {
  padding: 8px 12px;
  font-size: 12px;
}

.btn.full {
  width: 100%;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: var(--text);
  text-align: center;
}

.btn.secondary:hover {
  box-shadow: var(--shadow);
}

/* Make the "Уже есть аккаунт" CTA readable on the register landing */
.lp-register .signup-card .btn.secondary {
  color: rgba(255, 255, 255, 0.95);
  background: linear-gradient(135deg, rgba(255, 45, 155, 0.92), rgba(255, 115, 0, 0.82));
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow:
    0 14px 30px rgba(255, 45, 155, 0.22),
    0 6px 16px rgba(255, 115, 0, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.22);
}
.lp-register .signup-card .btn.secondary:hover {
  filter: saturate(1.1) brightness(1.05);
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 600px) {
  .header-actions {
    justify-content: flex-end;
    margin-left: auto;
  }
}

.menu-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 60;
  padding: 0;
  align-self: center;
}

.side-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 70;
}

.side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 45vw;
  background: radial-gradient(circle at 20% 20%, rgba(255, 77, 109, 0.2), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(255, 143, 163, 0.18), transparent 50%),
    rgba(10, 12, 24, 0.98);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px;
  overflow-y: auto;
}

.drawer-link {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 22px;
  font-weight: 500;
  padding: 6px 4px;
  margin: 0;
  line-height: 1.2;
  text-decoration: none;
  letter-spacing: 0.2px;
  cursor: pointer;
  font-family: "Stengazeta", "Poiret One", sans-serif;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.drawer-link[hidden] {
  display: none !important;
}

.drawer-link:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.drawer-text-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.05;
}

.link-inline {
  background: none;
  border: none;
  padding: 0;
  margin: 0 2px;
  color: #ffd1df;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font: inherit;
}

.page-hero {
  padding: 32px 6vw 10px;
}

.page-hero h1 {
  font-size: 38px;
  margin-bottom: 12px;
}

.page-hero p {
  max-width: 820px;
  color: var(--text-muted);
  font-size: 18px;
}

.about-card {
  margin: 16px 6vw;
  padding: 22px 26px;
  border-radius: 22px;
  background: rgba(20, 22, 36, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  color: var(--text);
}

.about-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.about-card p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.55;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.about-card .accent-line {
  color: #fff;
  font-weight: 600;
}

.drawer-icon {
  width: 33px;
  height: 33px;
  object-fit: contain;
  flex: 0 0 33px;
}

.side-drawer.open {
  transform: translateX(0);
}

.chat-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff4d6d;
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.side-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

main {
  padding: 0 5vw 80px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  align-items: center;
  padding: 40px 0 80px;
}

.hero-copy h1 {
  font-size: clamp(32px, 4vw, 54px);
  margin: 20px 0 16px;
}

.hero-copy p {
  color: var(--muted);
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(255, 209, 102, 0.18);
  color: #ffe3a3;
  border-radius: 999px;
  font-size: 12px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.hero-metrics {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.metric {
  background: var(--glass);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: 16px;
}

.metric-value {
  font-size: 22px;
  font-weight: 700;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
}

.hero-visual {
  position: relative;
  min-height: 360px;
}

.card3d {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
  backdrop-filter: blur(10px);
}

.card3d-top {
  font-size: 14px;
  text-transform: uppercase;
  color: var(--accent-3);
  letter-spacing: 1px;
}

.card3d-title {
  font-size: 24px;
  font-weight: 700;
  margin: 10px 0;
}

.card3d-row {
  color: var(--muted);
  margin: 6px 0;
}

.card3d-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.5px);
}

.orb-1 {
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 77, 109, 0.7), transparent 70%);
  top: -20px;
  right: 10%;
}

.orb-2 {
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.7), transparent 70%);
  bottom: -20px;
  left: 20%;
}

.section {
  margin: 80px 0;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 30px;
}

.section-head p {
  color: var(--muted);
  max-width: 560px;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
}

.day-card {
  background: var(--glass);
  border: 1px solid var(--border);
  padding: 16px 10px;
  border-radius: 14px;
  color: var(--text);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.day-open-hint {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  opacity: 0.8;
  animation: dayHintPulse 2.2s ease-in-out infinite;
}

@keyframes dayHintPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .day-open-hint {
    animation: none;
  }
}

.day-card.active,
.day-card:hover {
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.4), rgba(255, 143, 163, 0.25));
  transform: translateY(-2px);
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  align-items: center;
}

.split.reverse {
  grid-auto-flow: dense;
}

.split.reverse .split-text {
  order: 2;
}

.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 24px;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  font-size: 12px;
}

.video-mock {
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.35), rgba(255, 209, 102, 0.2));
  border: 1px solid var(--border);
  padding: 20px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.video-center {
  display: grid;
  place-items: center;
  flex: 1;
}

.play {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  font-size: 28px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.menu-card {
  padding: 20px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--border);
}

.menu-title {
  font-weight: 700;
  font-size: 18px;
}

.menu-desc {
  color: var(--muted);
  margin: 8px 0;
}

.care-card {
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 209, 102, 0.2), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  min-height: 260px;
}

.care-title {
  font-size: 18px;
  font-weight: 700;
}

.care-body {
  margin: 10px 0 20px;
  color: var(--muted);
}

.timer {
  display: grid;
  place-items: center;
  gap: 10px;
}

.timer-ring {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent-3);
  animation: spin 4s linear infinite;
}

.timer-time {
  font-size: 18px;
  font-weight: 700;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.motivation-row {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.quote {
  background: var(--glass);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 18px;
  font-style: italic;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.pricing-card {
  padding: 22px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--border);
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.pricing-card.highlight {
  background: linear-gradient(150deg, rgba(255, 77, 109, 0.25), rgba(255, 255, 255, 0.06));
}

.referral-card {
  background: linear-gradient(120deg, rgba(255, 77, 109, 0.55), rgba(255, 209, 102, 0.45), rgba(255, 77, 109, 0.55));
  background-size: 200% 200%;
  animation: gradient-flow 8s ease-in-out infinite;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 60px rgba(255, 77, 109, 0.22);
}

.ref-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.5px);
  opacity: 0.7;
  animation: float 6s ease-in-out infinite;
}

.ref-glow-1 {
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 77, 109, 0.6), transparent 70%);
  top: -40px;
  right: -30px;
}

.ref-glow-2 {
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.5), transparent 70%);
  bottom: -60px;
  left: -40px;
  animation-delay: 1.5s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.02);
  }
}

.pricing-title {
  font-weight: 700;
  font-size: 18px;
}

.pricing-value {
  font-size: 22px;
  font-weight: 700;
  color: #ffe3a3;
}

.pricing-note {
  color: var(--muted);
}

.signup {
  margin-bottom: 60px;
}

/* Landing ("register") */
.lp-register .footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.lp-main {
  padding-top: 0;
}

.lp-section {
  position: relative;
  padding: 44px 0;
  overflow: hidden; /* keep waves/gradients from "sticking out" on mobile */
}

.lp-section--light {
  background: #ffffff;
}

.lp-section--pink {
  background: linear-gradient(180deg, rgba(255, 45, 155, 0.96), rgba(255, 0, 128, 0.86));
}

.lp-section--aqua {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.92), rgba(0, 229, 255, 0.72));
}

.lp-section--dark {
  background: linear-gradient(180deg, rgba(123, 47, 255, 0.92), rgba(123, 47, 255, 0.72));
}

.lp-wave {
  display: block;
  width: 100%;
  height: 70px;
}

.lp-wave-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
}

.lp-wave path {
  fill: rgba(255, 255, 255, 0.18);
}

.lp-wave--pink path {
  fill: rgba(255, 45, 155, 0.98);
}

.lp-wave--aqua path {
  fill: rgba(0, 229, 255, 0.92);
}

.lp-wave--light path {
  fill: #ffffff;
}

.container {
  width: 100%;
  margin: 0;
  padding: 0 18px;
}

.lp-kicker {
  display: inline-block;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.lp-h1 {
  font-size: clamp(30px, 3.8vw, 56px);
  line-height: 1.06;
  margin: 12px 0 10px;
  color: #fff;
  text-shadow: none;
}

.lp-lead {
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.55;
  max-width: 60ch;
}

.lp-hero-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
}

@media (max-width: 920px) {
  .lp-hero-grid {
    grid-template-columns: 1fr;
  }
}

.lp-cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
  justify-content: center;
}

.lp-micro {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
}

.lp-btn {
  padding: 14px 22px;
  min-width: 260px;
  border-radius: 18px;
  border: 4px solid var(--lp-dark);
  background: var(--lp-yellow);
  color: var(--lp-dark);
  box-shadow: 6px 6px 0 var(--lp-dark);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.lp-btn:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow: 9px 9px 0 var(--lp-dark);
}

.lp-btn:active {
  transform: translateY(0px) scale(0.99);
}

@media (max-width: 520px) {
  .lp-btn {
    min-width: 100%;
  }
}

.lp-hero-card {
  /* No frame around the cover (user asked). */
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
  overflow: visible;
  position: relative;
}

.lp-hero-card::before {
  content: none; /* remove blurred background */
}

.lp-cover {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 2;
  border-radius: 0;
}

.lp-cover-note {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 3px solid rgba(26, 0, 51, 0.45);
  background: rgba(255, 255, 255, 0.18);
}

.lp-cover-title {
  font-weight: 700;
}

.lp-cover-sub {
  color: rgba(26, 0, 51, 0.9);
  font-size: 13px;
  margin-top: 2px;
}

.lp-head {
  margin-bottom: 14px;
}

.lp-h2 {
  font-size: clamp(22px, 2.4vw, 34px);
  margin: 0 0 8px;
  color: var(--lp-dark);
  text-shadow: none;
}

.lp-sub {
  margin: 0;
  color: rgba(26, 0, 51, 0.78);
  line-height: 1.55;
}

.lp-section--pink .lp-h2,
.lp-section--aqua .lp-h2,
.lp-section--dark .lp-h2 {
  color: #fff;
  text-shadow: none;
}

.lp-section--pink .lp-sub,
.lp-section--aqua .lp-sub,
.lp-section--dark .lp-sub {
  color: rgba(255, 255, 255, 0.92);
}

.lp-cta-under {
  margin-top: 18px;
}

.lp-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 920px) {
  .lp-two {
    grid-template-columns: 1fr;
  }
}

.lp-bullets {
  margin: 16px 0 18px;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.lp-placeholder {
  /* Placeholder without a visible "frame" */
  border-radius: 18px;
  border: none;
  background: transparent;
  padding: 0;
  min-height: 240px;
  display: grid;
  gap: 10px;
  align-content: center;
}

.lp-inline-image {
  width: 100%;
  height: auto;
  display: block;
}

.lp-placeholder-badge {
  display: inline-flex;
  width: fit-content;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.lp-placeholder-note {
  color: rgba(255, 255, 255, 0.75);
}

/* Referral card (screen 2) */
.lp-ref-card {
  border-radius: 28px;
  padding: 26px 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.10));
  border: 3px solid rgba(26, 0, 51, 0.22);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.92);
  max-width: 920px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.lp-ref-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(260px 140px at 15% 20%, rgba(255, 230, 0, 0.35), transparent 60%),
    radial-gradient(320px 200px at 80% 30%, rgba(0, 229, 255, 0.28), transparent 62%),
    radial-gradient(260px 180px at 50% 90%, rgba(255, 0, 128, 0.22), transparent 62%);
  pointer-events: none;
  filter: blur(0.2px);
  animation: lpRefGlow 3.2s ease-in-out infinite;
}

@keyframes lpRefGlow {
  0% { opacity: 0.75; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
  100% { opacity: 0.75; transform: translateY(0); }
}

.lp-ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--lp-yellow);
  color: var(--lp-dark);
  border: 3px solid var(--lp-dark);
  box-shadow: 5px 5px 0 var(--lp-dark);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
  animation: lpRefBadgePulse 1.8s ease-in-out infinite;
}

.lp-ref-badge::before {
  content: "🔥";
  font-size: 16px;
  line-height: 1;
}

@keyframes lpRefBadgePulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px) scale(1.03); }
}

.lp-ref-title {
  font-size: clamp(34px, 6vw, 54px);
  color: rgba(255, 255, 255, 0.98);
  text-shadow: none;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.lp-ref-text {
  font-weight: 700;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

.lp-ref-list {
  margin: 8px 0 0;
  padding-left: 18px;
  position: relative;
  z-index: 1;
}

/* Blob cards (screen 5) */
.lp-blob-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 980px;
  margin: 26px auto 0;
}

@media (max-width: 980px) {
  .lp-blob-grid {
    grid-template-columns: 1fr;
  }
}

.lp-blob {
  background: #ffffff;
  border: 5px solid var(--lp-dark);
  border-radius: 30px;
  padding: 22px 20px;
  box-shadow: 7px 7px 0 var(--lp-dark);
}

.lp-blob-tag {
  display: inline-block;
  background: var(--lp-yellow);
  color: var(--lp-dark);
  font-weight: 900;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 3px solid var(--lp-dark);
  letter-spacing: 1px;
}

.lp-blob-h {
  margin-top: 12px;
  font-weight: 900;
  font-size: 20px;
  color: var(--lp-hot-pink);
}

.lp-blob-p {
  margin-top: 10px;
  color: rgba(26, 0, 51, 0.78);
  font-weight: 700;
  line-height: 1.55;
}

.lp-video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 980px) {
  .lp-video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.lp-video-card {
  /* Cleaner "story" placeholder cards */
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  padding: 14px;
  min-height: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  color: rgba(255, 255, 255, 0.88);
}

body.lp-register .lp-video-card {
  background: rgba(255, 255, 255, 0.92);
  border: 4px solid var(--lp-dark);
  box-shadow: 6px 6px 0 var(--lp-dark);
  color: var(--lp-dark);
  justify-items: stretch;
}

.lp-video {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  background: #000;
  display: block;
  object-fit: cover;
}

@media (max-width: 560px) {
  /* On very small screens a 9:16 "story" is too tall and feels jumpy while scrolling. */
  .lp-video-card {
    padding: 12px;
  }
}

.lp-play {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.10);
  position: relative;
}

.lp-play::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 14px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid rgba(86, 26, 74, 0.85);
}

.lp-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 980px) {
  .lp-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .lp-steps {
    grid-template-columns: 1fr;
  }
}

.lp-step {
  /* Remove frames around content blocks */
  border-radius: 18px;
  border: none;
  background: transparent;
  padding: 0;
  display: grid;
  gap: 8px;
}

.lp-step-num {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--lp-dark);
  background: var(--lp-yellow);
  border: 3px solid var(--lp-dark);
  box-shadow: 4px 4px 0 var(--lp-dark);
}

/* Keep the registration form nicely aligned on the landing. */
.lp-register .signup-card {
  width: 100%;
  margin: 0;
}

@media (max-width: 420px) {
  .container {
    padding: 0 14px;
  }
}

.lp-step-title {
  font-weight: 800;
}

.lp-step-text {
  color: rgba(26, 0, 51, 0.78);
  line-height: 1.5;
  font-size: 13px;
}

.signup-card {
  /* User requested a "free form" layout: no outer card background/frame. */
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* On the bright register landing we DO keep a clear registration frame (user requirement). */
body.lp-register .signup-card {
  background: rgba(255, 255, 255, 0.85);
  border: 5px solid var(--lp-dark);
  border-radius: 28px;
  padding: 22px 20px;
  box-shadow: 8px 8px 0 var(--lp-dark);
  grid-template-columns: 1fr;
}

body.lp-register .signup-text h3 {
  color: var(--lp-dark);
}

body.lp-register .muted-note {
  color: rgba(26, 0, 51, 0.72);
}

.signup-form {
  display: grid;
  gap: 12px;
}

.email-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.email-row .btn {
  padding: 10px 16px;
  white-space: nowrap;
}

.email-row input {
  width: 100%;
}

@media (max-width: 520px) {
  .email-row {
    grid-template-columns: 1fr;
  }
  .email-row .btn {
    width: 100%;
  }
}

.signup-form input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

body.lp-register .signup-form input {
  border: 2px solid rgba(26, 0, 51, 0.22);
  background: #ffffff;
  color: var(--lp-dark);
}

body.lp-register .checkbox {
  color: rgba(26, 0, 51, 0.75);
  font-weight: 700;
}

body.lp-register .link-inline {
  color: var(--lp-hot-pink);
  font-weight: 900;
}

.channel-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
}

.checkbox {
  font-size: 12px;
  color: var(--muted);
}

.form-status {
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}

.form-status.ok {
  color: #8cffc1;
}

.form-status.error {
  color: #ff8fa3;
}

.transformations {
  margin-bottom: 60px;
}

.section-head {
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.1;
  margin: 0 0 8px;
}

.hero-subtitle {
  max-width: 880px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.transform-marquee {
  position: relative;
  overflow: hidden;
  padding: 10px 0;
  border-radius: 0;
  border: none;
  background: transparent;
  /* Prevent layout jumps while images are loading (helps stop "blinking"). */
  min-height: 260px;
  contain: paint;
}

/* On the register landing we want a user-controllable carousel:
   - auto-scroll via JS (scrollLeft)
   - pause + manual swipe/scroll on touch */
body.lp-register .transform-marquee {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

body.lp-register .transform-marquee::-webkit-scrollbar {
  display: none; /* Safari/Chrome */
}

.transform-marquee::before,
.transform-marquee::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 70px;
  pointer-events: none;
  z-index: 2;
}

.transform-marquee::before {
  left: 0;
  background: transparent;
}

.transform-marquee::after {
  right: 0;
  background: transparent;
}

.transform-track {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  padding: 0 12px;
  /* Slightly faster so the "train" effect is obvious on mobile too. */
  animation: transform-marquee 7.5s linear infinite;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

@media (hover: hover) and (pointer: fine) {
  .transform-track:hover {
    animation-play-state: paused;
  }
}

body.lp-register .transform-track {
  /* JS drives scrollLeft, so disable transform animation to avoid jumps. */
  animation: none !important;
  will-change: auto;
  transform: none !important;
}

.transform-track img {
  height: 240px;
  width: auto;
  display: block;
  border-radius: 18px;
  border: none;
  background: transparent;
  backface-visibility: hidden;
  transform: translateZ(0);
  scroll-snap-align: start;
}

@keyframes transform-marquee {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (max-width: 640px) {
  .transform-track img {
    height: 190px;
  }
  .transform-marquee::before,
  .transform-marquee::after {
    width: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .transform-track {
    animation: none;
  }
}

.muted-note {
  color: var(--muted);
  font-size: 13px;
}

.login-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  max-width: 520px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.password-form {
  display: grid;
  gap: 12px;
}

.password-form input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.timer-form {
  display: grid;
  gap: 12px;
}

.timer-form input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.cabinet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: start;
}

.cabinet-card {
  padding: 22px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--border);
  display: grid;
  gap: 12px;
  min-width: 0;
}

.cabinet-title {
  font-weight: 700;
  font-size: 18px;
}

.cabinet-body {
  color: var(--muted);
  line-height: 1.5;
}

.cabinet-note {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.7;
}

.hidden {
  display: none;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 5vw 40px;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links {
  display: none !important;
  gap: 16px;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.profile-card {
  padding: 22px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--border);
  display: grid;
  gap: 12px;
}

.profile-title {
  font-weight: 700;
  font-size: 18px;
}

.profile-desc,
.profile-note {
  color: var(--muted);
  font-size: 13px;
}

.ref-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  min-width: 0;
}

.ref-box input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  min-width: 0;
}

.profile-form {
  display: grid;
  gap: 10px;
}

.profile-avatar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.profile-avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
}

.profile-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-btn {
  white-space: nowrap;
}

.profile-form input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.list {
  padding-left: 18px;
  color: var(--muted);
}

.day-one-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

.day-one-hero img,
.day-one-media img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--border);
  display: block;
  height: auto;
  object-fit: cover;
}

.day-one-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--border);
  margin: 24px 0;
}

.day-one-block img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
  display: block;
  height: auto;
  object-fit: cover;
}

.day-one-content h3 {
  margin: 0 0 8px;
}

.day-text {
  white-space: pre-line;
  line-height: 1.55;
  color: var(--muted);
}

.video-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 20px;
}

.video-card {
  padding: 8px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  display: grid;
  gap: 10px;
  flex: 0 0 calc(25% - 12px);
  max-width: calc(25% - 12px);
}

.video-card video {
  width: 100%;
  border-radius: 12px;
  background: #000;
  display: block;
  height: auto;
}

.video-label {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .nav {
    display: none;
  }
}

@media (max-width: 600px) {
  .topbar {
    flex-direction: row;
    gap: 12px;
  }

  .cta {
    display: flex;
    justify-content: flex-end;
    width: auto;
  }

  .cta a.btn {
    display: none;
  }

  .cta .menu-toggle {
    display: grid;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 700px) {
  .day-one-block {
    grid-template-columns: 1fr;
  }

  .day-one-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .video-card {
    flex: 0 0 calc(50% - 12px);
    max-width: calc(50% - 12px);
  }
}

@media (max-width: 640px) {
  .video-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .video-card {
    flex: 0 0 70%;
    max-width: 70%;
  }
}

.day-video-block {
  grid-template-columns: 1fr;
}

.day-nav {
  margin: 24px 0 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--border);
}

.day-nav-title {
  font-size: 16px;
  margin-bottom: 10px;
}

.day-nav-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.day-number {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}

.day-number.active {
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.45), rgba(255, 143, 163, 0.3));
}

.day-next {
  margin: 16px 0 28px;
}

.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.calc-section {
  margin-top: 20px;
}

.pay-cta {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-note {
  font-size: 13px;
  opacity: 0.75;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.calc-reset-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.calc-info {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  font-size: 12px;
  cursor: help;
}

.calc-tooltip {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(25, 16, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  z-index: 5;
  pointer-events: none;
}

.calc-info:hover .calc-tooltip,
.calc-info:focus .calc-tooltip {
  opacity: 1;
  visibility: visible;
}

.calc-forecast {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.calc-card {
  padding: 18px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--border);
}

.calc-card h4 {
  margin: 0 0 10px;
  font-size: 18px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0;
  color: var(--muted);
  font-size: 14px;
}

.calc-row strong {
  color: var(--text);
}

.calc-footnote {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.calc-actions {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.calc-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.forecast-weight {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}

.forecast-weight strong {
  color: var(--text);
}

.forecast-volumes {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

.forecast-title {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.forecast-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.forecast-row strong {
  color: var(--text);
}

.goal-fields {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.goal-range {
  font-size: 13px;
  color: var(--muted);
}

.goal-error {
  font-size: 13px;
  color: #ff8080;
  min-height: 16px;
}

.goal-results {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.params-card {
  padding: 18px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--border);
  display: grid;
  gap: 10px;
}

.params-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.params-row strong {
  color: var(--text);
}

.params-header {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 18, 0.85);
  display: grid;
  place-items: center;
  z-index: 120;
}

.modal-overlay[hidden] {
  display: none;
}

.chat-poll-overlay {
  z-index: 200;
}

.calc-modal {
  width: min(520px, 92vw);
  background: linear-gradient(140deg, rgba(255, 77, 109, 0.16), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.doc-modal {
  width: min(760px, 92vw);
  max-height: 80vh;
  overflow: hidden;
}

.doc-body {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 8px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.calc-title {
  font-size: 20px;
  margin-bottom: 10px;
}

.calc-text {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.calc-photo {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 6px;
  margin-bottom: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.calc-step.hidden {
  display: none;
}

.calc-form {
  display: grid;
  gap: 14px;
}

.calc-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.calc-field input,
.calc-field select {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.water-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  color: var(--muted);
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.water-toggle > span {
  flex: 1 1 auto;
  min-width: 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.2s;
  border-radius: 999px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.switch input:checked + .slider:before {
  transform: translateX(24px);
}

.water-plan {
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 10px;
}

.water-plan-head {
  font-size: 14px;
  color: var(--muted);
}

.water-list {
  display: grid;
  gap: 10px;
}

.water-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.water-row input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  min-width: 0;
}

.water-row button {
  padding: 8px 10px;
  border-radius: 10px;
}

.water-ml {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.water-ml span {
  color: var(--muted);
  font-size: 13px;
}

.day-card.locked {
  position: relative;
  opacity: 0.55;
}

.day-card.locked::after {
  content: "🔒";
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 14px;
}

@keyframes gradient-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.avatar-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
}

.avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  border: 1px solid var(--border);
  overflow: hidden;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-label {
  display: inline-block;
}

.chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.75);
  display: grid;
  place-items: center;
  z-index: 140;
  overscroll-behavior: contain;
}

.chat-overlay[hidden] {
  display: none;
}

.chat-panel {
  width: min(980px, 94vw);
  height: min(80vh, 720px);
  background: linear-gradient(160deg, rgba(20, 21, 30, 0.98), rgba(46, 24, 34, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  display: grid;
  /* head, body, typing, reply, input, subscribe, attach-hint */
  grid-template-rows: auto 1fr auto auto auto auto auto;
  overflow: hidden;
  box-shadow: var(--shadow);
  touch-action: pan-y;
}

.chat-subscribe {
  padding: 8px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 6px;
}

.chat-subscribe-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chat-subscribe-links {
  display: grid;
  gap: 4px;
  margin-top: 0;
}

.chat-subscribe-links[hidden] {
  display: none !important;
}

.chat-subscribe-links a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  text-decoration: underline;
}

.chat-subscribe-links .muted {
  color: var(--muted);
  font-size: 11px;
}

/* Smaller toggles in chat subscribe UI (keep the main "switch" sizes elsewhere). */
.chat-subscribe .switch {
  width: 42px;
  height: 22px;
}

.chat-subscribe .slider:before {
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
}

.chat-subscribe .switch input:checked + .slider:before {
  transform: translateX(20px);
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-title {
  font-size: 20px;
  font-weight: 700;
}

.chat-sub {
  color: var(--muted);
  font-size: 13px;
}

.chat-close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
}

.chat-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  touch-action: pan-y;
}

.chat-msg {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.chat-msg.mine {
  grid-template-columns: 1fr auto;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-online {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3ee87f;
  position: absolute;
  right: -1px;
  bottom: -1px;
  border: 2px solid rgba(20, 21, 30, 1);
}

.chat-bubble {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 10px;
  border-radius: 16px;
  position: relative;
  max-width: min(82vw, 360px);
  width: auto;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overflow: hidden;
  box-sizing: border-box;
}

.chat-msg.mine .chat-bubble {
  background: linear-gradient(120deg, rgba(255, 95, 122, 0.5), rgba(255, 179, 107, 0.35));
  border-color: rgba(255, 255, 255, 0.12);
  justify-self: end;
}

.chat-name {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.chat-text {
  line-height: 1.4;
  user-select: none;
  -webkit-user-select: none;
}

.chat-attach-text {
  padding: 6px 16px 12px;
  color: var(--muted);
  font-size: 12px;
}

.chat-attach-text.error {
  color: #ffb4b4;
}

.chat-avatar .chat-online {
  display: none;
}

.chat-image {
  margin-top: 8px;
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  object-fit: contain;
  box-sizing: border-box;
  align-self: stretch;
}
.chat-image {
  cursor: zoom-in;
}

#chat-image-overlay {
  padding: 16px;
  z-index: 2000;
}
#chat-image-overlay img {
  max-width: min(96vw, 960px);
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
#chat-image-overlay .modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
}

.chat-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.admin-page {
  padding: 32px 24px 64px;
}

.admin-hero .hero-card {
  margin-bottom: 24px;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.admin-kpi {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-kpi-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.admin-kpi-value {
  font-size: 26px;
  font-weight: 700;
  margin: 6px 0 4px;
}

.admin-kpi-sub {
  font-size: 12px;
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.admin-card {
  padding: 22px;
  border-radius: 22px;
  background: rgba(18, 12, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.admin-card-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.admin-card-head p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form .field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form textarea,
.admin-form input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 14px;
}

.admin-inline {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-inline input[readonly] {
  opacity: 0.9;
}

.admin-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.admin-tools-grid {
  display: grid;
  gap: 12px;
}

.admin-tool-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.admin-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.admin-ref-result {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.admin-ref-result .muted {
  color: var(--muted);
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-upload-status {
  font-size: 12px;
  color: var(--muted);
}

.admin-table {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-row.new {
  border-color: rgba(255, 170, 90, 0.5);
  background: rgba(255, 170, 90, 0.12);
}

.admin-row.paid {
  border-color: rgba(120, 255, 180, 0.35);
  background: rgba(120, 255, 180, 0.12);
}

.admin-row-user {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 600;
}

.admin-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-avatar-fallback {
  font-size: 14px;
  text-transform: uppercase;
}

.admin-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  margin-left: 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #1b0f14;
  background: linear-gradient(120deg, #ffb26a, #ff7b9b);
}

.admin-paid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #0f2a19;
  background: linear-gradient(120deg, #a8f3c6, #7ddfa4);
}

.admin-row-title {
  font-weight: 600;
}

.admin-row-sub {
  font-size: 12px;
  color: var(--muted);
}

.copyable {
  cursor: pointer;
  user-select: text;
}

.copyable:hover {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: underline;
}

.copyable.copied {
  color: rgba(120, 255, 180, 0.95);
  text-decoration: none;
}

.admin-row-meta {
  text-align: right;
  font-size: 13px;
}

.admin-row-actions {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.admin-link {
  font-size: 12px;
  color: #ffb3b3;
}

.admin-empty {
  font-size: 13px;
  color: var(--muted);
}

.chat-reactions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.chat-reaction {
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
}

.chat-reaction.active {
  background: rgba(255, 255, 255, 0.24);
}

.chat-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.chat-action {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.chat-typing {
  padding: 0 20px 10px;
  color: var(--muted);
  font-size: 12px;
}

.chat-reply {
  margin: 0 20px 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-reply[hidden] {
  display: none;
}

.chat-reply-text {
  font-size: 12px;
  color: var(--muted);
}

.chat-reply-close {
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-input-field {
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
}

.chat-upload,
.chat-emoji {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
}

.chat-poll-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
}

.poll-options {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.poll-option-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.poll-option-row input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 14px;
}

.poll-option-remove {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.chat-poll {
  margin-top: 6px;
  display: grid;
  gap: 8px;
}

.chat-poll-question {
  font-weight: 600;
  font-size: 14px;
}

.chat-poll-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
  cursor: zoom-in;
}

.chat-poll-options {
  display: grid;
  gap: 8px;
}

.chat-poll-option {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
}

.chat-poll-option-text {
  flex: 1;
  text-align: left;
}

.chat-poll-option.selected {
  border-color: rgba(255, 179, 107, 0.7);
  background: rgba(255, 179, 107, 0.2);
}

.chat-poll-option.leading {
  border-color: rgba(120, 255, 180, 0.5);
  background: rgba(120, 255, 180, 0.16);
}

.chat-poll-option-count {
  font-weight: 600;
}

.chat-poll-total {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.chat-emoji-panel {
  padding: 8px 16px 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 1;
}

.chat-emoji-panel button {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px 8px;
  cursor: pointer;
}

.chat-action-sheet {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 18, 0.6);
  display: grid;
  place-items: center;
  z-index: 200;
}

.chat-action-sheet[hidden] {
  display: none;
}

.chat-action-card {
  width: min(360px, 90vw);
  background: rgba(20, 22, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.chat-action-btn {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
}

.chat-action-btn.danger {
  background: rgba(255, 77, 109, 0.18);
}

@media (max-width: 720px) {
  .chat-panel {
    width: 94vw;
    height: 88vh;
  }

  .chat-body {
    padding: 14px 14px 18px;
  }

  .chat-bubble {
    max-width: 90vw;
  }

  .chat-input {
    grid-template-columns: 1fr auto auto auto;
  }

  .chat-input .btn {
    grid-column: span 4;
  }
}

/* League */
.league-page {
  --league-glow: rgba(255, 77, 109, 0.38);
  --league-ice: rgba(255, 255, 255, 0.1);
}

.league-page::before,
.league-page::after {
  content: '';
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: 0;
}

.league-page::before {
  background:
    radial-gradient(1200px 600px at 15% 0%, rgba(255, 77, 109, 0.22), transparent 55%),
    radial-gradient(1100px 600px at 85% 0%, rgba(255, 214, 224, 0.18), transparent 55%),
    radial-gradient(900px 520px at 50% 110%, rgba(255, 95, 122, 0.14), transparent 55%);
  filter: blur(0px);
}

.league-page::after {
  background: conic-gradient(
    from 120deg,
    rgba(255, 77, 109, 0.08),
    rgba(255, 214, 224, 0.06),
    rgba(255, 77, 109, 0.08)
  );
  mask: radial-gradient(closest-side, rgba(0,0,0,0), rgba(0,0,0,0.55), rgba(0,0,0,0.0));
  opacity: 0.65;
}

.league-page .bg-orbit,
.league-page header,
.league-page main,
.league-page footer {
  position: relative;
  z-index: 1;
}

.league-page main {
  padding-top: 18px;
}

.league-app {
  padding: 12px 0 56px;
}

.league-app-screen {
  max-width: 560px;
  margin: 0 auto;
  border-radius: 40px;
  padding: 18px 16px 22px;
  background: rgba(10, 14, 26, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(125%);
}

.league-app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.league-app-title {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff, rgba(165, 240, 255, 0.95));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.league-app-sub {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.league-app-cta {
  border-radius: 999px;
  padding: 10px 16px;
}

.league-app-profile {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  padding: 14px;
  backdrop-filter: blur(14px) saturate(120%);
}

.league-app-profile-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.league-app-h {
  font-weight: 900;
}

.league-app-p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.league-app-section-title {
  margin: 16px 0 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(170, 179, 207, 0.9);
  font-weight: 800;
  padding-left: 6px;
}

.league-formats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.league-format-card {
  flex: 1;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 27, 45, 0.55);
  border-radius: 26px;
  padding: 12px 8px;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px) saturate(120%);
}

.league-format-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 214, 224, 0.35);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.26);
}

.league-format-card.active {
  border-color: rgba(255, 77, 109, 0.5);
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.22), rgba(255, 214, 224, 0.1));
  box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.08), 0 26px 60px rgba(0, 0, 0, 0.28);
}

.league-format-icon {
  font-size: 26px;
  margin-bottom: 6px;
}

.league-format-name {
  font-weight: 900;
  font-size: 13px;
}

.league-format-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

.league-view {
  margin-top: 6px;
}

.league-page .btn {
  transform: translateY(0);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.league-page .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.league-page .btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.league-page .btn.primary {
  position: relative;
  overflow: hidden;
}

.league-page .btn.primary::after {
  content: '';
  position: absolute;
  inset: -30% -60%;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.5) 45%, transparent 55%);
  transform: translateX(-20%);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.6s ease;
}

.league-page .btn.primary:hover::after {
  opacity: 0.9;
  transform: translateX(35%);
}

.league-hero {
  padding: 40px 0 60px;
}

.league-hero h1 {
  letter-spacing: -0.02em;
}

.league-visual-stack {
  position: relative;
  perspective: 900px;
}

.league-trophy {
  position: absolute;
  top: -22px;
  left: -14px;
  width: 110px;
  height: 110px;
  opacity: 0.9;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.35));
  transform: translateZ(26px);
  animation: league-float 3.8s ease-in-out infinite;
}

.league-trophy svg {
  width: 100%;
  height: 100%;
}

.league-card3d {
  transform-style: preserve-3d;
}

.tilt-card {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tilt-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px 220px at 20% 0%, rgba(255, 255, 255, 0.18), transparent 60%);
  opacity: 0.65;
  pointer-events: none;
  transform: translateZ(1px);
}

.tilt-card:hover {
  border-color: rgba(255, 214, 224, 0.42);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.28);
}

.league-tabs {
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px) saturate(120%);
}

.league-tab {
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.16);
}

.league-tab.active {
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.26), rgba(255, 214, 224, 0.16));
  border-color: rgba(255, 77, 109, 0.35);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
}

.league-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 18px;
}

.league-tab {
  padding: 10px 14px;
}

.league-tab.active {
  background: rgba(255, 77, 109, 0.18);
  border-color: rgba(255, 77, 109, 0.35);
}

.league-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

.league-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px) saturate(120%);
}

.league-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: radial-gradient(
      800px 380px at 20% 0%,
      rgba(255, 77, 109, 0.16),
      transparent 55%
    ),
    radial-gradient(700px 360px at 80% 0%, rgba(255, 214, 224, 0.12), transparent 55%);
  pointer-events: none;
}

@keyframes league-float {
  0% { transform: translateY(0) rotate(-3deg) translateZ(26px); }
  50% { transform: translateY(8px) rotate(2deg) translateZ(26px); }
  100% { transform: translateY(0) rotate(-3deg) translateZ(26px); }
}

@media (prefers-reduced-motion: reduce) {
  .league-trophy { animation: none; }
  .tilt-card { transition: none; }
  .league-page .btn.primary::after { transition: none; }
}

.league-card > * {
  position: relative;
  z-index: 1;
}

.league-card-head {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.league-card-title {
  font-size: 18px;
  font-weight: 700;
  transform: translateZ(18px);
}

.league-card-sub {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.35;
}

.league-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  transform: translateZ(18px);
}

.league-empty {
  background: rgba(0, 0, 0, 0.18);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 14px;
  margin-top: 10px;
}

.league-empty-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.league-empty-text {
  color: var(--text-muted);
  line-height: 1.45;
}

.team-top {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 10px 0 14px;
}

.team-name {
  font-size: 20px;
  font-weight: 800;
}

.team-sub {
  margin-top: 6px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.team-code {
  font-weight: 800;
  letter-spacing: 1px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.team-captain {
  font-weight: 700;
}

.team-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.league-subhead {
  font-weight: 800;
  margin: 8px 0 10px;
}

.team-split {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 12px 0 14px;
}

.roster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.player-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  backdrop-filter: blur(14px) saturate(120%);
}

.player-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 214, 224, 0.35);
}

.player-card.active {
  border-color: rgba(255, 77, 109, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.player-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.avatar-frame {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  padding: 3px;
  background: conic-gradient(from 180deg, rgba(255, 77, 109, 0.85), rgba(255, 214, 224, 0.9), rgba(255, 77, 109, 0.85));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  transform: translateZ(22px);
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-letter {
  font-weight: 900;
  font-size: 22px;
  color: #fff;
}

.player-name {
  font-weight: 900;
  line-height: 1.2;
  transform: translateZ(16px);
}

.player-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.progress-ring {
  --pct: 0;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  position: relative;
  background: conic-gradient(
    rgba(255, 77, 109, 0.95) 0 calc(var(--pct) * 1%),
    rgba(255, 255, 255, 0.12) calc(var(--pct) * 1%) 100%
  );
  display: grid;
  place-items: center;
  transform: translateZ(18px);
}

.progress-ring::after {
  content: '';
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.progress-ring-text {
  position: absolute;
  font-size: 12px;
  font-weight: 900;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-chip {
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.badge-chip.gold {
  background: rgba(255, 209, 102, 0.16);
  border-color: rgba(255, 209, 102, 0.25);
}

.checkin-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 12px;
  backdrop-filter: blur(14px) saturate(120%);
}

.checkin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.checkin-label {
  color: var(--text-muted);
}

.checkin-name {
  font-weight: 900;
  margin-left: 6px;
}

.checkin-date {
  color: var(--text-muted);
  font-size: 12px;
}

.checkin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  margin: 10px 0 12px;
}

.checkin-item {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}

.checkin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.leaderboard {
  display: grid;
  gap: 10px;
}

.lb-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px 12px;
}

.lb-left {
  display: grid;
  gap: 2px;
}

.lb-title {
  font-weight: 900;
}

.lb-sub {
  color: var(--text-muted);
  font-size: 12px;
}

.lb-score {
  font-weight: 900;
}

.rules-mini,
.rules-full {
  color: var(--text-muted);
  line-height: 1.55;
}

.league-modal {
  max-width: 560px;
}

.league-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.league-form input,
.league-form select {
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
}

.league-form input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.league-form input:focus,
.league-form select:focus {
  border-color: rgba(255, 77, 109, 0.45);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22), 0 0 0 4px rgba(255, 77, 109, 0.12);
  transform: translateY(-1px);
}

.league-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.75) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.75) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.league-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.league-stat {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px;
}

.league-stat-label {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.league-stat-value {
  font-weight: 900;
  font-size: 16px;
}

.league-callout {
  background: linear-gradient(135deg, rgba(255, 77, 109, 0.16), rgba(255, 214, 224, 0.08));
  border: 1px solid rgba(255, 77, 109, 0.18);
  border-radius: 18px;
  padding: 12px;
  margin-top: 10px;
}

.league-callout strong {
  color: #fff;
}

.league-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.duel-list {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.duel-card {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 10px;
  backdrop-filter: blur(14px) saturate(120%);
}

.duel-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.duel-title {
  font-weight: 900;
}

.duel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.war-list {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.war-card {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 10px;
  backdrop-filter: blur(14px) saturate(120%);
}

.war-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.teams-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.team-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.team-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 214, 224, 0.35);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.team-chip.active {
  border-color: rgba(255, 77, 109, 0.45);
}

.team-chip-title {
  font-weight: 900;
}

.team-chip-sub {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

@media (max-width: 720px) {
  /* Prevent iOS Safari zoom on focus */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .checkin-grid {
    grid-template-columns: 1fr;
  }
  .duel-grid {
    grid-template-columns: 1fr;
  }
  .war-grid {
    grid-template-columns: 1fr;
  }
  .league-stats {
    grid-template-columns: 1fr;
  }
}

/* Prevent iOS Safari zoom on focus (broader, iOS-only) */
@supports (-webkit-touch-callout: none) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}
