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

  body {
    font-family: "Arial", sans-serif;
    background: #1a1a1a;
    color: #fff;
    overflow-x: hidden;
  }

  .container {
    display: flex;
    height: 100vh;
  }

  .canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    position: relative;
    max-width: 75%;
  }

  #pixiCanvas {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
  }

  .controls {
    width: 25%;
    min-width: 350px;
    background: #2a2a2a;
    padding: 20px;
    overflow-y: auto;
    border-left: 1px solid #444;
  }

  .control-group {
    margin-bottom: 25px;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
  }

  .control-group h3 {
    color: #4caf50;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .control-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap;
  }

  label {
    font-size: 12px;
    color: #ccc;
    min-width: 80px;
  }

  input,
  select,
  button {
    background: #333;
    border: 1px solid #555;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
  }

  input[type="range"] {
    flex: 1;
  }

  input[type="color"] {
    width: 40px;
    height: 30px;
    padding: 0;
    border: none;
  }

  input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
  }

  button {
    background: #4caf50;
    cursor: pointer;
    transition: background 0.3s;
    padding: 10px 15px;
    width: 100%;
    margin-top: 10px;
  }

  button:hover {
    background: #45a049;
  }

  .playback-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 8px;
  }

  .timeline {
    position: absolute;
    bottom: 80px;
    left: 20px;
    right: 20px;
    height: 60px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    padding: 10px;
  }

  .timeline-track {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
  }

  .timeline-progress {
    height: 100%;
    background: #4caf50;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s;
  }

  .timeline-marker {
    position: absolute;
    top: -10px;
    width: 2px;
    height: 26px;
    background: #fff;
    cursor: ew-resize;
  }

  .json-output {
    background: rgba(42, 42, 42, 0.95);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    max-height: 300px;
    overflow: auto;
    font-family: monospace;
    font-size: 11px;
    margin-top: 10px;
    display: none;
  }

  .toggle-json {
    background: #666;
    padding: 8px 12px;
    font-size: 11px;
    margin-top: 10px;
  }

  .particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }

  .recording-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2a2a2a;
    border: 2px solid #4caf50;
    border-radius: 12px;
    padding: 30px;
    z-index: 2000;
    min-width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  .recording-dialog h3 {
    color: #4caf50;
    margin-bottom: 20px;
    font-size: 18px;
  }

  .recording-dialog p {
    margin-bottom: 25px;
    color: #ccc;
    line-height: 1.5;
  }

  .recording-dialog .button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
  }

  .recording-dialog button {
    padding: 12px 25px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
  }

  .recording-dialog .save-btn {
    background: #4caf50;
    color: white;
  }

  .recording-dialog .save-btn:hover {
    background: #45a049;
  }

  .recording-dialog .cancel-btn {
    background: #666;
    color: white;
  }

  .recording-dialog .cancel-btn:hover {
    background: #777;
  }

  .recording-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1999;
  }

  .transition-group {
    border: 1px solid #555;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
  }

  .transition-group h4 {
    color: #81c784;
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .transition-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
  }

  .transition-checkbox-row label {
    min-width: auto;
    flex: 1;
    font-size: 11px;
  }

  .transition-note {
    font-size: 10px;
    color: #999;
    font-style: italic;
    margin-top: 8px;
    line-height: 1.3;
  }

  .enhanced-audio-section {
    margin-top: 20px;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
  }
  
  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
  }
  
  .section-header h4 {
    margin: 0;
    color: #fff;
  }
  
  .add-sound-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    margin-bottom:10px;
  }
  
  .add-sound-btn:hover {
    background: #45a049;
  }

  .sound-instance {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #555;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
  }
  
  .sound-instance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
  }
  
  .sound-instance-header h4 {
    margin: 0;
    color: #00ff88;
    font-size: 16px;
  }
  
  .remove-sound-btn {
    background: #f44336;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }
  
  .remove-sound-btn:hover {
    background: #da190b;
  }
  
  .sound-controls-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
  }
  
  .control-group {
    flex: 1;
    min-width: 200px;
  }
  
  .control-group label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 14px;
  }
  
  .sound-type-select,
  .sound-start-time,
  .sound-play-length,
  .sound-volume {
    width: 100%;
    padding: 6px;
    background: #333;
    border: 1px solid #555;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
  }
  
  .sound-type-select {
    height: 35px;
  }

  .sound-speed-match,
  .sound-enabled {
    margin-right: 8px;
  }
  
  .test-sound-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
  }
  
  .test-sound-btn:hover {
    background: #1976D2;
  }
  
  /* Timeline sound markers */
  .sound-marker {
    pointer-events: none;
    opacity: 0.8;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
  }
  
  .sound-marker::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -1px;
    width: 4px;
    height: 6px;
    background: inherit;
    border-radius: 2px 2px 0 0;
  }
  
  /* Responsive design for smaller screens */
  @media (max-width: 768px) {
    .sound-controls-row {
      flex-direction: column;
      gap: 10px;
    }
    
    .control-group {
      min-width: auto;
    }
    
    .section-header {
      flex-direction: column;
      gap: 10px;
      align-items: stretch;
    }
    
    .add-sound-btn {
      width: 100%;
    }
  }
  
  /* Scrollbar styling for sound instances container */
  .sound-instances-container::-webkit-scrollbar {
    width: 6px;
  }
  
  .sound-instances-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
  }
  
  .sound-instances-container::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
  }
  
  .sound-instances-container::-webkit-scrollbar-thumb:hover {
    background: #888;
  }
  
  /* Enhanced checkbox styling */
  input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #00ff88;
  }
  
  /* Better spacing for control rows */
  .control-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
  }
  
  .control-row .control-group {
    flex: 1;
    min-width: 250px;
  }
  
  /* Legacy controls toggle */
  .legacy-toggle {
    color: #888;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    margin-bottom: 10px;
  }
  
  .legacy-toggle:hover {
    color: #aaa;
  }

  .logo-instance-management {
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    background: #2a2a2a;
  }
  
  .instance-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
  }
  
  .instance-selector {
    flex: 1;
    padding: 8px;
    background: #1a1a1a;
    border: 1px solid #555;
    border-radius: 4px;
    color: white;
  }
  
  .btn-primary {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .btn-primary:hover {
    background: #45a049;
  }
  
  .btn-secondary {
    background: #666;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .btn-secondary:hover {
    background: #777;
  }
  
  .btn-secondary:disabled {
    background: #333;
    cursor: not-allowed;
  }
  
  .instances-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #555;
    border-radius: 4px;
    background: #1a1a1a;
  }
  
  .instance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #333;
    cursor: pointer;
    transition: background-color 0.2s;
  }
  
  .instance-item:hover {
    background: #333;
  }
  
  .instance-item.selected {
    background: #4CAF50;
    color: white;
  }
  
  .instance-item:last-child {
    border-bottom: none;
  }
  
  .instance-info {
    flex: 1;
  }
  
  .instance-name {
    font-weight: bold;
    margin-bottom: 2px;
  }
  
  .instance-details {
    font-size: 12px;
    opacity: 0.7;
  }
  
  .instance-actions {
    display: flex;
    gap: 5px;
  }
  
  .instance-toggle {
    margin-right: 10px;
  }
  
  .selected-logo-controls {
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    background: #2a2a2a;
  }
  
  .selected-logo-controls h4 {
    margin: 0 0 15px 0;
    color: #4CAF50;
  }
  
  /* Timeline markers for multiple logos */
  .logo-timeline-marker {
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    z-index: 4;
    opacity: 0.8;
    cursor: pointer;
  }
  
  .logo-timeline-marker.logo-in {
    background: linear-gradient(45deg, #4CAF50, #45a049);
  }
  
  .logo-timeline-marker.logo-out {
    background: linear-gradient(45deg, #f44336, #d32f2f);
  }
  
  .logo-timeline-marker:hover {
    opacity: 1;
    transform: scaleX(1.5);
  }
  
  /* Logo instance indicators */
  .logo-marker-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: white;
    background: rgba(0,0,0,0.7);
    padding: 2px 4px;
    border-radius: 2px;
    white-space: nowrap;
  }