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

body {
  font-family: 'Nunito', sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100dvh;
  background: linear-gradient(180deg, #e8f4fd 0%, #c5e1f5 40%, #a8d4ef 100%);
  -webkit-tap-highlight-color: transparent;
}

/* Only hide cursor on desktop with hover capability */
@media (hover: hover) and (pointer: fine) {
  body.cursor-active * { cursor: none; }
}

/* Wii Cursor - desktop only */
#wii-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  width: 40px;
  height: 52px;
  transform: translate(-8px, -2px);
  transition: transform 0.05s ease-out;
  filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.3));
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  #wii-cursor { display: block; }
}

/* Background effects */
@keyframes floatOrb {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
  25% { transform: translateY(-30px) translateX(15px); opacity: 0.5; }
  50% { transform: translateY(-15px) translateX(-10px); opacity: 0.4; }
  75% { transform: translateY(-40px) translateX(20px); opacity: 0.6; }
}

.floating-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
  animation: floatOrb var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
}

@keyframes lightRay {
  0%, 100% { opacity: 0.03; transform: rotate(var(--rot)) scaleY(1); }
  50% { opacity: 0.08; transform: rotate(var(--rot)) scaleY(1.1); }
}

.light-ray {
  position: absolute;
  top: -20%;
  width: 120px;
  height: 140%;
  background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 100%);
  animation: lightRay var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
  transform-origin: top center;
}

/* Channel animations */
@keyframes channelSlideIn {
  0% { transform: scale(0.3) translateY(40px); opacity: 0; }
  60% { transform: scale(1.05) translateY(-3px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.channel-tile {
  animation: channelSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  background: none;
  border: none;
  padding: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .channel-tile:hover .channel-tile-inner {
    transform: scale(1.06);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15), 0 0 20px rgba(100,180,255,0.3);
  }
}

.channel-tile:active .channel-tile-inner {
  transform: scale(0.94);
}

/* Click ripple */
@keyframes ripple {
  0% { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(2.5); opacity: 0; }
}

.click-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  width: 60px;
  height: 60px;
  animation: ripple 0.5s ease-out forwards;
  pointer-events: none;
}

/* Channel open/close */
@keyframes channelOpen {
  0% { transform: scale(0.1); opacity: 0; border-radius: 24px; }
  100% { transform: scale(1); opacity: 1; border-radius: 0; }
}

.channel-open-anim {
  animation: channelOpen 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes channelClose {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.1); opacity: 0; }
}

.channel-close-anim {
  animation: channelClose 0.3s ease-in forwards;
}

/* Home overlay */
@keyframes homeOverlayIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.home-overlay {
  animation: homeOverlayIn 0.3s ease forwards;
}

/* Page transitions */
@keyframes pageSlideLeft {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-100%); opacity: 0; }
}

@keyframes pageSlideRight {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

@keyframes pageSlideInLeft {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes pageSlideInRight {
  0% { transform: translateX(-100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.page-slide-left { animation: pageSlideLeft 0.35s ease-in-out forwards; }
.page-slide-right { animation: pageSlideRight 0.35s ease-in-out forwards; }
.page-slide-in-left { animation: pageSlideInLeft 0.35s ease-in-out forwards; }
.page-slide-in-right { animation: pageSlideInRight 0.35s ease-in-out forwards; }

/* Channel wobble */
@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(0.5deg); }
  75% { transform: rotate(-0.5deg); }
}

.channel-wobble .channel-tile-inner {
  animation: wobble 4s ease-in-out infinite;
}

/* Easter egg */
@keyframes easterEgg {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.3) rotate(10deg); }
  50% { transform: scale(0.8) rotate(-10deg); }
  75% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.easter-egg-anim {
  animation: easterEgg 1s ease-in-out;
}

/* Startup */
@keyframes startupFadeIn {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes startupFadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

.startup-screen {
  animation: startupFadeIn 0.5s ease-out forwards;
}

.startup-screen.fade-out {
  animation: startupFadeOut 0.4s ease-in forwards;
}

/* Button pulse */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(100,180,255,0.3); }
  50% { box-shadow: 0 0 20px rgba(100,180,255,0.6); }
}

@media (hover: hover) {
  .btn-pulse:hover {
    animation: pulseGlow 1.5s ease-in-out infinite;
  }
}

/* Dark theme */
.dark-theme {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%) !important;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(100,180,255,0.4); border-radius: 3px; }

/* Channel tile inner transition */
.channel-tile-inner {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Safe area padding for notched devices */
.safe-bottom {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.safe-top {
  padding-top: max(8px, env(safe-area-inset-top));
}