/* ====== KAWAII PASTEL THEME ====== */
:root {
  /* Kawaii color palette */
  --pastel-blue: #bde3ff;
  --pastel-pink: #ffd1ec;
  --pastel-mint: #cff6e6;
  --pastel-purple: #e6d1ff;
  --pastel-yellow: #fff3d1;
  --ink: #2b2b44;
  --ink-soft: #596286;
  --panel: #f8fcff;
  --panel-alt: #f1f8ff;
  --nav: #edf4ff;
  --accent: #6bc3ff;
  --accent-2: #a594f9;
  --border: #b7d7ff;
  --shadow: 0 2px 0 rgba(43, 43, 68, 0.15), 0 8px 24px rgba(43, 43, 68, 0.12);
  --gradient-bg: linear-gradient(
    135deg,
    #bde3ff 0%,
    #ffd1ec 25%,
    #cff6e6 50%,
    #e6d1ff 75%,
    #fff3d1 100%
  );
    --miku-sky: #bfeaff;
  --miku-mint: #ccfff5;
  --miku-pink: #ffd7ec;
  --miku-cream: #fffafc;
  --miku-ink: #103b53;
}


/* Global performance optimizations */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* Improve scroll performance */
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Nunito",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  background-attachment: fixed;
  color: var(--ink);
  image-rendering: pixelated !important;
  line-height: 1.6;
  /* Performance optimizations (avoid forcing new stacking context on body) */
  -webkit-font-smoothing: antialiased;
  background: url("../assets/root.png") center/cover no-repeat fixed;
  z-index: -3;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}



h2 {
  margin-bottom: 9px;
}

/* Root Background */
.root-bg {
  position: fixed;
  inset: 0;
  background: var(--gradient-bg);
  z-index: -2;
  animation: subtlePulse 20s ease-in-out infinite;
}

/* Splash screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 1s ease-in;
}

.splash-content {
  text-align: center;
  animation: bounceIn 1.5s ease-out;
  padding: 2rem;
}

.splash-miku {
  width: 200px;
  height: auto;
  margin-bottom: 20px;
  animation: float 4.5s ease-in-out infinite;
}

.glitch {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow:
    2px 2px 0 var(--pastel-pink),
    4px 4px 0 var(--pastel-mint);
  animation: glitch 2s infinite;
}

.typing-text {
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin: 20px 0;
  animation: typing 2s steps(30) infinite;
}

/* Hero Miku gentle loop */
.hero-miku {
  animation: float 6s ease-in-out infinite;
}

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

@keyframes subtleHeaderFloat {
  0%, 100% {
    transform: translateY(0px);
    filter: brightness(1);
  }
  25% {
    transform: translateY(-3px);
    filter: brightness(1.02);
  }
  50% {
    transform: translateY(-5px);
    filter: brightness(1.03);
  }
  75% {
    transform: translateY(-2px);
    filter: brightness(1.01);
  }
}

.enter-btn {
  background: linear-gradient(45deg, var(--pastel-blue), var(--pastel-pink));
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  /* transition: all 0.3s ease; */
  box-shadow: var(--shadow);
  
}


.enter-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 0 rgba(43, 43, 68, 0.2),
    0 12px 32px rgba(43, 43, 68, 0.15);
}


.hidden {
  visibility: hidden;
}

/* Typing × DIVA visuals */

/* Noscript fallback styles for MikuDex and shrine */
.noscript-dex {
  display: block;
}
.noscript-dex .dex-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}
.noscript-dex .dex-card {
  width: 120px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}
.noscript-dex .dex-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}
.noscript-dex .dex-name {
  margin-top: 8px;
  font-size: 0.9em;
  color: var(--ink);
}
.noscript-shrine-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

#typingDivaOverlay .typing-panel {
  position: relative;
}
.typing-highway {
  position: relative;
  height: 200px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(233, 238, 255, 0.7)
  );
  overflow: hidden;
}
.typing-hitbar {
  position: relative;
  margin-top: 6px;
  height: 22px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #596286;
  font-weight: 900;
}
.typing-note {
  position: absolute;
  left: 10px; /* x-offset grows with index via inline transform */
  top: 0;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #2b2b44;
  text-shadow: 0 1px 0 #fff;
  transition: transform 0.08s linear;
}
.typing-note.hit {
  color: #00a97f;
  filter: drop-shadow(0 0 6px rgba(0, 169, 127, 0.35));
}

/* Judge echo when using flashJudge with id 'typingHighway' */
#typingHighway + #typingHitbar[aria-live]::after {
  content: attr(data-judge);
}
#petIframe
{
  background-image: url("../assets/root.png");
}
/* Main site */
.main-site {
  animation: slideIn 0.8s ease-out;
}

#container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 35px;
  position: relative;
}

.hero-wrap {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: subtleHeaderFloat 8s ease-in-out infinite;
  /* No background here - let the pseudo-element handle it */
}

.hero-wrap::before {
  content: "";
  position: absolute;
  top: -300px; 
  left: 0;
  right: 0;
  bottom: -40px; /* Extend below to maintain coverage */
  background-image: url("../assets/pt_top.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
  animation: heroImageFloat 10s ease-in-out infinite;
}

.hero-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(189, 227, 255, 0.8), rgba(255, 209, 236, 0.7));
  z-index: 0;
  pointer-events: none;
  filter: saturate(1.1) brightness(1.05);
  backdrop-filter: blur(1px);
}

@keyframes heroImageFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  25% {
    transform: translateY(-5px);
  }
  50% {
    transform: translateY(-10px);
  }
  75% {
    transform: translateY(-3px);
  }
}

#header {
  height: 180px;
  border: 1px solid var(--border);
  background-position: center;
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  z-index: 1; /* Above gradient overlay */
}

.header-content {
  position: absolute;
  left: 30px;
  bottom: 20px;
  z-index: 2;
  z-index: 2;
}

#siteTitle {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
  margin: 0;
  animation: pulse 3s ease-in-out infinite;
}

#siteSub {
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 5px 0 0 0;
  font-style: italic;
}

.floating-mikus {
  position: absolute;
  top: 12px; /* lift a bit so they don't touch the title */
  right: 20px;
  pointer-events: none;
  z-index: 3; /* above header content */
}

.float-miku {
  width: 60px;
  height: auto;
  margin: 0 10px;
  animation: float 4s ease-in-out infinite;
  /* Performance optimizations */
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.float-miku:nth-child(2) {
  animation-delay: 2s;
}

@media (prefers-reduced-motion: reduce) {
  .float-miku {
    animation: none !important;
  }
  .blink {
    animation: none !important;
  }
}

/* Status bar with integrated navigation */

.status-bar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 2px solid var(--border);
  border-top: none;
  border-radius: 0 0 20px 20px;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  position: relative;
  padding: 20px;
  z-index: 1; /* Above gradient overlay */
}

.status-left {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.status-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 15px;
}

.status-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid rgba(183, 215, 255, 0.65);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(
    45deg,
    rgba(207, 246, 230, 0.32),
    rgba(189, 227, 255, 0.32)
  );
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backdrop-filter: blur(6px) saturate(115%);
  backdrop-filter: blur(6px) saturate(115%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.status-nav a span,
.status-nav a img {
  position: relative;
  z-index: 2;
}

.status-nav a:hover,
.status-nav a.active {
  background: linear-gradient(
    135deg,
    rgba(255, 209, 236, 0.36),
    rgba(230, 209, 255, 0.36)
  );
  transform: translateY(-3px) scale(1.02);
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  border-color: rgba(183, 215, 255, 0.85);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  backdrop-filter: blur(8px) saturate(130%);
}

/* Hover effects now rely on background/transform only (no overlays) */

.status-nav a:active {
  transform: translateY(-1px) scale(1.02);
  transition-duration: 0.1s;
}

/* Wish preview styles */
.Wish-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.preview-reel {
  width: 140px;
  height: 140px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: slotMachineGlow 2s ease-in-out infinite;
}
.preview-image {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  transition: transform 0.1s linear;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.6);
  padding: 6px 10px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(183, 215, 255, 0.6);
  font-weight: 600;
}


.blink {
  animation: blink 1s infinite;
  color: #ffbf00; /* amber by default */
}

.editable {
  background: transparent;
  border: none;
  outline: 2px dashed transparent;
  padding: 2px 5px;
  border-radius: 5px;
  font: inherit;
  color: inherit;
}

.editable:focus {
  outline-color: var(--pastel-pink);
  background: rgba(255, 245, 251, 0.8);
}

/* Layout */
#flex {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

aside {
  background: var(--panel-alt);
  width: 390px;
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow);
  height: fit-content;
}

main {
  background: var(--panel);
  flex: 1;
  padding: 25px;
  border: 2px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow);
  min-height: 600px;
  height: fit-content;
}

/* Make home section a flexible column so the guestbook can sit at the bottom */
#home.content-section.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#home.content-section.active .content-grid {
  /* Allow presentation area to grow/shrink without pushing other panels abruptly */
  flex: 1 1 auto;
}

.widget {
  margin-bottom: 25px;
  background: var(--panel);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 15px;
}

.widget h3 {
  margin: 0 0 15px 0;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 800;
}

/* Enhanced widget with sparkle animation */
.widget {
  position: relative;
  background: linear-gradient(135deg, 
    rgba(255, 182, 193, 0.15), 
    rgba(221, 160, 221, 0.15), 
    rgba(173, 216, 230, 0.15)
  );
  border: 2px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.widget-sparkle {
  animation: sparkleFloat 3s ease-in-out infinite;
}

@keyframes sparkleFloat {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
    opacity: 0.8;
  }
  50% { 
    transform: translateY(-4px) rotate(10deg); 
    opacity: 1;
  }
}
.link-container a {
  display: inline-block;
  background: linear-gradient(135deg, var(--pastel-purple), var(--pastel-pink));
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 15px;
  margin: 4px 0;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.link-container a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.link-container a:hover::before {
  left: 100%;
}

.link-container a:hover {
  background: linear-gradient(135deg, var(--pastel-mint), var(--pastel-blue));
  transform: translateY(-2px) scale(1.03);
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

/* Game-specific link styling */
.link-container a[href*="rpg"] {
  background: linear-gradient(135deg, #ffd1dc, #ffc1cc);
  border-color: #ffc1cc;
}

.link-container a[href*="rpg"]:hover {
  background: linear-gradient(135deg, #ffc1cc, #ffb1c1);
  box-shadow: 0 6px 16px rgba(255, 193, 204, 0.4);
}

.link-container a[href*="ttj2"],
.link-container a[href*="jetpack"] {
  background: linear-gradient(135deg, #bdefff, #a5d8f0);
  border-color: #a5d8f0;
}

.link-container a[href*="ttj2"]:hover,
.link-container a[href*="jetpack"]:hover {
  background: linear-gradient(135deg, #a5d8f0, #8ccae1);
  box-shadow: 0 6px 16px rgba(165, 216, 240, 0.4);
}
/* Content sections */
/* Wish floating text effect */
.Wish-float-text {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%) scale(1);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--float-color, #ff69b4);
  text-shadow:
    0 0 12px var(--float-color, #ff69b4),
    0 2px 8px #fff,
    0 0 24px var(--float-color, #ff69b4);
  pointer-events: none;
  opacity: 0.92;
  z-index: 10;
  animation: WishFloatUp 1.5s cubic-bezier(.19,1,.22,1) forwards;
}
.Wish-float-text.fade {
  opacity: 0;
  transition: opacity 0.5s ease;
}
@keyframes WishFloatUp {
  0% {
    transform: translateX(-50%) scale(1) translateY(0);
    opacity: 0.92;
  }
  60% {
    transform: translateX(-50%) scale(1.08) translateY(-32px);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(1.12) translateY(-64px);
    opacity: 0;
  }
}
.content-section {
  display: none;
  animation: fadeInUp 0.5s ease-out;
}

.content-section.active {
  display: block;
}

.hero-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px;
  background: linear-gradient(
    45deg,
    rgba(189, 227, 255, 0.3),
    rgba(255, 209, 236, 0.3)
  );
  border: 2px solid var(--border);
  border-radius: 15px;
}

.hero-miku {
  width: 125px;
  height: auto;
  animation: bounce 2s ease-in-out infinite;
}

.hero-text h2 {
  color: var(--ink);
  margin: 0 0 15px 0;
  font-size: 1.8rem;
}

.heart-btn {
  margin-top: 15px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.card h3 {
  color: var(--ink);
  margin: 0 0 15px 0;
}

/* Guestbook embed (kept outside the grid under presentation) */
.guestbook-card {
  background: var(--panel-alt);
  border: 2px solid var(--border);
}

.guestbook-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guestbook-container {
  background: var(--panel-alt);
  border: 2px dashed var(--border);
  border-radius: 12px;
  overflow: hidden;
  /* Cap height so presentation resizing above doesn’t cause large shifts */
  max-height: 700px;
}

.guestbook-frame {
  width: 100%;
  height: 680px;
  border: 0;
  display: block;
}

.guestbook-card { margin-top: 8px; }

.guestbook-note {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
}

@media (max-width: 768px) {
  .guestbook-frame {
    height: 600px;
  }
}

/* Quick links - fancy button style */
.quick-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-links li {
  margin: 0;
}

.quick-links a {
  display: block;
  background: linear-gradient(45deg, var(--pastel-mint), var(--pastel-blue));
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  text-align: center;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  font-size: 0.9rem;
}

.quick-links a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s ease;
}

.quick-links a:hover::before {
  left: 100%;
}

.quick-links a:hover {
  background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-purple));
  transform: translateY(-3px) scale(1.02);
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

/* Fancy vibes for specific link types */
/* duplicate quick-links block removed (original exists earlier) */

.quick-links a.link-discord {
  background: linear-gradient(135deg, #B8A9FF, #A696E8);
  color: #4A4A6A;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  border: 2px solid #A696E8;
  box-shadow: 0 4px 12px rgba(166, 150, 232, 0.3);
}

.quick-links a.link-discord:hover {
  background: linear-gradient(135deg, #A696E8, #9584DB);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(166, 150, 232, 0.4);
  color: #4A4A6A;
}

.quick-links a.link-youtube {
  background: linear-gradient(135deg, #FFABAB, #FF9999);
  color: #8B4444;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  border: 2px solid #FF9999;
  box-shadow: 0 3px 10px rgba(255, 153, 153, 0.3);
}

.quick-links a.link-youtube:hover {
  background: linear-gradient(135deg, #FF9999, #FF8888);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 16px rgba(255, 153, 153, 0.4);
  color: #8B4444;
}

.quick-links a.link-spotify {
  background: linear-gradient(135deg, #A8E6CF, #88D8A3);
  color: #2D5A3D;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  border: 2px solid #88D8A3;
  box-shadow: 0 3px 10px rgba(136, 216, 163, 0.3);
}

.quick-links a.link-spotify:hover {
  background: linear-gradient(135deg, #88D8A3, #7BCB96);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 16px rgba(136, 216, 163, 0.4);
  color: #2D5A3D;
}

.quick-links a.link-twitch {
  background: linear-gradient(135deg, #D4B5FF, #C7A6F7);
  color: #5D4E75;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  border: 2px solid #C7A6F7;
  box-shadow: 0 3px 10px rgba(199, 166, 247, 0.3);
}

.quick-links a.link-twitch:hover {
  background: linear-gradient(135deg, #C7A6F7, #B896E8);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 16px rgba(199, 166, 247, 0.4);
  color: #5D4E75;
}

.quick-links a.link-shop {
  background: linear-gradient(135deg, #FFD1DC, #FFC1CC);
  color: #8B5A6B;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  border: 2px solid #FFC1CC;
  box-shadow: 0 3px 10px rgba(255, 193, 204, 0.3);
}

.quick-links a.link-shop:hover {
  background: linear-gradient(135deg, #FFC1CC, #FFB1C1);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 16px rgba(255, 193, 204, 0.4);
  color: #8B5A6B;
}

.quick-links a.link-badge {
  background: linear-gradient(135deg, #F0E68C, #DDD26A);
  color: #6B6B2F;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  border: 2px solid #DDD26A;
  box-shadow: 0 3px 10px rgba(221, 210, 106, 0.3);
}

.quick-links a.link-badge:hover {
  background: linear-gradient(135deg, #DDD26A, #CCC157);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 16px rgba(221, 210, 106, 0.4);
  color: #6B6B2F;
}

.quick-links a.link-linktree {
  background: linear-gradient(135deg, #B8F2B8, #A8E6A8);
  color: #3D5A3D;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  border: 2px solid #A8E6A8;
  box-shadow: 0 3px 10px rgba(168, 230, 168, 0.3);
}

.quick-links a.link-linktree:hover {
  background: linear-gradient(135deg, #A8E6A8, #98D698);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 16px rgba(168, 230, 168, 0.4);
  color: #3D5A3D;
}

/* Pet frame */
.pet-frame {
  border: 2px solid var(--border);
  border-radius: 10px;
  background: white;
  width: 314px;
  height: 321px;
  display: block;
  margin: 0 auto;
}

/* Stats and badges */
.stats {
  text-align: center;
  padding: 8px;
}

.stat-item {
  margin: 10px 0;
}

/* Visitor counter badge specific styling */
.badge[alt*="friends:"],
a[data-visitor-counter] .badge {
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(189,227,255,0.4), 0 2px 6px rgba(255,209,236,0.3) !important;
  transition: all 0.3s ease !important;
  filter: saturate(1.1) !important;
  border: 2px solid rgba(189,227,255,0.3) !important;
}

.badge[alt*="friends:"]:hover,
a[data-visitor-counter] .badge:hover {
  transform: scale(1.05) translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(189,227,255,0.6), 0 4px 8px rgba(255,209,236,0.4) !important;
  filter: saturate(1.2) brightness(1.05) !important;
  border-color: rgba(189,227,255,0.6) !important;
}

/* Visitor counter fallback text styling */
.visitor-fallback {
  background: linear-gradient(135deg, var(--pastel-blue), var(--pastel-pink)) !important;
  border: 2px solid rgba(189,227,255,0.3) !important;
  color: var(--ink) !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8) !important;
  transition: all 0.3s ease !important;
}

.visitor-fallback:hover {
  transform: scale(1.05) translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(189,227,255,0.4) !important;
}

.badge {
  width: 88px;
  height: 31px;
  image-rendering: pixelated;
  margin: 2px;
  transition: transform 0.3s ease;
}

.badge:hover {
  transform: scale(1.1);
}

.our-own-badge {
  border-radius: 6px !important;
  box-shadow: 0 0 0 2px rgba(107, 195, 255, 0.3) !important;
  animation: gentle-glow 3s ease-in-out infinite;
}


.visitor-counter {
  background: linear-gradient(135deg, #FFE5F1, #E5F3FF, #F0E5FF);
  border: 2px dotted #D1A3E1;
  border-radius: 16px;
  padding: 12px 16px;
  margin: 8px 0;
  font-weight: 700;
  position: relative;
  box-shadow: 0 4px 12px rgba(209, 163, 225, 0.2);
  overflow: hidden;
}

/* When the visitor counter becomes an anchor with stats link */
.visitor-counter.has-stats-link {
  text-decoration: none;
  display: block;
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(.19,1,.22,1), box-shadow 0.35s ease, filter 0.35s ease;
  will-change: transform;
  color: inherit;
}

.visitor-counter.has-stats-link:hover,
.visitor-counter.has-stats-link:focus-visible {
  text-decoration: none;
  transform: rotate(-2deg) translateY(-3px);
  box-shadow: 0 10px 24px rgba(209,163,225,0.35), 0 4px 10px rgba(0,0,0,0.08);
  filter: brightness(1.03) saturate(1.05);
}

.visitor-counter.has-stats-link:active {
  transform: rotate(-1deg) translateY(-1px) scale(.985);
  box-shadow: 0 6px 16px rgba(209,163,225,0.28), 0 2px 6px rgba(0,0,0,0.08);
}

.visitor-counter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.4) 2px, transparent 2px),
    radial-gradient(circle at 75% 75%, rgba(255, 192, 203, 0.3) 1px, transparent 1px);
  background-size: 15px 15px, 20px 20px;
  animation: sparkleFloat 30s ease-in-out infinite;
  z-index: 1;
}

.visitor-counter .counter-label,
.visitor-counter .counter-number {
  position: relative;
  z-index: 2;
}

.counter-label {
  color: var(--ink-soft);
  font-size: 0.9em;
  margin-right: 1px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.counter-link {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
}

.counter-link:hover {
  color: var(--accent);
  background: rgba(124, 58, 237, 0.1);
  text-decoration: none;
  transform: translateY(-1px);
  text-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.counter-number {
  color: var(--ink-soft);
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1.1em;
  text-shadow: 0 2px 4px rgba(139, 90, 159, 0.3);
  animation: counterGlow 3s ease-in-out infinite alternate;
}

@keyframes sparkleFloat {
  0%, 100% { 
    background-position: 0% 0%, 100% 100%;
    opacity: 0.6;
  }
  50% { 
    background-position: 100% 100%, 0% 0%;
    opacity: 0.8;
  }
}

@keyframes counterGlow {
  0% { 
    text-shadow: 0 2px 4px rgba(139, 90, 159, 0.3);
  }
  100% { 
    text-shadow: 0 2px 8px rgba(209, 163, 225, 0.6), 0 0 12px rgba(255, 192, 203, 0.4);
  }
}

/* Socials grid */
.socials-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.social-item {
  background: linear-gradient(
    135deg,
    rgba(189, 227, 255, 0.4),
    rgba(255, 209, 236, 0.4),
    rgba(255, 255, 255, 0.2)
  );
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.social-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

.social-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--accent),
    var(--accent-2),
    var(--accent)
  );
  border-radius: 16px 16px 0 0;
}

.social-title {
  font-weight: 900;
  color: #2c5f84;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* When social-title is an anchor (clickable), style it like the stamp */
.social-title[href] {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.social-title[href]:focus {
  outline: 3px solid rgba(135,206,235,0.25);
  outline-offset: 4px;
}

.social-title .icon {
  
  font-size: 1.8rem;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.15))
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.8));
  transition: all 0.3s ease;
}

.social-title:hover .icon {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2))
    drop-shadow(0 2px 0 rgba(255, 255, 255, 0.9));
}

.social-embed {
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
}

/* Ensure embeds can host absolutely positioned overlay titles */
.social-embed {
  position: relative;
}

/* When the title is inside the embed, pin it to the top-right */
.social-embed .social-title {
  position: absolute;
  top: 12px;
  right: 12px;
  transform: translateY(0) rotate(-3deg);
  z-index: 20;
  margin: 0;
  pointer-events: auto;
}

/* Slightly reduce size when overlaid so it doesn't block content */
.social-embed .social-title { padding: 8px 12px; border-radius: 10px; }

.social-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
}

/* Miku character with sparkles (shop card) */
.miku-character {
  display: inline-block;
  position: relative;
  width: 96px;
  height: 96px;
  transform-origin: 50% 90%;
}
.miku-character .miku-standalone {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  }
.miku-character .miku-sparkles {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 18px;
  transform-origin: center;
  opacity: 0.85;
  pointer-events: none;
}
.miku-character .sparkle-2 { left: auto; right: 10px; top: 10px; font-size: 20px; }
.miku-character .sparkle-3 { left: 20px; top: auto; bottom: 6px; font-size: 16px; }

/* Hover: lift and slight rotate + make sparkles pop */
.miku-character:hover {
  transform: translateY(-6px) rotate(-4deg) scale(1.02);
}
.miku-character:hover .miku-standalone { transform: translateY(-4px); }
.miku-character:hover .miku-sparkles {
  transform: scale(1.35) translateY(-6px) rotate(-10deg);
  opacity: 1;
}
.miku-character:hover .sparkle-2 { transform: scale(1.5) translateY(-8px) rotate(12deg); }
.miku-character:hover .sparkle-3 { transform: scale(1.25) translateY(-4px) rotate(-8deg); }

/* Gentle idle animation for sparkles to keep things lively */
@keyframes sparkle-bob {
  0%,100% { transform: translateY(0) scale(1); opacity: .9; }
  50% { transform: translateY(-3px) scale(1.05); opacity: 1; }
  }
  .miku-character .miku-sparkles { animation: sparkle-bob 3s ease-in-out infinite; }
  .miku-character .sparkle-2 { animation-delay: 0.2s; }
  .miku-character .sparkle-3 { animation-delay: 0.6s; }

.embedded-player .social-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
  float: right;
}

/* Make Spring card span full width in the socials layout */
.socials-grid { 
  width: 100%;
  /* No grid-column needed since socials-grid uses flexbox */
}


/* Title vibe - Postage Stamp Style */
.social-title {
  background:
    linear-gradient(135deg, var(--miku-cream) 0%, #fff3f8 25%, var(--panel) 50%, #f0f8ff 75%, var(--miku-cream) 100%);
  background-size: 200% 200%;
  border: 3px solid #ff69b4;
  border-style: dashed;
  border-radius: 8px;
  padding: 12px 16px;
  position: relative;
  overflow: visible;
  animation: subtle-shimmer 8s ease-in-out infinite;
  box-shadow: 
    0 4px 12px rgba(57, 174, 239, 0.15),
    0 2px 6px rgba(255, 105, 180, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(0) rotate(-3deg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Postage stamp perforations */
  background-image: 
    /* Top perforations */
    radial-gradient(circle at 8px -2px, transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at 24px -2px, transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at 40px -2px, transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at 56px -2px, transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at 72px -2px, transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at 88px -2px, transparent 3px, var(--miku-cream) 3px),
    /* Bottom perforations */
    radial-gradient(circle at 8px calc(100% + 2px), transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at 24px calc(100% + 2px), transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at 40px calc(100% + 2px), transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at 56px calc(100% + 2px), transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at 72px calc(100% + 2px), transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at 88px calc(100% + 2px), transparent 3px, var(--miku-cream) 3px),
    /* Left perforations */
    radial-gradient(circle at -2px 8px, transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at -2px 24px, transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at -2px 40px, transparent 3px, var(--miku-cream) 3px),
    /* Right perforations */
    radial-gradient(circle at calc(100% + 2px) 8px, transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at calc(100% + 2px) 24px, transparent 3px, var(--miku-cream) 3px),
    radial-gradient(circle at calc(100% + 2px) 40px, transparent 3px, var(--miku-cream) 3px),
    /* Base gradient */
    linear-gradient(135deg, var(--miku-cream) 0%, #fff3f8 25%, var(--panel) 50%, #f0f8ff 75%, var(--miku-cream) 100%);
}

/* Postage stamp corner detail */
.social-title::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, #ff69b4 40%, transparent 50%);
  border-radius: 50%;
}

/* Hover effect for social-title */
.social-title:hover {
  transform: translateY(-2px) rotate(1deg);
  box-shadow: 
    0 8px 25px rgba(57, 174, 239, 0.25),
    0 4px 15px rgba(255, 105, 180, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation-play-state: paused;
  border-color: #87ceeb;
}

/* Shimmer animation for social-title */
@keyframes subtle-shimmer {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Text shimmer animation */
@keyframes subtle-text-shimmer {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Gentle pulse for icons */
@keyframes gentle-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}


/* Cute cloud/konpeito background around the iframe */
.pastel-miku .social-embed {
  position: relative;
  border-radius: 16px;
  padding: 12px;
  background:
    radial-gradient(24px 24px at 18% 22%, rgba(255,255,255,.85) 40%, transparent 41%),
    radial-gradient(18px 18px at 78% 36%, rgba(255,255,255,.8) 40%, transparent 41%),
    linear-gradient(180deg, var(--miku-sky), var(--miku-cream) 55%, var(--miku-pink));
  box-shadow:
    inset 0 0 0 2px #dff2ff,
    0 10px 28px rgba(143,219,255,.35),
    0 3px 10px rgba(255,207,231,.25);
}

/* Full-bleed, responsive widget */
.pastel-miku .spring-embed { 
  width: 100%;
  height: 450px;        
  overflow: hidden;         
}

.pastel-miku .spring-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  background: #f7fbff;
}

/* Optional: soften the icon a touch */
.social-title .icon { filter: drop-shadow(0 2px 0 rgba(0,0,0,.04)); }

.embedded-player h4 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  color: #495057;
}

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

.play-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.play-button:hover {
  transform: scale(1.05);
}

.player-info {
  flex: 1;
  min-width: 0;
}

.track-title {
  font-weight: 600;
  font-size: 14px;
  color: #212529;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist-name {
  font-size: 12px;
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-btn {
  width: 100%;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  display: block;
  text-align: center;
  transition: opacity 0.2s ease;
}

.player-btn:hover {
  opacity: 0.9;
}

/* Radio widget for sidebar */
.radio-widget .retro-radio {
  background: linear-gradient(145deg, #f0f2f5,  var(--pastel-purple),var(--pastel-yellow), #d8dde6);
  border: 3px solid #bcc4d1;
  border-radius: 20px;
  padding: 16px;
  box-shadow:
    inset 3px 3px 8px rgba(255, 255, 255, 0.7),
    inset -3px -3px 8px rgba(0, 0, 0, 0.15),
    0 8px 20px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  position: relative;
  overflow: hidden;
}

.radio-widget .retro-radio::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, 
    rgba(189, 227, 255, 0.1) 0%,
    rgba(255, 182, 193, 0.1) 50%,
    rgba(221, 160, 221, 0.1) 100%);
  border-radius: 17px;
  z-index: 1;
}

.radio-widget .retro-radio > * {
  position: relative;
  z-index: 2;
}

.radio-widget .radio-display {
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  color: #00ffd4;
  border: 3px solid #333;
  border-radius: 12px;
  padding: 12px 16px;
  font-family: "Courier New", "Monaco", "Lucida Console", monospace;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 
    inset 2px 2px 6px rgba(0, 0, 0, 0.8),
    inset -1px -1px 3px rgba(255, 255, 255, 0.1);
  text-shadow: 0 0 8px #00ffd4, 0 0 16px #00ffd4;
  position: relative;
  overflow: hidden;
}

.radio-widget .radio-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(0, 255, 212, 0.2) 50%, 
    transparent 100%);
  animation: scanline 3s ease-in-out infinite;
}

@keyframes scanline {
  0% { left: -100%; }
  100% { left: 100%; }
}

.radio-widget .eq-bars {
  display: flex;
  gap: 3px;
  align-items: end;
  height: 24px;
}

.radio-widget .bar {
  width: 4px;
  background: linear-gradient(180deg, #00ffd4 0%, #00cc88 100%);
  border-radius: 2px;
  animation: eq 1.2s ease-in-out infinite;
  animation-play-state: paused;
  box-shadow: 
    0 0 6px rgba(0, 255, 212, 0.6),
    inset 1px 1px 2px rgba(255, 255, 255, 0.3);
  position: relative;
}

.radio-widget .bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.4) 0%, 
    transparent 50%);
  border-radius: 2px;
}

.radio-widget .bar:nth-child(1) {
  height: 8px;
  animation-delay: 0s;
}
.radio-widget .bar:nth-child(2) {
  height: 16px;
  animation-delay: 0.3s;
}
.radio-widget .bar:nth-child(3) {
  height: 12px;
  animation-delay: 0.6s;
}
.radio-widget .bar:nth-child(4) {
  height: 20px;
  animation-delay: 0.9s;
}

.radio-widget .radio-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 4px;
}

/* Merged Site Stats + Badges styling */
#statsAndBadges .badges-subtitle {
  margin: 12px 0 8px;
  font-weight: 800;
  color: #2b2b44;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: lowercase;
}
/* Space badges nicely from stats block */
#statsAndBadges .badges-collection {
  margin-top: 6px;
}

/* Playing state enhancements */
.radio-widget.playing .bar {
  animation-play-state: running;
}

.radio-widget.playing .radio-display {
  animation: radioGlow 2s ease-in-out infinite alternate;
}

@keyframes radioGlow {
  0% {
    box-shadow: 
      inset 2px 2px 6px rgba(0, 0, 0, 0.8),
      inset -1px -1px 3px rgba(255, 255, 255, 0.1),
      0 0 16px rgba(0, 255, 212, 0.3);
    text-shadow: 0 0 8px #00ffd4, 0 0 16px #00ffd4;
  }
  100% {
    box-shadow: 
      inset 2px 2px 6px rgba(0, 0, 0, 0.8),
      inset -1px -1px 3px rgba(255, 255, 255, 0.1),
      0 0 24px rgba(0, 255, 212, 0.6);
    text-shadow: 0 0 12px #00ffd4, 0 0 24px #00ffd4, 0 0 36px #00ffd4;
  }
}

/* Radio widget title enhancement */
.radio-widget h3 {
  background: linear-gradient(45deg, var(--pastel-purple), var(--pastel-pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  text-shadow: none;
  margin-bottom: 12px;
  position: relative;
}

.radio-widget h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(45deg, var(--pastel-purple), var(--pastel-pink));
  border-radius: 1px;
  opacity: 0.5;
}


/* Music player */
.music-player {
  margin-bottom: 30px;
}

.retro-radio {
  border: 1px solid #999;
  border-radius: 15px;
  padding: 20px;
  box-shadow:
    inset 2px 2px 5px rgba(0, 0, 0, 0.3),
    2px 2px 10px rgba(0, 0, 0, 0.2);
  max-width: 400px;
}

.radio-display {
  background: #001100;
  color: #00ff00;
  border: 2px inset #666;
  border-radius: 5px;
  padding: 10px;
  font-family: "Courier New", monospace;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.eq-bars {
  display: flex;
  gap: 2px;
  align-items: end;
}

.bar {
  width: 3px;
  background: #00ff00;
  border-radius: 1px;
  animation: eq 0.8s ease-in-out infinite;
}

.bar:nth-child(1) {
  height: 10px;
  animation-delay: 0s;
}
.bar:nth-child(2) {
  height: 20px;
  animation-delay: 0.2s;
}
.bar:nth-child(3) {
  height: 15px;
  animation-delay: 0.4s;
}
.bar:nth-child(4) {
  height: 25px;
  animation-delay: 0.6s;
}

.radio-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Radio controls reuse pixel-btn styling */
.radio-btn {
  padding: 10px 16px;
  font-size: 1.1rem;
  border: 3px solid #bcc4d1;
  border-radius: 14px;
  background: linear-gradient(145deg, #e8ecf1, #d0d8e2);
  color: var(--ink);
  box-shadow: 
    3px 3px 8px rgba(0, 0, 0, 0.15),
    inset 2px 2px 4px rgba(255, 255, 255, 0.8),
    inset -2px -2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.radio-btn:hover {
  background: linear-gradient(145deg, #f0f4f9, #d8e2ed);
  transform: translateY(-1px);
  box-shadow: 
    4px 4px 12px rgba(0, 0, 0, 0.2),
    inset 2px 2px 4px rgba(255, 255, 255, 0.9),
    inset -2px -2px 4px rgba(0, 0, 0, 0.15);
}

.radio-btn:active {
  transform: translateY(1px);
  box-shadow: 
    1px 1px 4px rgba(0, 0, 0, 0.2),
    inset -2px -2px 4px rgba(255, 255, 255, 0.8),
    inset 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.radio-btn:focus {
  outline: none;
  box-shadow: 
    3px 3px 8px rgba(0, 0, 0, 0.15),
    inset 2px 2px 4px rgba(255, 255, 255, 0.8),
    inset -2px -2px 4px rgba(0, 0, 0, 0.1),
    0 0 0 3px rgba(189, 227, 255, 0.5);
}

/* Study section */
.study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.study-card {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow:
    var(--shadow),
    0 6px 24px rgba(165, 148, 249, 0.08);
  position: relative;
  overflow: hidden;
}

/* Mode overlay (game mode picker) */
.mode-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.mode-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  width: min(560px, 92vw);
  text-align: center;
  box-shadow: var(--shadow);
}
.mode-title {
  font-weight: 900;
  font-size: 18px;
  margin-bottom: 10px;
}
.mode-options {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 8px 0 10px;
  flex-wrap: wrap;
}
.mode-option.active {
  outline: 3px solid var(--accent);
}
.mode-options .pixel-btn {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.mode-toggle {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.mode-start {
  padding: 6px 12px;
}
.mode-toggles {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 10px;
}
.mode-start {
  width: 100%;
  font-size: 16px;
  padding: 10px 14px;
  border-radius: 10px;
}

.start-menu.hidden {
  display: none;
}
.start-menu .menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  width: 100%;
}
.menu-tile {
  font-size: 1rem;
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(145deg, #ffffff, #f3f3ff);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    outline 0.12s ease,
    background-position 0.5s ease;
  position: relative;
  overflow: hidden;
  background-size: 200% 100%;
}
.menu-tile.active,
.menu-tile:focus-visible {
  outline: 3px solid var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(43, 43, 68, 0.2);
}
.menu-tile.has-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.45)),
    var(--tile-cover);
  background-size: cover;
  background-position: center;
}
.menu-tile.has-cover::after {
  content: attr(data-label);
  position: relative;
  z-index: 1;
  display: inline-block;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 800;
}

/* shiny swipe on menu tile */
.menu-tile:hover {
  background-image:
    linear-gradient(145deg, #ffffff, #f3f3ff),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  background-blend-mode: overlay;
  background-position: 100% 0;
}

.menu-tile .corner-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--border);
  border-radius: 999px;
  font-weight: 900;
  padding: 2px 8px;
  font-size: 12px;
}

/* MikuDex filters */
.dex-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}
.dex-controls label {
  font-weight: 800;
  color: #596286;
}
.dex-controls select,
.dex-controls input[type="search"],
.dex-controls input[type="text"] {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}
.dex-controls .spacer {
  flex: 1;
}

/* Bigger, readable quiz text for kanji visibility */
#vocabQuestion,
#kanjiQuestion {
  font-size: 28px;
  line-height: 1.4;
  font-weight: 700;
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  margin: 8px 0;
}
#vocabChoices .pixel-btn,
#kanjiChoices .pixel-btn {
  font-size: 18px;
  padding: 12px;
  min-height: 48px;
}

/* ====== ULTIMATE PROJECT DIVA BEATPAD SYSTEM ====== */
.rhythm-grid {
  position: relative;
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: repeat(2, 1fr) !important;
  gap: 12px !important;
  padding: 8px;
  z-index: 10;
}

/* Apply same grid behavior for generic beatpad containers */
.beatpad-grid {
  position: relative;
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  grid-auto-rows: minmax(64px, auto) !important;
  gap: 12px !important;
  padding: 8px;
  z-index: 10;
}

/* PlayStation Colors with Neon Glow */
:root {
  --ps-triangle: #00ff88; /* Neon Green */
  --ps-circle: #ff0080; /* Hot Pink */
  --ps-cross: #0088ff; /* Electric Blue */
  --ps-square: #ffaa00; /* Bright Orange */
}

/* Beatpad Button Base */
.beatpad-btn {
  position: relative !important;
  min-height: 92px !important;
  border: 1px solid transparent !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  overflow: hidden !important;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  word-wrap: break-word !important;
  hyphens: auto !important;
}

/* PlayStation Symbol Styling */
.beatpad-btn[data-ps="triangle"] {
  border-color: var(--ps-triangle) !important;
  color: var(--ps-triangle) !important;
  box-shadow:
    0 0 20px rgba(0, 255, 136, 0.3),
    inset 0 0 20px rgba(0, 255, 136, 0.1) !important;
}

.beatpad-btn[data-ps="circle"] {
  border-color: var(--ps-circle) !important;
  color: var(--ps-circle) !important;
  box-shadow:
    0 0 20px rgba(255, 0, 128, 0.3),
    inset 0 0 20px rgba(255, 0, 128, 0.1) !important;
}

.beatpad-btn[data-ps="cross"] {
  border-color: var(--ps-cross) !important;
  color: var(--ps-cross) !important;
  box-shadow:
    0 0 20px rgba(0, 136, 255, 0.3),
    inset 0 0 20px rgba(0, 136, 255, 0.1) !important;
}

.beatpad-btn[data-ps="square"] {
  border-color: var(--ps-square) !important;
  color: var(--ps-square) !important;
  box-shadow:
    0 0 20px rgba(255, 170, 0, 0.3),
    inset 0 0 20px rgba(255, 170, 0, 0.1) !important;
}

/* PlayStation Symbol Icons */
/* Big PS glyph centered */
.beatpad-btn .ps-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 900;
  opacity: 0.85;
  text-shadow: 0 0 14px currentColor, 0 0 28px currentColor;
  pointer-events: none;
}
.beatpad-btn .beatpad-text {
  position: relative;
  z-index: 2;
  padding-top: 44px; /* push label below glyph */
}

/* Remove any mysterious grid overlay */
.beatpad-grid::before {
  content: none !important;
}

/* HUD Miku sprite on cards */
.hud-miku {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 88px;
  max-width: 25%;
  opacity: 0.9;
  image-rendering: pixelated;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.15));
}

/* Safety: hide empty buttons often rendered as placeholder ovals */
.beatpad-grid .pixel-btn:empty,
.chat-choices .pixel-btn:empty,
.pixel-btn:empty {
  display: none !important;
}

/* Keyboard Hint */
.beatpad-btn::after {
  content: attr(data-key);
  position: absolute;
  bottom: 8px;
  left: 12px;
  font-size: 11px !important;
  font-weight: 700 !important;
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 6px;
  z-index: 2;
}

/* Hover Effects */
.beatpad-btn:hover {
  transform: translateY(-4px) scale(1.02) !important;
  filter: brightness(1.1) !important;
}

.beatpad-btn[data-ps="triangle"]:hover {
  box-shadow:
    0 8px 30px rgba(0, 255, 136, 0.5),
    inset 0 0 30px rgba(0, 255, 136, 0.2) !important;
}

.beatpad-btn[data-ps="circle"]:hover {
  box-shadow:
    0 8px 30px rgba(255, 0, 128, 0.5),
    inset 0 0 30px rgba(255, 0, 128, 0.2) !important;
}

.beatpad-btn[data-ps="cross"]:hover {
  box-shadow:
    0 8px 30px rgba(0, 136, 255, 0.5),
    inset 0 0 30px rgba(0, 136, 255, 0.2) !important;
}

.beatpad-btn[data-ps="square"]:hover {
  box-shadow:
    0 8px 30px rgba(255, 170, 0, 0.5),
    inset 0 0 30px rgba(255, 170, 0, 0.2) !important;
}

/* Active/Press Animation */
.beatpad-btn:active {
  transform: scale(0.95) translateY(-2px) !important;
  animation: divaHitPulse 0.3s ease !important;
}

.beatpad-btn:disabled {
  opacity: 0.4 !important;
  transform: none !important;
  filter: grayscale(0.8) !important;
}

/* Falling Beat Notes */
.beat-note {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.beat-note.triangle {
  background: radial-gradient(circle, var(--ps-triangle), #00cc66);
  box-shadow: 0 0 12px var(--ps-triangle);
}

.beat-note.circle {
  background: radial-gradient(circle, var(--ps-circle), #cc0060);
  box-shadow: 0 0 12px var(--ps-circle);
}

.beat-note.cross {
  background: radial-gradient(circle, var(--ps-cross), #0066cc);
  box-shadow: 0 0 12px var(--ps-cross);
}

.beat-note.square {
  background: radial-gradient(circle, var(--ps-square), #cc8800);
  box-shadow: 0 0 12px var(--ps-square);
}

/* Spotlight Sweep Effect */
.spotlight-sweep {
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 20%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.1) 80%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 5;
  animation: spotlightSweep 2s ease-in-out;
}

/* Confetti Particles */
.confetti-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  pointer-events: none;
  z-index: 9;
}

.confetti-particle.triangle {
  background: var(--ps-triangle);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.confetti-particle.circle {
  background: var(--ps-circle);
  border-radius: 50%;
}

.confetti-particle.cross {
  background: var(--ps-cross);
  clip-path: polygon(
    20% 0%,
    0% 20%,
    30% 50%,
    0% 80%,
    20% 100%,
    50% 70%,
    80% 100%,
    100% 80%,
    70% 50%,
    100% 20%,
    80% 0%,
    50% 30%
  );
}

.confetti-particle.square {
  background: var(--ps-square);
}

/* Special kanji emphasis */
#kanjiQuestion {
  font-size: 36px;
  font-family: "Noto Sans CJK JP", "Yu Gothic", "Hiragino Sans", sans-serif;
}

/* Diva HUD (in-card overlay) */
.diva-hud {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.diva-voltage {
  flex: 1;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #eee;
  position: relative;
  overflow: hidden;
}
.diva-hud .singer-badge {
  box-shadow: 0 2px 6px rgba(43, 43, 68, 0.2);
}
.diva-voltage .fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6bc3ff, #a594f9);
  box-shadow:
    0 0 10px rgba(165, 148, 249, 0.6),
    0 0 18px rgba(107, 195, 255, 0.5);
  transition: width 0.2s ease;
}
.diva-lives {
  display: flex;
  gap: 4px;
  align-items: center;
}
.diva-lives .life {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff6b9d;
  box-shadow: 0 0 6px rgba(255, 107, 157, 0.6);
}
.diva-lives .life.off {
  background: #ffd6e5;
  opacity: 0.6;
  box-shadow: none;
}
.diva-judge {
  font-weight: 900;
  min-width: 84px;
  text-align: center;
}
.judge-COOL {
  color: #35a7ff;
  text-shadow: 0 0 8px rgba(53, 167, 255, 0.7);
}
.judge-GREAT {
  color: #00c853;
  text-shadow: 0 0 8px rgba(0, 200, 83, 0.7);
}
.judge-FINE {
  color: #ffb300;
  text-shadow: 0 0 8px rgba(255, 179, 0, 0.7);
}
.judge-SAD,
.judge-MISS {
  color: #ff1744;
  text-shadow: 0 0 8px rgba(255, 23, 68, 0.7);
}

/* Glowsticks and leeks particles */
.party {
  position: relative;
  overflow: visible;
}

/* Cute rhythm grid accent */
.rhythm-grid {
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid var(--border);
  border-radius: 12px;
}

/* Missing animations for merged Diva features */
@keyframes idolBreathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}
@keyframes speechBubbleIn {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes speechBubbleOut {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(6px);
    opacity: 0;
  }
}
@keyframes idolSpeaking {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}
@keyframes ringExpand {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
  }
}
@keyframes confettiFall {
  0% {
    transform: translateY(-10px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(120px) rotate(180deg);
    opacity: 0;
  }
}
@keyframes stageLighting {
  0% {
    opacity: 0.8;
  }
  100% {
    opacity: 0.5;
  }
}
.party .stick,
.party .leek {
  position: absolute;
  width: 6px;
  height: 28px;
  border-radius: 3px;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.2));
  animation: fall 1s ease-out forwards;
}
.party .stick {
  background: linear-gradient(180deg, #6bc3ff, #a594f9);
}
.party .leek {
  background: linear-gradient(180deg, #a5d6a7, #66bb6a);
}
@keyframes fall {
  from {
    transform: translateY(-20px) rotate(-15deg);
  }
  to {
    transform: translateY(30px) rotate(25deg);
    opacity: 0;
  }
}

/* Result overlay */
.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: visible;
}
.result-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  width: min(520px, 92vw);
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  overflow: visible; /* allow decorative rings to extend */
  margin: 60px; /* provide space for rings to expand */
}
.result-panel.win {
  background-image: url("../assets/win.jpg");
  background-size: cover;
  background-position: center;
}
.result-panel.gamer {
  background-image: url("../assets/win.png");
  background-size: cover;
  background-position: center;
}
.result-panel.win,
.result-panel.gamer {
  color: #2b2b44;
}
.result-panel h2 {
  margin: 0 0 6px;
  font-weight: 900;
  background: linear-gradient(90deg, #6bc3ff, #a594f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.result-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.ring {
  position: absolute;
  border: 1px solid #a594f9;
  border-radius: 50%;
  animation: ring 1.8s ease-out infinite;
  opacity: 0.4;
}
.ring:nth-child(2) {
  border-color: #6bc3ff;
  animation-delay: 0.4s;
}
.ring:nth-child(3) {
  border-color: #ffb300;
  animation-delay: 0.8s;
}
@keyframes ring {
  0% {
    transform: scale(0.6);
    opacity: 0.6;
  }
  70% {
    opacity: 0.2;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Song Over modal */
.song-over-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 1000;
}
.song-over-panel .counts {
  margin: 6px 0;
}
.song-over-panel .reward {
  font-weight: 800;
  margin-bottom: 8px;
}

/* JP HUD widget */
.jp-hud-widget .hud-line {
  font-weight: 700;
  margin-bottom: 4px;
}
.jp-hud-widget .hud-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin: 6px 0;
}
.jp-hud-widget .hud-controls:not(#hudDifficultyWrap) select,
.jp-hud-widget .hud-controls:not(#hudDifficultyWrap) .hud-label {
  display: none;
}
.jp-hud-widget #hudDifficulty {
  width: 140px;
}
.jp-hud-widget #hudLevelBar {
  margin-top: 6px;
}
.jp-hud-widget .hud-actions {
  display: flex;
  gap: 8px;
}
.jp-hud-widget .hud-label {
  font-weight: 800;
}

.progress-bar {
  background: #eee;
  border: 2px solid var(--border);
  border-radius: 10px;
  height: 20px;
  margin: 10px 0;
  overflow: hidden;
}

.progress {
  background: linear-gradient(45deg, var(--pastel-blue), var(--pastel-mint));
  height: 100%;
  transition: width 1s ease;
}

/* Dex / Pokedex styles */
.dex-pokedex {
  padding: 12px;
  border: 1px solid var(--accent-2);
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(189, 227, 255, 0.8)
  );
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.dex-pokedex::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--pastel-pink),
    var(--pastel-blue),
    var(--pastel-mint)
  );
  border-radius: 16px 16px 0 0;
}

.dex-open {
  animation: dexOpen 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes dexOpen {
  0% {
    transform: rotateY(-90deg) scale(0.8);
    opacity: 0;
  }
  60% {
    transform: rotateY(10deg) scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: rotateY(0) scale(1);
    opacity: 1;
  }
}
.dex-header {
  font-weight: 900;
  margin-bottom: 8px;
}
.dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
.dex-card {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}
.dex-card:focus {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}
.dex-card.locked {
  filter: grayscale(0.9) brightness(0.9);
}

/* Disabled state for locked secret cards */
.dex-card.dex-disabled {
  cursor: not-allowed;
  opacity: 0.6;
  filter: grayscale(1) brightness(0.7);
  transition: all 0.3s ease;
}

.dex-card.dex-disabled:hover {
  transform: none;
  filter: grayscale(1) brightness(0.5);
}

.dex-card.dex-disabled .dex-stars {
  color: #999;
}

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

.dex-card.owned {
  border-color: transparent;
}
.dex-name {
  font-size: 10px;
  text-align: center;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dex-stars {
  position: absolute;
  left: 6px;
  top: 4px;
  font-size: 12px;
  text-shadow: 0 1px 0 #fff;
}
.dex-count,
.dex-locked {
  position: absolute;
  right: 6px;
  top: 4px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 6px;
  font-weight: 800;
}
.dex-open {
  animation: dexOpen 0.5s ease-out;
}
@keyframes dexOpen {
  from {
    transform: scale(0.98) rotate(-1deg);
    opacity: 0.5;
  }
  to {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

/* Image modal */
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.image-modal.open {
  display: flex;
}
.image-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(720px, 95vw);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.image-panel .top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
}
.image-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}
.image-panel .meta {
  padding: 10px;
}
.image-panel .meta h3 {
  margin: 0 0 6px;
  font-size: 18px;
}
.image-panel .actions {
  display: flex;
  gap: 8px;
  padding: 10px;
}

/* Dex inline details (used in modal or future expansion) */
.dex-details {
  padding: 8px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 240, 250, 0.8)
  );
  border-top: 2px dashed var(--border);
}
.dex-title {
  font-weight: 900;
  margin-bottom: 2px;
  color: #2b2b44;
}
.dex-rarity {
  font-weight: 800;
  color: #ffb300;
  margin-bottom: 6px;
}
.dex-desc {
  font-size: 12px;
  color: #596286;
}
.dex-video iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

/* Video container and error handling */
.video-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.1);
}

.video-container iframe {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-error {
  padding: 20px;
  text-align: center;
  background: linear-gradient(
    135deg,
    rgba(255, 182, 193, 0.2),
    rgba(255, 192, 203, 0.2)
  );
  border: 2px dashed rgba(255, 182, 193, 0.6);
  border-radius: 8px;
  color: #ff69b4;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.video-error a {
  color: #ff1493;
  text-decoration: none;
  border-bottom: 1px dotted #ff1493;
  transition: all 0.2s ease;
}

.video-error a:hover {
  color: #ff69b4;
  border-bottom-style: solid;
  text-shadow: 0 0 4px rgba(255, 20, 147, 0.4);
}
.dex-links {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.dex-link {
  font-weight: 800;
  color: #596286;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--border);
  padding: 4px 8px;
  border-radius: 8px;
}
.dex-link:hover {
  color: #2b2b44;
}

.word-of-day {
  text-align: center;
  padding: 15px;
  background: linear-gradient(
    45deg,
    rgba(189, 227, 255, 0.3),
    rgba(207, 246, 230, 0.3)
  );
  border-radius: 10px;
  border: 2px dashed var(--border);
}

.japanese {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-2);
  margin-bottom: 5px;
}

.romaji {
  display: block;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.meaning {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

/* Games section */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.game-widget {
  background: var(--panel-alt);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

/* Cursor playground */

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 15px 0;
}

/* When the memory grid is in a win state, let the win image occupy the full area */
.memory-grid.won {
  display: block;
}
.memory-win {
  position: relative;
  width: 100%;
}
.memory-win img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(43, 43, 68, 0.15);
}

.memory-stats {
  text-align: center;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.memory-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  cursor: pointer;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d; /* iOS Safari 3D fix */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Performance + paint stability */
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -webkit-tap-highlight-color: transparent;
}


   @media (hover: hover) and (pointer: fine) {
  .memory-card:hover:not(.flipped):not(.matched) {
    transform: translateY(-4px) scale(1.02);
   filter: brightness(1.05);
  }
}
.memory-card .card-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Promote faces to their own layers to avoid iOS flicker */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.memory-card .card-front {
  background: var(--pastel-blue);
  border: 2px solid var(--border);
  font-size: 1.6rem;
}

.memory-card .card-back {
  background: #fff;
  border: 2px solid var(--border);
  transform: rotateY(180deg);
  overflow: hidden;
}

.memory-card .card-back img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  border-radius: 6px;
}

.memory-card.flipped {
  transform: rotateY(180deg);
}

.memory-card.matched {
  box-shadow: 0 0 0 3px rgba(107, 195, 255, 0.4) inset;
  pointer-events: none;
  animation: matchedPulse 0.8s ease-out;
}

@keyframes matchedPulse {
  0% {
    transform: rotateY(180deg) scale(1);
  }
  50% {
    transform: rotateY(180deg) scale(1.1);
    box-shadow: 
      0 0 0 3px rgba(107, 195, 255, 0.6) inset,
      0 6px 20px rgba(107, 195, 255, 0.3);
  }
  100% {
    transform: rotateY(180deg) scale(1);
  }
}

.heart-zone {
  background: linear-gradient(
    45deg,
    rgba(255, 182, 193, 0.3),
    rgba(255, 105, 180, 0.3)
  );
  border: 3px dashed var(--pastel-pink);
  border-radius: 15px;
  padding: 40px;
  margin: 15px 0;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.heart-zone:hover {
  background: linear-gradient(
    45deg,
    rgba(255, 182, 193, 0.5),
    rgba(255, 105, 180, 0.5)
  );
  transform: scale(1.02);
}

.random-miku img {
  width: 100px;
  height: auto;
  border: 2px solid var(--border);
  border-radius: 10px;
  margin: 15px 0;
  transition: all 0.3s ease;
}

.random-miku img:hover {
  transform: rotate(5deg) scale(1.1);
}

/* Wish styles */
.Wish {
  text-align: center;
  padding: 12px 0;
}
.Wish-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 15px;
  padding-bottom: 15px;
}
.Wish-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.Wish-actions .pixel-btn {
  background: linear-gradient(180deg, #ffffff, #ffe9f6);
  border: 1px solid var(--accent);
  box-shadow:
    0 6px 14px rgba(43, 43, 68, 0.15),
    inset 0 -2px 0 rgba(0, 0, 0, 0.05);
  transform: translateY(0);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
}
.Wish-actions .pixel-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 20px rgba(43, 43, 68, 0.25);
  filter: saturate(1.05);
}
.Wish-actions .pixel-btn:active {
  transform: translateY(0);
}
.Wish-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 10px 0;
}
.Wish-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.Wish-card {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--gradient-bg);
  box-shadow: var(--shadow);
  /* Performance optimizations */
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
}
/* Wish slot machine styles */
.Wish-card.slot-machine {
  background: linear-gradient(45deg, #f0f8ff, #ffd1ec, #e6f3ff);
  border: 1px solid #6bc3ff;
  animation: slotMachineGlow 0.5s ease-in-out infinite alternate;
  overflow: hidden;
}

.slot-reel {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.9) 20%,
    rgba(107, 195, 255, 0.3) 100%
  );
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.reel-image {
  width: 80%;
  height: 80%;
  object-fit: contain;
  image-rendering: pixelated;
  animation: reelSpin 0.15s linear infinite;
  filter: blur(1px) brightness(1.2);
}

.slot-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  font-size: 12px;
  animation: sparkleFloat 0.8s ease-out forwards;
  pointer-events: none;
  z-index: 10;
}

.Wish-card.revealing {
  animation: revealPulse 0.6s ease-out;
}

.reveal-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: pixelated;
  animation: revealZoom 0.5s ease-out;
}

@keyframes slotMachineGlow {
  0% {
    box-shadow: 0 0 10px rgba(107, 195, 255, 0.5);
    transform: scale(1);
  }
  100% {
    box-shadow:
      0 0 20px rgba(107, 195, 255, 0.8),
      0 0 30px rgba(255, 107, 157, 0.3);
    transform: scale(1.02);
  }
}

@keyframes reelSpin {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) scale(1.05) rotate(5deg);
  }
  50% {
    transform: translateY(0) scale(0.95) rotate(0deg);
  }
  75% {
    transform: translateY(3px) scale(1.05) rotate(-5deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes sparkleFloat {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.5) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: translateY(-10px) scale(1.2) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(0.8) rotate(360deg);
  }
}

@keyframes revealPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes revealZoom {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(10deg);
    filter: brightness(2);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }
}

@keyframes legendaryGlow {
  0%,
  100% {
    filter: brightness(1) hue-rotate(0deg);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
  }
  33% {
    filter: brightness(1.2) hue-rotate(60deg);
    box-shadow: 0 0 25px rgba(255, 107, 157, 0.8);
  }
  66% {
    filter: brightness(1.2) hue-rotate(240deg);
    box-shadow: 0 0 25px rgba(107, 195, 255, 0.8);
  }
}

.Wish-card.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.Wish-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(180deg, #f6f9ff, #eaeffd);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #a8b5d1;
}
.Wish-card.placeholder.spin .Wish-placeholder {
  animation: slotSpin 600ms ease-in-out infinite;
}
@keyframes slotSpin {
  0% {
    filter: brightness(1);
    transform: translateY(0);
  }
  50% {
    filter: brightness(1.2);
    transform: translateY(-6px);
  }
  100% {
    filter: brightness(1);
    transform: translateY(0);
  }
}
.Wish-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: pixelated;
}
.Wish-stars {
  position: absolute;
  left: 6px;
  top: 6px;
  font-size: 14px;
  text-shadow: 0 1px 0 #0002;
}
.Wish-new {
  position: absolute;
  right: 6px;
  top: 6px;
  background: #ff69b4;
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
}
.rarity-1 {
  border-color: #bfc7d5;
}
.rarity-2 {
  border-color: #6bc3ff;
}
.rarity-3 {
  border-color: #a594f9;
}
.rarity-4 {
  border-color: #ffb347;
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.2) inset;
}
.rarity-5 {
  border-color: #ffd700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.25) inset;
}
.Wish-collection {
  margin-top: 12px;
  border-top: 2px dashed var(--border);
  padding-top: 10px;
}
.Wish-collection .dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}
.Wish-collection .dex-card {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
}
.Wish-collection .dex-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: pixelated;
  filter: grayscale(1) contrast(0.8);
  opacity: 0.6;
}
.Wish-collection .dex-name {
  display: none;
}
.Wish-collection .dex-card.owned {
  border-style: solid;
}
.Wish-collection .dex-card.owned img {
  filter: none;
  opacity: 1;
}
.dex-count {
  position: absolute;
  right: 6px;
  font-size: 11px;
  background: #0008;
  color: #fff;
  padding: 2px 6px;
  border-radius: 8px;
}
.dex-stars {
  position: absolute;
  left: 6px;
  top: 6px;
  font-size: 12px;
}

.pixel-btn {
  background: linear-gradient(45deg, var(--pastel-blue), var(--pastel-mint));
  border: 2px solid var(--border);
  margin: 4px;
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.pixel-btn:hover {
  background: linear-gradient(45deg, var(--pastel-pink), var(--pastel-purple));
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Highlight active/selected buttons */
.pixel-btn.active {
  background: linear-gradient(45deg, var(--pastel-purple), var(--pastel-pink));
}

/* Kotoba chat option styling */
.chat-option {
  align-self: flex-start;
  text-align: left;
}

.chat-option.correct {
  background: linear-gradient(45deg, #a7f3d0, #6ee7b7);
  color: #065f46;
}

.chat-option.wrong {
  background: linear-gradient(45deg, #fecaca, #fca5a5);
  color: #7f1d1d;
}

/* Shrine section */
.shrine-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 30px;
  align-items: center;
}

.shrine-altar {
  text-align: center;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.9),
    rgba(189, 227, 255, 0.3)
  );
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.shrine-favorites {
  width: 100%;
  max-width: 500px;
  text-align: center;
}

.shrine-favorites h3 {
  margin-bottom: 15px;
  color: var(--ink);
}

.shrine-image {
  width: 200px;
  height: auto;
  border-radius: 10px;
  margin-bottom: 15px;
}

.offering-candles {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* Shrine prayer box */
.shrine-prayer-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.6);
  background: linear-gradient(180deg, rgba(255,250,245,0.95), rgba(255,245,255,0.85));
  box-shadow: 0 6px 18px rgba(43,43,68,0.12), inset 0 1px 0 rgba(255,255,255,0.6);
  max-width: 540px;
}
.shrine-prayer-box .prayer-header {
  font-family: 'Press Start 2P', 'Nunito', system-ui, sans-serif;
  font-size: 12px;
  color: #3b3b5a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.shrine-prayer-box .prayer-body {
  padding: 10px;
  background: rgba(255,255,255,0.6);
  border-radius: 8px;
  box-shadow: inset 0 2px 8px rgba(102,187,255,0.06);
  color: #2b2b44;
  line-height: 1.5;
}
.shrine-prayer-box .prayer-text { white-space: pre-wrap; }
.shrine-prayer-box .prayer-actions { margin-top: 8px; text-align: right; }
.shrine-prayer-box .another-blessing {
  background: linear-gradient(90deg,#ffd1e6,#e0f7ff);
  border: 1px solid rgba(43,43,68,0.06);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.shrine-prayer-box .another-blessing.clicked { transform: translateY(1px); opacity: 0.9; }

.candle {
  font-size: 1.5rem;
  .Wish-rotation {
    margin: 8px 0 12px;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
  }
  .Wish-rotation .rotation-strip {
    display: flex;
    gap: 8px;
    padding: 6px;
    overflow: auto;
  }
  .Wish-rotation .rotation-strip img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
  }
  animation: flicker 2s ease-in-out infinite;
}

.candle:nth-child(2) {
  animation-delay: 0.7s;
}
.candle:nth-child(3) {
  animation-delay: 1.4s;
}

.shrine-info {
  width: 100%;
  max-width: 600px;
  text-align: center;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.95),
    rgba(189, 227, 255, 0.4)
  );
  border: 2px solid rgba(189, 227, 255, 0.6);
  border-radius: 16px;
  padding: 24px;
  box-shadow:
    0 8px 24px rgba(43, 43, 68, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}

.shrine-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #bde3ff, #ffd1ec, #cff6e6, #e6d1ff);
  border-radius: 16px 16px 0 0;
}

.shrine-info h3 {
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  display: inline-block;
}

.shrine-info h3::after {
  content: '✨';
  position: absolute;
  top: -8px;
  right: -20px;
  font-size: 1.2rem;
  opacity: 0.8;
  animation: sparkle 2s ease-in-out infinite;
}

.shrine-info p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
  text-align: left;
  max-width: none;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.shrine-info p::first-letter {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ff6b9d;
  float: left;
  margin-right: 8px;
  margin-top: 2px;
  line-height: 0.8;
}

.shrine-info {
  transition: all 0.3s ease;
}

.shrine-info:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 32px rgba(43, 43, 68, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(189, 227, 255, 0.8);
}

.shrine-info:hover h3::after {
  animation-duration: 1s;
  opacity: 1;
}

.song-list {
  list-style: none;
  padding: 0;
}

.song-list li {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
  transition: all 0.3s ease;
}

.song-list li:hover {
  background: rgba(189, 227, 255, 0.6);
  transform: translateX(5px);
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.gallery-image {
  width: 100%;
  height: 120px;
  object-fit: contain; /* fit pixel Miku inside box */
  image-rendering: pixelated;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-image:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Media credits container */
.media-credits {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.8),
    rgba(189, 227, 255, 0.4)
  );
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: var(--shadow);
}

.media-credits h3 {
  margin-top: 0;
  color: var(--text-primary);
  font-weight: 600;
}

.media-credits ul {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.media-credits li {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 6px 0;
  transition: all 0.3s ease;
}

.media-credits li:hover {
  background: rgba(189, 227, 255, 0.6);
  transform: translateX(3px);
}

.media-credits a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.media-credits a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.media-credits em {
  color: var(--text-secondary);
  font-size: 0.9em;
}

/* Collapsible section */
.collapsible-section {
  margin: 20px 0;
}

.collapsible-header {
  width: 100%;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.8),
    rgba(189, 227, 255, 0.4)
  );
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 15px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.collapsible-header:hover {
  background: linear-gradient(
    145deg,
    rgba(189, 227, 255, 0.6),
    rgba(255, 255, 255, 0.8)
  );
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.collapsible-header .toggle-icon {
  transition: transform 0.3s ease;
  font-size: 0.8em;
}

.collapsible-header[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

.collapsible-content {
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  max-height: 1000px;
}

.collapsible-content.collapsed {
  max-height: 0;
}

.collapsible-content .game-widget {
  padding: 20px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.7),
    rgba(189, 227, 255, 0.3)
  );
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 15px 15px;
  box-shadow: var(--shadow);
}

/* Gallery item wrappers for mystery covers */
.gallery-item {
  position: relative;
}

/* Avoid double border: remove base image border when rarity ring is present */
.gallery-item .gallery-image {
  border: none;
}

/* Rarity ring overlay for gallery images */
.gallery-item .rarity-ring {
  position: absolute;
  inset: -4px;
  border-radius: 12px;
  pointer-events: none;
  border: 1px solid transparent;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  animation: ringGlow 2.4s ease-in-out infinite;
}
.gallery-item.rarity-1 .rarity-ring {
  border-color: #bfc7d5;
  box-shadow: 0 0 0 3px rgba(191, 199, 213, 0.15) inset;
}
.gallery-item.rarity-2 .rarity-ring {
  border-color: #6bc3ff;
  box-shadow: 0 0 0 3px rgba(107, 195, 255, 0.18) inset;
}
.gallery-item.rarity-3 .rarity-ring {
  border-color: #a594f9;
  box-shadow: 0 0 0 3px rgba(165, 148, 249, 0.18) inset;
}
.gallery-item.rarity-4 .rarity-ring {
  border-color: #ffb347;
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.22) inset;
}
.gallery-item.rarity-5 .rarity-ring {
  border-color: #ffd700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.25) inset;
}

/* ★6: PixieBel • rainbow accent ring */
.gallery-item.rarity-6 .rarity-ring {
  border: 1px solid transparent;
  border-radius: 12px;
  /* Ring-only gradient using masks */
  background: conic-gradient(
      from 0deg,
      #ff6ec7,
      #ffd700,
      #6bc3ff,
      #a594f9,
      #ffb347,
      #ff6ec7
    )
    border-box;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.6) inset,
    0 0 20px #ff6ec733;
  animation: rainbowSpin 6s linear infinite;
}

/* Dex card ★6 accent */
.Wish-collection .dex-card.owned.rarity-6 {
  border-color: transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    conic-gradient(#ff6ec7, #ffd700, #6bc3ff, #a594f9, #ffb347, #ff6ec7)
      border-box;
  border: 2px solid transparent;
  box-shadow: 0 6px 18px rgba(255, 110, 199, 0.25);
  animation: rainbowSpin 8s linear infinite;
}

/* Dex card rarity ring styles */
.dex-card .rarity-ring {
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 1;
}

.dex-card.owned.rarity-1 .rarity-ring {
  border: 2px  #9ca3af;
  -webkit-box-shadow: 0 0 20px 3px rgba(156, 163, 175, 0.5);
  -moz-box-shadow: 0 0 20px 3px rgba(156, 163, 175, 0.5);
  box-shadow: 0 0 20px 3px rgba(156, 163, 175, 0.5);
}
.dex-card.owned.rarity-2 .rarity-ring {
  border: 2px  #10b981;
  -webkit-box-shadow: 0 0 20px 3px rgba(16, 185, 129, 0.52);
  -moz-box-shadow: 0 0 20px 3px rgba(16, 185, 129, 0.52);
  box-shadow: 0 0 20px 3px rgba(16, 185, 129, 0.52);
}
.dex-card.owned.rarity-3 .rarity-ring {
  border: 2px  #3b82f6;
  -webkit-box-shadow: 0 0 20px 3px rgba(59, 130, 246, 0.52);
  -moz-box-shadow: 0 0 20px 3px rgba(59, 130, 246, 0.52);
  box-shadow: 0 0 20px 3px rgba(59, 130, 246, 0.52);
}
.dex-card.owned.rarity-4 .rarity-ring {
  border: 2px  #a594f9;
  -webkit-box-shadow: 0 0 20px 3px rgba(165, 148, 249, 0.52);
  -moz-box-shadow: 0 0 20px 3px rgba(165, 148, 249, 0.52);
  box-shadow: 0 0 20px 3px rgba(165, 148, 249, 0.52);
}
.dex-card.owned.rarity-5 .rarity-ring {
  border: 2px  #ffb347;
  -webkit-box-shadow: 0 0 20px 3px rgba(255, 179, 71, 0.52);
  -moz-box-shadow: 0 0 20px 3px rgba(255, 179, 71, 0.52);
  box-shadow: 0 0 20px 3px rgba(255, 179, 71, 0.52);
}
.dex-card.owned.rarity-6 .rarity-ring {
  border: 2px  #ffd700;
  -webkit-box-shadow: 0 0 20px 3px rgba(255, 215, 0, 0.52);
  -moz-box-shadow: 0 0 20px 3px rgba(255, 215, 0, 0.52);
  box-shadow: 0 0 20px 3px rgba(255, 215, 0, 0.52);
}

/* Dex card mystery cover for PixieBel */
.dex-card .mystery-cover {
  position: absolute;
  inset: 0;
  background: rgba(43, 43, 68, 0.85);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.dex-card .mystery-text {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* Enhanced image modal styles */
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-modal.open {
  opacity: 1;
}

.image-modal .image-panel {
  width: min(600px, 92vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 3px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  transform: scale(0.9);
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.image-modal.open .image-panel {
  transform: scale(1);
}

/* Smooth content transitions */
.image-modal .image-panel.transitioning {
  opacity: 0.3;
  transform: scale(0.98);
}

.image-modal .top {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.image-modal .top img {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.image-modal .meta {
  transition: opacity 0.2s ease;
  flex: 1;
}

.image-modal .top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.image-modal .meta h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.image-modal .rarity-info {
  margin-bottom: 8px;
}

.image-modal .owned-info {
  font-weight: 600;
  color: var(--ink-soft);
}

.image-modal .description {
  line-height: 1.4;
}

.image-modal .song-info {
  color: var(--accent);
  font-weight: 600;
}

.image-modal .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .image-modal .top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .image-modal .actions {
    justify-content: center;
  }
}

/* MikuDex Navigation */
.image-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}

.image-modal .modal-counter {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(189, 227, 255, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.image-modal .nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(189, 227, 255, 0.4));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-modal .nav-btn:hover:not(.disabled) {
  background: linear-gradient(145deg, rgba(189, 227, 255, 0.8), rgba(255, 255, 255, 0.9));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-modal .nav-btn:active:not(.disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.image-modal .nav-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(200, 200, 200, 0.3);
}

.image-modal .nav-btn .nav-icon {
  font-size: 12px;
  color: var(--accent);
}

.image-modal .nav-btn .nav-text {
  font-size: 12px;
}

.image-modal .prev-btn .nav-icon {
  margin-right: 2px;
}

.image-modal .next-btn .nav-icon {
  margin-left: 2px;
}

/* Mobile responsive navigation */
@media (max-width: 600px) {
  .image-modal .modal-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .image-modal .nav-btn .nav-text {
    display: none;
  }
  
  .image-modal .nav-btn {
    padding: 10px;
    border-radius: 50%;
    min-width: 40px;
    min-height: 40px;
    justify-content: center;
  }
  
  .image-modal .modal-counter {
    order: -1;
  }
}

@keyframes rainbowSpin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes ringGlow {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 0.6;
  }
}

.gallery-item.mystery-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(43, 43, 68, 0.8);
  border-radius: 10px;
  backdrop-filter: blur(8px);
}

.mystery-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 10;
  pointer-events: none;
}

/* Friends and badges */
.friends-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.friend-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(45deg, var(--pastel-mint), var(--pastel-blue));
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  overflow: hidden;
  min-height: 60px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.friend-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.friend-image {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.friend-button:hover .friend-image {
  transform: scale(1.1);
}

.friend-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.friend-icon {
  font-size: 1.2em;
}

.friend-name {
  font-weight: 700;
  font-size: 1.1em;
  text-transform: capitalize;
  letter-spacing: 0.5px;
}

/* Ocean theme for hachi */
.friend-ocean {
  background: linear-gradient(135deg, #B8E6F0, #A8D8EA, #7FB3D3);
  color: #2C3E50;
  border-color: #7FB3D3;
  position: relative;
}

.friend-ocean::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.4) 2px, transparent 2px),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    radial-gradient(circle at 60% 20%, rgba(255, 255, 255, 0.2) 3px, transparent 3px);
  animation: oceanBubbles 4s ease-in-out infinite;
  z-index: 1;
}

.friend-ocean .friend-content,
.friend-ocean .friend-image {
  position: relative;
  z-index: 2;
}

.friend-ocean:hover {
  background: linear-gradient(135deg, #A8D8EA, #7FB3D3, #6BA5C7);
  box-shadow: 0 8px 20px rgba(127, 179, 211, 0.3);
}

@keyframes oceanBubbles {
  0%, 100% { opacity: 0.6; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

/* Lain theme for pia */
.friend-lain {
  background: linear-gradient(135deg, #2A2A3E, #3E3E5C, #4A4A6A);
  color: #B8F2B8;
  border-color: #7DD87D;
  position: relative;
  font-family: 'Courier New', monospace;
}

.friend-lain::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(90deg, transparent 98%, #7DD87D 100%),
    linear-gradient(0deg, transparent 98%, #7DD87D 100%);
  background-size: 10px 10px, 8px 8px;
  opacity: 0.2;
  animation: lainGrid 3s linear infinite;
  z-index: 1;
}

.friend-lain .friend-content,
.friend-lain .friend-image {
  position: relative;
  z-index: 2;
}

.friend-lain .friend-name {
  text-shadow: 0 0 8px #7DD87D;
  animation: lainGlow 2s ease-in-out infinite alternate;
}

.friend-lain:hover {
  background: linear-gradient(135deg, #1A1A2E, #2E2E4C, #3A3A5A);
  box-shadow: 0 8px 20px rgba(125, 216, 125, 0.2);
}

@keyframes lainGrid {
  0% { transform: translate(0, 0); }
  100% { transform: translate(10px, 8px); }
}

@keyframes lainGlow {
  0% { text-shadow: 0 0 8px #7DD87D; }
  100% { text-shadow: 0 0 15px #7DD87D, 0 0 20px #B8F2B8; }
}

/* Persona theme for hero */
.friend-persona {
  background: linear-gradient(135deg, #F5D982, #F2B373, #E8A87C);
  color: #5D4E37;
  border-color: #D4A574;
  position: relative;
  font-weight: bold;
}

.friend-persona::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 25% 25%, rgba(245, 217, 130, 0.5) 20%, transparent 21%),
    radial-gradient(circle at 75% 75%, rgba(232, 168, 124, 0.4) 15%, transparent 16%),
    radial-gradient(circle at 50% 50%, rgba(242, 179, 115, 0.3) 25%, transparent 26%);
  background-size: 30px 30px, 40px 40px, 35px 35px;
  animation: personaMask 5s ease-in-out infinite;
  z-index: 1;
}

.friend-persona .friend-content,
.friend-persona .friend-image {
  position: relative;
  z-index: 2;
}

.friend-persona .friend-name {
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
  animation: personaPulse 3s ease-in-out infinite;
}

.friend-persona:hover {
  background: linear-gradient(135deg, #F2B373, #E8A87C, #D4A574);
  box-shadow: 0 8px 20px rgba(212, 165, 116, 0.3);
  transform: translateY(-3px) scale(1.02);
}

@keyframes personaMask {
  0%, 100% { 
    background-position: 0% 0%, 100% 100%, 50% 50%;
    opacity: 0.6;
  }
  50% { 
    background-position: 100% 100%, 0% 0%, 25% 75%;
    opacity: 0.8;
  }
}

@keyframes personaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.badges-collection {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}

.vibe-meter {
  text-align: center;
}

.vibe-bar {
  background: #eee;
  border: 2px solid var(--border);
  border-radius: 10px;
  height: 20px;
  margin: 10px 0;
  overflow: hidden;
}

.vibe-fill {
  height: 100%;
  transition: width 1s ease;
  animation: rainbow 3s ease-in-out infinite;
}

/* Footer */
#footer {
  background: var(--nav);
  border: 2px solid var(--border);
  border-radius: 15px;
  margin: 30px 0 20px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
}

/* Responsive footer text: inline like one sentence; stacks under 900px */
#footer p.footer-text {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.6ch; /* tighter, sentence-like spacing */
  margin: 0;
  white-space: normal;
}

#footer p.footer-text .footer-line {
  display: inline;
}

.footer-badges {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Made-by GIF (right-aligned, cute but subtle) */
.made-by-gif {
  position: absolute;
  right: 5px;
  bottom: -50px;
  width: 200px;
  height: auto;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.made-by-gif:hover {
  transform: translateY(-2px) scale(1.02);
}

/* Prevent overlap on small screens: stack gif below text */
@media (max-width: 1200px) {
  .made-by-gif {
    position: static;
    display: block;
    margin: 0 auto;
  }
  /* Stack footer text under 900px */
  #footer p.footer-text {
    flex-direction: column;
    gap: 6px;
  }
}

/* Background animations */
.bg-animations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.floating-hearts {
  position: fixed;
  inset: 0;
  font-size: 1.5rem;
  opacity: 0.6;
  will-change: transform;
  transform: translateZ(0);
}

/* Cursor trail */
#cursorTrail {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
}

.heart-trail {
  position: absolute;
  font-size: 1rem;
  animation: heartPop 2s ease-out forwards;
  pointer-events: none;
}

/* Responsive design */
@media (max-width: 1200px) {
  #flex {
    flex-direction: column;
  }

  aside {
    width: 100%;
    order: 2;
  }

  main {
    order: 1;
  }

  .hero-banner {
    flex-direction: column;
    text-align: center;
  }

  .shrine-content {
    flex-direction: column;
  }

  .memory-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  #siteTitle {
    font-size: 2rem;
  }

  .splash-miku {
    width: 150px;
  }
}

@media (max-width: 1200px) {
  #container {
    padding: 5px;
  }

  .status-bar {
    flex-direction: column;
    gap: 10px;
  }

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

  .status-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .status-nav a {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .study-grid {
    grid-template-columns: 1fr;
  }

  .memory-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Heart garden planted hearts */
.heart-zone {
  position: relative;
  overflow: hidden;
}
.planted-heart {
  position: absolute;
  font-size: 18px;
  transform-origin: 50% 100%;
  animation: heartGrow 2.4s ease-out forwards;
  pointer-events: none;
}
@keyframes heartGrow {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 0.1;
  }
  50% {
    transform: translateY(-6px) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translateY(-12px) scale(1);
    opacity: 0;
  }
}

.heart-target {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--pastel-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: targetFade 2.4s linear forwards;
}
.heart-target::after {
  content: "💖";
  font-size: 20px;
}
.heart-target .approach {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 2px solid var(--pastel-blue);
  border-radius: 50%;
  animation: approachShrink 2.4s linear forwards;
}
@keyframes approachShrink {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.1);
    opacity: 0;
  }
}
@keyframes targetFade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Keyframe animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes glitch {
  0%,
  100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
}

@keyframes typing {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0.5;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) translateZ(0);
  }
  50% {
    transform: translateY(-20px) translateZ(0);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0) translateZ(0);
  }
  50% {
    transform: translateY(-10px) translateZ(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0.3;
  }
}

@keyframes eq {
  0%,
  100% {
    height: 5px;
    background: linear-gradient(180deg, #00ffd4 0%, #00cc88 100%);
    box-shadow: 0 0 4px rgba(0, 255, 212, 0.4);
  }

  50% {
    height: 25px;
    background: linear-gradient(180deg, #44ffd4 0%, #00ff88 30%, #00ffd4 70%, #00cc88 100%);
    box-shadow: 0 0 12px rgba(0, 255, 212, 1);
  }
}

@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes rainbow {
  0% {
    background: linear-gradient(45deg, var(--pastel-blue), var(--pastel-mint));
  }
  33% {
    background: linear-gradient(
      45deg,
      var(--pastel-pink),
      var(--pastel-purple)
    );
  }
  66% {
    background: linear-gradient(
      45deg,
      var(--pastel-yellow),
      var(--pastel-blue)
    );
  }
  100% {
    background: linear-gradient(45deg, var(--pastel-blue), var(--pastel-mint));
  }
}

/* Enhanced floating hearts */
.floating-hearts {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.heart-particle {
  position: absolute;
  font-size: 1.5rem;
  pointer-events: none;
  user-select: none;
  animation: heartFloat 8s linear infinite;
}

@keyframes heartFloat {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) translateX(var(--drift)) rotate(360deg);
    opacity: 0;
  }
}

@keyframes heartEaten {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.5) rotate(180deg);
    opacity: 0.5;
  }
  100% {
    transform: scale(0) rotate(360deg);
    opacity: 0;
  }
}

.heart-eaten {
  animation: heartEaten 0.6s ease-out forwards !important;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.8;
  }
}

/* small pop used for click bursts */
@keyframes heartPop {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(1.2);
  }
}

/* Grey tint for not-owned gallery images */
.gallery-item.not-owned .gallery-image {
  filter: grayscale(0.7) brightness(0.9);
  opacity: 0.8;
  cursor: default;
}
.gallery-item.not-owned .gallery-image:hover {
  transform: none;
  box-shadow: none;
}

@keyframes speechBubbleIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes speechBubbleOut {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(0.8);
  }
}

@keyframes idolSpeaking {
  0%,
  100% {
    transform: translateX(-50%) scale(1) translateY(0);
  }
  25% {
    transform: translateX(-50%) scale(1.05) translateY(-3px);
  }
  50% {
    transform: translateX(-50%) scale(1.08) translateY(-5px);
  }
  75% {
    transform: translateX(-50%) scale(1.05) translateY(-2px);
  }
}

@keyframes ringExpand {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(4);
    opacity: 0;
  }
}

@keyframes divaHitPulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
    transform: scale(0.95) translateY(-2px);
  }
  50% {
    box-shadow: 0 0 0 20px transparent;
    transform: scale(1) translateY(-4px);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
    transform: scale(1) translateY(0);
  }
}

@keyframes spotlightSweep {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

@keyframes confettiFall {
  0% {
    transform: translateY(-10px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes beatFall {
  0% {
    transform: translateY(-20px) scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: translateY(120px) scale(1);
    opacity: 1;
  }
}

@keyframes perfectTiming {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.1);
    filter: brightness(1.3) saturate(1.5);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes comboGlow {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  50% {
    box-shadow: 0 0 30px 10px currentColor;
  }
  100% {
    box-shadow: 0 0 0 0 currentColor;
  }
}

@keyframes stageLighting {
  0% {
    opacity: 0.3;
  }
  100% {
    opacity: 0.7;
  }
}

/* Stage visuals */
.stage-floor {
  pointer-events: none;
}
.stage-lighting {
  pointer-events: none;
}
.stage-idol {
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.25));
  transform-origin: bottom center;
  pointer-events: none;
}

@media (max-width: 540px) {
  .stage-idol {
    width: 76px !important;
  }
}

@keyframes fadeToast {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px) scale(0.9);
  }
  15% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  85% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.9);
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--panel);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, var(--pastel-blue), var(--pastel-pink));
  border-radius: 6px;
  border: 2px solid var(--panel);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, var(--pastel-pink), var(--pastel-purple));
}

@keyframes gentle-glow {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(107, 195, 255, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(107, 195, 255, 0.5),
      0 0 12px rgba(107, 195, 255, 0.3);
  }
}

/* Enhanced floating animations for splash and hero Miku
.splash-miku,
.hero-miku {
  animation: gentleFloat 3s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.splash-miku:hover,
.hero-miku:hover {
  transform: scale(1.05) translateY(-2px);
  animation-play-state: paused;
} */

@keyframes gentleFloat {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-8px) rotate(1deg);
  }
  50% {
    transform: translateY(-12px) rotate(0deg);
  }
  75% {
    transform: translateY(-8px) rotate(-1deg);
  }
}

/* Enhanced Project DIVA vocab feedback styling that persists */
.vocab-feedback,
.kanji-feedback,
.kotoba-feedback,
.diva-feedback-enhanced {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) scale(1.2) !important;
  font-size: 1.8rem !important;
  font-weight: 900 !important;
  padding: 20px 32px !important;
  border-radius: 25px !important;
  background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%) !important;
  color: white !important;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.8) !important;
  box-shadow:
    0 0 25px rgba(255, 107, 157, 0.9),
    0 0 50px rgba(255, 107, 157, 0.7),
    0 0 75px rgba(255, 107, 157, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
  animation:
    divaGlow 2s ease-in-out infinite,
    feedbackPulse 0.8s ease-out !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  border: 4px solid #fff !important;
  backdrop-filter: blur(4px) !important;
  /* Hidden by default; shown when .correct/.incorrect is applied */
  display: none !important;
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}

.diva-feedback-enhanced.incorrect {
  display: block !important;
  opacity: 1 !important;
  background: linear-gradient(135deg, #ff4757 0%, #c44569 100%) !important;
  box-shadow:
    0 0 25px rgba(255, 71, 87, 0.9),
    0 0 50px rgba(255, 71, 87, 0.7),
    0 0 75px rgba(255, 71, 87, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
}

.diva-feedback-enhanced.correct {
  display: block !important;
  opacity: 1 !important;
  background: linear-gradient(135deg, #2ed573 0%, #1e90ff 100%) !important;
  box-shadow:
    0 0 25px rgba(46, 213, 115, 0.9),
    0 0 50px rgba(46, 213, 115, 0.7),
    0 0 75px rgba(46, 213, 115, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.3) !important;
}

@keyframes divaGlow {
  0%,
  100% {
    box-shadow:
      0 0 20px rgba(255, 107, 157, 0.8),
      0 0 40px rgba(255, 107, 157, 0.6),
      0 0 60px rgba(255, 107, 157, 0.4);
  }
  50% {
    box-shadow:
      0 0 30px rgba(255, 107, 157, 1),
      0 0 60px rgba(255, 107, 157, 0.8),
      0 0 90px rgba(255, 107, 157, 0.6);
  }
}

@keyframes feedbackPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
  20% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }
}

/* Shop keeper styling with cute animations */
.shop-keeper {
  text-align: center;
  padding: 12px;
  background: linear-gradient(135deg, #f0f9ff 0%, #fce7f3 100%);
  border-radius: 16px;
  border: 1px solid var(--accent);
  animation: shopKeeperFloat 4s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.shop-keeper::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #ff6b9d, #4ecdc4, #45b7d1, #96ceb4);
  border-radius: 16px;
  z-index: -1;
  animation: rainbowBorder 3s linear infinite;
}


@keyframes shopKeeperFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-3px);
  }
}

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

/* Miku Icon Styling */
.miku-icon {
  width: 24px !important;
  height: 24px !important;
  display: inline-block !important;
  vertical-align: middle !important;
  margin: 0 2px !important;
  border-radius: 4px;
  transition: transform 0.2s ease;
  image-rendering: pixelated;
}

.miku-icon:hover {
  transform: scale(1.2);
}

/* Responsive 4-grid layout for Japanese games */
.study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

@media (min-width: 768px) {
  .study-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .study-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1000px;
  }
}

/* Hide unlock progress bars in Japanese games */
.jp-unlock-bar,
.unlock-progress {
  display: none !important;
}

.pixel-btn {
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.pixel-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 16px rgba(255, 107, 157, 0.3);
}

.pixel-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Cute sparkle effects */
.game-widget::before {
  content: "✨";
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 14px;
  animation: sparkleFloat 2s ease-in-out infinite;
  opacity: 0.7;
}

@keyframes sparkleFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-3px) rotate(180deg);
    opacity: 1;
  }
}

/* Enhanced reveal image styling */
.Wish-results img {
  margin-bottom: 16px !important;
  border-radius: 12px;
  animation: revealPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.Wish-footer {
  padding: 15px;
  margin-top: 15px !important;
}

@keyframes revealPop {
  0% {
    transform: scale(0.8) rotateY(90deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotateY(0deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
  }
}

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

/* Special styling for navigation icons */
#navbar .miku-icon {
  width: 20px !important;
  height: 20px !important;
  margin-right: 6px !important;
}

/* Toast message Miku icons */
.toast .miku-icon {
  width: 20px !important;
  height: 20px !important;
}

/* Social media Miku icons */
.social-title .miku-icon {
  width: 22px !important;
  height: 22px !important;
  margin-right: 4px !important;
}

/* ====== CARD PAGINATION SYSTEM ====== */
.paginated-card {
  position: relative;
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}

.card-header h3 {
  margin: 0;
  flex: 1;
}

.card-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.card-nav-btn {
  background: var(--pastel-blue);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  min-width: 32px;
  justify-content: center;
}

.card-nav-btn:hover {
  background: var(--pastel-pink);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(43, 43, 68, 0.2);
}

.card-nav-btn:active {
  transform: translateY(0);
}

.card-nav-btn .miku-icon {
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
}

.page-indicator {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  min-width: 40px;
  text-align: center;
}

.card-content {
  position: relative;
  min-height: 120px;
}

.card-page {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.card-page.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.card-page p {
  margin: 0 0 8px 0;
}

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

.card-page ul {
  margin: 0;
  padding-left: 20px;
}

.card-page li {
  margin-bottom: 4px;
}

/* Cute hover effects for paginated cards */
.paginated-card:hover {
  transform: translateY(-2px);
  box-shadow:
    var(--shadow),
    0 0 20px rgba(189, 227, 255, 0.3);
}

/* Auto-advance shimmer effect for about cards */
.paginated-card[data-card="about"] {
  animation: gentle-pulse 10s infinite;
}

@keyframes gentle-pulse {
  0%,
  100% {
    box-shadow: var(--shadow);
  }
  50% {
    box-shadow:
      var(--shadow),
      0 0 15px rgba(255, 209, 236, 0.4);
  }
}

/* ====== BELLE'S ENHANCED PRESENTATION SYSTEM ====== */
.belle-presentation {
  background: var(--panel-alt);
  border-radius: 15px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
  position: relative;
  overflow: hidden;
  max-width: 100%;
  margin: 0;
  height: 100%;
  /* Ensure the area remains stable; the slides can grow within */
  min-height: 500px;
}

@keyframes presentation-shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  50% {
    transform: translateX(0%) translateY(0%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.presentation-header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 2;
}

.presentation-header h2 {
  margin: 0 0 16px 0;
  font-size: 1.8em;
  color: var(--ink);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.presentation-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.presentation-btn {
  background: linear-gradient(135deg, var(--pastel-blue), var(--pastel-pink));
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  color: var(--ink);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.presentation-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s ease;
}

.presentation-btn:hover::before {
  left: 100%;
}

.presentation-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-purple));
}

.presentation-btn:active {
  transform: translateY(0);
}

.presentation-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.slide-indicator {
  background: var(--panel-alt);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 6px 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.presentation-progress {
  margin: 12px 0;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--panel-alt);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s ease;
  border-radius: 4px;
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.presentation-content {
  position: relative;
  height: auto;
  margin: 0;
  overflow: visible;
  transition: height 0.3s ease;
}

.presentation-slide {
  position: absolute;
  top: 0;
  /* inset slides slightly to avoid touching the panel edge during transforms */
  left: 8px;
  right: 8px;
  opacity: 0;
  /* smaller translate to reduce visible clipping and motion overshoot */
  transform: translateX(14px) scale(0.98);
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  padding: 12px 14px;
  background: var(--panel-alt);
  border-radius: 12px;
  border: 2px solid var(--border);
  box-sizing: border-box;

  overflow: visible;
}

.presentation-slide.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.presentation-slide.slide-sparkle {
  animation: slide-sparkle 1s ease;
}

@keyframes slide-sparkle {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.1),
      0 0 30px rgba(189, 227, 255, 0.6),
      0 0 60px rgba(255, 209, 236, 0.4);
  }
}

/* Slide themes */
.presentation-slide[data-theme="bio"] {
  background: linear-gradient(135deg, var(--pastel-blue), var(--pastel-mint));
}

.presentation-slide[data-theme="stats"] {
  background: linear-gradient(
    135deg,
    var(--pastel-purple),
    var(--pastel-yellow)
  );
}

.presentation-slide[data-theme="feelings"] {
  background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-blue));
}

.presentation-slide[data-theme="likes"] {
  background: linear-gradient(135deg, var(--pastel-mint), var(--pastel-pink));
}

.presentation-slide[data-theme="dislikes"] {
  background: linear-gradient(
    135deg,
    var(--pastel-yellow),
    var(--pastel-purple)
  );
}

.presentation-slide[data-theme="dreams"] {
  background: linear-gradient(135deg, var(--pastel-purple), var(--pastel-blue));
}

.presentation-slide[data-theme="finale"] {
  background: linear-gradient(
    135deg,
    var(--pastel-pink),
    var(--pastel-mint),
    var(--pastel-blue)
  );
  animation: finale-glow 3s infinite;
}

@keyframes finale-glow {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.1),
      0 0 40px rgba(255, 209, 236, 0.8);
  }
}

.slide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.slide-header h3 {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.slide-decorations {
  display: flex;
  gap: 4px;
  opacity: 0.7;
}

.slide-content {
  line-height: 1.6;
  color: var(--ink);
}

.slide-content p {
  margin: 0 0 10px 0;
  transition: all 0.3s ease;
  font-size: clamp(0.92rem, 2.2vw, 1rem);
}

.presentation-slide img,
.presentation-slide svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px 0;
}

.slide-content p:hover {
  transform: translateX(4px);
  color: var(--accent-2);
}

.slide-content p:empty {
  margin: 6px 0;
}

.slide-number {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.8em;
  color: var(--ink-soft);
  opacity: 0.6;
}

/* controls removed per new spec */

.floating-decorations {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.floating-decoration {
  position: absolute;
  animation: float-around 6s infinite linear;
  opacity: 0.3;
}

.floating-decoration img {
  width: 20px;
  height: 20px;
  filter: brightness(1.2) saturate(1.1);
}

@keyframes float-around {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-50px) translateX(50px) rotate(360deg);
    opacity: 0;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .belle-presentation {
    padding: 16px;
    margin: 0;
  }

  .presentation-controls {
    flex-direction: column;
    gap: 8px;
  }
  .slide-indicator {
    display: none;
  }

  .presentation-btn {
    width: 100%;
    justify-content: center;
  }

  .presentation-slide {
    padding: 12px;
  }

  .slide-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .presentation-header h2 {
    font-size: 1.4em;
  }

  .slide-header h3 {
    font-size: 1.2em;
  }
}

/* Diva game */
.diva-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.diva-stage {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #e8f5ff center/cover no-repeat;
  min-height: 320px;
  background-image: var(--diva-bg, url("../assets/root.png"));
}
.diva-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.diva-singer {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 140px;
  max-width: 25vw;
  z-index: 2;
  image-rendering: pixelated;
  transition: all 0.3s ease;
}



/* Canvas-specific animations */
@keyframes canvasGlow {
  0%, 100% { box-shadow: var(--shadow); }
  50% { box-shadow: 0 0 20px rgba(165, 148, 249, 0.3), var(--shadow); }
}

#studyCanvas:focus-within {
  animation: canvasGlow 2s ease-in-out infinite;
}

/* Responsive canvas */
@media (max-width: 768px) {
  #studyCanvas {
    max-height: 60vh;
  }
  
  .study-hud-overlay {
    top: 8px;
    right: 8px;
    gap: 4px;
  }
  
  .study-hud-overlay .hud-pill {
    font-size: 12px;
    padding: 4px 8px;
  }
}

/* Memory Game Mobile Responsiveness */
@media (max-width: 768px) {
  .memory-grid {
    gap: 8px;
    margin: 10px 0;
  }
  
  .memory-card {
    border-radius: 6px;
  }
  
  .memory-card .card-front {
    font-size: 1.2rem;
  }
  
  .memory-stats {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }
  
  .memory-controls {
    flex-direction: column;
    gap: 6px !important;
    margin-bottom: 8px !important;
  }
  
  .memory-controls label {
    font-size: 0.9rem;
  }
  
  #memoryDifficulty {
    font-size: 0.9rem;
    padding: 4px 8px !important;
  }
}

@media (max-width: 480px) {
  .memory-grid {
    gap: 6px;
    margin: 8px 0;
  }
  
  .memory-card .card-front {
    font-size: 1rem;
  }
  
  .memory-card .card-back img {
    border-radius: 4px;
  }
  
  .memory-stats {
    font-size: 0.8rem;
    line-height: 1.4;
  }
  
  .memory-controls {
    margin-bottom: 6px !important;
  }
  
  #memoryDifficulty {
    font-size: 0.8rem;
  }
}

/* Add a faint Miku background in the JP HUD widget/game select card */
#jpHudWidget .jp-hud-widget {
  position: relative;
  overflow: hidden;
}
#jpHudWidget .jp-hud-widget::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/miku_hatsune_5_by_makiilu_d4uklnz-fullview.webp") center right/contain no-repeat;
  opacity: 0.22;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.diva-singer.stunned {
  filter: grayscale(1) brightness(0.8) contrast(1.05);
  transform: translateY(6px) rotate(-3deg) scale(0.98);
  transition:
    filter 0.2s ease,
    transform 0.2s ease;
}

.diva-judge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 900;
  font-size: 22px;
  color: #333;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 3;
}
.diva-judge.show {
  opacity: 1;
  animation: judgeFlash 0.6s ease-out;
}
@keyframes judgeFlash {
  0% {
    transform: translateX(-50%) scale(1.2);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

.stage-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  text-align: right;
}
.score-display {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 800;
  color: var(--ink);
}
.score-display div {
  margin: 2px 0;
}

.diva-lanes {
  position: absolute;
  right: 6%;
  top: 8%;
  bottom: 12%;
  width: 40%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
  z-index: 1;
}
.diva-lane {
  position: relative;
  border: 2px dashed rgba(89, 98, 134, 0.25);
  border-radius: 10px;
  overflow: hidden;
}

.hit-zone {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  border: 1px solid rgba(125, 211, 252, 0.6);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.2), transparent);
  animation: ringPulse 1s ease-in-out infinite;
}
@keyframes ringPulse {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translateX(-50%) scale(1.1);
    opacity: 1;
  }
}

.diva-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -120px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #7dd3fc);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  animation: divaFall ease-out forwards;
  cursor: pointer;
  z-index: 2;
}
.diva-dot.has-ring .hit-ring {
  position: absolute;
  inset: -6px;
  border: 2px solid #fbbf24;
  border-radius: 50%;
  animation: ringSpin 0.8s linear infinite;
}
@keyframes ringSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes divaFall {
  from {
    /* Start further above the lane to increase visible fall height */
    top: -120px;
  }
  to {
    top: calc(100% - 14px);
  }
}

@keyframes pointsFloat {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-30px);
  }
}

.diva-ui {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.diva-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diva-options {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.question-prompt {
  text-align: center;
  margin-bottom: 10px;
}
.jp-word {
  font-size: 24px;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 4px;
}
.romaji {
  font-size: 14px;
  color: #666;
  font-style: italic;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.gamepad-opt {
  font-size: 0.95rem;
}

.diva-stats {
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
  color: #666;
}

.diva-items {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.diva-item-status {
  font-weight: 800;
  color: #596286;
}

.diva-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  min-width: 300px;
  max-width: 400px;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 8px 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 8px;
}
.chat-miku {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}
.chat-log {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
}
.chat-entry {
  padding: 6px 10px;
  border-radius: 10px;
  max-width: 85%;
  font-size: 0.9rem;
}
.chat-entry.user {
  align-self: flex-end;
  background: #e0f2fe;
  border: 2px solid #7dd3fc;
}
.chat-entry.miku {
  align-self: flex-start;
  background: #fce7f3;
  border: 2px solid #f472b6;
}
.chat-entry.welcome {
  background: #f0f9ff;
  border: 2px solid #0ea5e9;
}
.chat-entry.encourage {
  background: #ecfdf5;
  border: 2px solid #10b981;
  font-style: italic;
}
.miku-response {
  line-height: 1.4;
}
#divaChatForm {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.diva-kirby {
  position: absolute;
  width: 64px;
  height: auto;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}
.diva-bait {
  position: absolute;
  font-size: 22px;
  animation: baitBlink 1s ease-in-out infinite;
  z-index: 1;
}
@keyframes baitBlink {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* Shop enhancements */
.shop-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px;
}

.shop-keeper {
  text-align: center;
  padding: 8px;
  background: linear-gradient(135deg, #f0f9ff 0%, #fce7f3 100%);
  border-radius: 12px;
  border: 2px solid var(--border);
}

.shop-keeper-image {
  display: block;
  margin: 0 auto 8px auto;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: #fff;
  padding: 4px;
}

.shop-keeper-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-style: italic;
}

.shop-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-item button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.shop-icon-placeholder {
  display: inline-flex;
  align-items: center;
  width: 20px;
  height: 20px;
}

.shop-status {
  text-align: center;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--ink-soft);
  border: 1px solid var(--border);
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Swallower animations */
.swallow-game-mode {
  transition: filter 0.3s ease;
}

.swallow-game-mode.eating-bait {
  filter: hue-rotate(45deg) saturate(1.5)
    drop-shadow(2px 2px 8px rgba(255, 215, 0, 0.6));
}

.swallow-ambient-mode {
  transition: transform 0.3s ease;
}

/* Decoy treat improvements */
.decoy-treat {
  position: fixed;
  top: 20%;
  z-index: 9996;
  pointer-events: none;
  animation: decoyFloat 6s linear forwards;
}

.decoy-treat .decoy-img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}

@keyframes decoyFloat {
  0% {
    opacity: 1;
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(200px) rotate(360deg);
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
}

@keyframes zapAway {
  0% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: hue-rotate(180deg) saturate(2) brightness(1.5)
      drop-shadow(0 0 10px #00ffff);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.2) rotate(180deg);
    filter: hue-rotate(270deg) saturate(3) brightness(2)
      drop-shadow(0 0 20px #ff00ff);
  }
  100% {
    opacity: 0;
    transform: scale(0.1) rotate(360deg);
    filter: hue-rotate(360deg) saturate(0) brightness(0)
      drop-shadow(0 0 0px transparent);
  }
}

@keyframes sparkle {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.8;
  }
  25% {
    transform: scale(1.2) rotate(90deg);
    opacity: 1;
  }
  50% {
    transform: scale(0.9) rotate(180deg);
    opacity: 0.9;
  }
  75% {
    transform: scale(1.1) rotate(270deg);
    opacity: 1;
  }
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.card h3 {
  color: var(--ink);
  margin: 0 0 15px 0;
}

/* Guestbook embed (kept outside the grid under presentation) */
.guestbook-card {
  background: var(--panel-alt);
  border: 2px solid var(--border);
}

.guestbook-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guestbook-container {
  background: var(--panel-alt);
  border: 2px dashed var(--border);
  border-radius: 12px;
  overflow: hidden;
  /* Cap height so presentation resizing above doesn’t cause large shifts */
  max-height: 700px;
}

.guestbook-frame {
  width: 100%;
  height: 680px;
  border: 0;
  display: block;
}

.guestbook-card { margin-top: 8px; }

.guestbook-note {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
}

@media (max-width: 768px) {
  .guestbook-frame {
    height: 600px;
  }
}

/* Quick links - fancy button style */
.quick-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-links li {
  margin: 0;
}

.quick-links a {
  display: block;
  background: linear-gradient(45deg, var(--pastel-mint), var(--pastel-blue));
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  text-align: center;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.quick-links a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s ease;
}

.quick-links a:hover::before {
  left: 100%;
}

.quick-links a:hover {
  background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-purple));
  transform: translateY(-3px) scale(1.02);
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

/* Fancy vibes for specific link types */
.quick-links a.link-insta {
  background: linear-gradient(135deg, #F5E1A4, #E8B4CB, #D1A3E1);
  color: #6B4C93;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  border: 2px solid #E8B4CB;
  box-shadow: 0 3px 10px rgba(232, 180, 203, 0.3);
}

.quick-links a.link-insta:hover {
  background: linear-gradient(135deg, #E8B4CB, #D1A3E1, #B794D1);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(232, 180, 203, 0.4);
}