* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

/* Main background that persists throughout the app */
html {
  min-height: 100vh;
  background: url("messi background.png") center/cover no-repeat fixed;
  position: relative;
}

html::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: -1;
}

body {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: transparent;
}

/* Remove old blur effect since we're handling it in html::before */
body::before {
  display: none;
}

/* Remove old overlay since we're handling it in html::before */
body::after {
  display: none;
}

.video-container {
  min-height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2;
  background: transparent !important;
}

/* Dark overlay and blur for game section */
.video-container::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: -1;
}

.container {
  text-align: center;
  color: white;
  z-index: 2;
  padding: 2rem;
  max-width: 800px;
  width: 90%;
  margin-top: -32px;
}

h1 {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #ffffff 0%, #42cae0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(66, 202, 224, 0.3);
}

.description {
  margin-bottom: 3rem;
}

.description p {
  font-size: 1.5rem;
  line-height: 1.6;
  margin: 1rem 0;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Glass effect button */
.start-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem 3rem;
  font-size: 1.5rem;
  color: white;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.start-button:hover {
  background: rgba(66, 202, 224, 0.2);
  border-color: rgba(66, 202, 224, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(66, 202, 224, 0.3);
}

.start-button:active {
  transform: translateY(0);
}

.start-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.container h1 {
  margin-bottom: 32px;
  padding: 0;
}

.container p {
  margin-bottom: 32px;
}

#startGame {
  margin-top: 0;
}

.container img {
  width: 100%;
  max-width: 1200px;
  border-radius: 16px 16px 0 0;
  margin: 0;
}

.player-name {
  position: absolute;
  top: 2rem;
  left: 2rem;
  font-family: "Montserrat", sans-serif;
  font-size: 2rem;
  font-weight: 600;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 3;
}

.hero-image {
  margin: -2rem -2rem 2rem -2rem;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  max-height: 400px;
}

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

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.overlay.visible {
  display: block;
  opacity: 1;
}

.countdown {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 200px;
  font-weight: bold;
  color: #42cae0;
  text-shadow: 0 0 20px rgba(66, 202, 224, 0.5);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.countdown.visible {
  display: block;
}

.countdown.animate {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.2);
}

.video-wrapper {
  position: relative;
  width: 80%;
  max-width: 1200px;
  height: 290px;
  margin: 0 0 8px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3;
}

.goal-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
}

.video-question-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  justify-content: center;
  align-items: center;
}

.video-question-overlay.visible {
  display: flex;
  opacity: 1;
}

.video-question {
  color: white;
  font-size: 2.5rem;
  font-weight: bold;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  padding: 0 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.video-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.video-container.visible {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 1;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 80%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease-in-out;
}

@media (max-width: 768px) {
  .options-grid {
    grid-template-columns: 1fr;
    margin-left: 16px;
    margin-right: 16px;
    width: calc(100% - 32px);
    padding: 0;
  }

  h1 {
    font-size: 32px !important;
  }

  .description p {
    font-size: 16px !important;
  }

  .start-button {
    transform: translateY(48px) !important;
  }

  .video-container {
    width: 100%;
    padding: 0;
  }

  .nav-bar {
    width: 100%;
    margin-bottom: 16px !important;
  }

  .nav-logo {
    height: 24px !important;
    width: 24px !important;
  }

  .video-wrapper {
    height: 180px !important;
    min-height: 180px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  .overlay-text h2 {
    font-size: 2rem;
  }

  #questionOverlay h2 {
    font-size: 1.5rem;
    font-weight: 500;
  }

  .timeout-overlay h2,
  .correct-overlay h2,
  .wrong-overlay h2 {
    font-size: 2rem;
  }

  .option-button {
    font-size: 14px !important;
    padding: 12px !important;
  }

  .stats-wrapper {
    gap: 8px;
    margin-bottom: 24px !important;
    width: calc(100% - 32px) !important;
    margin-left: 16px !important;
    margin-right: 16px !important;
    max-width: none;
  }

  .progress-tracker,
  .points-tracker {
    font-size: 14px !important;
  }

  .music-credit {
    margin-top: 40px !important;
  }
}

.options-grid.visible {
  opacity: 1;
  transform: translateY(0);
}

.option-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 1rem;
  color: white;
  font-size: 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.option-button:hover {
  background: rgba(66, 202, 224, 0.2);
  border-color: rgba(66, 202, 224, 0.4);
  transform: translateY(-2px);
}

.option-button.disabled,
.option-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.option-button.disabled:hover,
.option-button:disabled:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: none;
}

.option-button.selected {
  background: rgba(66, 202, 224, 0.3);
  border-color: #42cae0;
}

.option-button.correct {
  background: rgba(46, 213, 115, 0.3);
  border-color: #2ed573;
}

.option-button.incorrect {
  background: rgba(255, 71, 87, 0.3);
  border-color: #ff4757;
}

.next-button {
  background: rgba(66, 202, 224, 0.2);
  border: 1px solid rgba(66, 202, 224, 0.4);
  color: white;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 16px;
  display: none;
  opacity: 0;
  transform: translateY(20px);
}

.next-button.visible {
  display: inline-block;
  opacity: 1;
  transform: translateY(0);
}

.next-button:hover {
  background: rgba(66, 202, 224, 0.3);
  transform: translateY(-2px);
}

.next-button.disabled,
.next-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.next-button.disabled:hover,
.next-button:disabled:hover {
  background: rgba(66, 202, 224, 0.2);
  transform: none;
}

.timer-bar-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.timer-bar-container.visible {
  opacity: 1;
}

.timer-bar {
  width: 100%;
  height: 100%;
  background-color: #42cae0;
  transform-origin: left;
  transform: scaleX(1);
  transition: none;
}

.timer-bar.running {
  transform: scaleX(0);
  transition: transform 8s linear;
  animation: timerColorChange 8s linear forwards;
}

@keyframes timerColorChange {
  0% {
    background-color: #42cae0;
  }
  62.5% {
    /* At 5 seconds */
    background-color: #42cae0;
  }
  62.5001% {
    /* Immediate change at 5 seconds */
    background-color: #ff3333;
  }
  100% {
    background-color: #ff3333;
  }
}

/* Overlay Messages */
.overlay-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  z-index: 10;
}

.overlay-text.visible {
  display: flex;
  opacity: 1;
}

.overlay-text h2 {
  color: white;
  font-size: 2.5rem;
  margin: 0;
  text-align: center;
  padding: 2rem;
}

.timeout-overlay h2 {
  color: #ff4757;
}

.correct-overlay h2 {
  color: #2ed573;
}

.wrong-overlay h2 {
  color: #ff4757;
}

/* Stats Container */
.stats-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  color: white;
  padding: 0.5rem 1rem;
  width: 100%;
}

.progress-tracker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
}

.points-tracker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
}

#currentVideo,
#totalVideos,
#pointsCount {
  color: #42cae0;
  font-weight: bold;
}

.mute-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: white;
  transition: opacity 0.3s ease;
  position: static;
}

.mute-button svg {
  width: 24px;
  height: 24px;
}

.mute-button:hover {
  opacity: 0.7;
}

.mute-button.muted .sound-wave {
  display: none;
}

/* Special styling for final score backgrounds */
html.final-score {
  background: var(--final-background) center/cover no-repeat fixed;
}

html.final-score::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: -1;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Footer styling */
.footer {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 0.75rem;
  text-align: center;
  width: 100%;
  z-index: 10;
}

.stats-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 80%;
  max-width: 1200px;
  margin: 0 auto 32px auto;
  z-index: 3;
}

#questionOverlay {
  background: rgba(0, 0, 0, 0.35);
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 80%;
  max-width: 1200px;
  margin: 0 auto 32px auto;
  padding: 16px 16px 0 16px;
}

.nav-logo {
  height: 32px;
  width: auto;
}

.video-wrapper {
  position: relative;
  width: 80%;
  max-width: 1200px;
  height: 290px;
  margin: 0 0 8px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.visible {
  display: flex;
}

.modal-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 16px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-content h2 {
  color: white;
  font-size: 20px;
  margin-bottom: 12px;
}

.modal-content p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  margin-bottom: 24px;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-button {
  padding: 12px 24px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.modal-button.primary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-button.primary:hover {
  background: rgba(66, 202, 224, 0.2);
  border-color: rgba(66, 202, 224, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(66, 202, 224, 0.3);
}

.modal-button.secondary {
  background: transparent;
  color: white;
  border: none;
  padding: 12px 16px;
}

.modal-button.secondary:hover {
  opacity: 0.8;
}

@media (max-width: 768px) {
  .options-grid {
    grid-template-columns: 1fr;
    margin-left: 16px;
    margin-right: 16px;
    width: calc(100% - 32px);
    padding: 0;
  }

  h1 {
    font-size: 32px !important;
  }

  .description p {
    font-size: 16px !important;
  }

  .start-button {
    transform: translateY(48px) !important;
  }

  .video-container {
    width: 100%;
    padding: 0;
  }

  .nav-bar {
    width: 100%;
    margin-bottom: 16px !important;
  }

  .nav-logo {
    height: 24px !important;
    width: 24px !important;
  }
}
