/* пёсу.рф - Pess & Chika fan site (enhanced) */

/* ===== prefers-reduced-motion: respect user preference ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Disable expensive ambient animations entirely */
  .sparkle-rain, .virtual-pess, .virtual-pet, .day-night-cycle { display: none !important; }
}

:root {
  --pink: #FFC9DE;
  --mint: #B5E8E0;
  --vanilla: #FFF9C4;
  --lavender: #D4C1FF;
  --coral: #FFABAB;
  --text-dark: #5D576B;
  --text-soft: #8A7F8D;
  --button: #FF6B8B;
  --hover: #4ECDC4;
  --bg: #FFF9F5;
  --card: #FFFFFF;
  /* Shuchiin Academy palette */
  --shuchiin-blue: #1a3a5c;
  --shuchiin-gold: #d4af37;
  --shuchiin-white: #ffffff;
}

[data-theme="dark"] {
  --pink: #8B4A6B;
  --mint: #4A8B82;
  --vanilla: #5D5A3E;
  --lavender: #6B5A8B;
  --coral: #8B5A5A;
  --text-dark: #F0E8F0;
  --text-soft: #C4BFC9;
  --button: #FF6B8B;
  --hover: #4ECDC4;
  --bg: #2D2436;
  --card: #3D3548;
  --shuchiin-blue: #0E1F3A;
  --shuchiin-gold: #d4af37;
  --shuchiin-white: #2D2436;
}

/* Day/night cycle palettes — applied via [data-cycle] on <html> */
[data-cycle="morning"] { --bg: #FFF9F5; --card: #FFFFFF; --pink: #FFD4E2; }
[data-cycle="noon"] { --bg: #FFFAEC; --card: #FFFFFF; --pink: #FFC9DE; }
[data-cycle="evening"] { --bg: #FFE9DD; --card: #FFF6F0; --pink: #FFB8C9; --lavender: #D8B8FF; }
[data-cycle="night"] { --bg: #1F1A2D; --card: #2D2540; --text-dark:#F0E8F0; --pink:#9B6088; }

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

body {
  font-family: 'Nunito', 'Arial Rounded MT Bold', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.8s ease, color 0.8s ease;
}

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--text-dark);
}

/* Background decorative paw-print pattern (CSS-only, very subtle) */
body::before {
  content: '';
  position: fixed;
  top: -100px; left: -100px;
  width: 400px; height: 400px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,201,222,0.5) 0%, transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(212,193,255,0.35) 0%, transparent 60%);
  border-radius: 50%;
  opacity: 0.4;
  z-index: -2;
  animation: blobFloat 20s infinite ease-in-out;
}

body::after {
  content: '';
  position: fixed;
  bottom: -100px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--mint) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0.4;
  z-index: -2;
  animation: blobFloat 25s infinite ease-in-out reverse;
}

/* Subtle paw-print background pattern (SVG dataURI) */
.paw-pattern {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><g fill='%23FFC9DE' opacity='0.13'><ellipse cx='40' cy='52' rx='10' ry='8'/><ellipse cx='25' cy='38' rx='5' ry='6'/><ellipse cx='32' cy='30' rx='4' ry='5'/><ellipse cx='48' cy='30' rx='4' ry='5'/><ellipse cx='55' cy='38' rx='5' ry='6'/></g></svg>");
}

/* Falling sparkles (decoration container) */
.sparkle-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.sparkle-rain span {
  position: absolute;
  top: -20px;
  font-size: 14px;
  opacity: 0;
  animation: sparkleFall linear infinite;
}
@keyframes sparkleFall {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  10% { opacity: 0.7; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 30px) scale(1.1); }
}

/* Nav */
nav {
  background: rgba(255, 249, 245, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(255, 107, 139, 0.1);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap;
}
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--button);
  text-decoration: none; font-weight: 700;
}
.nav-links {
  display: flex; gap: 1rem;
  list-style: none; flex-wrap: wrap;
}
.nav-links a {
  color: var(--text-dark);
  text-decoration: none; font-weight: 600;
  padding: 0.5rem 0.95rem; border-radius: 20px;
  transition: all 0.3s; font-size: 0.95rem;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--pink);
  color: var(--text-dark);
  transform: translateY(-2px);
}

.theme-toggle {
  background: var(--lavender);
  border: none; width: 40px; height: 40px;
  border-radius: 50%; cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.3s;
}
.theme-toggle:hover { transform: rotate(180deg); }

/* Hero */
.hero {
  min-height: 80vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; text-align: center; position: relative;
}
.hero-content { max-width: 900px; animation: bounceIn 1s ease-out; }
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.5) translateY(50px); }
  60% { opacity: 1; transform: scale(1.05) translateY(-10px); }
  100% { transform: scale(1) translateY(0); }
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--button), var(--lavender), var(--mint));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.hero p { font-size: 1.25rem; color: var(--text-soft); margin-bottom: 1.5rem; }
.hero-tagline-long {
  font-size: 1.05rem; max-width: 700px; margin: 1rem auto 1.5rem; color: var(--text-soft);
}
.hero-characters { display: flex; justify-content: center; gap: 2rem; margin: 1.5rem 0; flex-wrap: wrap; }
.hero-composite { margin: 1rem auto; max-width: 600px; }
.character-svg {
  width: 200px; height: 200px;
  cursor: pointer;
  transition: transform 0.3s;
  position: relative;
}
.character-svg:hover { transform: translateY(-10px) scale(1.05); }

.btn {
  background: var(--button);
  color: white; border: none;
  padding: 0.9rem 2rem;
  border-radius: 30px;
  font-size: 1.05rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
  display: inline-block;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(255, 107, 139, 0.4);
  margin: 0.3rem;
}
.btn:hover {
  background: var(--hover); transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.5);
}
.btn-outline {
  background: transparent; color: var(--button);
  border: 2px solid var(--button);
  box-shadow: none;
}
.btn-outline:hover { background: var(--button); color: white; }

/* Did-you-know carousel */
.dyk-carousel {
  max-width: 800px; margin: 2rem auto;
  background: linear-gradient(135deg, var(--vanilla), var(--pink));
  border-radius: 25px; padding: 2rem;
  text-align: center; min-height: 140px;
  box-shadow: 0 8px 25px rgba(255, 107, 139, 0.18);
  position: relative; overflow: hidden;
}
.dyk-label { color: var(--button); font-weight: 700; letter-spacing: 1px; font-size: 0.9rem; }
.dyk-text { font-size: 1.15rem; margin-top: 0.5rem; line-height: 1.5; color: var(--text-dark); transition: opacity 0.5s; }
.dyk-dots { display: flex; justify-content: center; gap: 6px; margin-top: 1rem; }
.dyk-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.6); cursor: pointer; transition: all 0.3s; }
.dyk-dot.active { background: var(--button); transform: scale(1.4); }

/* Sections */
section.content { max-width: 1200px; margin: 3rem auto; padding: 0 2rem; }
section.content h2 {
  text-align: center;
  font-size: 2.4rem; margin-bottom: 1.5rem;
  position: relative;
}
section.content h2::after {
  content: '';
  display: block; width: 80px; height: 4px;
  background: linear-gradient(90deg, var(--button), var(--hover));
  margin: 1rem auto; border-radius: 2px;
}
.lead { text-align: center; color: var(--text-soft); font-size: 1.1rem; max-width: 700px; margin: 0 auto 2rem; }

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem; margin: 2rem 0;
}
.card {
  background: var(--card);
  border-radius: 20px;
  padding: 1.5rem; text-align: center;
  box-shadow: 0 4px 20px rgba(255, 107, 139, 0.15);
  transition: all 0.3s;
  border: 2px solid transparent;
  opacity: 0; transform: translateY(20px);
  animation: cardFadeIn 0.6s forwards;
}
@keyframes cardFadeIn { to { opacity: 1; transform: translateY(0); } }
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:hover {
  transform: translateY(-10px);
  border-color: var(--pink);
  box-shadow: 0 10px 30px rgba(255, 107, 139, 0.25);
}
.card-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.card h3 { margin-bottom: 0.5rem; color: var(--button); }

/* Feature cards (with link) */
.feature-card {
  display: flex; flex-direction: column; gap: 0.5rem;
  align-items: center;
}
.feature-card a {
  display: inline-block; margin-top: 0.7rem;
  color: var(--hover); font-weight: 700; text-decoration: none;
}
.feature-card a:hover { text-decoration: underline; }

/* Counter */
.counter-box {
  background: linear-gradient(135deg, var(--pink), var(--lavender));
  padding: 2rem; border-radius: 25px;
  text-align: center; margin: 2rem auto; max-width: 500px;
  box-shadow: 0 8px 25px rgba(255, 107, 139, 0.3);
}
.counter-number {
  font-size: 4rem; font-weight: 700;
  font-family: 'Playfair Display', serif;
  color: var(--text-dark);
  text-shadow: 2px 2px 4px rgba(255,255,255,0.5);
  display: block;
}
.counter-label { color: var(--text-dark); font-size: 1.2rem; margin-top: 0.5rem; }

/* Gallery */
.gallery-filters { display: flex; justify-content: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filter-btn {
  background: var(--card); color: var(--text-dark);
  border: 2px solid var(--pink);
  padding: 0.5rem 1.2rem; border-radius: 20px;
  cursor: pointer; font-weight: 600;
  transition: all 0.3s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--button); color: white; border-color: var(--button);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.gallery-item {
  background: var(--card); border-radius: 15px;
  overflow: hidden; cursor: pointer; transition: all 0.3s;
  position: relative;
}
.gallery-item:hover { transform: scale(1.03); box-shadow: 0 8px 20px rgba(255,107,139,0.3); }
.gallery-item .thumb {
  width: 100%; height: 200px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--vanilla), var(--mint));
}
.gallery-item .thumb svg { width: 90%; height: 90%; }
.gallery-item .meta {
  padding: 0.7rem;
  display: flex; justify-content: space-between; align-items: center;
}
.gallery-item .caption {
  display:block; font-size: 0.78rem; color: var(--text-soft); padding: 0 0.7rem 0.6rem;
}

.like-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; transition: transform 0.2s;
}
.like-btn:hover { transform: scale(1.3); }
.like-btn.liked { color: var(--coral); }

/* Lightbox */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.85); z-index: 1000;
  align-items: center; justify-content: center; cursor: pointer;
  padding: 2rem;
}
.lightbox.active { display: flex; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-content {
  background: var(--card); border-radius: 20px;
  padding: 2rem; max-width: 600px; max-height: 90vh;
  overflow: auto; text-align: center;
}
.lightbox-content svg { width: 100%; max-width: 400px; }

/* Timeline */
.timeline { position: relative; max-width: 900px; margin: 3rem auto; padding: 0 1rem; }
.timeline::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--button), var(--lavender), var(--mint));
  transform: translateX(-50%); border-radius: 2px;
}
.timeline-item {
  position: relative; margin: 2rem 0; padding: 1.4rem;
  background: var(--card); border-radius: 15px;
  box-shadow: 0 4px 15px rgba(255,107,139,0.15);
  width: 45%; opacity: 0; transform: translateY(30px);
  transition: all 0.6s;
}
.timeline-item.visible { opacity: 1; transform: translateY(0); }
.timeline-item:nth-child(odd) { margin-left: 0; }
.timeline-item:nth-child(even) { margin-left: 55%; }
.timeline-item::before {
  content: '🐾'; position: absolute;
  width: 40px; height: 40px;
  background: var(--pink); border-radius: 50%;
  top: 1rem; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; border: 3px solid var(--card);
}
.timeline-item:nth-child(odd)::before { right: -75px; }
.timeline-item:nth-child(even)::before { left: -75px; }
.timeline-item .episode { color: var(--button); font-weight: 700; font-size: 0.9rem; }
.timeline-item h3 { margin: 0.3rem 0; }

@media (max-width: 700px) {
  .timeline::before { left: 20px; }
  .timeline-item, .timeline-item:nth-child(even), .timeline-item:nth-child(odd) {
    width: calc(100% - 50px); margin-left: 50px;
  }
  .timeline-item::before, .timeline-item:nth-child(odd)::before, .timeline-item:nth-child(even)::before {
    left: -45px; right: auto;
  }
}

/* Games */
.game-area {
  background: var(--card); border-radius: 20px;
  padding: 2rem; margin: 1.5rem 0;
  box-shadow: 0 4px 20px rgba(255,107,139,0.15);
}
.feed-game {
  position: relative; height: 300px;
  background: linear-gradient(180deg, var(--vanilla), var(--mint));
  border-radius: 15px; overflow: hidden;
  cursor: pointer; user-select: none;
}
.pess-feed {
  position: absolute; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  font-size: 4rem; transition: transform 0.2s;
}
.food-drop { position: absolute; font-size: 2rem; pointer-events: none; }
.score-display {
  display: flex; justify-content: space-around;
  font-size: 1.1rem; font-weight: 700;
  color: var(--button); margin-top: 1rem; flex-wrap: wrap; gap: 0.5rem;
}

.quiz-question { font-size: 1.2rem; margin-bottom: 1rem; font-weight: 700; }
.quiz-options { display: grid; gap: 0.5rem; }
.quiz-option {
  background: var(--vanilla);
  border: 2px solid transparent;
  padding: 0.8rem; border-radius: 10px;
  cursor: pointer; text-align: left; font-size: 1rem;
  transition: all 0.3s;
}
.quiz-option:hover { border-color: var(--button); transform: translateX(5px); }
.quiz-option.correct { background: var(--mint); border-color: var(--hover); }
.quiz-option.wrong { background: var(--coral); border-color: #ff5555; }

.meme-canvas {
  width: 100%; max-width: 400px; height: 300px;
  background: var(--vanilla); border-radius: 15px;
  position: relative; margin: 1rem auto;
  display: flex; align-items: center; justify-content: center;
  border: 3px dashed var(--pink);
}
.meme-text {
  position: absolute;
  font-family: Impact, sans-serif;
  text-transform: uppercase; color: white;
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000;
  text-align: center; width: 90%; font-size: 1.4rem;
}
.meme-text.top { top: 10px; left: 5%; }
.meme-text.bottom { bottom: 10px; left: 5%; }

input[type="text"], textarea {
  width: 100%; padding: 0.7rem;
  border: 2px solid var(--pink); border-radius: 10px;
  font-size: 1rem; font-family: inherit;
  background: var(--bg); color: var(--text-dark);
  margin: 0.5rem 0;
}
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--button); }

/* Rhythm game */
.rhythm-game {
  position: relative; height: 320px;
  background: linear-gradient(180deg, var(--lavender), var(--pink));
  border-radius: 15px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
}
.rhythm-track { display: flex; gap: 16px; margin-top: 16px; }
.rhythm-key {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700;
  color: var(--button);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: all 0.1s;
  user-select: none;
}
.rhythm-key.active { background: var(--button); color: white; transform: scale(0.92); }
.rhythm-key.hit { background: var(--mint); color: white; transform: scale(1.05); }
.rhythm-falling-row {
  display: flex; gap: 16px; position: absolute; top: 0;
  animation: rhythmFall 1.4s linear forwards;
}
.rhythm-falling-row .note {
  width: 64px; height: 30px; border-radius: 8px;
  background: var(--vanilla);
}
.rhythm-falling-row .note.active { background: var(--coral); }
@keyframes rhythmFall {
  from { transform: translateY(0); }
  to { transform: translateY(280px); }
}
.rhythm-info {
  position: absolute; top: 6px; right: 12px;
  background: rgba(255,255,255,0.7); padding: 4px 12px;
  border-radius: 12px; font-weight: 700; color: var(--button);
  font-size: 0.95rem;
}
.dancing-mascot {
  position: absolute; bottom: 8px; left: 12px;
  font-size: 3.2rem; animation: dance 0.5s infinite alternate;
}

/* Footer */
footer {
  background: linear-gradient(135deg, var(--lavender), var(--pink));
  padding: 2rem; text-align: center;
  color: var(--text-dark); margin-top: 3rem;
}
footer .small { font-size: 0.85rem; color: var(--text-soft); margin-top: 0.5rem; max-width: 800px; margin-left: auto; margin-right: auto; }

.marquee {
  background: var(--button); color: white;
  padding: 0.5rem; overflow: hidden; white-space: nowrap;
  font-weight: 700; margin-bottom: 2rem;
}
.marquee-content { display: inline-block; animation: scroll 18s linear infinite; padding-left: 100%; }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

.heart-rain {
  position: absolute; pointer-events: none;
  animation: floatUp 1.5s ease-out forwards; font-size: 1.5rem;
}
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(0); }
  50% { opacity: 1; transform: translateY(-50px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-120px) scale(0.5); }
}

.confetti-piece {
  position: fixed; width: 10px; height: 10px;
  pointer-events: none;
  animation: confettiFall 3s linear forwards; z-index: 999;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Eye blink */
.eye { animation: blink 4s infinite; transform-origin: center; }
.eye:nth-of-type(2) { animation-delay: 0.1s; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }

/* Konami Chika dance */
.chika-dance-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(255,201,222,0.6);
  backdrop-filter: blur(5px);
  z-index: 9999; justify-content: center; align-items: center;
  cursor: pointer;
}
.chika-dance-overlay.active { display: flex; animation: fadeIn 0.5s; }
.dancing-chika { font-size: 8rem; animation: dance 0.5s infinite alternate ease-in-out; }
@keyframes dance {
  0% { transform: rotate(-15deg) translateY(0) scale(1); }
  50% { transform: rotate(0deg) translateY(-30px) scale(1.1); }
  100% { transform: rotate(15deg) translateY(0) scale(1); }
}
.dance-message {
  position: absolute; bottom: 20%;
  font-family: 'Playfair Display', serif;
  font-size: 2rem; color: var(--button);
  background: white; padding: 1rem 2rem;
  border-radius: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Tail cursor follower */
.pess-tail {
  position: fixed; width: 30px; height: 30px;
  pointer-events: none; z-index: 999;
  transition: transform 0.15s ease-out;
  font-size: 1.5rem; display: none;
}
.pess-tail.active { display: block; }

/* Virtual pet (small Pess in corner) */
.virtual-pet {
  position: fixed; bottom: 20px; left: 16px;
  width: 80px; height: 80px;
  z-index: 998;
  cursor: pointer;
  transition: transform 0.2s;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.18));
}
.virtual-pet:hover { transform: scale(1.1); }
.virtual-pet svg { width: 100%; height: 100%; }
#pess-mini-tail {
  transform-origin: 60px 56px;
  transition: transform 0.1s;
}

/* Achievement chip */
.achievement-toast {
  position: fixed; right: 16px; top: 80px; z-index: 1500;
  background: linear-gradient(135deg, var(--shuchiin-gold), #ffd566);
  color: var(--shuchiin-blue);
  padding: 0.8rem 1.2rem; border-radius: 14px;
  font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(.2,.9,.3,1.4);
  max-width: 280px;
}
.achievement-toast.show { transform: translateX(0); }
.achievement-toast .label { font-size: 0.7rem; letter-spacing: 1px; opacity: 0.7; }
.achievement-toast .name { font-size: 1.05rem; }

.badges-floating {
  position: fixed; right: 16px; bottom: 16px; z-index: 997;
  background: var(--card); border-radius: 14px;
  padding: 8px 12px; display: flex; gap: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  max-width: 220px; flex-wrap: wrap;
}
.badges-floating .b { font-size: 1.2rem; cursor: help; }

/* Quotes page */
.quote-card {
  background: var(--card); border-radius: 16px;
  padding: 1.4rem; margin: 1rem 0;
  box-shadow: 0 4px 12px rgba(255,107,139,0.12);
  border-left: 5px solid var(--button);
  transition: all 0.3s;
}
.quote-card:hover { transform: translateX(8px); box-shadow: 0 6px 18px rgba(255,107,139,0.2); }
.quote-jp { color: var(--shuchiin-blue); font-size: 1.05rem; font-weight: 600; }
.quote-ru { color: var(--text-dark); font-size: 1.1rem; margin-top: 0.4rem; font-style: italic; }
.quote-context { color: var(--text-soft); font-size: 0.85rem; margin-top: 0.5rem; }
.quote-actions { margin-top: 0.7rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn-tts {
  background: var(--mint); color: var(--text-dark);
  border: none; padding: 0.4rem 0.9rem; border-radius: 18px;
  cursor: pointer; font-weight: 600; font-size: 0.9rem;
}
.btn-tts:hover { background: var(--hover); color: white; }

/* Character relationship diagram (SVG) */
.diagram-wrap { background: var(--card); border-radius: 18px; padding: 1.2rem; box-shadow: 0 4px 16px rgba(0,0,0,0.08); margin: 1.5rem 0; overflow-x: auto; }
.diagram-wrap svg { display:block; margin:0 auto; max-width: 100%; height: auto; }

.character-card {
  background: var(--card); border-radius: 16px;
  padding: 1.2rem; box-shadow: 0 4px 16px rgba(255,107,139,0.12);
  display: flex; gap: 1rem; align-items: flex-start;
  transition: all 0.3s;
}
.character-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(255,107,139,0.2); }
.character-card .avatar { flex: 0 0 100px; }
.character-card .avatar svg { width: 100px; height: 100px; }
.character-card .info { flex: 1; }
.character-card h3 { color: var(--button); margin-bottom: 0.3rem; }
.character-card .role { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 0.4rem; }
.character-card .traits { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.character-card .traits span {
  background: var(--vanilla); color: var(--text-dark);
  padding: 0.18rem 0.6rem; border-radius: 10px; font-size: 0.78rem;
}

/* Trivia / badges page */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; margin-top: 2rem; }
.badge {
  background: var(--card); border-radius: 14px;
  padding: 1rem 0.8rem; text-align: center;
  box-shadow: 0 4px 10px rgba(255,107,139,0.1);
  position: relative; opacity: 0.4; transition: all 0.3s;
}
.badge.earned { opacity: 1; box-shadow: 0 6px 20px rgba(212,175,55,0.4); border: 2px solid var(--shuchiin-gold); }
.badge .b-icon { font-size: 2.5rem; margin-bottom: 0.3rem; }
.badge .b-name { font-weight: 700; font-size: 0.9rem; }
.badge .b-desc { font-size: 0.78rem; color: var(--text-soft); margin-top: 0.3rem; }

/* Mobile */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .character-svg { width: 140px; height: 140px; }
  nav { padding: 0.8rem 1rem; }
  .nav-links { gap: 0.4rem; font-size: 0.85rem; }
  .nav-links a { padding: 0.3rem 0.55rem; }
  section.content { padding: 0 1rem; }
  section.content h2 { font-size: 1.7rem; }
  .counter-number { font-size: 2.5rem; }
  .dancing-chika { font-size: 5rem; }
  .character-card { flex-direction: column; align-items: center; text-align: center; }
  .virtual-pet { width: 60px; height: 60px; bottom: 10px; left: 10px; }
  .badges-floating { display: none; }
  .achievement-toast { right: 8px; left: 8px; max-width: none; }
}
