/* ============================================================================
 * styles.css — Unified Stylesheet for the Retro Chiptune & Link SFX Project
 * Covers: index.html, composer.html, SFX.html, info.html, template.html, game.html
 * ============================================================================ */

/* ----------------------------------------------------------------------------
 * 1. Base & Page Layout
 * ---------------------------------------------------------------------------- */
body {
  font-family: monospace;
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 20px;
  max-width: 1020px;
  margin: 0 auto;
  line-height: 1.6;
}

body.no-select {
  user-select: none;
}

h1, h2, h3 {
  color: #00fff5;
  margin-top: 0;
}

h1.section-divider {
  border-bottom: 2px solid #e94560;
  padding-bottom: 10px;
}

h2.section-accent {
  margin-top: 32px;
  border-left: 4px solid #e94560;
  padding-left: 10px;
}

a {
  color: #00fff5;
}

code {
  background: #0f3460;
  color: #ff8fa3;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

pre {
  background: #0f3460;
  border: 1px solid #00fff5;
  padding: 14px;
  border-radius: 6px;
  overflow-x: auto;
  color: #fff;
}

/* ----------------------------------------------------------------------------
 * 2. Buttons & Form Controls
 * ---------------------------------------------------------------------------- */
button,
.btn {
  background: #e94560;
  color: #fff;
  border: none;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  text-align: left;
}

button:hover,
.btn:hover {
  background: #ff5c77;
}

button.active {
  background: #0f3460;
  border: 2px solid #00fff5;
}

button.cyan,
.btn-cyan,
.btn-primary {
  background: #00fff5;
  color: #1a1a2e;
  font-weight: bold;
  border: none;
}

button.cyan:hover,
.btn-cyan:hover,
.btn-primary:hover {
  background: #5cfff9;
}

button.green,
.btn-green {
  background: #06d6a0;
  color: #1a1a2e;
}

button.green:hover,
.btn-green:hover {
  background: #38e8ba;
}

button.secondary,
.btn-dark {
  background: #333;
  border: 1px solid #777;
  color: #fff;
}

button.secondary:hover,
.btn-dark:hover {
  background: #444;
}

#stopBtn {
  background: #444;
  margin-bottom: 15px;
  width: 220px;
  text-align: center;
}

input,
select,
textarea {
  background: #1a1a2e;
  color: #fff;
  border: 1px solid #00fff5;
  border-radius: 4px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
}

textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}

/* ----------------------------------------------------------------------------
 * 3. Navigation Bars (index.html, composer.html, SFX.html, info.html, game.html)
 * ---------------------------------------------------------------------------- */
.sfx-bar,
.nav-bar,
.top-nav {
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  max-width: 1020px;
}

.top-nav {
  margin-bottom: 20px;
}

.sfx-bar a,
.nav-bar a,
.top-nav a.secondary {
  color: #00fff5;
  text-decoration: none;
  background: #0f3460;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #00fff5;
  font-size: 13px;
}

.sfx-bar a:hover,
.nav-bar a:hover,
.top-nav a.secondary:hover {
  background: #00fff5;
  color: #1a1a2e;
}

.nav-bar a {
  border-color: #e94560;
  color: #ff8fa3;
}

.nav-bar a:hover {
  background: #e94560;
  color: #fff;
}

.nav-bar a.docs-link {
  border-color: #00fff5;
  color: #00fff5;
  font-weight: bold;
}

.nav-bar a.docs-link:hover {
  background: #00fff5;
  color: #1a1a2e;
}

.top-nav a {
  background: #e94560;
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 13px;
}

.top-nav a:hover {
  background: #ff5c77;
}

.top-nav a.home-link {
  background: #e94560;
  color: #fff;
  border-color: #e94560;
  font-weight: bold;
}

.top-nav a.home-link:hover {
  background: #ff5c77;
}

/* ----------------------------------------------------------------------------
 * 4. Hub Grid, Engine Mode Toggle & Hidden Diagnostic Bar (index.html)
 * ---------------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  max-width: 960px;
}

.grid button {
  padding: 12px;
  font-weight: normal;
}

#diagBar {
  display: none;
  background: #0f3460;
  border: 1px solid #00fff5;
  color: #00fff5;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 15px;
  max-width: 960px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

#diagBar.visible {
  display: flex;
}

#testToneBtn {
  background: #00fff5;
  color: #1a1a2e;
  font-weight: bold;
  padding: 8px 14px;
  width: auto;
}

#wavFallbackBtn {
  background: #ff9f1c;
  color: #1a1a2e;
  font-weight: bold;
  padding: 8px 14px;
  width: auto;
}

.engine-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0f3460;
  border: 1px solid #00fff5;
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}

.engine-toggle input {
  accent-color: #00fff5;
  width: 15px;
  height: 15px;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.engine-badge {
  color: #ff8fa3;
  font-weight: bold;
}

.engine-toggle input:checked ~ .engine-badge {
  color: #00fff5;
}

/* ----------------------------------------------------------------------------
 * 5. Dummy Stage View & Subpage Content Cards (index.html, template.html)
 * ---------------------------------------------------------------------------- */
.stage-card {
  background: #0f3460;
  border: 2px solid #00fff5;
  border-radius: 8px;
  padding: 24px;
  max-width: 720px;
  margin-top: 20px;
}

.stage-card h1 {
  color: #00fff5;
  margin-top: 0;
}

.stage-meta {
  color: #ff8fa3;
  margin-bottom: 16px;
  font-size: 14px;
}

.stage-actions,
.audio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.stage-actions a,
.stage-actions button {
  padding: 10px 16px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.btn-back {
  background: #e94560;
  color: #fff;
  border: none;
}

.content-box {
  background: #0f3460;
  border: 1px solid #1f4068;
  border-left: 4px solid #00fff5;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

/* ----------------------------------------------------------------------------
 * 6. Studio Panels, Piano Keyboard & Code Output (composer.html, SFX.html)
 * ---------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  background: #0f3460;
  color: #00fff5;
  border: 2px solid #00fff5;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 6px;
}

.tab-btn.active {
  background: #00fff5;
  color: #1a1a2e;
}

.panel {
  background: #0f3460;
  border: 1px solid #1f4068;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 12px;
  color: #ff8fa3;
  font-weight: bold;
}

.piano-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 10px 0;
  background: #1a1a2e;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #1f4068;
}

.note-key {
  background: #222;
  color: #fff;
  border: 1px solid #555;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: normal;
  cursor: pointer;
  border-radius: 3px;
}

.note-key:hover {
  background: #e94560;
  border-color: #fff;
}

.note-key.sharp {
  background: #111;
  color: #00fff5;
  border-color: #00fff5;
}

.note-key.rest {
  background: #333;
  color: #ff9f1c;
  border-color: #ff9f1c;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.code-box {
  position: relative;
  margin-top: 14px;
}

.code-box textarea {
  background: #0b132b;
  color: #72efdd;
  border: 1px solid #00fff5;
  font-size: 12px;
  min-height: 160px;
}

.beat-badge {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 4px;
  background: #1a1a2e;
  border: 1px solid #00fff5;
  color: #00fff5;
}

.beat-badge.warn {
  border-color: #ff9f1c;
  color: #ff9f1c;
}

#studioStatus {
  color: #00fff5;
  font-weight: bold;
  margin-left: auto;
}

/* ----------------------------------------------------------------------------
 * 7. Documentation Tables & Function Reference Cards (info.html)
 * ---------------------------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: #0f3460;
}

th,
td {
  border: 1px solid #1f4068;
  padding: 10px 12px;
  text-align: left;
}

th {
  background: #e94560;
  color: #fff;
}

.fn-card {
  background: #0f3460;
  border: 1px solid #1f4068;
  border-left: 4px solid #00fff5;
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 14px;
}

.fn-card.auto-only {
  border-left-color: #ff9f1c;
}

.fn-card.studio-card {
  border-left-color: #72efdd;
}

.fn-card.debug-card {
  border-left-color: #ff5c77;
}

.fn-title {
  font-size: 16px;
  font-weight: bold;
  color: #00fff5;
  margin-bottom: 6px;
}

.fn-card.auto-only .fn-title {
  color: #ff9f1c;
}

.fn-card.studio-card .fn-title {
  color: #72efdd;
}

.fn-card.debug-card .fn-title {
  color: #ff8fa3;
}

.fn-meta {
  font-size: 13px;
  color: #ff8fa3;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  background: #ff9f1c;
  color: #1a1a2e;
  font-size: 11px;
  font-weight: bold;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 8px;
  vertical-align: middle;
}

.badge.studio {
  background: #72efdd;
}

Use code with caution.
.badge.debug {
background: #e94560;
color: #fff;
}
/* ----------------------------------------------------------------------------
• 
	8. Mini-Game Arcade Shell, HUD & Canvas (game.html)
• ---------------------------------------------------------------------------- */
.game-shell {
background: #0f3460;
border: 2px solid #00fff5;
border-radius: 8px;
padding: 18px;
}
.hud {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
gap: 12px;
background: #1a1a2e;
border: 1px solid #1f4068;
padding: 10px 14px;
border-radius: 6px;
margin-bottom: 12px;
font-size: 14px;
font-weight: bold;
}
.hud span b {
color: #00fff5;
}
.hud .star-active {
color: #ff9f1c;
}
canvas {
display: block;
width: 100%;
height: auto;
background: #101828;
border: 2px solid #e94560;
border-radius: 6px;
cursor: pointer;
}
.controls-bar {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 10px;
margin-top: 14px;
}
.hint {
font-size: 12px;
color: #ff8fa3;
}
