/* ============================================
   Rate Goals - Game Container Styles
   Layout and styling for the voting game view
   ============================================ */

/* ===========================================
   Game Page Reset
   =========================================== */

.game-page {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

/* ===========================================
   Game Container Layout (Mobile-first)
   =========================================== */

.game-container {
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0.35rem;
  box-sizing: border-box;
}

.game-container .navbar {
  flex: 0 0 auto;
  max-height: 3rem;
  margin-bottom: 0.25rem;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1);
  background-color: var(--navbar-bg);
}

.game-container .columns {
  flex: 1;
  margin: 0;
  display: flex;
  padding: 0;
}

.game-container .column {
  padding: 0 0.25rem;
  display: flex;
  flex-direction: column;
}

.game-container .column .hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
}

.game-container .container.p-4 {
  padding: 0.35rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Desktop only: lock viewport height and prevent scrolling */
@media screen and (min-width: 769px) {
  .game-container {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }

  .game-container .columns {
    overflow: hidden;
    height: calc(100vh - 3.5rem);
    max-height: calc(100vh - 3.5rem);
  }

  .game-container .column .hero {
    overflow: hidden;
  }

  .game-container .container.p-4 {
    overflow: hidden;
  }
}

/* ===========================================
   Player Header Section
   =========================================== */

.game-container .player-header {
  flex: 0 0 auto;
  padding: 0.2rem 0;
  margin-bottom: 0.2rem;
}

.player-header {
  padding-bottom: 0.5rem;
}

.player-header .title {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
  line-height: 1.1;
}

.player-header .subtitle {
  margin-top: 0;
  margin-bottom: 0.25rem;
  line-height: 1.1;
}

.game-container .title.is-2 {
  font-size: 1.6rem;
  margin-bottom: 0.15rem;
  line-height: 1.1;
}

.game-container .subtitle.is-5 {
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
  line-height: 1.2;
}

.game-container .subtitle.is-6 {
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
  line-height: 1.2;
}

.game-container .has-text-white.subtitle {
  font-size: 0.85rem;
  margin: 0;
  padding: 0;
}

/* ===========================================
   Video Container Styles
   =========================================== */

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  background-color: #000;
  overflow: hidden;
  margin-bottom: 1rem;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 10px;
}

.game-container .video-container:hover {
  transform: scale(1.01);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Responsive video container */
.responsive-video-container {
  width: 100%;
  margin: 0.25rem auto;
  max-width: 800px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  background-color: #000;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.video-container-wrapper {
  position: relative;
  background: #000;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.video-container__aspect-ratio {
  position: relative;
  padding-top: 56.25%;
  height: 0;
  width: 100%;
}

.video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* YouTube Facade - Lightweight thumbnail placeholder */
.youtube-facade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.youtube-facade:hover .youtube-facade__play-btn {
  background-color: #f00;
}

.youtube-facade img {
  display: block;
}

.image.is-16by9 {
  overflow: hidden;
  border-radius: 10px;
}

/* ===========================================
   Stats Container & Boxes
   =========================================== */

.stats-container {
  display: flex;
  justify-content: center;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
  width: 100%;
}

.stats-box {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 0.35rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
  margin: 0.25rem;
  min-width: 90px;
  transition: all 0.3s ease;
  transform: translateZ(0);
  backface-visibility: hidden;
  flex: 0 0 auto;
}

.stats-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.stats-box .is-size-1 {
  font-size: 1.4rem;
}

.stats-box .is-size-5 {
  font-size: 0.85rem;
}

.stats-box p {
  margin: 0;
  padding: 0;
  line-height: 1;
}

.stats-box__label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.1rem;
}

.stats-box__value-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-box__value {
  font-size: 1.3rem;
  color: var(--primary-color);
  font-weight: bold;
  margin: 0;
}

/* ===========================================
   Results Container
   =========================================== */

.results-container {
  margin-top: 1rem;
  margin-bottom: 1rem;
  background-color: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  position: relative;
  flex: 0 0 auto;
}

.hero-body-result {
  width: 100%;
  text-align: center;
  padding: 0.25rem 0;
}

.hero-body-result__stats {
  display: flex;
  justify-content: center;
  margin: 0.15rem 0;
  flex-wrap: wrap;
}

/* ===========================================
   Contestant Cards (Desktop)
   =========================================== */

.contestant-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--primary-color);
  border-radius: 12px;
  padding: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  justify-content: space-between;
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.contestant-card .card-content {
  flex: 1;
  overflow: auto;
  padding: 1rem;
}

.contestant-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.contestant-card.player-two {
  background-color: var(--secondary-color);
}

.contestant-card.winner-card {
  box-shadow: 0 0 30px rgba(14, 165, 165, 0.5), 0 8px 20px rgba(0, 0, 0, 0.15);
  transform: scale(1.02);
}

.contestant-card.loser-card {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  opacity: 0.65;
  transform: scale(0.98);
}

.loser-card {
  filter: grayscale(20%);
}

/* Contestant card header */
.contestant-card__header {
  text-align: center;
  margin-bottom: 0.35rem;
}

.contestant-card__title {
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.15rem;
}

.contestant-card__subtitle {
  color: white;
  font-size: 0.9rem;
  margin: 0;
}

.contestant-card__subtitle--muted {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Winner header animation */
.contestant-card__winner-header {
  animation: pulseGlow 0.5s ease-out;
}

.contestant-card__winner-text {
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.15rem;
}

.contestant-card__winner-emoji {
  color: white;
  font-size: 0.9rem;
  margin: 0;
}

/* Loser state */
.contestant-card__loser-text {
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.15rem;
  opacity: 0.8;
}

.contestant-card__loser-subtitle {
  color: white;
  font-size: 0.9rem;
  margin: 0;
  opacity: 0.8;
}

/* Video container in card */
.contestant-card__video {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

/* Results section */
.contestant-card__results {
  margin-top: 0.5rem;
}

/* Submitting overlay */
.contestant-card__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 12px;
}

.contestant-card__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.contestant-card__overlay-text {
  color: white;
  margin-top: 0.75rem;
  font-weight: 600;
}

/* Contestant column */
.contestant-column {
  padding: 0.25rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ===========================================
   Vote Buttons
   =========================================== */

.vote-btn {
  margin-top: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.vote-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 1);
}

.vote-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.vote-btn__content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.vote-btn__icon {
  font-size: 1rem;
}

.vote-btn.player-two {
  color: var(--secondary-color);
}

/* Ripple effect on vote button */
.vote-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.vote-btn:active::after {
  width: 300px;
  height: 300px;
}

/* ===========================================
   Next Matchup Button (Desktop)
   =========================================== */

.next-matchup-wrapper {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.next-matchup-btn-desktop {
  background: linear-gradient(135deg, var(--primary-color) 0%, #22c55e 100%);
  border: none;
  color: white;
  padding: 1rem 3rem;
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(14, 165, 165, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
}

.next-matchup-btn-desktop:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 30px rgba(14, 165, 165, 0.45);
}

.next-matchup-btn-desktop:active {
  transform: translateY(0) scale(0.98);
}

/* ===========================================
   Rating Change Badge
   =========================================== */

.rating-change {
  font-size: 0.9rem;
  font-weight: bold;
  margin-left: 0.25rem;
}

.rating-change--positive {
  color: var(--success-color);
}

.rating-change--negative {
  color: var(--danger-color);
}

/* ===========================================
   Submitting Overlay
   =========================================== */

.submitting-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  z-index: 10;
}

.submitting-overlay__spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.submitting-overlay__text {
  color: white;
  margin-top: 0.75rem;
  font-weight: bold;
  font-size: 1rem;
}

/* ===========================================
   Confetti Container
   =========================================== */

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  will-change: transform, opacity;
}
