/* ==========================================================================
   THE CAT TRIP - STYLESHEET
   Psychedelic Feline Experience & 18+ Age Gate
   ========================================================================== */

:root {
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Fredoka', cursive, sans-serif;
  --font-retro: 'Press Start 2P', monospace;
  
  --color-bg-dark: #07070d;
  --color-card-bg: rgba(18, 18, 28, 0.75);
  --color-card-border: rgba(255, 255, 255, 0.12);
  --color-primary: #ff007f;
  --color-secondary: #00f0ff;
  --color-accent: #ffe600;
  --color-text: #ffffff;
  --color-text-dim: #a5a5c5;
  --color-error: #ff3366;
  --color-error-bg: rgba(255, 51, 102, 0.15);
  
  --rainbow-gradient: linear-gradient(
    90deg,
    #ff0000 0%,
    #ff7700 16.6%,
    #ffff00 33.3%,
    #00ff00 50%,
    #00ffff 66.6%,
    #0000ff 83.3%,
    #8b00ff 100%
  );
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--color-bg-dark);
  font-family: var(--font-primary);
  color: var(--color-text);
  user-select: none;
}

/* ==========================================================================
   Background Layers
   ========================================================================== */

.bg-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* Very blurry cat in background */
.blurry-cat-layer {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: blur(35px) brightness(0.55) contrast(1.15) saturate(1.2);
  transform: scale(1.15);
  transition: filter 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: filter, transform;
}

/* When the trip activates, background becomes hyper-psychedelic */
body.trip-active .blurry-cat-layer {
  filter: blur(14px) brightness(1.1) saturate(3.5) contrast(1.4);
  animation: bg-pulse-zoom 4s ease-in-out infinite alternate, bg-hue-spin 5s linear infinite;
}

@keyframes bg-pulse-zoom {
  0% { transform: scale(1.15) rotate(0deg); }
  50% { transform: scale(1.42) rotate(4deg); }
  100% { transform: scale(1.22) rotate(-4deg); }
}

@keyframes bg-hue-spin {
  0% { filter: blur(12px) brightness(1.1) saturate(3.5) hue-rotate(0deg); }
  50% { filter: blur(6px) brightness(1.35) saturate(4.5) hue-rotate(180deg); }
  100% { filter: blur(12px) brightness(1.1) saturate(3.5) hue-rotate(360deg); }
}

/* Trip Canvas (kaleidoscope, hyperspace stars, rainbow vortex) */
.trip-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  mix-blend-mode: screen;
}

body.trip-active .trip-canvas {
  opacity: 1;
}

/* Psychedelic overlay */
.psychedelic-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.6) 100%);
  transition: opacity 0.8s ease;
}

body.trip-active .psychedelic-overlay {
  opacity: 0.85;
  background: radial-gradient(circle at center, rgba(255, 0, 128, 0.15) 0%, rgba(0, 240, 255, 0.2) 50%, rgba(0, 0, 0, 0.4) 100%);
  animation: overlay-pulse 3s ease-in-out infinite alternate;
}

@keyframes overlay-pulse {
  0% { opacity: 0.7; filter: hue-rotate(0deg); }
  100% { opacity: 0.95; filter: hue-rotate(360deg); }
}

/* Laser canvas layer */
.laser-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  pointer-events: none;
}

/* Cat Storm Container */
.cat-storm-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}

/* ==========================================================================
   Age Gate Modal
   ========================================================================== */

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at center, rgba(10, 10, 18, 0.4) 0%, rgba(5, 5, 10, 0.85) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

.age-gate.dismissed {
  opacity: 0;
  transform: scale(1.15) rotate(-2deg);
  pointer-events: none;
  visibility: hidden;
}

.gate-card {
  width: 100%;
  max-width: 480px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 28px;
  padding: 2.75rem 2.25rem 2.25rem;
  text-align: center;
  position: relative;
  box-shadow: 
    0 24px 60px -10px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(255, 0, 127, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  animation: card-appear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes card-appear {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cat-lock-badge {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #232338 0%, #11111d 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 0, 128, 0.3);
}

.badge-icon {
  font-size: 1.75rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.badge-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 0, 128, 0.6);
  animation: ring-spin 12s linear infinite;
}

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

.gate-header {
  margin-bottom: 2rem;
}

.gate-tag {
  display: inline-block;
  font-family: var(--font-retro);
  font-size: 0.65rem;
  letter-spacing: 2px;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 0, 128, 0.15);
  color: #ff55a3;
  border: 1px solid rgba(255, 0, 128, 0.3);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.gate-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  margin-bottom: 0.85rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 40%, #ffc0e0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gate-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-dim);
  line-height: 1.55;
  padding: 0 0.5rem;
}

/* Form */
.age-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  text-align: left;
}

.input-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #c4c4e0;
  margin-bottom: 0.55rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.date-input {
  width: 100%;
  height: 56px;
  padding: 0 3.25rem 0 1.25rem;
  background: rgba(12, 12, 22, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  color: #ffffff;
  font-family: var(--font-primary);
  font-size: 1.1rem;
  font-weight: 600;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.date-input:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.date-input:focus {
  border-color: var(--color-primary);
  background: rgba(18, 18, 32, 0.95);
  box-shadow: 
    0 0 0 4px rgba(255, 0, 127, 0.25),
    inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Custom WebKit Date picker icon style */
.date-input::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  right: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.calendar-icon {
  position: absolute;
  right: 1.25rem;
  pointer-events: none;
  font-size: 1.25rem;
  opacity: 0.75;
}

/* Error Alert */
.gate-error {
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  background: var(--color-error-bg);
  border: 1px solid rgba(255, 51, 102, 0.4);
  color: #ff7090;
  border-radius: 14px;
  padding: 0 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.gate-error.visible {
  min-height: 48px;
  max-height: 100px;
  padding: 0.75rem 1rem;
  opacity: 1;
  margin-top: -0.25rem;
}

/* Shake Animation */
.shake {
  animation: gate-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes gate-shake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Submit Button */
.enter-btn {
  width: 100%;
  height: 56px;
  background: linear-gradient(135deg, #ff007f 0%, #7928ca 100%);
  border: none;
  border-radius: 16px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(255, 0, 127, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: all 0.25s ease;
}

.enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -5px rgba(255, 0, 127, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, #ff1a8c 0%, #8b34e0 100%);
}

.enter-btn:active {
  transform: translateY(1px);
}

.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-25deg);
  animation: shine 4s ease-in-out infinite;
}

@keyframes shine {
  0% { left: -100%; }
  30%, 100% { left: 150%; }
}

.btn-arrow {
  font-size: 1.3rem;
  transition: transform 0.2s ease;
}

.enter-btn:hover .btn-arrow {
  transform: translateX(4px);
}

.gate-footer {
  margin-top: 1.75rem;
  font-size: 0.75rem;
  color: #7b7b9e;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* ==========================================================================
   Cat Trip HUD (In-Trip Controls)
   ========================================================================== */

.trip-hud {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(14, 14, 26, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 240, 255, 0.2);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
}

.trip-hud.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-30px);
  pointer-events: none;
}

.hud-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hud-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.trip-badge {
  font-family: var(--font-retro);
  font-size: 0.6rem;
  color: #00ff66;
  background: rgba(0, 255, 102, 0.15);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 255, 102, 0.3);
  letter-spacing: 1px;
  animation: pulse-green 1.5s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.cat-counter {
  font-family: var(--font-retro);
  font-size: 0.7rem;
  color: #ffeb3b;
  letter-spacing: 1px;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hud-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.hud-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.4);
}

.hud-btn-special {
  background: linear-gradient(90deg, #ff007f, #ff7700);
  border: none;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.4);
}

.hud-btn-special:hover {
  background: linear-gradient(90deg, #ff1a8c, #ff8c1a);
  box-shadow: 0 0 22px rgba(255, 0, 127, 0.7);
}

.hud-btn-audio {
  border-color: rgba(0, 240, 255, 0.4);
  color: #00f0ff;
}

.hud-btn.active {
  background: #00f0ff;
  color: #000000;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
}

/* ==========================================================================
   Trip Announcement Banner
   ========================================================================== */

.trip-banner {
  position: fixed;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  pointer-events: none;
  animation: banner-flash 3.5s ease-out forwards;
}

.trip-banner.hidden {
  display: none;
}

.trip-banner-text {
  font-family: var(--font-retro);
  font-size: clamp(0.9rem, 2.5vw, 1.4rem);
  color: #ffffff;
  text-shadow: 
    0 0 8px #ff00ff,
    0 0 16px #00ffff,
    0 0 24px #ffff00;
  letter-spacing: 2px;
  text-align: center;
  padding: 0.8rem 1.6rem;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 999px;
  border: 2px solid #00f0ff;
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
}

@keyframes banner-flash {
  0% { transform: translateX(-50%) scale(0.6); opacity: 0; }
  15% { transform: translateX(-50%) scale(1.1); opacity: 1; }
  25% { transform: translateX(-50%) scale(1); opacity: 1; }
  80% { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) scale(0.9) translateY(-20px); opacity: 0; }
}

/* ==========================================================================
   Flying Nyan Cats & Psychedelic Sprites
   ========================================================================== */

.flying-nyan-cat {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  z-index: 12;
  will-change: transform;
}

/* Authentic Nyan Cat Sprite with Rainbow Trail */
.nyan-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.nyan-trail {
  position: absolute;
  right: 80%;
  height: 48px;
  width: 200px;
  background: repeating-linear-gradient(
    to bottom,
    #ff0000 0px, #ff0000 8px,
    #ff9900 8px, #ff9900 16px,
    #ffff00 16px, #ffff00 24px,
    #33ff00 24px, #33ff00 32px,
    #0099ff 32px, #0099ff 40px,
    #6633ff 40px, #6633ff 48px
  );
  border-radius: 4px 0 0 4px;
  transform-origin: right center;
  animation: nyan-trail-wave 0.25s infinite ease-in-out alternate;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

@keyframes nyan-trail-wave {
  0% { transform: scaleY(0.92) skewY(-2deg); }
  100% { transform: scaleY(1.08) skewY(2deg); }
}

.nyan-sprite {
  width: 90px;
  height: 60px;
  position: relative;
  z-index: 2;
  animation: nyan-bob 0.25s infinite ease-in-out alternate;
}

@keyframes nyan-bob {
  0% { transform: translateY(-2px); }
  100% { transform: translateY(2px); }
}

/* Meme Cat Floating Head */
.floating-cat-head {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  z-index: 11;
  transition: transform 0.15s ease-out;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
}

.floating-cat-head:hover {
  transform: scale(1.3) rotate(15deg) !important;
}

.cat-head-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #ff00ff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 40px rgba(255, 0, 128, 0.6);
  animation: rainbow-border 2s linear infinite;
}

@keyframes rainbow-border {
  0% { border-color: #ff0000; box-shadow: 0 0 20px #ff0000; }
  17% { border-color: #ff7700; box-shadow: 0 0 20px #ff7700; }
  33% { border-color: #ffff00; box-shadow: 0 0 20px #ffff00; }
  50% { border-color: #00ff00; box-shadow: 0 0 20px #00ff00; }
  67% { border-color: #00ffff; box-shadow: 0 0 20px #00ffff; }
  83% { border-color: #8b00ff; box-shadow: 0 0 20px #8b00ff; }
  100% { border-color: #ff0000; box-shadow: 0 0 20px #ff0000; }
}

/* Floating speech bubble / captions */
.cat-meow-bubble {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #000000;
  font-family: var(--font-retro);
  font-size: 0.65rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  animation: meow-bubble-pop 1.5s ease-out forwards;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

@keyframes meow-bubble-pop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
  20% { opacity: 1; transform: translateX(-50%) scale(1.1); }
  30% { transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-25px); }
}

/* Rainbow Sparkle Cursor Trail Particles */
.sparkle-particle {
  position: fixed;
  pointer-events: none;
  z-index: 50;
  border-radius: 50%;
  animation: sparkle-fade 0.8s ease-out forwards;
}

@keyframes sparkle-fade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) translateY(-20px);
  }
}

/* Click Confetti Cats */
.confetti-cat {
  position: fixed;
  pointer-events: none;
  z-index: 40;
  font-size: 2rem;
  animation: confetti-explode 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes confetti-explode {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(1.4) rotate(var(--rot));
  }
}

/* Responsive Styles */
@media (max-width: 640px) {
  .gate-card {
    padding: 2.25rem 1.5rem 1.75rem;
    border-radius: 22px;
  }
  
  .gate-title {
    font-size: 1.6rem;
  }
  
  .gate-subtitle {
    font-size: 0.88rem;
  }
  
  .trip-hud {
    width: calc(100% - 2rem);
    border-radius: 20px;
    padding: 0.5rem 0.8rem;
  }
  
  .hud-header {
    gap: 0.5rem;
    justify-content: space-between;
  }
  
  .hud-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
  }
  
  .trip-badge {
    display: none;
  }
}
