/* ============================================
   CAST CONNECTION - Cyber Cinematic Game Styles
   ============================================ */

/* ---- Brighter theme override for Cast Connection ----
   The global variables use #030008 deep void which feels too dark and blue.
   We override the key panels to be lighter / more vibrant here. */
:root {
  /* Bring glass panels from near-black to a warm charcoal slate */
  --cc-glass: rgba(22, 12, 46, 0.78);
  --cc-glass-hover: rgba(32, 18, 64, 0.88);
  --cc-border: rgba(0, 240, 255, 0.22);
  --cc-panel-bg: rgba(26, 14, 54, 0.80);
  /* Brighter glass for this game */
  --glass-bg: rgba(22, 12, 46, 0.72);
  --glass-frosted: rgba(20, 10, 44, 0.90);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-border-highlight: rgba(112, 0, 255, 0.28);
}

/* ---- Shared Game Shell (body, main, footer, social-link, stats-btn) ---- */
body {
  font-family: var(--font-body);
  background: #0a0516;
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(112, 0, 255, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 75%, rgba(0, 240, 255, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(60, 0, 140, 0.15) 0%, transparent 70%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  padding: clamp(0.5rem, 2vw, 1rem) clamp(0.75rem, 2.5vw, 1.5rem);
  display: flex;
  flex-direction: column;
}

footer {
  text-align: center;
  padding: clamp(0.4rem, 1vw, 0.6rem) 1rem;
  background: rgba(3, 0, 8, 0.7);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: clamp(0.65rem, 1.5vw, 0.75rem);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

footer p { margin: 0; }

.version {
  font-size: 0.65rem;
  opacity: 0.45;
  font-weight: 500;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 1px 6px;
  border-radius: 4px;
}

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

.social-link,
.stats-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(30px, 5vw, 34px);
  height: clamp(30px, 5vw, 34px);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  text-decoration: none;
  font-size: clamp(0.9rem, 2vw, 1rem);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-body);
}

.social-link:hover,
.stats-btn:hover {
  transform: translateY(-2px) scale(1.06);
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.2);
}

/* Override glass panels to use slightly lighter cast-connection theme */
.challenge-banner,
.current-actor-panel,
.movie-input-section .movie-search-input,
.cast-card,
.chain-summary,
.overlay-content {
  background: var(--cc-glass) !important;
}


.challenge-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1rem, 3vw, 2rem);
  margin: clamp(0.5rem, 2vw, 1rem) auto;
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.challenge-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(0, 240, 255, 0.04) 0%,
    rgba(112, 0, 255, 0.04) 100%);
  pointer-events: none;
}

.actor-endpoint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 80px;
}

.actor-photo-ring {
  width: clamp(64px, 10vw, 90px);
  height: clamp(64px, 10vw, 90px);
  border-radius: 50%;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 0 20px var(--accent-primary-glow), 0 0 40px rgba(0, 240, 255, 0.1);
  overflow: hidden;
  background: var(--bg-tertiary);
  flex-shrink: 0;
  animation: nodeGlow 3s ease-in-out infinite;
}

.actor-photo-ring.target {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 20px rgba(112, 0, 255, 0.4), 0 0 40px rgba(112, 0, 255, 0.1);
  animation: targetGlow 3s ease-in-out infinite;
}

.actor-photo-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.actor-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  text-align: center;
  color: var(--text-primary);
  max-width: 100px;
  line-height: 1.2;
}

.actor-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.actor-tag.target {
  color: #b026ff;
  background: rgba(112, 0, 255, 0.1);
  border-color: rgba(112, 0, 255, 0.3);
}

.chain-connector {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  min-width: 80px;
}

.connector-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transform: translateY(-50%);
  opacity: 0.4;
}

.connector-dots {
  display: flex;
  gap: clamp(4px, 1vw, 8px);
  position: relative;
  z-index: 1;
}

.dot {
  width: clamp(10px, 2vw, 14px);
  height: clamp(10px, 2vw, 14px);
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.4s var(--transition-spring);
}

.dot.filled {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary-glow);
}

.dot.complete {
  background: #00ff88;
  border-color: #00ff88;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.6);
}

/* ---- Chain Web Visualizer ---- */
.chain-web-container {
  position: relative;
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto clamp(0.5rem, 2vw, 1rem);
  min-height: 120px;
  overflow: visible;
}

.chain-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.chain-nodes {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(0.3rem, 1vw, 0.5rem);
  padding: clamp(0.5rem, 1.5vw, 1rem);
  min-height: 100px;
}

/* Chain Node Styles */
.chain-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  animation: nodeAppear 0.5s var(--transition-spring) both;
}

.chain-node-bubble {
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 2.5px solid var(--accent-primary);
  box-shadow: 0 0 14px var(--accent-primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chain-node-bubble.actor-node {
  width: clamp(44px, 7vw, 60px);
  height: clamp(44px, 7vw, 60px);
}

.chain-node-bubble.movie-node {
  width: clamp(40px, 6vw, 52px);
  height: clamp(40px, 6vw, 52px);
  border-radius: var(--radius-sm);
  border-color: var(--accent-secondary);
  box-shadow: 0 0 14px rgba(112, 0, 255, 0.4);
}

.chain-node-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chain-node-bubble.movie-node .movie-icon {
  font-size: 1.4rem;
}

.chain-node-label {
  font-size: clamp(0.6rem, 1.5vw, 0.7rem);
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  max-width: 70px;
  line-height: 1.2;
}

.chain-arrow {
  font-size: clamp(0.8rem, 2vw, 1.1rem);
  color: var(--accent-primary);
  opacity: 0.6;
  align-self: center;
  flex-shrink: 0;
}

/* SVG Beam */
.beam-line {
  stroke: var(--accent-primary);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  opacity: 0.6;
  animation: beamFlow 1.2s linear infinite;
}

.beam-line.complete {
  stroke: #00ff88;
  opacity: 0.8;
}

@keyframes beamFlow {
  to { stroke-dashoffset: -20; }
}

/* ---- Current Actor Panel ---- */
.current-actor-panel {
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto clamp(0.5rem, 1.5vw, 0.75rem);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: clamp(0.6rem, 1.5vw, 1rem) clamp(0.75rem, 2vw, 1.25rem);
}

.current-actor-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.current-actor-photo {
  width: clamp(36px, 5vw, 48px);
  height: clamp(36px, 5vw, 48px);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary-glow);
  flex-shrink: 0;
}

.current-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  text-transform: uppercase;
}

.current-actor-name {
  font-family: var(--font-heading);
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  font-weight: 800;
  color: var(--text-primary);
}

/* ---- Start Actor Movie Hint ---- */
.hint-container {
  max-width: 600px;
  margin: 0 auto clamp(0.5rem, 1.5vw, 0.75rem);
  width: 100%;
  box-sizing: border-box;
  padding: 0;
}

.hint-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--cc-glass);
  border: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-md);
  padding: clamp(0.5rem, 1.2vw, 0.75rem) clamp(0.75rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.hint-toggle-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 0 14px var(--accent-primary-glow);
  transform: translateY(-1px);
}

.hint-toggle-btn:active {
  transform: translateY(0);
}

.hint-toggle-btn.open {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: var(--accent-primary);
}

.hint-chevron {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.3s var(--transition-spring);
  color: var(--accent-primary);
}

.hint-toggle-btn.open .hint-chevron {
  transform: rotate(180deg);
}

.hint-movies-content {
  background: rgba(18, 10, 38, 0.88);
  border: 1px solid var(--accent-primary);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 1rem;
  animation: fadeIn 0.25s ease both;
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.15);
}

.hint-movies-content.hidden {
  display: none;
}

.hint-movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom scrollbar for hint grid */
.hint-movies-grid::-webkit-scrollbar {
  width: 6px;
}
.hint-movies-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}
.hint-movies-grid::-webkit-scrollbar-thumb {
  background: var(--accent-primary-glow);
  border-radius: 3px;
}

.hint-movie-card {
  background: rgba(30, 18, 58, 0.85);
  border: 1px solid rgba(112, 0, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  text-align: center;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.hint-movie-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color var(--transition-fast);
}

.hint-movie-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary-glow);
  transform: translateY(-2px);
}

.hint-movie-card:hover img {
  border-color: var(--accent-primary);
}

.hint-movie-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 2.5em;
  margin-top: 0.2rem;
}

.hint-movie-year {
  font-size: 0.62rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ---- Movie Search ---- */
.movie-input-section {
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto clamp(0.5rem, 1.5vw, 1rem);
  padding: 0;
}

.search-label {
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  font-weight: 500;
}

.actor-hint {
  color: var(--accent-primary);
  font-weight: 700;
}

.search-wrapper {
  position: relative;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.movie-search-input {
  flex: 1;
  padding: clamp(0.7rem, 1.8vw, 0.9rem) clamp(0.9rem, 2vw, 1.2rem);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2vw, 1rem);
  transition: all var(--transition-fast);
  outline: none;
}

.movie-search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.movie-search-input::placeholder {
  color: var(--text-tertiary);
}

.movie-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 90px;
  background: var(--glass-frosted);
  border: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  z-index: 50;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
  display: none;
  box-shadow: var(--shadow-lg);
}

.movie-dropdown.show {
  display: block;
  animation: fadeIn 0.15s ease;
}

.movie-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--divider-color);
}

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

.movie-dropdown-item:hover {
  background: rgba(0, 240, 255, 0.08);
}

.movie-dropdown-item img {
  width: 36px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.movie-dropdown-item .movie-info-text strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.movie-dropdown-item .movie-info-text span {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.submit-btn {
  padding: clamp(0.7rem, 1.8vw, 0.9rem) clamp(1rem, 2.5vw, 1.5rem);
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.25);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.submit-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.4);
}

.submit-btn:active {
  transform: translateY(0) scale(0.98);
}

.error-msg {
  margin-top: 0.5rem;
  color: #ff5f5f;
  font-size: 0.875rem;
  font-weight: 600;
  animation: shakeError 0.4s ease;
}

/* ---- Cast Picker ---- */
.cast-picker {
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto clamp(0.5rem, 1.5vw, 1rem);
  padding: 0;
}

.cast-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cast-movie-title {
  font-family: var(--font-heading);
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 700;
  color: var(--accent-primary);
}

.cast-back-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-tertiary);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cast-back-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(80px, 15vw, 110px), 1fr));
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
}

.cast-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.cast-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(0, 240, 255, 0.05));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.cast-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px var(--accent-primary-glow);
  transform: translateY(-3px) scale(1.03);
}

.cast-card:hover::before {
  opacity: 1;
}

.cast-card.is-target {
  border-color: #00ff88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
  animation: targetPulse 1.5s ease-in-out infinite;
}

.cast-card img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  margin-bottom: 0.4rem;
  transition: border-color var(--transition-fast);
}

.cast-card:hover img {
  border-color: var(--accent-primary);
}

.cast-card .cast-name {
  font-size: clamp(0.65rem, 1.5vw, 0.75rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.cast-card .cast-character {
  font-size: 0.6rem;
  color: var(--text-tertiary);
  margin-top: 0.1rem;
}

/* ---- Start Screen Modes ---- */
.start-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.rules-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  text-align: left;
}

.rules-list li {
  padding: 0.4rem 0 0.4rem 1.5rem;
  position: relative;
  font-size: clamp(0.82rem, 2vw, 0.95rem);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--divider-color);
}

.rules-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: 700;
}

.mode-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

.mode-panel {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.mode-panel h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.mode-panel p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex: 1;
}

.mode-btn {
  margin-top: auto;
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.03em;
}

.daily-btn {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.3);
}

.daily-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.5);
}

.endless-btn {
  background: linear-gradient(135deg, #7000ff, #b026ff);
  color: #fff;
  box-shadow: 0 4px 16px rgba(112, 0, 255, 0.3);
}

.endless-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(112, 0, 255, 0.5);
}

/* ---- Result Screens ---- */
.result-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
}

.result-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.success-title {
  background: linear-gradient(135deg, #00ff88, #00f0ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fail-title {
  background: linear-gradient(135deg, #ff5f5f, #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-message {
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.chain-summary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.8;
  text-align: left;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

.answer-reveal {
  background: var(--glass-bg);
  border: 1px solid rgba(255, 95, 95, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.03em;
}

.share-btn {
  background: linear-gradient(135deg, #1d9bf0, #0077b6);
  color: #fff;
}

.play-again-btn {
  background: var(--accent-gradient);
  color: #fff;
}

.action-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--shadow-md);
}

/* ---- Stats Modal ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}

.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem 0.5rem;
  text-align: center;
  transition: all var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--glass-border-highlight);
  box-shadow: 0 0 12px var(--accent-primary-glow);
}

.stat-icon {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 900;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.15rem;
}

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

.achievements-section h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

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

/* ---- How To Play ---- */
.how-to-content {
  max-width: min(90%, 580px) !important;
}

.how-to-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.how-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.step-num {
  width: 28px;
  height: 28px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #000;
  flex-shrink: 0;
}

.how-step p {
  font-size: clamp(0.82rem, 2vw, 0.92rem);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  padding-top: 4px;
}

.how-to-example {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.example-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 0.6rem;
}

.example-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: clamp(0.7rem, 1.8vw, 0.82rem);
}

.example-node {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--accent-primary);
}

.example-node.target {
  background: rgba(0, 255, 136, 0.1);
  border-color: rgba(0, 255, 136, 0.4);
  color: #00ff88;
}

.example-arrow {
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

/* ---- Loading ---- */
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(0, 240, 255, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ---- 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.75);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  z-index: 200;
}

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

.overlay-content {
  background: rgba(20, 10, 44, 0.97);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(112, 0, 255, 0.25);
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: min(92%, 640px);
  max-height: 85vh;
  overflow-y: auto;
  z-index: 201;
  box-shadow: 0 0 40px rgba(112, 0, 255, 0.18), var(--shadow-glow);
  animation: scaleIn 0.4s var(--transition-bounce);
  position: relative;
}

.start-content {
  max-width: min(92%, 580px);
}

.start-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.start-content > p {
  color: var(--text-secondary);
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  margin-bottom: 0.75rem;
}

.stats-content {
  max-width: min(90%, 700px);
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.close-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--accent-primary);
}

/* ---- Header chain status ---- */
.chain-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(22, 12, 46, 0.75);
  border: 1px solid rgba(112, 0, 255, 0.3);
  border-radius: var(--radius-pill);
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
}

.chain-label {
  color: var(--text-tertiary);
  font-weight: 500;
}

.chain-count {
  color: var(--accent-primary);
  font-weight: 800;
  font-family: var(--font-heading);
}

/* ---- Animations ---- */
@keyframes nodeGlow {
  0%, 100% { box-shadow: 0 0 20px var(--accent-primary-glow), 0 0 40px rgba(0, 240, 255, 0.1); }
  50% { box-shadow: 0 0 30px var(--accent-primary-glow), 0 0 60px rgba(0, 240, 255, 0.2); }
}

@keyframes targetGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(112, 0, 255, 0.4), 0 0 40px rgba(112, 0, 255, 0.1); }
  50% { box-shadow: 0 0 30px rgba(112, 0, 255, 0.6), 0 0 60px rgba(112, 0, 255, 0.2); }
}

@keyframes targetPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 255, 136, 0.4); }
  50% { box-shadow: 0 0 24px rgba(0, 255, 136, 0.7); }
}

@keyframes nodeAppear {
  from { opacity: 0; transform: scale(0.5) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

  .challenge-banner {
    gap: 0.75rem;
  }

  .connector-dots {
    gap: 3px;
  }

  .search-wrapper {
    flex-direction: column;
  }

  .movie-dropdown {
    right: 0;
  }

  .submit-btn {
    width: 100%;
  }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 240, 255, 0.3); }
