:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-light: #252525;
  --text: #f5f5f5;
  --text-muted: #a0a0a0;
  --accent: #ff3e3e;
  --accent-hover: #ff6161;
  --success: #22c55e;
  --border: #333333;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

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

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  letter-spacing: -0.5px;
}

header p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 100%;
}

.search-form {
  display: flex;
  gap: 12px;
}

.search-form input {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-light);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.search-form input:focus {
  border-color: var(--accent);
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 20px;
  right: 20px;
  margin-top: 8px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
}

.autocomplete-dropdown.hidden {
  display: none;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s ease;
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
  background: rgba(255, 62, 62, 0.1);
}

.autocomplete-item img {
  width: 80px;
  height: 45px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.autocomplete-item .info {
  flex: 1;
  min-width: 0;
}

.autocomplete-item .info h4 {
  margin: 0 0 2px;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-item .info p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.autocomplete-empty {
  padding: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:active {
  transform: scale(0.98);
}

.btn.secondary {
  background: var(--surface-light);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.secondary:hover {
  background: #333;
}

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

.results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin-bottom: 8px;
  background: var(--surface-light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-width: 100%;
  min-width: 0;
}

.result-item img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.result-info {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.result-info h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.result-info p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.vote-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.vote-count .number {
  color: var(--accent);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
}

.error {
  background: rgba(255, 62, 62, 0.15);
  color: #ff9e9e;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid rgba(255, 62, 62, 0.3);
}

.success {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Dashboard */
.dashboard {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.dashboard-main {
  display: flex;
  flex: 1;
  min-height: 0;
}

.player-section {
  flex: 2;
  display: flex;
  flex-direction: column;
  background: #000;
  min-width: 0;
}

#player {
  flex: 1;
  width: 100%;
  min-height: 0;
}

.sidebar {
  flex: 1;
  min-width: 320px;
  max-width: 420px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.ranking-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--surface-light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.rank-item.current {
  border-color: var(--accent);
  background: rgba(255, 62, 62, 0.1);
}

.rank-thumb {
  width: 80px;
  height: 45px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.rank-info {
  flex: 1;
  min-width: 0;
}

.rank-info h4 {
  margin: 0 0 2px;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-info p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.rank-votes {
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 28px;
  text-align: center;
}

.dashboard-footer {
  background: var(--surface-light);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}

.footer-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.footer-logo img {
  height: 160px;
  width: auto;
  max-width: 500px;
  object-fit: contain;
}

.qr-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.qr-section img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: white;
  padding: 4px;
}

.qr-text {
  display: flex;
  flex-direction: column;
}

.qr-text strong {
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.qr-text span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-shrink: 0;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Legal pages */
.legal-page h2 {
  font-size: 1.1rem;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-page h2:first-child {
  margin-top: 0;
}

.legal-page ul {
  padding-left: 20px;
  color: var(--text-muted);
}

.legal-page a {
  color: var(--accent);
  text-decoration: none;
}

.legal-page a:hover {
  text-decoration: underline;
}

.back-link {
  text-align: center;
  margin-top: 24px;
}

/* Playlist grid on vote page */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

@media (max-width: 1200px) {
  .playlist-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 900px) {
  .playlist-grid {
    grid-template-columns: 1fr !important;
  }
}

.playlist-card {
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.playlist-card-title {
  margin: 0;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-card-count {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.playlist-card-songs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.playlist-card-songs::-webkit-scrollbar {
  width: 6px;
}

.playlist-card-songs::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 3px;
}

.playlist-card-songs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.playlist-card-songs::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

@media (max-width: 560px) {
  .playlist-card-songs {
    max-height: 50vh;
  }
}

.playlist-item-song {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  max-width: 100%;
  min-width: 0;
}

.playlist-item-song img {
  width: 60px;
  height: 34px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.playlist-item-song .result-info h3 {
  font-size: 0.85rem;
}

.playlist-item-song .result-info p {
  font-size: 0.75rem;
}

.playlist-item-song .btn {
  padding: 6px 10px;
  font-size: 0.8rem;
}

/* History items */
.history-item {
  padding: 8px;
  gap: 10px;
}

.history-item img {
  width: 80px;
  height: 45px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.history-item .result-info h3 {
  font-size: 0.9rem;
}

.history-item .vote-count {
  font-size: 0.8rem;
}

.history-item .btn {
  padding: 6px 10px;
  font-size: 0.8rem;
}

/* Admin page */
.admin-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px;
  text-align: center;
}

.admin-page h1 {
  margin-bottom: 24px;
}

.admin-card {
  text-align: left;
  margin-bottom: 24px;
}

.admin-card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.admin-card .hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.playlist-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.playlist-form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-light);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.playlist-form input:focus {
  border-color: var(--accent);
}

.playlists {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.playlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface-light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.playlist-item.default {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.playlist-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.playlist-info strong {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.playlist-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.playlist-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.playlist-actions .btn {
  padding: 8px 12px;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .dashboard-main {
    flex-direction: column;
  }

  .sidebar {
    max-width: none;
    border-left: none;
    border-top: 1px solid var(--border);
    min-height: 200px;
  }

  .dashboard-footer {
    flex-direction: column;
    text-align: center;
    padding-top: 80px;
  }

  .footer-logo {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-logo img {
    height: 112px;
  }

  .qr-section {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 12px;
  }

  .card {
    padding: 14px;
  }

  .result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .result-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .history-item {
    flex-direction: row;
    align-items: center;
  }

  .history-item img {
    width: 60px;
    height: 34px;
  }

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

  .playlist-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .playlist-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Flash Play Styles */
.flash-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.flash-form input[type="text"] {
  flex: 1;
  min-width: 300px;
}

.flash-btn {
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.flash-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff8e53, #ff6b6b);
  transform: translateY(-1px);
}

.flash-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.flash-preview {
  margin-top: 12px;
}

.flash-preview-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--surface-light);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.flash-preview-thumb {
  width: 80px;
  height: 45px;
  border-radius: 4px;
  object-fit: cover;
}

.flash-preview-info h4 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: var(--text);
}

.flash-preview-info p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.flash-preview-error {
  padding: 8px 12px;
  background: rgba(255, 62, 62, 0.1);
  border: 1px solid rgba(255, 62, 62, 0.3);
  border-radius: 6px;
  color: #ff6b6b;
  font-size: 0.85rem;
}

/* Settings Form Styles */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-group label {
  font-weight: 600;
  color: var(--text);
}

.setting-group input[type="number"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  width: 120px;
}

.setting-group select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  width: 300px;
}

.setting-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* FULLSCREEN MODE - Only when enabled */
body.dashboard.fullscreen-mode-enabled #player {
  width: 100vw !important;
  height: 100vh !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

body.dashboard.fullscreen-mode-enabled .player-section {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

/* Override dashboard layout in fullscreen mode */
body.dashboard.fullscreen-mode-enabled .dashboard-main {
  position: fixed !important;
  z-index: 10 !important;
}

body.dashboard.fullscreen-mode-enabled .dashboard-footer {
  position: fixed !important;
  z-index: 10 !important;
}

/* STANDARD MODE - Original layout when fullscreen is disabled */
body.dashboard:not(.fullscreen-mode-enabled) #player {
  width: 100% !important;
  height: 100vh !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  z-index: auto !important;
  min-height: 100vh !important;
  object-fit: cover !important;
}

/* YouTube iframe styling for standard mode */
body.dashboard:not(.fullscreen-mode-enabled) #player iframe {
  width: 100% !important;
  height: 100vh !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  border: none !important;
}

body.dashboard:not(.fullscreen-mode-enabled) .player-section {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  height: 100vh !important;
  z-index: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 1;
  min-height: 100vh !important;
  background: #000 !important;
}

/* Restore original dashboard layout in standard mode */
body.dashboard:not(.fullscreen-mode-enabled) .dashboard-main {
  position: relative !important;
  display: flex !important;
  flex-direction: row !important;
  z-index: auto !important;
  background: var(--background) !important;
  backdrop-filter: none !important;
  width: 100% !important;
  height: 100vh !important;
  overflow: hidden !important;
}

body.dashboard:not(.fullscreen-mode-enabled) .dashboard-footer {
  position: relative !important;
  z-index: auto !important;
  background: var(--surface) !important;
  backdrop-filter: none !important;
  border-top: 1px solid var(--border) !important;
}

/* Hide overlay effects in standard mode */
body.dashboard:not(.fullscreen-mode-enabled) .dashboard-main.hidden,
body.dashboard:not(.fullscreen-mode-enabled) .dashboard-footer.hidden {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Sidebar styles for standard mode */
body.dashboard:not(.fullscreen-mode-enabled) .sidebar {
  position: fixed !important;
  top: 50% !important;
  right: 25px !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  width: 400px !important;
  max-height: 80vh !important;
  min-height: 300px !important;
  background: rgba(30, 30, 30, 0.85) !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
  padding: 20px !important;
  overflow-y: auto !important;
  z-index: 100 !important;
  border: none !important;
  opacity: 1 !important;
  transition: opacity 2s ease-in-out !important;
  pointer-events: auto !important;
  backdrop-filter: blur(10px) !important;
}

body.dashboard:not(.fullscreen-mode-enabled) .sidebar.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Playlist items for floating sidebar */
body.dashboard:not(.fullscreen-mode-enabled) .rank-item {
  border-radius: 12px !important;
  margin-bottom: 12px !important;
  padding: 16px !important;
  transition: transform 0.2s ease !important;
}

/* Hide scrollbar for auto-scroll effect - all playlist containers */
body.dashboard:not(.fullscreen-mode-enabled) .sidebar {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

body.dashboard:not(.fullscreen-mode-enabled) .sidebar::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

/* Hide scrollbar for vote page playlist */
#playlist {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

#playlist::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

/* Hide scrollbar for dashboard ranking container */
#ranking {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

#ranking::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

/* Hide scrollbar for any scrollable playlist container */
.results, .playlist-grid, .ranking-container {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.results::-webkit-scrollbar, 
.playlist-grid::-webkit-scrollbar, 
.ranking-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

body.dashboard:not(.fullscreen-mode-enabled) .rank-item:hover {
  transform: translateY(-2px) !important;
}

body.dashboard:not(.fullscreen-mode-enabled) .rank-thumb {
  border-radius: 8px !important;
}

body.dashboard:not(.fullscreen-mode-enabled) .sidebar-header {
  text-align: center !important;
  margin-bottom: 15px !important;
}

/* Overlay styles only for fullscreen mode */
body.dashboard.fullscreen-mode-enabled .dashboard-main,
body.dashboard.fullscreen-mode-enabled .dashboard-footer {
  position: fixed;
  z-index: 10;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  transition: opacity 2s ease-in-out;
}

.dashboard-main {
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-footer {
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-main.hidden,
.dashboard-footer.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Overlay for fade effects */
.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0) 20%,
    rgba(0, 0, 0, 0) 80%,
    rgba(0, 0, 0, 0.8) 100%
  );
  opacity: 0;
  transition: opacity 2s ease-in-out;
}

.video-overlay.show-start {
  opacity: 1;
  animation: fadeOutStart 2s ease-in-out 18s forwards;
}

.video-overlay.show-end {
  opacity: 1;
  animation: fadeInEnd 2s ease-in-out;
}

@keyframes fadeOutStart {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes fadeInEnd {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Dashboard overlay for fade transitions */
.dashboard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9998;
  background: #0f0f0f;
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease-in-out;
}

.dashboard-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.dashboard-overlay .dashboard-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Hide dashboard elements in fullscreen mode */
.fullscreen-video-mode .dashboard-main,
.fullscreen-video-mode .dashboard-footer {
  display: none;
}

.fullscreen-video-mode .dashboard-overlay.show .dashboard-main,
.fullscreen-video-mode .dashboard-overlay.show .dashboard-footer {
  display: flex;
}

@media (max-width: 400px) {
  .container {
    padding: 8px;
  }

  .card {
    padding: 12px;
  }

  .flash-form {
    flex-direction: column;
  }

  .flash-preview-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .flash-preview-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
  }
}
