/* ===================== ROOT / VARIABLES — "PASTEL GLOW" PREMIUM THEME ===================== */
:root {
  --bg-deep: #ffe3f0;
  --bg-soft: #f3d9f7;
  --bg-panel: #fff6fb;
  --bg-card: #ffffff;
  --pink-strong: #e0489a;
  --pink-mid: #ef7fc0;
  --pink-soft: #f0b8dc;
  --pink-pale: #fbdcee;
  --lilac: #9a5fd9;
  --lilac-soft: #c9a3ee;
  --gold: #6a5fd9;
  --gold-soft: #b3a8f0;
  --live-red: #ff3b5c;
  --text-main: #35163c;
  --text-dim: #82577f;
  --border-soft: rgba(160, 60, 150, 0.2);
  --shadow-pink: rgba(160, 40, 120, 0.32);
  --btn-edge: #9c2d72;
  --btn-edge-gold: #423693;
  /* extra accents used to echo the original cheat-sheet page colors */
  --accent-green: #2fbf8f;
  --accent-navy: #3a2a55;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  background: linear-gradient(150deg, #ffeef8 0%, var(--bg-deep) 30%, var(--bg-soft) 65%, #ecd6f5 100%);
  color: var(--text-main);
  overflow-x: hidden;
  position: relative;
  letter-spacing: 0.1px;
}

h1, h2, h3 { font-family: 'Fraunces', serif; font-optical-sizing: auto; letter-spacing: -0.01em; }
a { text-decoration: none; color: inherit; }
ul { margin: 0; padding: 0; }

/* Decorative floating gift icons (TikTok gift assets, premium accent, transparent PNG) */
.gift-deco {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 12px 22px rgba(120,40,90,0.25));
}
.gift-deco img { width: 100%; display: block; }
@media (max-width: 720px) {
  .gift-deco { display: none; }
}

/* ===================== BACKGROUND GLOWS ===================== */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}
.bg-glow--one {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--pink-mid), transparent 70%);
  top: -150px; left: -150px;
  opacity: 0.5;
}
.bg-glow--two {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--lilac), transparent 70%);
  top: 30%; right: -250px;
  opacity: 0.35;
}
.bg-glow--three {
  width: 550px; height: 550px;
  background: radial-gradient(circle, var(--gold), transparent 70%);
  bottom: -200px; left: 20%;
  opacity: 0.22;
}

/* ===================== FLOATING HEARTS ===================== */
.hearts-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.floating-heart {
  position: absolute;
  bottom: -40px;
  color: var(--pink-strong);
  opacity: 0;
  animation: floatHeart 7s linear infinite;
  font-size: 1.1rem;
}
.floating-heart:nth-child(1) { left: 6%; animation-delay: 0s; color: #e0489a; }
.floating-heart:nth-child(2) { left: 18%; animation-delay: 1.4s; color: #6a5fd9; font-size: 0.9rem; }
.floating-heart:nth-child(3) { left: 32%; animation-delay: 2.6s; color: #9a5fd9; }
.floating-heart:nth-child(4) { left: 48%; animation-delay: 0.8s; color: #ef7fc0; font-size: 1.3rem; }
.floating-heart:nth-child(5) { left: 63%; animation-delay: 3.2s; color: #e0489a; font-size: 0.85rem; }
.floating-heart:nth-child(6) { left: 78%; animation-delay: 1.9s; color: #6a5fd9; }
.floating-heart:nth-child(7) { left: 90%; animation-delay: 4s; color: #9a5fd9; font-size: 1.2rem; }

@keyframes floatHeart {
  0% { transform: translateY(0) scale(0.8) rotate(0deg); opacity: 0; }
  10% { opacity: 0.85; }
  50% { transform: translateY(-55vh) scale(1.1) rotate(8deg); opacity: 0.7; }
  100% { transform: translateY(-105vh) scale(0.9) rotate(-6deg); opacity: 0; }
}

/* ===================== HEADER ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(255, 246, 250, 0.75);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  color: var(--text-main);
}
.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pink-strong), var(--lilac));
  color: #fff;
  font-size: 0.95rem;
  box-shadow: 0 6px 16px var(--shadow-pink);
}
.brand-icon.small { width: 28px; height: 28px; font-size: 0.8rem; }
.brand-accent { color: var(--pink-strong); margin-left: 4px; }
.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-dim);
}
.main-nav a { transition: color 0.2s; }
.main-nav a:hover { color: var(--pink-strong); }
.main-nav a.is-current { color: var(--pink-strong); }

/* Mobile hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: #fff;
  color: var(--text-main);
  font-size: 1rem;
  cursor: pointer;
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    background: #fff6fb;
    border-bottom: 1px solid var(--border-soft);
    padding: 18px 24px 22px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
    box-shadow: 0 14px 24px rgba(160,40,120,0.14);
  }
  .main-nav.is-open {
    max-height: 320px;
    opacity: 1;
  }
  .header-inner { position: relative; }
}

/* ===================== HERO ===================== */
.hero {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px 20px;
  text-align: center;
  overflow: visible;
}
.hero-mascot--tikki-cheatsheet {
  position: absolute;
  width: 190px;
  top: 10px;
  right: -30px;
  pointer-events: none;
  filter: drop-shadow(0 16px 30px rgba(160,40,120,0.24));
  animation: heroMascotFloatCheat 4.2s ease-in-out infinite;
}
@keyframes heroMascotFloatCheat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@media (max-width: 900px) {
  .hero-mascot--tikki-cheatsheet { width: 140px; right: 0; top: -10px; }
}
@media (max-width: 640px) {
  .hero-mascot--tikki-cheatsheet { display: none; }
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b8306e;
  background: rgba(224, 72, 154, 0.12);
  border: 1px solid rgba(224, 72, 154, 0.3);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 22px;
}
.hero-title {
  font-size: clamp(2rem, 4.6vw, 3rem);
  line-height: 1.18;
  margin: 0 0 14px;
  font-weight: 700;
  color: var(--text-main);
}
.text-gradient {
  background: linear-gradient(90deg, var(--pink-strong), var(--pink-mid), var(--lilac));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-desc {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 640px;
  margin: 0 auto 26px;
}

/* Author credit badge */
.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #fff, var(--pink-pale));
  border: 1.5px solid var(--pink-soft);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 10px 24px rgba(197,60,122,0.16);
}
.credit-badge i { color: var(--pink-strong); }
.credit-badge a { color: var(--pink-strong); font-weight: 800; }
.credit-badge a:hover { text-decoration: underline; }

/* ===================== SEARCH ===================== */
.search-wrap {
  max-width: 560px;
  margin: 30px auto 0;
  position: relative;
}
.search-wrap i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pink-strong);
}
#topic-search {
  width: 100%;
  padding: 14px 20px 14px 46px;
  border-radius: 999px;
  border: 1.5px solid var(--border-soft);
  font-family: 'Manrope', sans-serif;
  font-size: 0.98rem;
  color: var(--text-main);
  background: #fff;
  box-shadow: 0 10px 26px rgba(160,40,120,0.12);
  transition: border-color 0.2s, box-shadow 0.2s;
}
#topic-search:focus {
  outline: none;
  border-color: var(--pink-strong);
  box-shadow: 0 0 0 3px rgba(224,72,154,0.18);
}
#search-empty {
  text-align: center;
  color: var(--text-dim);
  margin-top: 18px;
  font-size: 0.95rem;
}

/* ===================== TOPICS SECTION ===================== */
.topics-section {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 90px;
}
.topics-grid {
  display: grid;
  gap: 16px;
}

/* ===================== TOPIC CARD (accordion) ===================== */
.topic-card {
  background: linear-gradient(180deg, #ffffff, #fffaFD);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 6px 18px rgba(197,60,122,0.08);
}
.topic-card:hover {
  border-color: var(--pink-mid);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 12px 28px rgba(197,60,122,0.18);
  transform: translateY(-2px);
}
.topic-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text-main);
  font-family: inherit;
}
.topic-num {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.1rem;
  min-width: 32px;
  opacity: 0.9;
}
.topic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(160,40,120,0.22);
}
.topic-titles { flex: 1; min-width: 0; }
.topic-title-ru {
  font-size: 1.02rem;
  font-weight: 800;
  display: block;
}
.topic-title-en {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}
.topic-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--pink-pale);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
}
.topic-toggle {
  color: var(--text-dim);
  transition: transform 0.25s ease;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.topic-head[aria-expanded="true"] .topic-toggle {
  transform: rotate(180deg);
  color: var(--pink-strong);
}
.topic-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.topic-body-inner {
  padding: 4px 22px 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Individual phrase item */
.phrase-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px 16px;
}
.phrase-en {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--text-main);
  margin: 0 0 6px;
}
.phrase-ph {
  font-style: italic;
  font-size: 0.86rem;
  color: var(--pink-strong);
  margin: 0 0 4px;
}
.phrase-ru {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin: 0;
}

/* One-glance battle table variant: stage label chip */
.phrase-item .phrase-stage {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  background: var(--live-red);
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}

/* Missing / placeholder topic card */
.topic-card.is-placeholder {
  opacity: 0.65;
}
.topic-card.is-placeholder .topic-head { cursor: default; }
.topic-placeholder-note {
  margin: 0 22px 20px;
  padding: 14px 16px;
  border: 1.5px dashed var(--gold);
  border-radius: 12px;
  background: rgba(106,95,217,0.1);
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ===================== FOOTER ===================== */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border-soft);
  padding: 28px 24px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.88rem;
}
.footer-credit a { color: var(--pink-strong); font-weight: 700; }
.footer-credit a:hover { text-decoration: underline; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
  .header-inner { padding: 12px 16px; }
  .brand-text { font-size: 0.95rem; }
  .main-nav { gap: 10px; font-size: 0.76rem; }
  .hero { padding: 40px 16px 14px; }
  .topics-section { padding: 30px 16px 60px; }
  .topic-head { padding: 14px 16px; gap: 10px; }
  .topic-title-ru { font-size: 0.92rem; }
  .topic-title-en { font-size: 0.74rem; }
  .topic-body-inner { grid-template-columns: 1fr; padding: 4px 16px 18px; }
  .topic-count { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
}
