/* Theme layer — deliberately plain for the MVP; every color and shape
   lives here so re-skinning never touches the engine or UI logic. */
:root {
  --bg: #0f1115;
  --surface: #181b22;
  --text: #e2e8f0;
  --muted: #64748b;
  --accent: #38bdf8;
  --flat: #fbbf24;
  --sharp: #fb7185;
  --tuned: #4ade80;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

body {
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
}

h1 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

#tuning-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.9rem;
  max-width: 48vw;
  text-overflow: ellipsis;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 18px;
}

#note-display { text-align: center; }

#note-name {
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  transition: color 0.15s;
}
#note-name.in-tune { color: var(--tuned); }
#note-name.flat { color: var(--flat); }
#note-name.sharp { color: var(--sharp); }

#note-detail {
  margin-top: 8px;
  font-size: 1.1rem;
  color: var(--muted);
  min-height: 1.4em;
}

#trace {
  width: 100%;
  max-width: 560px;
  flex: 1;
  min-height: 150px;
  border-radius: 14px;
  background: var(--surface);
  margin: 10px 0;
}

#headstock-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#headstock {
  height: 190px;
  width: auto;
}

#pegs-left, #pegs-right {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 165px;
}

.peg {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #2a2f3a;
  background: var(--surface);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.peg-note { font-size: 1.15rem; font-weight: 600; line-height: 1; }
.peg-oct { font-size: 0.62rem; color: var(--muted); }
.peg.active { border-color: var(--accent); }
.peg.locked { border-color: var(--sharp); background: #241a20; }
.peg.tuned { border-color: var(--tuned); }

#auto-btn {
  margin-bottom: 8px;
  padding: 6px 20px;
  border-radius: 10px;
  border: 1px solid var(--sharp);
  background: transparent;
  color: var(--sharp);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.hidden { display: none !important; }

#start-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 10;
}

#start-btn {
  font-size: 1.3rem;
  font-weight: 600;
  padding: 18px 44px;
  border-radius: 16px;
  border: none;
  background: var(--accent);
  color: #06222e;
  cursor: pointer;
}
#start-btn:disabled { opacity: 0.6; }

#start-hint {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  max-width: 300px;
}
