
/* =========================
   Theme
   ========================= */
:root {
  --bg: #f5eddc;
  --card: #fff8e7ee;
  --ink: #2b2b2b;
  --muted: #6b6154;
  --line: #e7dcc7;
  --accent: #a66a2b;
  --accent-2: #d39c5a;
  --badge: #f2e6cf;
  --badge-active: #ffe2a8;
}

/* =========================
   Base / Resets
   ========================= */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: url('site_bg.jpg') fixed;
  background-size: cover;
  color: var(--ink);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
}

/* =========================
   Layout
   ========================= */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px;
}

.card {
  background: var(--card);
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0;
}

.viz {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 12px;
  text-align: center;
}

/* =========================
   Typography
   ========================= */
h1 {
  margin: 0 0 6px;
  font-size: 22px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

/* =========================
   Forms & Controls
   ========================= */
input,
select,
button {
  font: inherit;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  margin: 3px;
}

input {
  /* inputs keep border/color from shared rules above */
}

select {
  /* selects share same look; customize if needed */
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
}

button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

/* Grouped control areas (key/octave pickers etc.) */
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 8px 0 14px;
}

/* =========================
   Results / Badges / Separators
   ========================= */
.results {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.result {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--badge);
  border: 1px solid var(--line);
  cursor: pointer;
  margin: 0 8px 8px 0;
  font-size: 12px;
}

.badge.active,
.badge.om {
  background: var(--badge-active);
  border-color: var(--accent-2);
}

.sep {
  border: none;
  border-top: 1px dashed var(--line);
  margin: 14px 0;
}

/* =========================
   Omnichord Grid
   ========================= */
.omgrid {
  margin-top: 10px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
}

.omrowwrap {
  display: flex;
  align-items: center;
  margin: 4px 0;
}

.omrowlabel {
  display: inline-block;
  min-width: 20px;
  margin-right: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* stepped labels (like panel) */
.omrowwrap:nth-child(2) .omrowlabel { margin-left: 8px; }
.omrowwrap:nth-child(3) .omrowlabel { margin-left: 16px; }

.omrow {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
}

.omrow .cell {
  width: 23px;
  text-align: center;
  padding: 8px 4px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
}

.omrow .cell.active {
  outline: 2px solid var(--accent-2);
  background: #fff3cf;
}

.pressline {
  margin-top: 6px;
}

/* =========================
   SVG Visuals (Piano / Staff / Guitar)
   ========================= */
#piano svg,
#staff svg,
#gchart svg {
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}

.keyW { fill: #f8fafc; stroke: #c9bda5; stroke-width: 1; }
.keyW.activeW { fill: #ffecc2; }

.keyB { fill: #3a3a3a; stroke: #c9bda5; stroke-width: 1; }
.keyB.activeB { fill: #d39c5a; }

.staffLine { stroke: #d8ccb6; stroke-width: 1; }
.noteHead  { fill: #2b2b2b; }

.gcap {
  font: 12px/1 ui-monospace, Menlo, Consolas, monospace;
  color: var(--muted);
}

/* =========================
   Sections
   ========================= */
.grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.head {
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-top: 8px;
}

.section-title {
  margin: 18px 0 6px;
  font-size: 18px;
}

/* =========================
   Footer
   ========================= */
.footer {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

/* =========================
   Print
   ========================= */
@media print {
  .controls,
  .play,
  .playall,
  .mobile-note {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .card {
    border: none;
    box-shadow: none;
  }
}

