:root {
  --primary-color: #ffda75; /* FilmIQ Gold */
  --secondary-color: #3b82f6; /* FilmIQ Blue */
  --accent-color: #ff5f5f; /* FilmIQ Red */
  --bg-color: #1a1a1a;
  --green: #16a34a;
  --red: #dc2626;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  min-height: 100vh;
  background: radial-gradient(circle at 50% -20%, #4a0d0d, #111111 60%, #000000 100%);
  color: white;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  margin: 0;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.05"/></svg>');
  z-index: -1;
  pointer-events: none;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 2rem);
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(15px);
  border-bottom: 2px solid #333;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0,0,0,0.8);
}

header h4 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right { display: flex; gap: clamp(0.3rem, 1vw, 0.5rem); align-items: center; }
.social-icons { display: flex; 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.05); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 218, 117, 0.3); color: #ffda75;
  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, .stats-btn:hover {
  transform: translateY(-2px) scale(1.05); background: rgba(255, 218, 117, 0.15);
  box-shadow: 0 0 15px rgba(255, 218, 117, 0.4); border-color: #ffda75;
}

main {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  width: 100%;
}

/* Overlays and Modals */
.overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.overlay:not(.hidden) { opacity: 1; pointer-events: auto; }

.start-content {
  background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 20px;
  padding: clamp(1.5rem, 4vw, 2.5rem); max-width: 600px; width: 90%;
  text-align: center; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

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

.mode-selection-start { display: flex; flex-direction: column; gap: 15px; align-items: center; }

.overlay-content {
  background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(20px);
  padding: 30px; border-radius: 12px; max-width: 500px; width: 90%;
  border: 1px solid rgba(255, 255, 255, 0.2); position: relative;
  text-align: center; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4); color: #fff;
}

.close-btn {
  position: absolute; top: 15px; right: 15px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%; width: 32px; height: 32px; color: white;
  font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
}
.close-btn:hover { background: rgba(255, 255, 255, 0.2); transform: rotate(90deg); }

/* Buttons */
.action-btn, #submit-btn, .play-btn {
  padding: clamp(0.6rem, 2vw, 0.8rem) clamp(1.2rem, 3vw, 1.6rem);
  background: rgba(255, 255, 255, 0.05); color: white;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px;
  cursor: pointer; font-size: clamp(0.9rem, 2vw, 1rem); font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px); box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}
.action-btn:hover, #submit-btn:hover, .play-btn:hover {
  transform: translateY(-2px); background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5); box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}

.neon-btn {
  background: linear-gradient(135deg, rgba(255, 95, 95, 0.2), rgba(255, 95, 95, 0.05));
  border: 1px solid #ff5f5f;
  color: #fff; width: 100%; max-width: 300px;
  box-shadow: 0 0 15px rgba(255, 95, 95, 0.2), inset 0 0 10px rgba(255, 95, 95, 0.1);
}
.neon-btn:hover {
  background: linear-gradient(135deg, rgba(255, 95, 95, 0.4), rgba(255, 95, 95, 0.2));
  box-shadow: 0 0 25px rgba(255, 95, 95, 0.4), inset 0 0 15px rgba(255, 95, 95, 0.2);
  border-color: #ff7979;
}

#submit-btn { border-color: rgba(255, 218, 117, 0.5); color: #ffda75; }
#submit-btn:hover { background: rgba(255, 218, 117, 0.15); border-color: #ffda75; box-shadow: 0 0 20px rgba(255, 218, 117, 0.4); }

#hint-btn { border-color: rgba(16, 185, 129, 0.5); color: #34d399; }
#hint-btn:hover { background: rgba(16, 185, 129, 0.15); border-color: #34d399; box-shadow: 0 0 20px rgba(16, 185, 129, 0.4); }

#skip-btn { border-color: rgba(156, 163, 175, 0.5); color: #9ca3af; }
#skip-btn:hover { background: rgba(156, 163, 175, 0.15); border-color: #9ca3af; box-shadow: 0 0 20px rgba(156, 163, 175, 0.4); }

/* Game Specific Container */
#game-container {
  display: flex; flex-direction: column; align-items: center;
  max-width: 800px; width: 100%; margin: 0 auto; gap: 25px;
}

#streak-container, #endless-stats-container {
  font-size: clamp(1rem, 2.5vw, 1.2rem); font-weight: 700; text-align: center;
  background: linear-gradient(180deg, #1f1f1f, #0a0a0a);
  border: 2px solid #333; padding: clamp(0.75rem, 2vw, 1rem);
  border-radius: 8px; width: 100%; max-width: 600px; margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), inset 0 2px 0 rgba(255,255,255,0.1);
  position: relative; overflow: hidden;
}
#streak-container::before, #endless-stats-container::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, #ffda75, transparent); opacity: 0.5;
}
#streak-container span, #endless-stats-container span { color: #ffda75; text-shadow: 0 0 8px rgba(255, 218, 117, 0.6); }

/* Audio Player / Vinyl Aesthetic */
#audio-player-wrapper {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 30px 20px; background: rgba(20, 20, 20, 0.8);
  backdrop-filter: blur(20px); border: 2px solid #333;
  border-radius: 12px; width: 100%; max-width: 600px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8), inset 0 2px 0 rgba(255,255,255,0.05);
  position: relative; overflow: hidden;
}

#audio-player-wrapper::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%);
  background-size: 100% 4px; pointer-events: none; z-index: 1; opacity: 0.5;
}

.vinyl-record {
  width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, #111 30%, #333 40%, #111 60%, #333 80%, #050505 100%);
  display: flex; justify-content: center; align-items: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.8), 0 0 0 4px rgba(255,255,255,0.05);
  border: 1px solid #000; transition: transform 0.2s linear; z-index: 2;
}
.vinyl-record.playing { animation: spin 2s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.record-center {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, #ffda75, #ff5f5f);
  border: 4px solid #000; display: flex; justify-content: center; align-items: center;
}
.record-center::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #000; }

.audio-controls { display: flex; flex-direction: column; width: 100%; align-items: center; gap: 15px; z-index: 2; }

.play-btn { border-radius: 30px; font-size: 1.1rem; padding: 10px 25px; }

.progress-bar {
  width: 100%; max-width: 400px; height: 8px; background: rgba(0,0,0,0.6);
  border-radius: 4px; border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden; position: relative;
}
.progress-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, #ffda75, #ff5f5f);
  transition: width 0.1s linear; box-shadow: 0 0 10px #ff5f5f;
}

.visualizer { display: flex; gap: 5px; height: 40px; align-items: flex-end; z-index: 2; }
.visualizer .bar { width: 10px; background: rgba(255, 218, 117, 0.4); height: 6px; border-radius: 3px 3px 0 0; transition: height 0.1s; }
.visualizer.playing .bar { animation: bounce 0.5s ease-in-out infinite alternate; background: #ffda75; box-shadow: 0 0 10px #ffda75; }
.visualizer.playing .bar:nth-child(1) { animation-delay: 0.1s; }
.visualizer.playing .bar:nth-child(2) { animation-delay: 0.3s; }
.visualizer.playing .bar:nth-child(3) { animation-delay: 0.2s; }
.visualizer.playing .bar:nth-child(4) { animation-delay: 0.4s; }
.visualizer.playing .bar:nth-child(5) { animation-delay: 0.15s; }
@keyframes bounce { 0% { height: 6px; } 100% { height: 35px; } }

/* Inputs and UI */
#input-container { position: relative; display: flex; gap: 10px; width: 100%; max-width: 600px; margin: 0 auto; z-index: 10; }
#guess-input {
  flex: 1; padding: clamp(0.8rem, 2vw, 1rem); font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-family: 'Inter', sans-serif; font-weight: 600;
  border: 2px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px); color: white; border-radius: 12px;
  transition: all 0.3s;
}
#guess-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 15px rgba(255, 218, 117, 0.4); }

.dropdown {
  position: absolute; top: 100%; left: 0; right: 150px; 
  background: rgba(0, 0, 0, 0.95); backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 12px;
  margin-top: 0.5rem; max-height: 250px; overflow-y: auto; z-index: 50;
  display: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.dropdown-item {
  padding: clamp(0.6rem, 1.5vw, 0.8rem); cursor: pointer; border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}
.dropdown-item:hover { background: rgba(255, 255, 255, 0.2); padding-left: 1.5rem; }

.game-controls { display: flex; gap: 10px; justify-content: center; margin-top: 5px; }

.hint-display {
  width: 100%; max-width: 600px; background: rgba(255,255,255,0.05); backdrop-filter: blur(5px);
  border-radius: 12px; padding: 15px; border-left: 4px solid var(--primary-color); min-height: 50px; margin-top: 10px;
}
#hints-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
#hints-list li { font-size: 0.95rem; color: #ddd; animation: fadeIn 0.3s ease-out; }
#hints-list li strong { color: var(--primary-color); }

.guesses-grid { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 600px; }
.guess-row {
  display: flex; align-items: center; padding: 12px 15px;
  background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(5px);
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); font-weight: 600;
}
.guess-row.correct { background: rgba(34, 197, 94, 0.15); border-color: var(--green); color: #bbf7d0; box-shadow: 0 0 10px rgba(34, 197, 94, 0.2); }
.guess-row.incorrect { background: rgba(239, 68, 68, 0.15); border-color: var(--red); color: #fecaca; }

.lives-indicator { display: flex; justify-content: center; gap: 8px; margin: 10px 0; }
.life-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255,255,255,0.2); transition: all 0.3s;
}
.life-dot.active { background: #3b82f6; border-color: #60a5fa; box-shadow: 0 0 12px #3b82f6; }
.life-dot.lost { background: rgba(239, 68, 68, 0.5); border-color: var(--red); filter: grayscale(1); }

.filter-container { display: flex; justify-content: center; gap: 15px; margin-bottom: 20px; width: 100%; flex-wrap: wrap; }
.filter-container.hidden { display: none; }
.game-select {
  padding: 10px 15px; border-radius: 8px; background: rgba(20, 20, 20, 0.8);
  color: white; border: 1px solid rgba(255, 255, 255, 0.2); font-family: 'Inter', sans-serif;
  cursor: pointer; outline: none;
}
.game-select:focus { border-color: var(--primary-color); }

.mode-selector { display: flex; justify-content: center; gap: 15px; margin-bottom: 25px; }
.mode-btn {
  padding: 10px 25px; border-radius: 30px; border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0,0,0,0.5); color: #fff; cursor: pointer; transition: all 0.3s; font-weight: 700;
}
.mode-btn.active {
  background: rgba(255, 218, 117, 0.2); border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(255, 218, 117, 0.3); color: var(--primary-color);
}

.endless-stats { display: flex; gap: 20px; justify-content: center; }
.combo-text { color: var(--primary-color); font-weight: 900; text-shadow: 0 0 10px rgba(255, 218, 117, 0.6); animation: pulse 1s infinite; }

.fun-fact-card {
  background: rgba(0,0,0,0.5); padding: 20px; border-radius: 12px;
  border: 1px solid rgba(255, 218, 117, 0.3); margin-top: 20px; text-align: left;
}
.fun-fact-card h3 { margin: 0 0 10px 0; color: var(--primary-color); font-size: 1.1rem; }

.stats-grid { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.stat-card {
  background: rgba(255,255,255,0.05); padding: 15px; border-radius: 10px;
  min-width: 90px; border: 1px solid rgba(255,255,255,0.1);
}
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--primary-color); }
.stat-label { font-size: 0.85rem; color: #aaa; text-transform: uppercase; margin-top: 5px; }
