/* Тема «Розважальний»: премиальный неон — глубокий фиолет, переливающиеся
   градиенты, светящиеся рамки и живые анимации. */
:root {
  --fun-bg: #0b0618;
  --fun-bg-2: #180a2e;
  --fun-pink: #ff4fc3;
  --fun-violet: #8b5cff;
  --fun-cyan: #37d5ff;
  --fun-text: #f6ecff;
  --fun-muted: #c7a9e2;
  --fun-line: rgba(180, 120, 255, 0.28);
}

body {
  background: var(--fun-bg);
  color: var(--fun-text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

/* Неоновые прожекторы, медленно плывущие по фону */
body::before {
  content: "";
  position: fixed;
  inset: -25vh -25vw;
  z-index: -2;
  background:
    radial-gradient(34vw 34vw at 15% 15%, rgba(255, 79, 195, 0.34), transparent 62%),
    radial-gradient(32vw 32vw at 85% 25%, rgba(55, 213, 255, 0.26), transparent 62%),
    radial-gradient(40vw 40vw at 55% 92%, rgba(139, 92, 255, 0.32), transparent 62%),
    linear-gradient(180deg, var(--fun-bg-2), var(--fun-bg) 65%);
  animation: funLights 20s ease-in-out infinite alternate;
}
/* Тонкая световая сетка поверх фона */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(80% 60% at 50% 20%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(80% 60% at 50% 20%, #000 20%, transparent 80%);
  animation: funGrid 18s linear infinite;
}

.bg-layer { opacity: 0.3; filter: saturate(1.3) contrast(1.1); }
.bg-layer::after {
  background:
    linear-gradient(160deg, rgba(11, 6, 24, 0.82), rgba(60, 10, 70, 0.86)),
    radial-gradient(120% 80% at 50% 0%, transparent, rgba(11, 6, 24, 0.65));
}

/* --- Header / Footer --- */
.site-header,
.site-footer {
  position: relative;
  background: rgba(20, 9, 38, 0.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
.site-header { border-bottom: 1px solid var(--fun-line); animation: funDrop 0.7s cubic-bezier(.2,.7,.3,1) both; }
.site-footer { border-top: 1px solid var(--fun-line); }

/* --- Калькулятор в теме Розважальний --- */
.calculator-card {
  border: 1px solid var(--fun-line);
  background: linear-gradient(180deg, rgba(23, 15, 48, 0.7), rgba(12, 8, 28, 0.65));
  box-shadow: 0 24px 60px rgba(8, 4, 20, 0.55);
}
.calc-card-title { color: var(--fun-cyan); }
.calc-badge { background: var(--fun-pink); color: #fff; }
.calc-result-box {
  background: rgba(18, 10, 36, 0.7);
  border: 1px solid var(--fun-line);
}
.calc-result-sum { color: #facc15; }
.site-header::after,
.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--fun-pink), var(--fun-violet), var(--fun-cyan), var(--fun-pink));
  background-size: 300% 100%;
  animation: funFlow 6s linear infinite;
}
.site-header::after { bottom: -1px; }
.site-footer::before { top: -1px; }

.site-header .logo {
  height: 46px;
  filter: drop-shadow(0 0 12px rgba(255, 79, 195, 0.5));
  transition: transform 0.35s cubic-bezier(.2,.7,.3,1), filter 0.35s ease;
}
.site-header .logo:hover { transform: translateY(-2px) scale(1.05); filter: drop-shadow(0 0 18px rgba(55, 213, 255, 0.65)); }

/* --- Титульный блок --- */
.brand { animation: funRise 0.9s cubic-bezier(.2,.7,.3,1) 0.1s both; }
.site-title {
  background: linear-gradient(90deg, var(--fun-pink), var(--fun-violet), var(--fun-cyan), var(--fun-pink));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: -0.015em;
  animation: funFlow 8s linear infinite;
}
.brand::after {
  content: "";
  display: block;
  width: 0;
  height: 3px;
  margin: 1.1rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--fun-pink), var(--fun-cyan), transparent);
  box-shadow: 0 0 16px rgba(255, 79, 195, 0.6);
  animation: funRule 1.1s cubic-bezier(.2,.7,.3,1) 0.45s both;
}
.site-description { color: var(--fun-muted); font-size: 1.04rem; }

/* --- Контент: карточка со светящейся градиентной рамкой --- */
.content {
  position: relative;
  padding: 1.7rem 1.3rem;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(38, 16, 66, 0.72), rgba(22, 9, 42, 0.7)) padding-box,
    linear-gradient(130deg, var(--fun-pink), var(--fun-violet), var(--fun-cyan)) border-box;
  border: 1px solid transparent;
  box-shadow: 0 24px 60px rgba(5, 2, 12, 0.6), 0 0 40px rgba(139, 92, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: funRise 1s cubic-bezier(.2,.7,.3,1) 0.25s both;
}
.content h1, .content h2, .content h3 { color: #fff; margin-top: 1.6em; }
.content h2 {
  display: inline-block;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--fun-pink), var(--fun-cyan)) 1;
}
.content blockquote {
  margin: 1.4em 0;
  padding: 0.8rem 1.2rem;
  border-left: 3px solid var(--fun-pink);
  border-radius: 0 14px 14px 0;
  background: rgba(255, 79, 195, 0.09);
  color: #ffc7ee;
  font-style: italic;
}
.content ul li::marker { color: var(--fun-cyan); }
.content a {
  color: #ff9ae6;
  text-decoration: none;
  background: linear-gradient(90deg, var(--fun-pink), var(--fun-cyan)) 0 100% / 0 2px no-repeat;
  transition: background-size 0.35s ease, color 0.3s ease, text-shadow 0.3s ease;
}
.content a:hover { color: #fff; background-size: 100% 2px; text-shadow: 0 0 12px rgba(255, 79, 195, 0.7); }
.content img {
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(5, 2, 12, 0.6), 0 0 0 1px rgba(255, 79, 195, 0.25);
  transition: transform 0.5s cubic-bezier(.2,.7,.3,1), box-shadow 0.4s ease;
}
.content img:hover { transform: scale(1.02); box-shadow: 0 22px 52px rgba(5, 2, 12, 0.7), 0 0 26px rgba(139, 92, 255, 0.4); }

/* --- Кнопки контактов: неоновая заливка с бегущим блеском --- */
.contact-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(120deg, var(--fun-pink), var(--fun-violet), var(--fun-cyan));
  background-size: 220% 100%;
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(255, 79, 195, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.28s cubic-bezier(.2,.7,.3,1), box-shadow 0.3s ease, background-position 0.6s ease;
}
.contact-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.4) 50%, transparent 75%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}
.contact-btn:hover {
  transform: translateY(-3px) scale(1.02);
  background-position: 100% 50%;
  box-shadow: 0 16px 34px rgba(139, 92, 255, 0.45), 0 0 22px rgba(255, 79, 195, 0.4);
}
.contact-btn:hover::before { transform: translateX(120%); }
.contact-btn:active { transform: translateY(-1px) scale(1); }

.header-contacts .contact-btn {
  padding: 0.65rem 1.3rem;
  font-size: 0.92rem;
  background: rgba(255, 79, 195, 0.08);
  border-color: rgba(255, 79, 195, 0.55);
  color: #ffb1e6;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(255, 79, 195, 0.2);
}
.header-contacts .contact-btn:hover {
  background: rgba(255, 79, 195, 0.24);
  color: #fff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 28px rgba(255, 79, 195, 0.4), 0 0 16px rgba(139, 92, 255, 0.4);
}

.footer-contacts .contact-btn {
  padding: 0.75rem 1.6rem;
  font-size: 0.98rem;
  border-radius: 14px;
}
.footer-contacts .contact-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 16px 36px rgba(139, 92, 255, 0.5), 0 0 24px rgba(255, 79, 195, 0.45);
}

.bot-link .contact-btn {
  padding: 0.78rem 1.8rem;
  font-size: 1rem;
  font-weight: 700;
  animation: funGlow 3.2s ease-in-out infinite;
}

/* Вкладки fun */
.content-tab-btn {
  background: rgba(26, 17, 54, 0.7);
  color: #ffb1e6;
  border: 1px solid rgba(255, 79, 195, 0.35);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}
.content-tab-btn:hover {
  background: rgba(255, 79, 195, 0.2);
  color: #ffffff;
  border-color: var(--fun-pink);
  box-shadow: 0 4px 16px rgba(255, 79, 195, 0.35);
}
.content-tab-btn.active {
  background: linear-gradient(120deg, var(--fun-pink), var(--fun-violet));
  color: #ffffff;
  border-color: var(--fun-pink);
  box-shadow: 0 6px 20px rgba(255, 79, 195, 0.5), 0 0 16px rgba(139, 92, 255, 0.4);
}

/* --- Переключатель языка --- */
.lang-switch a {
  color: var(--fun-muted);
  transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.lang-switch a:hover { color: #fff; background: rgba(255, 79, 195, 0.15); }
.lang-switch a.active {
  color: #fff;
  background: linear-gradient(120deg, var(--fun-pink), var(--fun-violet));
  text-decoration: none;
  box-shadow: 0 0 14px rgba(255, 79, 195, 0.5);
}


@keyframes funLights {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-3%, -4%, 0) scale(1.12); }
}
@keyframes funGrid {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 64px 64px, 64px 64px; }
}
@keyframes funFlow {
  from { background-position: 0% 50%; }
  to   { background-position: 300% 50%; }
}
@keyframes funRise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
@keyframes funDrop {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes funRule {
  from { width: 0; opacity: 0; }
  to   { width: 110px; opacity: 1; }
}
@keyframes funGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(255, 79, 195, 0.3), 0 0 0 0 rgba(55, 213, 255, 0.4); }
  50%      { box-shadow: 0 8px 24px rgba(255, 79, 195, 0.3), 0 0 0 14px rgba(55, 213, 255, 0); }
}

@media (max-width: 560px) {
  .header-contacts .contact-btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
  }
  .footer-contacts .contact-btn {
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
  }
  .content-tab-btn {
    padding: 0.55rem 0.85rem;
    font-size: 0.86rem;
  }
  .content {
    padding: 1.25rem 0.95rem;
    border-radius: 16px;
  }
}

@media (min-width: 720px) {
  .content { padding: 2.5rem 2.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .site-header, .site-header::after, .site-footer::before,
  .site-title, .brand, .brand::after, .content, .bot-link .contact-btn {
    animation: none !important;
  }
  .brand::after { width: 110px; opacity: 1; }
}
