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

body {
  background: #0f0f1a;
  position: relative;
}

#film-grain {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  animation: grainShift 0.5s steps(3) infinite;
}

@keyframes grainShift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-10px, 5px); }
  66% { transform: translate(5px, -10px); }
  100% { transform: translate(0, 0); }
}

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

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

@keyframes reelSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes panelReveal {
  from { opacity: 0; transform: scale(0.9); filter: brightness(0); }
  to { opacity: 1; transform: scale(1); filter: brightness(1); }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.shimmer-btn {
  background: linear-gradient(90deg, #b08930, #e8c97a, #d4a854, #e8c97a, #b08930);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

.reel-spin {
  animation: reelSpin 1s linear infinite;
}

.panel-reveal {
  animation: panelReveal 0.5s ease-out forwards;
}

.drop-zone {
  border: 2px dashed #d4a854;
  transition: all 0.3s ease;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: #e8c97a;
  background: rgba(212, 168, 84, 0.08);
  box-shadow: 0 0 30px rgba(212, 168, 84, 0.15);
}

.glass-panel {
  background: rgba(26, 26, 46, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 168, 84, 0.15);
}

.panel-cell {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.panel-cell:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(212, 168, 84, 0.3);
  z-index: 10;
}

.sprocket-hole {
  width: 12px;
  height: 18px;
  border-radius: 3px;
  background: #0f0f1a;
  border: 1px solid #2a2a3e;
}

.lightbox-overlay {
  animation: fadeInUp 0.3s ease-out;
}

textarea:focus {
  outline: none;
  border-color: #d4a854;
  box-shadow: 0 0 20px rgba(212, 168, 84, 0.2);
}

.style-chip {
  transition: all 0.2s ease;
  cursor: pointer;
}

.style-chip:hover {
  background: rgba(212, 168, 84, 0.15);
}

.style-chip.active {
  background: rgba(212, 168, 84, 0.25);
  border-color: #d4a854;
  color: #e8c97a;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #0f0f1a;
}

::-webkit-scrollbar-thumb {
  background: #2a2a3e;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a4e;
}

.history-thumb {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(212, 168, 84, 0.3);
}

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