/* ============================================
   MAIN STYLES - Base styles and utilities
   ============================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #000;
  overflow: hidden;
  touch-action: manipulation;
}

#app {
  width: 100vw;
  height: 100vh;
  position: relative;
}

#pattern-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* Controls Overlay */
#controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 15px 20px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  transition: opacity 0.3s, transform 0.3s;
  z-index: 100;
}

#controls.hidden {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

.control-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pattern-name {
  color: white;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.pattern-category {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  text-align: center;
}

/* Buttons */
.btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover, .btn:active {
  background: rgba(255,255,255,0.25);
}

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

.btn.primary {
  background: rgba(59, 130, 246, 0.7);
  border-color: rgba(59, 130, 246, 0.8);
}

.btn.success {
  background: rgba(34, 197, 94, 0.7);
  border-color: rgba(34, 197, 94, 0.8);
}

.btn.warning {
  background: rgba(234, 179, 8, 0.7);
  border-color: rgba(234, 179, 8, 0.8);
}

.btn.danger {
  background: rgba(239, 68, 68, 0.7);
  border-color: rgba(239, 68, 68, 0.8);
}

.btn.small {
  padding: 6px 10px;
  font-size: 11px;
}

/* Info overlay */
#info {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 50;
}

#info.visible {
  opacity: 1;
}

#info div {
  margin-bottom: 3px;
}

#info div:last-child {
  margin-bottom: 0;
}

/* Timer overlay */
#timer-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-family: monospace;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 50;
}

#timer-overlay.visible {
  opacity: 1;
}

/* Keyboard shortcuts help */
.shortcuts {
  margin-top: 10px;
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  text-align: center;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Form controls */
input[type="range"] {
  width: 120px;
  accent-color: #3b82f6;
}

input[type="number"],
input[type="text"] {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 12px;
}

input[type="text"]::placeholder {
  color: rgba(255,255,255,0.4);
}

select {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 12px;
}

select option {
  background: #222;
  color: white;
}

/* Responsive */
@media (max-width: 600px) {
  .btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  input[type="range"] {
    width: 80px;
  }
}
