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

:root {
  --primary-color: #0a192f;
  --secondary-color: #172a45;
  --accent-color: #64ffda;
  --accent-hover: #4cceaa;
  --text-color: white;
  --light-on-color: yellow;
  --naval-blue: #003366;
  --naval-gold: #ccad00;
  --naval-highlight: #224b7a;
}

body {
  font-family: Arial, sans-serif;
  background-color: var(--primary-color);
  color: var(--text-color);
  padding: 20px;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 40px);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

.controls {
  margin-bottom: 20px;
  width: 100%;
}

textarea {
  width: 100%;
  height: 150px;
  padding: 10px;
  font-size: 16px;
  margin-bottom: 15px;
  background-color: var(--secondary-color);
  color: var(--text-color);
  border: 1px solid var(--accent-color);
  resize: vertical;
  font-family: monospace;
}

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

.primary-controls {
  display: flex;
  gap: 10px;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
  min-width: 200px;
}

#wpm-value {
  font-weight: bold;
  color: var(--accent-color);
  min-width: 70px;
}

.speed-presets {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  width: 100%;
  justify-content: space-between;
}

.preset {
  padding: 8px 15px;
  font-size: 0.95em;
  background-color: var(--naval-blue);
  border: 1px solid var(--naval-gold);
  color: var(--naval-gold);
  border-radius: 4px;
  font-weight: bold;
  flex: 1;
  text-align: center;
  max-width: 180px;
  transition: all 0.2s ease;
}

.preset:hover {
  background-color: var(--naval-gold);
  color: var(--naval-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button {
  padding: 8px 16px;
  background-color: var(--accent-color);
  color: var(--primary-color);
  border: none;
  cursor: pointer;
  font-weight: bold;
  white-space: nowrap;
}

button:hover {
  background-color: var(--accent-hover);
}

#toggle-sound {
  min-width: 100px;
}

#morse-preview {
  background-color: var(--secondary-color);
  padding: 10px;
  margin-bottom: 20px;
  font-family: monospace;
  min-height: 100px;
  border: 1px solid var(--accent-color);
  overflow-x: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Morse Code Reference */
.reference-toggle {
  margin-bottom: 20px;
  width: 100%;
  background-color: var(--naval-blue);
  color: var(--text-color);
  border: 1px solid var(--naval-gold);
  border-radius: 4px;
  padding: 12px;
  font-size: 1.1em;
  transition: all 0.2s ease;
}

.reference-toggle:hover {
  background-color: var(--naval-highlight);
  color: var(--naval-gold);
  transform: translateY(-2px);
}

#morse-reference {
  background-color: var(--naval-blue);
  padding: 25px;
  margin-bottom: 20px;
  border: 2px solid var(--naval-gold);
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#morse-reference h2 {
  margin-bottom: 20px;
  color: var(--naval-gold);
  text-align: center;
  font-size: 1.5em;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--naval-gold);
  padding-bottom: 10px;
}

#morse-reference h3 {
  margin-bottom: 15px;
  color: var(--naval-gold);
  font-size: 1.2em;
}

.hidden {
  display: none;
}

.reference-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.reference-column {
  flex: 1;
  min-width: 250px;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

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

.reference-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 15px;
  background-color: var(--naval-highlight);
  border-radius: 4px;
  border-left: 3px solid var(--naval-gold);
}

.reference-item .char {
  font-weight: bold;
}

.reference-item .code {
  font-family: monospace;
  color: var(--naval-gold);
  font-size: 1.1em;
  letter-spacing: 1px;
}

.reference-footnote {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid var(--naval-highlight);
  font-size: 0.9em;
  color: #aabbcc;
  line-height: 1.5;
}

#scene {
  position: relative;
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

#bg {
  width: 100%;
  height: auto;
  display: block;
}

#light {
  position: absolute;
  width: 34%;
  height: 35%;
  border-radius: 50%;
  background: #333333;
  transition: background 0.1s, box-shadow 0.1s;
  top: 23.5%;
  left: 9.8%;
}

#light.on {
  background: var(--light-on-color);
  box-shadow: 0 0 60px 20px var(--light-on-color);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .control-panel {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .speed-control {
    width: 100%;
  }
  
  .speed-presets {
    justify-content: space-between;
  }
  
  .preset {
    flex: 1;
    text-align: center;
    font-size: 0.8em;
    max-width: 30%;
  }
  
  #toggle-sound {
    width: 100%;
  }
  
  textarea {
    height: 120px;
  }
  
  .reference-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  .container {
    min-height: calc(100vh - 20px);
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  textarea {
    height: 100px;
    font-size: 14px;
  }
  
  #morse-preview {
    min-height: 80px;
    font-size: 12px;
  }
  
  .reference-container {
    flex-direction: column;
  }
  
  .reference-column {
    width: 100%;
  }
  
  .preset {
    max-width: 100%;
    margin-bottom: 8px;
  }
  
  .speed-presets {
    flex-direction: column;
  }
} 