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

:root {
  /* Dark mode (default) */
  --bg-primary: #0a0e1a;
  --bg-secondary: #151923;
  --bg-tertiary: #1e2330;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #3b82f6;
  --success-light: rgba(16, 185, 129, 0.1);
  --error: #ef4444;
  --border: #334155;
  --gradient-1: #667eea;
  --gradient-2: #764ba2;
  --gradient-3: #f093fb;
}

/* Light mode */
body.light-mode {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --accent: #0066cc;
  --accent-hover: #0052a3;
  --success: #3b82f6;
  --success-light: rgba(40, 167, 69, 0.1);
  --error: #dc3545;
  --border: #dee2e6;
  --gradient-1: #4a90e2;
  --gradient-2: #7b68ee;
  --gradient-3: #9b59b6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background animation */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(102, 126, 234, 0.1),
      transparent 50%
    ),
    radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1), transparent 50%),
    radial-gradient(
      circle at 40% 20%,
      rgba(240, 147, 251, 0.05),
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  width: 120px;
  height: auto;
  display: inline-block;
}

/* Theme Switch */
.theme-switch {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 1000;
}

.theme-switch .checkbox {
  opacity: 0;
  position: absolute;
}

.theme-switch .label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px;
  border-radius: 50px;
  position: relative;
  height: 35px;
  width: 70px;
  cursor: pointer;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.theme-switch .label:hover .moon,
.theme-switch .label:hover .sun {
  transform: rotate(360deg);
}

.theme-switch .ball {
  transition: all 0.3s ease;
  background-color: #fff;
  position: absolute;
  border-radius: 50%;
  top: 3px;
  left: 37px;
  height: 25px;
  width: 25px;
}

.theme-switch .moon {
  color: #f1c40f;
  transform-origin: center center;
  transition: all 0.5s cubic-bezier(0.76, 0, 0.24, 1);
  transform: rotate(0);
}

.theme-switch .sun {
  color: #ff6b00;
  transform-origin: center center;
  transition: all 0.5s cubic-bezier(0.76, 0, 0.24, 1);
  transform: rotate(0);
}

.theme-switch .checkbox:checked + .label .ball {
  transform: translateX(-32px);
  background-color: #212529;
}

/* Light mode adjustments for switch */
body.light-mode .theme-switch .label {
  background: var(--bg-tertiary);
}

body.light-mode .theme-switch .ball {
  background-color: var(--bg-primary);
}

/* Light mode specific adjustments */
body.light-mode .theme-toggle-label {
  background-color: #e9ecef;
}

body.light-mode .theme-toggle-switch {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--gradient-1),
    var(--gradient-2),
    var(--gradient-3)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.daily-challenge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 2rem;
  font-size: 0.9rem;
  color: var(--accent);
  animation: pulse 2s infinite;
}

/* Game Board */
.game-board {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: slideUp 0.8s ease-out;
  position: relative;
}

/* Dashed vertical line between actors */
.game-board::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--border) 0,
    var(--border) 7px,
    transparent 10px,
    transparent 15px
  );
  transform: translateX(-50%);
  z-index: 0;
  opacity: 0.9;
}

/* Actor Cards */
.actor-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: 7px;
  padding: 1.2rem;
  border: 2px solid var(--border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.actor-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
  animation: shimmer 3s infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.actor-card.connected {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary)),
    var(--success-light);
  background-blend-mode: normal, overlay;
}

.actor-card.connected::before {
  opacity: 1;
  background: var(--success);
}

.actor-image {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--border);
  object-fit: cover;
  background: var(--bg-tertiary);
  flex-shrink: 0;
  transition: border-color 0.3s ease;
}

.actor-card.connected .actor-image {
  border-color: var(--success);
}

.actor-info {
  flex: 1;
}

.actor-name {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.actor-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Full page loader */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.page-loader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

.loader-text {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Actor image skeleton loader */
.actor-image-skeleton {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-secondary) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border: 3px solid var(--border);
}

/* Connections Area */
.connections-area {
  position: relative;
  padding: 0.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Chain sections */
.chain-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top-chain {
  margin-bottom: 1rem;
}

.bottom-chain {
  margin-top: 1rem;
}

/* Connection lines */
.connection-line {
  position: absolute;
  left: 50%;
  width: 2px;
  background: var(--border);
  transform: translateX(-50%);
  transition: background 0.3s ease;
  z-index: 0;
}

.top-chain .connection-line {
  top: 0;
  height: 100%;
}

.bottom-chain .connection-line {
  bottom: 0;
  height: 100%;
}

.connection-line.active {
  background: var(--success);
}

.connection-line.failed {
  background: var(--error);
}

/* Status icon in the middle */
.status-icon {
  position: relative;
  z-index: 10;
  margin: 1rem 0;
}

.status-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.status-circle::before {
  content: "";
  width: 60px;
  height: 60px;
  border-radius: 50%;
  position: absolute;
  background-color: var(--bg-primary);
  border: 2px solid var(--bg-primary);
  top: -4px;
  left: -4px;
  z-index: -1;
}

.status-circle.success {
  border-color: var(--success);
  background: var(--success-light);
}

.status-circle.failed {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.status-symbol {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.status-circle.success .status-symbol {
  color: var(--success);
}

.status-circle.failed .status-symbol {
  color: var(--error);
}

/* Connections list */
.connections-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

/* Connection Items */
.connection-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 7px;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
  position: relative;
  animation: slideIn 0.4s ease-out;
  max-width: 500px;
  width: auto;
  min-width: 385px;
}

.connection-item.valid {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary)),
    var(--success-light);
  background-blend-mode: normal, overlay;
}

/* Vertical lines between connections */
.connection-item::before,
.connection-item::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 2px;
  height: 0.5rem;
  background: var(--border);
  transform: translateX(-50%);
  transition: background 0.3s ease;
}

.connection-item::before {
  top: -0.5rem;
}

.connection-item::after {
  bottom: -0.5rem;
}

.connection-item.valid::before,
.connection-item.valid::after {
  background: var(--success);
}

/* Hide lines for first/last items as needed */
.connection-item:first-child::before {
  display: none;
}

.connection-item:last-child::after {
  display: none;
}

.connection-movie {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.movie-poster {
  width: 32px;
  height: 50px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.movie-info {
  flex: 1;
}

.movie-title {
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--text-primary);
  font-size: 0.9rem;
}

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

.connection-actor {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 1.5rem;
  white-space: nowrap;
}

.actor-mini-image {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-primary);
}

.connection-actor span {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Input Section */
.input-section {
  background: var(--bg-secondary);
  border-radius: 7px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  position: relative;
}

.input-section.shake {
  animation: shake 0.5s ease-out;
}

.input-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Error Banner */
.error-banner {
  position: absolute;
  top: -2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--error);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.error-banner.show {
  opacity: 1;
}

.input-group {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.input-wrapper {
  flex: 1;
}

.input-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  flex-shrink: 0;
  margin-bottom: 0;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-top: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dropdown.active {
  display: block;
  animation: dropIn 0.3s ease-out;
}

.dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dropdown-item:hover {
  background: var(--bg-secondary);
}

.dropdown-item img {
  width: 40px;
  height: 60px;
  object-fit: cover;
  border-radius: 0.25rem;
}

.dropdown-item-text {
  flex: 1;
}

.dropdown-item-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.dropdown-item-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.add-button {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  border: none;
  border-radius: 7px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.add-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.add-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Success Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 1.5rem;
  padding: 3rem;
  text-align: center;
  max-width: 500px;
  width: 90%;
  border: 1px solid var(--border);
  animation: scaleIn 0.4s ease-out;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 1s ease-out;
}

.success-icon.failed {
  animation: shake 0.5s ease-out;
}

.modal h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal h2.failed {
  background: linear-gradient(135deg, var(--error), #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Failure Modal Styles */
.modal-icon.failure-icon {
  color: var(--error);
}

.modal-title-failure {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--error), #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-message-failure {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.modal-submessage {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.failure-stat {
  color: var(--error);
}

/* Help Button */
.help-button-container {
  position: absolute;
  top: 2rem;
  left: 2rem;
  z-index: 1000;
}

.help-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-button:hover {
  background: var(--bg-tertiary);
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}

/* Help Modal Content */
.modal-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.help-content {
  text-align: left;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  max-height: 50vh;
  overflow: scroll;
}

.help-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.help-section {
  margin-bottom: 1.5rem;
}

.help-section h3 {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.help-section ol,
.help-section ul {
  color: var(--text-secondary);
  margin-left: 1.5rem;
  line-height: 1.8;
}

.help-section li {
  margin-bottom: 0.3rem;
}

.modal-action-button {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  border: none;
  border-radius: 7px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.modal-action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 2rem 0;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.share-button {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  border: none;
  border-radius: 7px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.share-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.share-icon {
  font-size: 1.2rem;
}

.share-notification {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--success-light);
  color: var(--success);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.share-notification.show {
  opacity: 1;
}

/* Winning state animations */
.input-section.winning-glow {
  position: relative;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.4),
    0 0 90px rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.5);
  animation: goldPulse 2s ease-in-out infinite;
}

/* Remove the individual input glow */
.winning-glow .search-input {
  box-shadow: none;
  border-color: inherit;
  animation: none;
}

.winning-glow {
  position: relative;
}

/* Remove the old styling that was problematic */
.winning-glow::before,
.winning-glow::after {
  display: none;
}

/* Lock inputs when winning */
.input-wrapper.winning-locked {
  position: relative;
}

.winning-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  cursor: not-allowed;
  border-radius: 0.75rem;
}

/* Make the add button golden and pulsing when winning */
.add-button.winning-ready {
  background: linear-gradient(135deg, #ffd700, #ffa500);
  animation: goldPulse 2s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
}

.add-button.winning-ready:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(255, 215, 0, 0.7);
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes goldPulse {
  0%,
  100% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.4),
      0 0 90px rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 0 70px rgba(255, 215, 0, 0.6),
      0 0 100px rgba(255, 215, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.7);
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

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

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(200%);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

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

/* Responsive */
@media (max-width: 768px) {
  header {
    margin-bottom: 12px;
  }

  .logo {
    width: 80px;
  }

  .theme-switch {
    top: 1rem;
    right: 1rem;
  }

  .theme-switch .label {
    height: 35px;
    width: 65px;
  }

  .theme-switch .ball {
    height: 25px;
    width: 25px;
    top: 3px;
    left: 32px;
  }

  .theme-switch .checkbox:checked + .label .ball {
    transform: translateX(-29px);
  }

  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .game-board {
    gap: 0.5rem;
  }

  .actor-card {
    padding: 0.75rem;
    gap: 1rem;
  }

  .actor-image {
    width: 50px;
    height: 50px;
  }

  .actor-name {
    font-size: 1.1rem;
  }

  .connection-item {
    min-width: auto;
    width: 100%;
  }

  .connections-area {
    padding: 0.25rem 1rem;
  }

  .input-group {
    flex-direction: column;
  }

  .status-icon {
    margin: 0;
  }

  .input-section {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .input-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .input-label {
    min-width: 50px;
  }

  .error-banner {
    left: auto;
    transform: none;
    z-index: 10;
  }

  .help-button-container {
    top: 1rem;
    left: 1rem;
  }

  .help-button {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  #helpModal .modal-content {
    padding: 1rem;
  }

  #helpModal p,
  #helpModal li {
    font-size: 14px;
  }

  #helpModal .modal-icon {
    margin-bottom: 0px;
  }

  /* Adjust input group for mobile */
  .input-group {
    flex-direction: column;
    gap: 0.75rem;
  }

  /* Make button full width on mobile */
  .add-button {
    width: 100%;
  }

  .add-button {
    width: 100%;
  }

  .connection-item.align-top,
  .connection-item.align-bottom,
  .connection-item.align-middle {
    max-width: 100%;
    margin: 0;
  }
}
