/* latin - 400 */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin - 500 */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin - 600 */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin - 700 */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin - 800 */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-v12-latin-800.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 
  =========================================
  DEGREES OF SEPARATION - CINEMATIC THEME
  $150k Agency-Grade Mobile-Responsive UI
  =========================================
*/

:root {
  --bg-primary: #050508;
  --bg-surface: rgba(18, 18, 24, 0.7);
  --bg-surface-accent: rgba(255, 255, 255, 0.03);
  --bg-pill: rgba(255, 255, 255, 0.06);
  --bg-pill-hover: rgba(123, 97, 255, 0.15);

  --border-glow: rgba(123, 97, 255, 0.35);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(123, 97, 255, 0.6);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-color: #7b61ff;
  --accent-gradient: linear-gradient(135deg, #7b61ff 0%, #a855f7 100%);

  --shadow-diffuse: 0 20px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(123, 97, 255, 0.15);

  --radius-outer: 24px;
  --radius-inner: 16px;
  --radius-pill: 50px;

  --transition-spring: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Base resets & layout */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(circle at 50% 15%, rgba(123, 97, 255, 0.18) 0%, rgba(5, 5, 8, 0) 50%),
    radial-gradient(circle at 10% 80%, rgba(168, 85, 247, 0.08) 0%, rgba(5, 5, 8, 0) 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100dvh;
  padding: 20px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  margin-top: 20px;
  margin-bottom: 24px;
  background: linear-gradient(to right, #ffffff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Main Container (Double-Bezel Glass) */
#game-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background-color: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  padding: 30px;
  border-radius: var(--radius-outer);
  box-shadow: var(--shadow-diffuse);
  position: relative;
  overflow: visible;
}

.sticky-header {
  position: sticky;
  top: 0;
  margin: 0 -30px 20px -30px;
  padding: 15px 30px 10px 30px;
  background-color: rgba(5, 5, 8, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: 10;
}

/* Controls / Restart Button */
.controls {
  text-align: center;
  margin-bottom: 30px;
}

.btn {
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(123, 97, 255, 0.3);
  transition: var(--transition-spring);
  position: relative;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(123, 97, 255, 0.5);
}

.btn:active {
  transform: translateY(1px);
}

/* Actors Row & Double-Bezel nested architecture */
#actors-container {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 20px;
  margin-bottom: 30px;
}

.actor {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 320px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--radius-inner);
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  background-clip: padding-box;
  transition: var(--transition-spring);
}

.actor::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 5, 8, 1) 0%, rgba(5, 5, 8, 0.9) 15%, rgba(5, 5, 8, 0.4) 50%, rgba(5, 5, 8, 0) 100%);
  z-index: 1;
}

.actor:hover {
  transform: translateY(-4px);
  border-color: rgba(123, 97, 255, 0.3);
}

.actor h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
  text-align: center;
  padding: 16px;
  position: relative;
  z-index: 2;
  width: 100%;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Scorekeeper (Steps dashboard) */
.scorekeeper {
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-surface-accent);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-inner);
  padding: 20px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.05);
}

.scores {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
  width: 100%;
}

.score {
  text-align: center;
  width: 100%;
}

.score h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.score p {
  font-size: 2.25rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Path Connections Log List */
.selected-actors {
  width: 100%;
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 5px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.selected-actors::-webkit-scrollbar {
  width: 4px;
}

.selected-actors::-webkit-scrollbar-track {
  background: transparent;
}

.selected-actors::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-pill);
}

.path-node {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
  animation: fadeIn 0.4s ease-out;
  padding: 0;
  margin: 0;
}

.path-actor {
  gap: 10px;
  font-weight: 600;
  color: var(--text-primary);
  min-height: 24px;
}

.path-actor .node-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-pill);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  z-index: 2;
  color: var(--text-primary);
}

.path-actor.node-start .node-icon {
  background: rgba(123, 97, 255, 0.2);
  border-color: var(--accent-color);
  color: #fff;
  font-size: 0.8rem;
}

.path-actor.node-target .node-icon {
  background: rgba(168, 85, 247, 0.2);
  border-color: #a855f7;
  color: #fff;
  font-size: 0.8rem;
}

.path-actor.node-target .node-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.path-movie {
  flex-direction: column;
  align-items: flex-start;
  padding-left: 11px;
  /* Align with center of 24px dot (12px - 1px border) */
  margin: 0;
}

.node-connector {
  width: 2px;
  background-color: var(--border-light);
  margin-left: 0;
}

.node-connector.connector-top {
  height: 8px;
}

.node-connector.connector-bottom {
  height: 8px;
}

.movie-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(123, 97, 255, 0.08);
  border: 1px solid rgba(123, 97, 255, 0.25);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #c0b3ff;
  margin-left: -7px;
  /* Offset to center relative to connecting line */
  margin-top: 0;
  margin-bottom: 0;
  max-width: 95%;
  word-break: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.movie-badge .node-icon {
  font-size: 0.7rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

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

/* Search Containers & Inputs */
#search-container,
#actor-search-container {
  width: 100%;
  margin-top: 10px;
  margin-bottom: 25px;
  display: flex;
  justify-content: center;
}

#movie-search,
#actor-search {
  width: 100%;
  max-width: 460px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  color: #fff;
  border-radius: var(--radius-pill);
  outline: none;
  transition: var(--transition-spring);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

#movie-search::placeholder,
#actor-search::placeholder {
  color: var(--text-muted);
}

#movie-search:focus,
#actor-search:focus {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 20px rgba(123, 97, 255, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Movies Poster Grid */
#movies-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  width: 100%;
  justify-content: center;
}

.movie {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-accent);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-inner);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-spring);
  position: relative;
  text-align: center;
}

.movie:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.movie-poster {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-spring);
}

.movie:hover .movie-poster {
  filter: brightness(1.1);
}

.movie-title {
  padding: 10px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  min-height: 48px;
  line-height: 1.25;
}

/* Cast List Container & Navigation Pills */
.cast-list-container {
  margin-bottom: 30px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-inner);
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.cast-list-container h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.cast-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-height: 350px;
  overflow-y: auto;
  padding: 2px 8px 10px 8px;
}

.cast-list::-webkit-scrollbar {
  width: 4px;
}

.cast-list::-webkit-scrollbar-track {
  background: transparent;
}

.cast-list::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-pill);
}

.cast-list li {
  list-style: none;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  background: var(--bg-pill);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-spring);
}

.cast-list li:hover {
  background: var(--bg-pill-hover);
  border-color: var(--border-glow);
  transform: scale(1.05);
}

/* Winner Screen Banner */
.winner-container {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  background: rgba(123, 97, 255, 0.05);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-inner);
  box-shadow: 0 10px 30px rgba(123, 97, 255, 0.1);
  animation: fadeIn 0.6s ease-out;
}

.winner-container h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(123, 97, 255, 0.3);
}

.winner-movies-path {
  display: grid;
  grid-template-columns: repeat(auto-fill, 120px);
  justify-content: center;
  gap: 24px 20px;
  margin-bottom: 28px;
  width: 100%;
  max-width: 800px;
}

.winner-movie-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  text-align: center;
  animation: fadeIn 0.4s ease-out;
}

.winner-movie-badge {
  position: absolute;
  top: -8px;
  left: -8px;
  background: var(--accent-gradient);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(123, 97, 255, 0.4);
  z-index: 5;
  pointer-events: none;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.winner-movie-poster {
  width: 120px;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-inner);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-diffuse);
  margin-bottom: 8px;
  transition: var(--transition-spring);
}

.winner-movie-card:hover .winner-movie-poster {
  transform: scale(1.05);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.winner-movie-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.winner-actor-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  text-align: center;
  animation: fadeIn 0.4s ease-out;
}

.winner-actor-portrait {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(123, 97, 255, 0.4);
  box-shadow: var(--shadow-diffuse);
  margin-bottom: 8px;
  transition: var(--transition-spring);
}

.winner-actor-card:hover .winner-actor-portrait {
  transform: scale(1.05);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.winner-actor-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Custom badges for start/target actors */
.winner-movie-badge.start-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: var(--radius-pill);
  width: auto;
  height: auto;
  padding: 2px 8px;
  font-size: 0.65rem;
  left: 50%;
  transform: translateX(-50%);
  top: -10px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.winner-movie-badge.target-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: var(--radius-pill);
  width: auto;
  height: auto;
  padding: 2px 8px;
  font-size: 0.65rem;
  left: 50%;
  transform: translateX(-50%);
  top: -10px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Game Over Screen */
.game-over-container {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg-surface-accent);
  border: 1px solid rgba(239, 68, 68, 0.2);
  /* Red warning accent */
  border-radius: var(--radius-inner);
  box-shadow: 0 12px 40px rgba(239, 68, 68, 0.1);
  text-align: center;
  max-width: 500px;
  margin: 40px auto;
  animation: fadeIn 0.5s ease-out;
}

.game-over-container h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.game-over-reason {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.btn-copy-path {
  margin-top: 20px;
  display: inline-block;
  background: var(--accent-gradient);
  color: #fff !important;
  transition: background 0.3s ease, transform var(--transition-spring), box-shadow 0.3s ease;
}

/* 
  =========================================
  MOBILE RESPONSIVE OVERRIDES (<768px)
  =========================================
*/
@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  h1 {
    font-size: 1.65rem;
    margin-top: 10px;
    margin-bottom: 16px;
  }

  #game-container {
    padding: 16px;
    border-radius: var(--radius-inner);
    overflow: visible;
  }

  .sticky-header {
    top: 0;
    margin: 0 -16px 15px -16px;
    padding: 12px 16px 10px 16px;
  }

  #actors-container {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
  }

  /* Actor Cards side-by-side on mobile */
  .actor {
    width: 48%;
    flex: none;
    height: 220px;
    border-radius: 12px;
  }

  .actor h2 {
    font-size: 0.9rem;
    padding: 10px 6px;
  }

  /* Scorekeeper wraps full width below the side-by-side actors */
  .scorekeeper {
    width: 100%;
    order: 3;
    padding: 15px;
    border-radius: 12px;
  }

  .score p {
    font-size: 1.75rem;
  }

  .selected-actors {
    max-height: 150px;
  }

  .selected-actors li {
    font-size: 0.75rem;
  }

  /* Inputs sizing */
  #movie-search,
  #actor-search {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  /* Flexible Poster Grid adapts column counts */
  #movies-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }

  .movie-title {
    font-size: 0.75rem;
    padding: 8px 4px;
    min-height: 40px;
  }

  .cast-list-container {
    padding: 16px;
  }

  .cast-list-container h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
  }

  .cast-list li {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

  /* Winner layout mobile */
  .winner-container {
    padding: 24px 12px;
  }

  .winner-container h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
  }

  .winner-movies-path {
    grid-template-columns: repeat(auto-fill, 90px);
    gap: 16px 12px;
  }

  .winner-movie-card {
    width: 90px;
  }

  .winner-movie-poster {
    width: 90px;
    height: 135px;
  }

  .winner-movie-title {
    font-size: 0.7rem;
  }

  .winner-actor-card {
    width: 90px;
  }

  .winner-actor-portrait {
    width: 90px;
    height: 90px;
  }

  .winner-actor-name {
    font-size: 0.7rem;
  }
}

/* Target Actor Hint Interactions */
#actor-2 {
  cursor: pointer;
}

#actor-2:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

#actor-2::before {
  content: 'ℹ️ Show Movies';
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(123, 97, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  z-index: 3;
  opacity: 0.8;
  transition: var(--transition-spring);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#actor-2:hover::before {
  opacity: 1;
  transform: scale(1.05);
  background: var(--accent-gradient);
}

/* Hint Modal Overlay */
.hint-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hint-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.hint-modal-content {
  background: var(--bg-surface-accent);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-outer);
  padding: 30px;
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(123, 97, 255, 0.15);
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.hint-modal-overlay.active .hint-modal-content {
  transform: scale(1);
}

.hint-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
}

.hint-modal-close:hover {
  color: #fff;
}

.hint-modal-content h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(123, 97, 255, 0.2);
  padding-right: 30px;
}

.hint-movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 15px;
  overflow-y: auto;
  padding-right: 4px;
  flex-grow: 1;
}

.hint-movies-grid::-webkit-scrollbar {
  width: 4px;
}

.hint-movies-grid::-webkit-scrollbar-track {
  background: transparent;
}

.hint-movies-grid::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-pill);
}

.hint-movie-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  animation: fadeIn 0.4s ease-out forwards;
}

.hint-movie-poster {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-inner);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-diffuse);
  margin-bottom: 6px;
}

.hint-movie-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.25;
}

/* Extra small devices check */
@media (max-width: 380px) {
  .actor {
    width: 100%;
    /* Stack actors if screen is extremely narrow */
    height: 180px;
  }
}