:root {
  --primary: #e50914;
  --bg: #0f0f0f;
  --card-bg: #1f1f1f;
  --text: #ffffff;
  --text-dim: #999999;
  --success: #4caf50;
  --border: #333333;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden; /* Prevents awkward scrolling when keyboard is up */
}

movie-game {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px;
  max-width: 500px;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 5px;
}

header h2 {
  font-size: 0.9rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
}

.progress-pill {
  background: #333;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

main {
  flex: 1;
  display: flex;
  align-items: flex-end; /* Anchors card to bottom for better mobile UX */
  /* padding-bottom: 20px; */
}

.card {
  background: var(--card-bg);
  padding: 1.25rem;
  border-radius: 20px;
  width: 100%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
}

.hint-box {
  min-height: 35px;
  margin-bottom: 10px;

  &:empty {
    display: none;
  }
}

.hint-item {
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  margin: 2px;
  display: inline-block;
  color: var(--text-dim);
}

.quote-container {
  margin-bottom: 1rem;
}

.quote-number {
  color: var(--text-dim);
  font-size: 0.7rem;
  margin-bottom: 4px;
}

blockquote {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  font-family: 'Georgia', serif;
  font-style: italic;
  line-height: 1.2;
}

input[type='text'] {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #000;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

input:focus {
  border-color: var(--primary);
  outline: none;
}

.action-buttons {
  display: flex;
  gap: 8px;
}
.action-buttons button {
  flex: 1;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
}

button.secondary {
  background: #333;
}

/* Modals */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  z-index: 100;
}

.modal {
  background: #252525;
  padding: 2rem;
  border-radius: 25px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  border: 1px solid #444;
}

.success-icon {
  font-size: 3rem;
  color: var(--success);
}
.error-icon {
  font-size: 3rem;
  color: var(--primary);
}

.movie-reveal-title {
  font-size: 1.5rem;
  margin: 15px 0 5px;
  font-weight: 800;
}

.afi-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  margin: 10px 0 20px;
}
label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-dim);
}

#min-year,
#max-year {
  width: 80px;
  padding: 8px;
  background: #000;
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 5px;
  text-align: center;
}

#settings-btn {
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

#settings-btn:hover {
  transform: rotate(45deg);
}

/* Collection Specifics */
.collection-modal {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.collection-list {
  flex: 1;
  overflow-y: auto;
  text-align: left;
  margin: 15px 0;
  padding-right: 5px;
}

.collection-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.collection-info {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.replay-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: bold;
  border: 1px solid var(--primary);
  padding: 4px 8px;
  border-radius: 4px;
}

.replay-link:hover {
  background: var(--primary);
  color: white;
}

/* Desktop Adjustments */
@media (min-height: 500px) {
  main {
    align-items: center;
  }
  blockquote {
    font-size: 1.8rem;
  }
  .card {
    padding: 2rem 1rem;
  }
}
