:root {
  --primary-bg: rgba(0, 0, 0, 0.7);
  --accent-color: #FF5F5F;
  --accent-hover: #FF3F3F;
  --correct-bg: rgba(0, 255, 0, 0.2);
  --incorrect-bg: rgba(255, 0, 0, 0.2);
  --text-color: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-animated: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  min-height: 100vh;
  background: linear-gradient(-45deg, #667eea, #6b7973, #b33232, #df7819);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Animated gradient background */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Background overlay for better readability */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("/data/BG.jpg") no-repeat center center/cover;
  opacity: 0.3;
  z-index: -1;
}

header {
  display: flex;
  justify-content: center;
  padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 2rem);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.status-wrapper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
}

.status-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1rem);
  flex-wrap: wrap;
}

.status,
#mode-indicator {
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: var(--text-color);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-weight: 700;
}

.social-icons {
  display: flex;
  align-items: center;
  gap: clamp(0.3rem, 1vw, 0.5rem);
}

.social-link,
.stats-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(32px, 5vw, 36px);
  height: clamp(32px, 5vw, 36px);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-color);
  text-decoration: none;
  font-size: clamp(1rem, 2vw, 1.1rem);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover,
.social-link:focus,
.stats-btn:hover,
.stats-btn:focus {
  transform: translateY(-2px) scale(1.05);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  outline: none;
}

.mute-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0;
  transition: transform 0.2s ease;
}

.mute-btn:hover {
  transform: scale(1.15);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
}

#game-container {
  display: none;
  width: 100vw;
  height: calc(100vh - clamp(40px, 8vh, 60px));
  flex-direction: column;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

#game-container.show {
  display: flex;
  animation: fadeIn 0.5s ease;
}

.split-container {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-height: 0;
  overflow: hidden;
}

/* Glassmorphism Panels */
.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(0.3rem, 1vw, 0.75rem);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.panel:hover,
.panel:focus {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.01);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  outline: none;
}

.panel:hover::before {
  opacity: 1;
}

.panel.correct {
  background: var(--correct-bg);
  animation: pulse-correct 0.6s ease;
}

.panel.incorrect {
  background: var(--incorrect-bg);
  animation: pulse-incorrect 0.6s ease;
}

.panel.loading::after {
  content: '';
  position: absolute;
  width: clamp(16px, 2.5vw, 20px);
  height: clamp(16px, 2.5vw, 20px);
  border: 3px solid var(--text-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.divider {
  width: 2px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.3), transparent);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.movie-poster {
  max-width: min(30vh, 45vw, 300px);
  height: auto;
  border-radius: 12px;
  margin-bottom: clamp(0.3rem, 1.5vw, 0.6rem);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.movie-poster:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.movie-poster.loading {
  opacity: 0;
  transform: scale(0.95);
}

/* Glassmorphism Movie Info */
.movie-info {
  font-size: clamp(0.8rem, 2.5vw, 1.2rem);
  font-weight: 700;
  padding: clamp(0.4rem, 1vw, 0.6rem) clamp(0.6rem, 1.5vw, 0.8rem);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  width: min(90%, 400px);
  text-align: center;
  transition: all 0.5s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Overlay Styles */
.overlay {
  display: none;
  position: fixed;
  top: clamp(40px, 8vh, 60px);
  left: 0;
  width: 100vw;
  height: calc(100vh - clamp(40px, 8vh, 60px));
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.5s ease;
}

.overlay.show {
  display: flex;
  animation: fadeIn 0.5s ease;
}

/* Glassmorphism Overlay Content */
.overlay-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: 20px;
  text-align: center;
  max-width: min(90%, 600px);
  z-index: 101;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  position: relative;
}

.stats-content {
  max-width: min(90%, 800px);
  max-height: 80vh;
  overflow-y: auto;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-color);
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.start-content {
  max-width: min(90%, 600px);
  width: 100%;
}

.start-content h2,
.overlay-content h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: clamp(0.5rem, 1.5vw, 1rem);
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.start-content p {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  margin-bottom: clamp(0.5rem, 2vw, 1rem);
  opacity: 0.9;
}

.mode-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  margin-top: clamp(0.5rem, 1.5vw, 1rem);
}

/* Glassmorphism Mode Panels */
.mode-panel {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.mode-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.mode-panel:hover::before {
  left: 100%;
}

.mode-panel:hover {
  transform: translateY(-4px) scale(1.02);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.mode-panel h3 {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  margin-bottom: clamp(0.3rem, 1vw, 0.5rem);
  font-weight: 800;
}

.mode-panel p {
  font-size: clamp(0.75rem, 2vw, 1rem);
  margin-bottom: clamp(0.5rem, 1.5vw, 1rem);
  opacity: 0.85;
}

/* Statistics Page Styles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 0.25rem;
  animation: countUp 0.5s ease;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
  font-weight: 600;
}

.achievements-section {
  margin-top: 2rem;
}

.achievements-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 800;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

.achievement {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
}

.achievement.unlocked {
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.5);
}

.achievement.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.achievement:hover {
  transform: translateY(-2px);
}

.achievement-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.achievement-name {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.achievement-desc {
  font-size: 0.7rem;
  opacity: 0.7;
}

#result-message,
#game-over-message {
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  margin-bottom: clamp(0.5rem, 1.5vw, 1rem);
  font-weight: 700;
  line-height: 1.4;
}

#previous-guesses {
  margin: clamp(0.5rem, 1.5vw, 1rem) 0;
  max-height: 200px;
  overflow-y: auto;
  text-align: left;
  padding: 0.5rem;
}

.guess-item {
  margin: clamp(0.3rem, 1vw, 0.5rem) 0;
  padding: clamp(0.3rem, 1vw, 0.5rem);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.guess-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}

.game-note {
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  color: var(--text-color);
  margin-top: clamp(0.5rem, 2vw, 1rem);
  text-align: center;
  opacity: 0.7;
}

/* Premium Button Styles with Pulse Animation */
#continue-btn,
#share-btn,
#restart-btn,
#opening-mode-btn,
#gross-mode-btn {
  padding: clamp(0.6rem, 2vw, 0.8rem) clamp(1.2rem, 3vw, 1.6rem);
  background: linear-gradient(135deg, var(--accent-color), #ff7979);
  color: var(--text-color);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 800;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 102;
  box-shadow: 0 4px 16px rgba(255, 95, 95, 0.4);
  position: relative;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
  margin: 0.25rem;
}

#continue-btn::before,
#share-btn::before,
#restart-btn::before,
#opening-mode-btn::before,
#gross-mode-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

#continue-btn:hover::before,
#share-btn:hover::before,
#restart-btn:hover::before,
#opening-mode-btn:hover::before,
#gross-mode-btn:hover::before {
  width: 300px;
  height: 300px;
}

#continue-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#continue-btn:hover:not(:disabled),
#share-btn:hover,
#restart-btn:hover,
#opening-mode-btn:hover,
#gross-mode-btn:hover {
  background: linear-gradient(135deg, var(--accent-hover), #ff5555);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 24px rgba(255, 95, 95, 0.6);
}

#continue-btn:active:not(:disabled),
#share-btn:active,
#restart-btn:active,
#opening-mode-btn:active,
#gross-mode-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Button Pulse Animation (idle state) */
@keyframes buttonPulse {

  0%,
  100% {
    box-shadow: 0 4px 16px rgba(255, 95, 95, 0.4);
  }

  50% {
    box-shadow: 0 4px 24px rgba(255, 95, 95, 0.6);
  }
}

#opening-mode-btn,
#gross-mode-btn {
  animation: buttonPulse 2s ease-in-out infinite;
}

/* Premium Loading Spinner */
.loading {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  display: flex;
  align-items: center;
  gap: clamp(0.3rem, 1vw, 0.5rem);
  font-weight: 700;
}

.spinner {
  width: clamp(18px, 3vw, 24px);
  height: clamp(18px, 3vw, 24px);
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--accent-color);
  border-right-color: #f093fb;
  border-radius: 50%;
  animation: spinGlow 1s linear infinite;
}

@keyframes spinGlow {
  0% {
    transform: rotate(0deg);
    box-shadow: 0 0 10px rgba(255, 95, 95, 0.5);
  }

  50% {
    box-shadow: 0 0 20px rgba(240, 147, 251, 0.7);
  }

  100% {
    transform: rotate(360deg);
    box-shadow: 0 0 10px rgba(255, 95, 95, 0.5);
  }
}

footer {
  text-align: center;
  padding: clamp(0.3rem, 1vw, 0.5rem);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  font-size: clamp(0.65rem, 1.5vw, 0.75rem);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.version {
  display: inline-block;
  margin-left: clamp(0.3rem, 1vw, 0.5rem);
  opacity: 0.7;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }

  100% {
    opacity: 1;
  }
}

@keyframes pulse-correct {

  0%,
  100% {
    background: var(--correct-bg);
  }

  50% {
    background: rgba(0, 255, 0, 0.4);
    transform: scale(1.02);
  }
}

@keyframes pulse-incorrect {

  0%,
  100% {
    background: var(--incorrect-bg);
  }

  50% {
    background: rgba(255, 0, 0, 0.4);
    transform: scale(1.02);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Confetti trigger styles */
.milestone-reached {
  animation: celebratePulse 0.8s ease;
}

@keyframes celebratePulse {

  0%,
  100% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.1);
  }

  50% {
    transform: scale(0.95);
  }

  75% {
    transform: scale(1.05);
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .mode-panels {
    grid-template-columns: 1fr;
  }

  .movie-poster {
    max-width: min(20vh, 35vw, 200px);
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-end;
    gap: clamp(0.3rem, 1vw, 0.5rem);
  }

  .status-wrapper {
    position: static;
    transform: none;
    width: 100%;
    text-align: center;
  }

  .status-container {
    justify-content: center;
    font-size: clamp(0.7rem, 1.8vw, 0.9rem);
  }

  .social-icons {
    margin-left: 0;
  }

  .movie-poster {
    max-width: min(18vh, 45vw, 180px);
  }

  .movie-info {
    font-size: clamp(0.7rem, 2vw, 1rem);
    width: min(95%, 350px);
  }

  .panel {
    padding: clamp(0.2rem, 1vw, 0.5rem);
  }

  .mode-panel {
    padding: clamp(0.5rem, 2vw, 1rem);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {

  .status,
  #mode-indicator {
    font-size: clamp(0.6rem, 1.8vw, 0.8rem);
  }

  .movie-poster {
    max-width: min(16vh, 50vw, 140px);
  }

  .start-content h2 {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
  }

  .start-content p {
    font-size: clamp(0.75rem, 2vw, 0.95rem);
  }

  .mode-panel h3 {
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  }

  .achievements-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
}

@media (min-width: 1920px) {
  .movie-poster {
    max-width: min(38vh, 55vw, 400px);
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}