/* ==========================================================================
   CINECLUES - STANDALONE GAME DESIGN SYSTEM
   Art Direction: Darkroom Cinema & Celluloid Halation
   ========================================================================== */

:root {
  --cinema-black: #06070a;
  --cinema-surface: rgba(18, 20, 28, 0.85);
  --cinema-surface-card: #11131a;
  --cinema-border: rgba(255, 255, 255, 0.09);
  --cinema-border-hover: rgba(255, 255, 255, 0.22);
  
  --gold: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.35);
  --orange: #ff4d26;
  --orange-glow: rgba(255, 77, 38, 0.3);
  --cyan: #00f2fe;
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  background-color: var(--cinema-black);
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(255, 215, 0, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(255, 77, 38, 0.04) 0%, transparent 50%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 1. HUD & TOP NAVIGATION */
.game-hud {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 7, 10, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--cinema-border);
  padding: 0.85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: #fff;
}

.brand-icon {
  font-size: 1.25rem;
}

.brand-title {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-title span {
  color: var(--gold);
}

.hud-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
}

.hud-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--cinema-border);
  color: var(--text-secondary);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.hud-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* 2. GAME CONTAINER */
.game-container {
  flex-grow: 1;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  display: flex;
  flex-direction: column;
}

.game-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.issue-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.game-main-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 0.5rem;
}

.game-instruction {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* 3. CLUE PROGRESS PIPS */
.clue-progress-tracker {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 2rem;
}

.clue-progress-pip {
  width: 36px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
}

.clue-progress-pip.active {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold-glow);
}

/* 4. CLUES LIST */
.clues-wrapper {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.clue-item {
  background: var(--cinema-surface-card);
  border: 1px solid var(--cinema-border);
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.clue-item.revealed {
  border-color: rgba(255, 215, 0, 0.25);
  background: rgba(25, 28, 40, 0.6);
}

.clue-item.locked {
  opacity: 0.35;
  filter: blur(1px);
}

.clue-tag {
  display: flex;
  flex-direction: column;
  min-width: 100px;
}

.clue-step {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
}

.clue-type {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.clue-body {
  font-size: 1rem;
  line-height: 1.55;
  color: #e5e7eb;
}

/* 5. SEARCH & GUESS BOX WITH AUTOCOMPLETE */
.search-box-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.input-row {
  display: flex;
  gap: 0.75rem;
}

.search-input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--cinema-border);
  border-radius: 50px;
  padding: 1rem 1.5rem;
  color: #fff;
  font-size: 1.05rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
}

.search-input.shake {
  animation: shakeAnim 0.4s ease;
  border-color: #ef4444;
}

@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.btn-primary {
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 1rem 2rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px var(--gold-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--cinema-border);
  color: #fff;
  border-radius: 50px;
  padding: 1rem 1.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(18, 20, 28, 0.98);
  border: 1px solid var(--cinema-border-hover);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  backdrop-filter: blur(20px);
}

.ac-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}

.ac-item:last-child {
  border-bottom: none;
}

.ac-item:hover,
.ac-item.selected {
  background: rgba(255, 215, 0, 0.12);
}

.ac-poster {
  width: 32px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.ac-poster-ph {
  width: 32px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 1rem;
}

.ac-info {
  display: flex;
  flex-direction: column;
}

.ac-title {
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
}

.ac-year {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* 6. PREVIOUS GUESS CHIPS */
.previous-guesses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.guess-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* 7. OUTCOME MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-card {
  background: var(--cinema-surface-card);
  border: 1px solid var(--cinema-border-hover);
  border-radius: 24px;
  max-width: 680px;
  width: 100%;
  padding: 2.5rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8);
  position: relative;
  animation: modalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
}

.modal-badge.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.modal-badge.failure {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.modal-body {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.modal-poster {
  width: 160px;
  height: 240px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.modal-details {
  display: flex;
  flex-direction: column;
}

.modal-movie-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.35rem;
}

.modal-movie-meta {
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.modal-movie-overview {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.modal-score-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #fff;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* 8. FOOTER */
.game-footer {
  border-top: 1px solid var(--cinema-border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.game-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.game-footer a:hover {
  color: #fff;
}

/* Responsive */
@media (max-width: 640px) {
  .modal-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .input-row {
    flex-direction: column;
  }
  .btn-primary, .btn-secondary {
    width: 100%;
  }
}
