:root {
  --bg-dark: #222222;
  --brand-blue: #3454D1;
  --brand-sage: #9BC1BC;
  --text-cream: #E6EBE0;
  --font-title: 'Pacifico', cursive;
  --font-text: 'Montserrat', sans-serif;
  --accent-red: #e74c3c;
  --accent-green: #2ecc71;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-cream);
  font-family: var(--font-text);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- GLOW TRAIL BACKGROUND --- */
#canvas-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(135deg, #1a1a1f 0%, #2a2a35 100%);
}

/* --- HEADER --- */
.ui-top {
  width: 94%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  z-index: 50;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img{
  height: 30px;
  width: auto;
  display: block;
}

.scores-container {
  display: flex;
  gap: 10px;
}

.score-pill {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--brand-blue);
  padding: 5px 15px;
  border-radius: 5px;
  text-align: center;
  backdrop-filter: blur(5px);
}

.score-pill span:first-child {
  font-size: 0.6rem;
  color: var(--brand-sage);
  text-transform: uppercase;
  display: block;
}
.score-pill span:last-child {
  font-size: 1rem;
  font-weight: 700;
}

/* --- QUESTION --- */
.question-container {
  text-align: center;
  z-index: 40;
  padding: 10px 0;
  margin-bottom: 10px;
}

.question-text {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  opacity: 0.8;
  margin: 5px 0;
}

.keyword {
  font-family: var(--font-title);
  font-size: 2.8rem;
  color: var(--brand-blue);
  line-height: 1.6;
  display: block;
  margin: 15px 0;
  text-shadow: 0 0 20px rgba(52, 84, 209, 0.4);
}
.keyword.lower {
  color: var(--accent-red);
  text-shadow: 0 0 20px rgba(231, 76, 60, 0.4);
}

/* --- GAME LAYOUT --- */
.game-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-bottom: 20px;
}

.cards-container {
  display: flex;
  width: 100%;
  height: 100%;
  max-height: 550px;
  gap: 2rem;
  padding: 0 20px;
  z-index: 10;
}

.movie-card {
  flex: 1;
  position: relative;
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease, border 0.3s;
  cursor: pointer;
  border: 3px solid transparent;
  display: flex;
  flex-direction: column;
}

.movie-card:hover {
  transform: translateY(-5px);
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
  transition: opacity 0.4s;
}

.card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9) 70%);
  padding: 1.5rem;
  text-align: center;
}

.movie-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.movie-budget {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--brand-sage);
  font-variant-numeric: tabular-nums;
}

.movie-budget--hidden {
  opacity: 0;
}

.vs-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: var(--brand-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  z-index: 20;
  box-shadow: 0 0 20px rgba(52, 84, 209, 0.5);
  border: 3px solid var(--bg-dark);
}

.mobile-choice-btns {
  display: none;
  gap: 15px;
  margin-top: 15px;
  width: 100%;
  padding: 0 20px;
  z-index: 45;
}

.btn-choice {
  flex: 1;
  padding: 15px;
  border-radius: 8px;
  border: 2px solid var(--brand-blue);
  background: rgba(52, 84, 209, 0.1);
  color: white;
  font-weight: 700;
  font-family: var(--font-text);
  text-transform: uppercase;
  cursor: pointer;
}

@media (max-width: 768px) {
  body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  .ui-top {
    padding: 10px 0;
  }

  .logo-img{
    height: 26px;
  }

  .scores-container { gap: 8px; }

  .score-pill {
    padding: 4px 10px;
    border-radius: 6px;
  }
  .score-pill span:first-child { font-size: 0.55rem; }
  .score-pill span:last-child { font-size: 0.95rem; }

  .cards-container {
    flex-direction: column;
    max-height: none;
    gap: 15px;
    padding: 0 10px;
  }

  .movie-card {
    height: 260px;
    min-height: 260px;
    flex: none;
  }

  .vs-badge {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    margin: -25px auto;
  }

  .mobile-choice-btns {
    display: flex;
  }
}

/* Small mobile tuning */
@media (max-width: 420px) {
  .keyword { font-size: 2.2rem; line-height: 1.4; }
  .movie-title { font-size: 1.2rem; }
  .movie-budget { font-size: 1.5rem; }
  .modal-title { font-size: 2.2rem; }
  .btn-main { padding: 12px 28px; }
}

/* Tablet layout adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  .cards-container {
    gap: 1rem;
    max-height: 60vh;
    padding: 0 16px;
  }

  .movie-card {
    height: 320px;
    min-height: 320px;
  }

  .vs-badge {
    width: 44px;
    height: 44px;
  }
}

/* --- BONUS POPUP --- */
.bonus-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bonus-popup.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.bonus-popup-content {
  background: linear-gradient(135deg, rgba(52, 84, 209, 0.95) 0%, rgba(155, 193, 188, 0.95) 100%);
  border: 3px solid var(--brand-blue);
  border-radius: 20px;
  padding: 30px 50px;
  text-align: center;
  box-shadow: 0 0 50px rgba(52, 84, 209, 0.8), 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: pulse 0.6s ease-in-out;
}

.bonus-icon {
  font-size: 4rem;
  margin-bottom: 10px;
  animation: bounce 0.6s ease-in-out;
}

.bonus-text {
  font-family: var(--font-title);
  font-size: 2.5rem;
  color: white;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 5px;
  letter-spacing: 2px;
}

.bonus-subtext {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-15px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(-8px); }
}

@media (max-width: 768px) {
  .bonus-popup-content {
    padding: 25px 40px;
  }
  
  .bonus-icon {
    font-size: 3rem;
  }
  
  .bonus-text {
    font-size: 2rem;
  }
  
  .bonus-subtext {
    font-size: 0.95rem;
  }
}

/* --- BUTTONS + MODALS --- */
.btn-main {
  background: var(--bg-dark);
  color: var(--brand-blue);
  border: 2px solid var(--brand-blue);
  padding: 15px 40px;
  border-radius: 5px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 20, 20, 0.98);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  text-align: center;
  padding: 2rem;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 3rem;
  margin-bottom: 1rem;
}

.modal-title--start {
  color: var(--brand-blue);
}

.modal-title--end {
  color: var(--accent-red);
}

.modal-subtext {
  margin-bottom: 2rem;
  color: var(--brand-sage);
}

.modal-score-line {
  margin-bottom: 2rem;
}

.modal-score-number {
  font-weight: 700;
}

/* --- FOOTER --- */
.page-footer{
  width: 94%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 0 18px;
  text-align: center;
  z-index: 40;
}

.page-footer p{
  color: var(--brand-sage);
  font-size: 0.85rem;
}

.page-footer a{
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 700;
}

.page-footer a:hover{
  text-decoration: underline;
}

.footer-links{ margin: 0; }
.footer-disclaimer{
  margin: 6px 0 0;
  font-size: 0.75rem;
  opacity: 0.9;
}
