/* Analog Piano Roll Editor Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
 font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
 line-height: 1.6;
 color: #333;
 background: #fafafa;
}

header {
 background: #2c3e50;
 color: white;
 padding: 1rem 0;
 box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header .container { display: flex; justify-content: space-between; align-items: center; }

header h1 { font-size: 1.5rem; }

nav a {
 color: #ecf0f1;
 text-decoration: none;
 margin-left: 1.5rem;
 font-size: 0.9rem;
}

nav a:hover { text-decoration: underline; }

main { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; }

section { margin-bottom: 3rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

h2 { font-size: 1.8rem; margin-bottom: 1rem; color: #2c3e50; }

h3 { font-size: 1.2rem; margin: 1rem 0 0.5rem; color: #34495e; }

.editor-section { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 2rem; }

.roll-controls {
 display: flex;
 justify-content: space-between;
 align-items: center;
 margin-bottom: 1.5rem;
 flex-wrap: wrap;
 gap: 1rem;
}

.tempo-control {
 display: flex;
 flex-direction: column;
 gap: 0.5rem;
}

.presets select {
 padding: 0.5rem;
 border-radius: 4px;
 border: 1px solid #ddd;
 font-size: 1rem;
}

.keyboard-container {
 position: relative;
}

.keyboard-labels {
 display: flex; justify-content: space-between;
 padding: 0.5rem 0;
 color: #666;
 font-size: 0.85rem;
}

.note-label {
 background: #eee; padding: 0.25rem 0.5rem; border-radius: 4px; }

.piano-roll {
 position: relative;
 height: 300px;
 background: #1a1a2e;
 border: 2px solid #ddd;
 border-radius: 4px;
 overflow: hidden;
}

.piano-keys {
 position: absolute;
 top: 0; left: 0;
 width: 100%; height: 100%;
 display: grid;
 grid-template-columns: repeat(4, 1fr);
}

.key {
 border: 1px solid #34495e;
 cursor: pointer;
 position: relative;
}

.key.white { background: white; }

.key.black { background: #1a1a2e; width: 60%; height: 60%; position: absolute; right: 0; top: 0; z-index: 1; border-color: #2c3e50; }

.key.active { background: #3498db; }

.perforation-grid {
 position: absolute;
 top: 0; left: 0;
 width: 100%; height: 100%;
 display: grid;
 grid-template-columns: repeat(16, 1fr);
}

.hole { width: 80%; height: 80%; background: #e74c3c; border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); muzzle: center; }

.playback-controls {
 display: flex;
 gap: 1rem;
 align-items: center;
 margin-top: 1rem;
}

.play-button,
.stop-button,
.print-button,
.share-button,
.export-button {
 padding: 0.75rem 1.5rem;
 border: none;
 border-radius: 4px;
 cursor: pointer;
 font-size: 1rem;
 transition: background 0.2s;
}

.play-button { background: #27ae60; color: white; }

.stop-button { background: #e74c3c; color: white; }

.print-button { background: #3498db; color: white; }

.share-button { background: #9b59b6; color: white; }

.export-button { background: #f39c12; color: white; }

.playback-controls input[type="checkbox"] { margin-left: 0.5rem; }

.visualization-section { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 2rem; }

.pattern-preview {
 min-height: 200px;
 background: #f8f9fa;
 border: 1px dashed #ddd;
 border-radius: 4px;
 margin-bottom: 1rem;
 display: flex;
 align-items: center;
 justify-content: center;
 color: #999;
}

.library-section { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 2rem; }

.song-grid {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
 gap: 1.5rem;
}

.song-card {
 background: #f8f9fa;
 padding: 1.5rem;
 border-radius: 8px;
 border-left: 4px solid #3498db;
}

.song-card h3 { margin-bottom: 0.5rem; color: #2c3e50; }

.song-card p { color: #666; margin-bottom: 0.25rem; }

.guide-section { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 2rem; }

.guide-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }

.guide-column h3 { margin-top: 0; color: #2c3e50; }

.guide-column p { margin-bottom: 0.75rem; color: #555; }

.info-section { background: #f8f9fa; padding: 2rem; border-radius: 8px; }

.assumptions-list {
 list-style: none;
 padding-left: 0;
}

.assumptions-list li {
 padding: 0.5rem 0;
 border-bottom: 1px solid #eee;
}

.assumptions-list li:last-child { border-bottom: none; }

.last-updated { font-size: 0.85rem; color: #888; margin-top: 1rem; font-style: italic; }

.why-this-exists { background: #e8f4fc; padding: 1rem; border-radius: 4px; margin-top: 1.5rem; font-size: 0.95rem; }

footer {
 background: #2c3e50;
 color: #ecf0f1;
 padding: 1.5rem 0;
 margin-top: 3rem;
}

footer a {
 color: #bdc3c7;
 text-decoration: none;
}

footer a:hover { text-decoration: underline; }

@media (max-width: 768px) {
 header .container { flex-direction: column; text-align: center; gap: 1rem; }

 nav a { margin: 0 0.5rem; }

 .roll-controls { flex-direction: column; align-items: stretch; }

 .playback-controls { flex-direction: column; align-items: stretch; }

 .guide-content { grid-template-columns: 1fr; }

 main { padding: 1rem; }

 .editor-section, .visualization-section, .library-section, .guide-section { padding: 1rem; }
}

@media (max-width: 480px) {
 h2 { font-size: 1.5rem; }

 .play-button, .stop-button, .print-button, .share-button, .export-button { width: 100%; }
}

/* Print styles */
@media print {
 body { background: white; color: black; }

 header, nav, footer { display: none; }

 main { padding: 0; margin: 0; }

 .editor-section, .visualization-section, .library-section, .guide-section { box-shadow: none; border: none; margin-bottom: 0; }

 .piano-roll { border: 2px solid black; }

 .pattern-preview { border: 1px solid black; }
}


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
