/* Raga Mayil — Peacock theme */
:root {
  --bg: #0C3B47; --card: #11505F; --field: #0E4654; --line: #1F6676; --line2: #2A7A88;
  --text: #EAF7F4; --muted: #A9D3CB; --faint: #7FB5AC;
  --gold: #C9B037; --gold2: #D9C24E; --ondark: #0C3B47;
  --key: #16677A; --keyin: #1F8A8F; --good: #1F8A8F; --bad: #7A2E3A; --goodtx: #9FE3D9; --badtx: #E8A0A8;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; font-size: 16px; line-height: 1.5; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 16px 16px 40px; }
h1, h2 { font-weight: 600; margin: 0; }
h1 { font-size: 26px; } h2 { font-size: 18px; }
button, select, input { font: inherit; color: inherit; }
button { background: transparent; border: 1px solid #5FA9A0; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
button:hover { background: var(--key); }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button.main { background: var(--gold); color: var(--ondark); border-color: var(--gold); font-weight: 600; }
button.main:hover { background: var(--gold2); }
select, input[type=search] { background: var(--field); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; }
input[type=range] { accent-color: var(--gold); }

/* Header band: brand plus the shared sound settings (they apply to the scales and the quiz). */
.top { position: sticky; top: 0; z-index: 5; background: #0A3540; border-bottom: 1px solid var(--line); }
.topin { max-width: 1240px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { width: 64px; height: 64px; border-radius: 14px; }
.bname { font-size: 32px; font-weight: 700; letter-spacing: .3px; line-height: 1.1; }
.tagline { font-size: 14px; color: var(--muted); }
.settings { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.settings label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.settings .speed input { width: 140px; }
@media (max-width: 640px) {
  .top { position: static; }
  .brand img { width: 52px; height: 52px; }
  .bname { font-size: 27px; }
  .settings { margin-left: 0; width: 100%; }
  .settings .speed { flex: 1; }
  .settings .speed input { flex: 1; width: auto; }
}

/* Layout: one column on phones (search, raga, quiz, melakartas); two columns on wider screens. */
.cols { display: flex; flex-direction: column; }
.colL, .colR { display: contents; }
.search { order: 1; } .raga { order: 2; } .quiz { order: 3; } .browse { order: 4; }
@media (min-width: 980px) {
  .cols { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
  .colL, .colR { display: block; }
  .colL { position: sticky; top: 104px; max-height: calc(100vh - 120px); overflow: auto; padding-right: 4px; }
  .colR .card:first-child { margin-top: 0; }
  .kb .key { height: 120px; font-size: 13px; }
  .more { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .more .block { margin-top: 12px; }
}

.searchbox { position: relative; }
.searchbox input { width: 100%; padding-left: 38px; font-size: 16px; height: 44px; }
.sicon { position: absolute; left: 11px; top: 12px; width: 20px; height: 20px; fill: none; stroke: var(--faint); stroke-width: 2; }
.tries { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 4px; font-size: 12px; color: var(--faint); }
.chip { font-size: 13px; padding: 5px 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
#res { margin: 6px 0 12px; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; padding: 10px; font-size: 15px; }
.row .tag { margin-left: auto; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.row .why { font-size: 12px; color: var(--faint); }
.msg { font-size: 14px; color: var(--muted); margin: 6px 0; }

.card { background: var(--card); border-radius: 14px; padding: 16px; margin-top: 12px; }
.title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 6px; background: var(--gold); color: var(--ondark); font-weight: 600; }
.badge.soft { background: var(--bg); color: var(--muted); font-weight: 500; }
.badge:empty { display: none; }
.sub { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.sub a, .fb a { color: var(--gold); }
.scales { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0 10px; }
.lbl { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.sw { font-size: 17px; font-weight: 600; letter-spacing: .5px; word-spacing: 6px; }
.now { font-size: 13px; color: var(--gold); min-height: 20px; margin: 0 0 6px; }

.kb { display: flex; gap: 3px; margin-bottom: 12px; }
.key { flex: 1; min-width: 0; height: 96px; border-radius: 6px; background: var(--key); color: var(--faint);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 6px;
  font-size: 12px; line-height: 1.15; text-align: center; transition: transform .08s; overflow: hidden; }
.key.in { background: var(--keyin); color: var(--text); }
.key.play { background: var(--gold); color: var(--ondark); font-weight: 700; transform: translateY(4px) scale(1.04); }
@media (max-width: 480px) { .key { height: 78px; font-size: 10.5px; } }

.controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tiny { font-size: 12px; color: var(--faint); }
.spdo { font-size: 14px; font-weight: 600; min-width: 40px; text-align: right; color: var(--text); }
.astat { font-size: 12px; color: var(--faint); margin: 6px 0 0; min-height: 0; }
.astat:empty { display: none; }
.block { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.songs { margin: 0; padding: 0; list-style: none; font-size: 15px; }
.songs li { padding: 3px 0; }

.qhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.qhead select { margin-left: auto; }
.score { font-size: 13px; color: var(--muted); }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 4px; }
.opts .ok { background: var(--good); border-color: var(--good); }
.opts .bad { background: var(--bad); border-color: var(--bad); }
.fb { font-size: 14px; margin: 8px 0 0; color: var(--muted); min-height: 20px; }
.fb.good { color: var(--goodtx); } .fb.badc { color: var(--badtx); }

details summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸"; color: var(--gold); }
details[open] summary::before { content: "▾"; }
.chakra { margin-top: 12px; }
.chakra h3 { font-size: 14px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.chakra .chips button { font-size: 13px; padding: 5px 9px; }
.chakra .num { color: var(--gold); margin-right: 4px; }

footer { margin-top: 20px; font-size: 12px; color: var(--faint); text-align: center; }
footer p { margin: 4px 0; }
.qspd { align-self: center; }
.raga { scroll-margin-top: 12px; }
@media (min-width: 641px) { .raga { scroll-margin-top: 110px; } }
