/* Hide the default cursor */
body {
  cursor: none;
}

/* Apply the custom cursor */
body {
  cursor: url('./assets/cursor.cur'), auto;
}

/* Ensure the custom cursor is applied to all interactive elements */
a, button, .channel, .menu {
  cursor: url('./assets/cursor.cur'), auto;
}

/* Title display */
.channel {
  position: relative;
}

.channel .title {
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  pointer-events: none;
  z-index: 10;
}

.channel:hover .title {
  opacity: 1;
}

/* TV Static Effect */
.channel[data-static="true"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('./assets/static.gif') no-repeat center center;
  background-size: contain;
  opacity: 0.2;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
}

.channel[data-static="false"]::after {
  display: none;
}

/* Black Screen Overlay */
#black-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  z-index: 9999;
  cursor: pointer;
  opacity: 1;
  transition: opacity 1s ease;
}

/* Health and Safety Warning Screen */
#warning-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: Arial, sans-serif;
  z-index: 10000;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: auto;
}

#warning-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

#warning-screen h1 {
  font-size: 48px;
  margin-bottom: 30px;
}

#warning-screen p {
  font-size: 36px;
  margin: 20px 0;
}

#warning-screen a {
  color: #00a8ff;
  text-decoration: none;
  font-size: 36px;
}

#warning-screen a:hover {
  text-decoration: underline;
}

/* Animations */
#warning-screen p:last-of-type {
  opacity: 0;
  animation: fadeIn 1s ease-in 1s forwards, pulse 2s ease-in-out infinite 2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Main Menu Styles */
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  cursor: url('./assets/cursor.png'), auto;
}

/* Background fade-in effect */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('./assets/menu_background.png') no-repeat center center;
  background-size: cover;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: -1;
}

body.menu-visible::after {
  opacity: 1;
}

.menu {
  display: grid;
  grid-template-columns: repeat(4, 470px);
  grid-template-rows: repeat(3, 280px);
  grid-gap: 25px;
  width: fit-content;
  height: fit-content;
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 1s ease; /* Matched duration with black screen */
}

/* Wii Channel Static Lines */
#wiiChannel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 200%;
  z-index: 1; /* Above all channel elements */
  opacity: 0.08;
  pointer-events: none;
  mix-blend-mode: screen;
}

.channel {
  background: transparent;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  overflow: visible;
  width: 100%;
  height: 100%;
  position: relative;
}

.channel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

.channel .border {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110%;
  height: 110%;
  background: url('./assets/border.png') no-repeat center center;
  background-size: contain;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
}

.channel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('./assets/static.gif') no-repeat center center;
  background-size: contain;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Hover animations */
.channel::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110%;
  height: 110%;
  background: url('./assets/hover.png') no-repeat center center;
  background-size: contain;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: all .1s ease;
}

.channel:hover::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}