@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&family=DM+Serif+Display&family=Fredoka:wght@400;500;600&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg-primary: #07060a;
  --bg-secondary: #120e1e;
  --card-bg: #181426;
  --accent-purple: #9d4edd;
  --accent-lavender: #d8b4fe;
  --accent-gold: #ffb703;
  --accent-rose: #ff85a1;
  --text-main: #f4effa;
  --text-muted: #a69cb5;
  --border-color: rgba(157, 78, 221, 0.15);
  --polaroid-bg: #ffffff;
  --polaroid-text: #2b2b2b;
}

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

html {
  overflow-y: scroll;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  transition: background-color 1s ease-in-out;
}

/* Global Shawrma Cursor override */
html, body, button, input, a, .polaroid-item, .gate-btn, .quiz-btn, canvas, .cat-container, .dog-container {
  cursor: url("data:image/svg+xml;utf8,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2732%27%20height=%2732%27%20style=%27font-size:%2024px;%27%3E%3Ctext%20y=%2724%27%3E%F0%9F%8C%AF%3C/text%3E%3C/svg%3E") 0 24, auto !important;
}

/* Subtle background stars & dust texture */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(157, 78, 221, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(216, 180, 254, 0.08) 0%, transparent 50%);
  z-index: -2;
  pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #251e36;
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* Typography defaults */
h1, h2, h3 {
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.handwritten {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
}

/* Sticky Navbar */
.navbar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translate(-50%, -120%);
  width: 92%;
  max-width: 1200px;
  height: 64px;
  background: rgba(18, 14, 30, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(157, 78, 221, 0.25);
  border-radius: 40px;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar.visible {
  transform: translate(-50%, 0);
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--accent-lavender);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
  padding: 5px 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-main);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-purple);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Password Gate Screen */
#gateScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 20px;
  transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1s cubic-bezier(0.25, 1, 0.5, 1);
}

#gateScreen.hidden {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.gate-card {
  width: 100%;
  max-width: 480px;
  padding: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
}

/* Handcrafted scrap paper tape detail */
.gate-card::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 130px;
  height: 35px;
  background: rgba(216, 180, 254, 0.15);
  backdrop-filter: blur(2px);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.gate-title {
  font-size: 2.2rem;
  margin-bottom: 12px;
  color: var(--text-main);
}

.gate-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 30px;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.gate-input-wrapper {
  width: 100%;
  position: relative;
}

.gate-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(157, 78, 221, 0.3);
  color: var(--text-main);
  border-radius: 12px;
  font-size: 1rem;
  text-align: center;
  font-family: inherit;
  transition: all 0.3s;
}

.gate-input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 10px rgba(157, 78, 221, 0.2);
}

.gate-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent-purple);
  color: #fff;
  border: none;
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.gate-btn:hover {
  background: #b56cff;
  transform: translateY(-2px);
}

.gate-hint {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
  color: var(--accent-rose);
  margin-top: 15px;
  min-height: 24px;
}

/* Shake Animation on Wrong Password */
.shake {
  animation: shakeAnim 0.5s ease-in-out;
}

@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Main Content Styles */
#mainContent {
  opacity: 0;
  transition: opacity 1.5s ease;
  padding: 120px 20px 60px;
  max-width: 1100px;
  margin: 0 auto;
}

#mainContent.visible {
  opacity: 1;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 80px;
  position: relative;
}

.birthday-title {
  font-size: 3.8rem;
  color: var(--text-main);
  margin-bottom: 15px;
}

.hero-subtitle {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
  color: var(--accent-lavender);
  margin-bottom: 30px;
}

/* Countdown */
.countdown-container {
  display: inline-flex;
  gap: 20px;
  padding: 20px 30px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.countdown-box {
  min-width: 60px;
  text-align: center;
}

.countdown-number {
  font-family: 'DM Serif Display', serif;
  font-size: 2.2rem;
  color: var(--accent-gold);
}

.countdown-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 4px;
}

.page-section {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  will-change: transform, opacity;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Lightbox Photo/Video Zoom Modal Animations */
#zoomModal {
  transition: opacity 0.3s ease-in-out !important;
}

#zoomModal > div {
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease-in-out;
  will-change: transform, opacity;
}

#zoomModal.visible > div {
  transform: scale(1);
  opacity: 1;
}

.section-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 40px;
  position: relative;
}

.section-card h2 {
  font-size: 2.2rem;
  margin-bottom: 30px;
  color: var(--text-main);
  position: relative;
  display: inline-block;
}

.section-card h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-purple);
  border-radius: 2px;
}

/* Polaroid Memories Section */
.memories-container {
  padding: 20px 0;
  position: relative;
}

.memories-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
}

.polaroid-grid {
  position: relative;
  width: 100%;
  height: 520px; /* Default height for stacked view */
  margin: 0 auto;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.polaroid-item {
  background: var(--polaroid-bg);
  padding: 12px 12px 28px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  width: 280px;
  position: absolute;
  left: 0;
  top: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.polaroid-item.dragging {
  transition: none !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  z-index: 999 !important;
}

.polaroid-item:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

/* Polaroid image */
.polaroid-img-wrapper {
  width: 100%;
  height: 270px;
  overflow: hidden;
  background-color: #1a1625;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.polaroid-item img,
.polaroid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #1a1625;
  pointer-events: none;
  user-select: none;
}

/* Handwritten captions */
.polaroid-caption {
  font-family: 'Fredoka', sans-serif;
  color: var(--polaroid-text);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-top: 15px;
  line-height: 1.2;
}

/* Sticky Tape effect on Polaroids */
.polaroid-item::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(1deg);
  width: 90px;
  height: 25px;
  background: rgba(216, 180, 254, 0.3);
  backdrop-filter: blur(1px);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

/* Quiz Section Reskin */
.quiz-box {
  min-height: 250px;
}

.quiz-question-counter {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.3rem;
  color: var(--accent-lavender);
  margin-bottom: 8px;
}

.quiz-question {
  font-size: 1.4rem;
  line-height: 1.4;
  margin-bottom: 25px;
  color: var(--text-main);
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.quiz-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 16px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
  transition: all 0.25s ease;
}

.quiz-btn:hover {
  background: rgba(157, 78, 221, 0.1);
  border-color: var(--accent-lavender);
  transform: translateX(4px);
}

.quiz-btn.correct {
  background: rgba(52, 211, 153, 0.15) !important;
  border-color: #34d399 !important;
  color: #a7f3d0;
}

.quiz-btn.wrong {
  background: rgba(244, 63, 94, 0.15) !important;
  border-color: #f43f5e !important;
  color: #fca5a5;
}

.quiz-result-view {
  text-align: center;
  padding: 20px 0;
}

.quiz-result-emoji {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.quiz-result-title {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.quiz-result-desc {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 25px;
}

.btn-primary {
  background: var(--accent-purple);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 30px;
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: #b56cff;
  transform: translateY(-2px);
}

/* Wishes Wall */
.wishes-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wishes-list {
  max-height: 450px;
  overflow-y: auto;
  padding-right: 15px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wish-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  padding: 25px;
  border-radius: 16px;
  position: relative;
}

/* Hanging paperclip or pin decoration on wish card */
.wish-card::before {
  content: '📌';
  position: absolute;
  top: -12px;
  left: 20px;
  font-size: 1.1rem;
}

.wish-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.45rem;
  line-height: 1.4;
  color: var(--text-main);
  margin-bottom: 12px;
}

.wish-author {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--accent-gold);
  text-align: right;
  letter-spacing: 0.5px;
}

.wish-form {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

@media (max-width: 600px) {
  .wish-form {
    flex-direction: column;
  }
}

.wish-form input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(157, 78, 221, 0.2);
  color: var(--text-main);
  padding: 14px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  flex: 1;
}

.wish-form input:focus {
  outline: none;
  border-color: var(--accent-purple);
}

.wish-form button {
  padding: 14px 25px;
  background: var(--accent-purple);
  color: #fff;
  border: none;
  font-family: 'DM Serif Display', serif;
  font-size: 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wish-form button:hover {
  background: #b56cff;
  transform: translateY(-1px);
}

/* Audio Player */
.audio-player-fixed {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(24, 20, 38, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background 0.2s;
}

.audio-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.audio-track-info {
  font-size: 0.75rem;
  font-weight: 500;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.audio-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  width: 16px;
}

.audio-wave-bar {
  width: 2px;
  height: 100%;
  background-color: var(--accent-purple);
  transform-origin: bottom;
}

.audio-wave.playing .audio-wave-bar {
  animation: bounce 0.8s ease-in-out infinite alternate;
}

.audio-wave-bar:nth-child(2) {
  animation-delay: 0.15s !important;
}

.audio-wave-bar:nth-child(3) {
  animation-delay: 0.3s !important;
}

@keyframes bounce {
  0% { transform: scaleY(0.2); }
  100% { transform: scaleY(1); }
}

/* Background floating poppable balloons canvas */
#balloonCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: auto;
}

/* Footer styling */
footer {
  text-align: center;
  padding: 60px 0 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Birthday Letter Modal Overlay */
.letter-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(7, 6, 10, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 95;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  overflow-y: auto;
  box-sizing: border-box;
}

.letter-modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.letter-card {
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: #fbf8f0; /* Handcrafted warm paper background */
  border-radius: 16px;
  padding: 24px;
  color: #2b2b2b;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transform: translateY(30px) rotate(-1deg);
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.letter-card h2 {
  font-size: 1.6rem !important;
  margin-bottom: 10px !important;
  margin-top: 0 !important;
}

/* Scrollable message content for letter modal cards */
.letter-card p {
  overflow-y: auto !important;
  margin-bottom: 15px !important;
  padding-right: 8px;
  flex: 1;
  min-height: 0; /* CRITICAL layout fix: allows paragraph to shrink and scroll inside flex container */
  scrollbar-width: thin;
}

.letter-card p::-webkit-scrollbar {
  width: 6px;
}
.letter-card p::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
.letter-card p::-webkit-scrollbar-thumb {
  background: rgba(157, 78, 221, 0.4);
  border-radius: 4px;
}
.letter-card p::-webkit-scrollbar-thumb:hover {
  background: var(--accent-rose);
}

.letter-modal-overlay.visible .letter-card {
  transform: translateY(0) rotate(0deg);
}

.letter-seal {
  font-size: 2.2rem;
  width: 60px;
  height: 60px;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  border: 2px dashed var(--accent-purple);
  animation: pulse-slow 2s infinite ease-in-out;
}

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

.letter-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #120e1e;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
  padding-bottom: 10px;
}

.letter-body {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.2rem;
  line-height: 1.6;
  text-align: left;
  margin-bottom: 30px;
  color: #3d3d3d;
}

.letter-card .btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent-purple);
  color: #fff;
  border: none;
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(157, 78, 221, 0.3);
  transition: all 0.3s;
}

.letter-card .btn-primary:hover {
  background: #822faf;
  transform: translateY(-1px);
}

/* Sleepy Tuxedo Cat Pet */
.cat-container {
  position: fixed;
  bottom: -5px;
  left: 300px;
  z-index: 85;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease, transform 0.3s ease;
  transform-origin: bottom center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Sleepy Golden Retriever Dog Pet */
.dog-container {
  position: fixed;
  bottom: 190px;
  left: 300px;
  z-index: 85;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease, transform 0.3s ease;
  transform-origin: bottom center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.cat-container.visible, .dog-container.visible {
  opacity: 1;
  pointer-events: auto;
}

.cat-container:hover {
  transform: scale(1.05);
}

.dog-container:hover {
  transform: scale(1.05);
}

.cat-svg, .dog-svg {
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
  overflow: visible;
}

/* Tail animations */
.cat-tail {
  transform-origin: 68px 76px;
  transition: transform 0.3s;
}

.cat-container:hover .cat-tail {
  animation: tailWiggle 1.2s infinite alternate ease-in-out;
}

@keyframes tailWiggle {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(12deg); }
}

.dog-tail {
  transform-origin: 68px 76px;
  transition: transform 0.3s;
}

.dog-container:hover .dog-tail,
.dog-container.saying .dog-tail {
  animation: tailWag 0.3s infinite alternate ease-in-out;
}

/* Make torch glow and scale 2x when Rolex is talking/wagging tail */
.dog-container.saying ~ .hidden-torch-icon {
  opacity: 1 !important;
  color: #c77dff !important;
  text-shadow: 0 0 15px rgba(157, 78, 221, 0.9), 0 0 35px rgba(157, 78, 221, 0.6) !important;
  transform: scale(2) rotate(-12deg) !important;
}

@keyframes tailWag {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(15deg); }
}

/* Head bounce */
.cat-head {
  transition: transform 0.3s ease;
  transform-origin: 48px 45px;
}

.cat-container:hover .cat-head {
  transform: translateY(-2px);
}

.dog-head {
  transition: transform 0.3s ease;
  transform-origin: 48px 42px;
}

.dog-container:hover .dog-head {
  transform: translateY(-2px);
}

/* Eye and face feature toggles */
.cat-container:hover .cat-eye-closed {
  display: none !important;
}

.cat-container:hover .cat-eye-open,
.cat-container:hover .cat-eye-pupil {
  display: block !important;
}

.dog-container:hover .dog-eye-closed {
  display: none !important;
}

.dog-container:hover .dog-eye-open,
.dog-container:hover .dog-eye-highlight,
.dog-container:hover .dog-tongue {
  display: block !important;
}

/* Speech Bubble above Cat & Dog */
.cat-bubble, .dog-bubble {
  position: absolute;
  bottom: 96px; /* Shift slightly higher to accommodate name tag */
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: #fbf8f0;
  color: #2b2b2b;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 12px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.cat-bubble::after, .dog-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #fbf8f0 transparent;
  display: block;
  width: 0;
}

.cat-container:hover .cat-bubble,
.cat-container.saying .cat-bubble,
.dog-container:hover .dog-bubble,
.dog-container.saying .dog-bubble {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Draggable pets styles */
.cat-container.dragging, .dog-container.dragging {
  transition: none !important;
  cursor: grabbing !important;
}

.pet-name-tag {
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  text-align: center;
  white-space: nowrap;
  transition: background 0.3s;
}

.cat-container:hover .pet-name-tag, .dog-container:hover .pet-name-tag {
  background: var(--accent-purple);
  color: #ffffff;
}

/* Food Wheel Section Styles */
.wheel-outer-ring {
  position: relative;
  width: 410px;
  height: 410px;
  border-radius: 50%;
  padding: 5px;
  background: radial-gradient(circle, #120e1e 0%, #07060a 100%);
  border: 4px solid var(--accent-purple);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(157, 78, 221, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

#foodWheel {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  transform: rotate(0deg);
  transition: transform 5s cubic-bezier(0.1, 0.8, 0.1, 1);
}

.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 30px solid var(--accent-rose);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
  z-index: 10;
}

/* Word-by-word reveal style */
.word-span {
  opacity: 0;
  display: inline-block;
  transform: translateY(4px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  margin-right: 0.28em;
}

.word-span.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Custom scrollbar for secret vault content */
#vaultContent::-webkit-scrollbar {
  width: 6px;
}
#vaultContent::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}
#vaultContent::-webkit-scrollbar-thumb {
  background: var(--accent-purple);
  border-radius: 3px;
}

/* UV Flashlight Easter Egg Styles */
#uvCursor {
  position: fixed;
  pointer-events: none;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(157, 78, 221, 0.28) 0%, rgba(157, 78, 221, 0.08) 55%, transparent 70%);
  transform: translate(-50%, -50%);
  z-index: 9999;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#uvCursor.active {
  opacity: 1;
}

.hidden-torch-icon {
  position: fixed;
  top: 80px;
  right: 25px;
  font-size: 1.5rem;
  opacity: 0.12;
  cursor: pointer;
  z-index: 90;
  transition: opacity 0.3s, transform 0.3s, text-shadow 0.3s;
  user-select: none;
  -webkit-user-select: none;
}

.hidden-torch-icon:hover {
  opacity: 0.7;
  transform: scale(1.15) rotate(-15deg);
}

.hidden-torch-icon.unlocked {
  opacity: 1;
  color: #c77dff;
  text-shadow: 0 0 15px rgba(157, 78, 221, 0.8), 0 0 25px rgba(157, 78, 221, 0.4);
  transform: scale(1.1);
  animation: pulse-slow 1.5s infinite alternate;
}

.uv-word {
  color: transparent;
  text-shadow: none;
  transition: color 0.15s, text-shadow 0.15s;
  display: inline-block;
  margin-right: 0.25em;
}

/* Vertical Scrolling Ticker */
.vertical-scroll-hint {
  position: fixed;
  right: 8px;
  top: 100%;
  height: auto;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--accent-lavender);
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
  text-shadow: 0 0 10px rgba(157, 78, 221, 0.7);
  white-space: nowrap;
}

@keyframes scroll-vertical-hint {
  0% {
    top: 100%;
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  100% {
    top: -420px;
    opacity: 0;
  }
}

.vertical-scroll-hint.scrolling {
  animation: scroll-vertical-hint 11s linear forwards;
}

/* Secret Treasure Box Easter Egg */
#treasureBox {
  position: absolute;
  left: 50%;
  top: 220px;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  z-index: 0;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(157, 78, 221, 0.08);
  border: 2px dashed rgba(157, 78, 221, 0.3);
  box-shadow: 0 0 15px rgba(157, 78, 221, 0.15);
  user-select: none;
  -webkit-user-select: none;
}

#treasureBox:hover {
  background: rgba(157, 78, 221, 0.18);
  border-color: rgba(157, 78, 221, 0.6);
  box-shadow: 0 0 25px rgba(157, 78, 221, 0.4);
}

.chest-svg {
  transition: transform 0.2s;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.treasure-word-span {
  opacity: 0;
  display: inline-block;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(4px);
  margin-right: 0.22em;
}

.treasure-word-span.visible {
  opacity: 1;
  transform: translateY(0);
}

.golden-word-span {
  opacity: 0;
  display: inline-block;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(4px);
  margin-right: 0.22em;
}

.golden-word-span.visible {
  opacity: 1;
  transform: translateY(0);
}

body.food-victory-active {
  background-color: #3b0914 !important; /* deep rich crimson red background */
}

/* Cringe Tracker HUD Widget */
.cringe-tracker-widget {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(18, 14, 30, 0.85);
  border: 1.5px solid var(--accent-purple);
  border-radius: 30px;
  padding: 8px 16px;
  color: var(--text-main);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 2000;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(157, 78, 221, 0.25);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
}
.cringe-tracker-widget:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(157, 78, 221, 0.4);
  border-color: var(--accent-rose);
}

/* Wheel Jackpot Celebration Animations */
.wheel-outer-ring.jackpot-active {
  animation: wheelJackpotPulse 0.4s infinite alternate ease-in-out, wheelShake 0.45s ease;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.85), 0 0 20px rgba(255, 133, 161, 0.6);
  border-color: #ffd700 !important;
}

@keyframes wheelJackpotPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}

@keyframes wheelShake {
  0%, 100% { margin-top: 0; }
  20% { margin-top: -3px; transform: translate(-3px, 1px); }
  40% { margin-top: 3px; transform: translate(3px, -1px); }
  60% { margin-top: -2px; transform: translate(-1px, -3px); }
  80% { margin-top: 2px; transform: translate(1px, 3px); }
}
