/* Guitar Larp
   Layout: one working column — header → load → my songs → play along → settings → timeline → shapes → tab → tuner.
   Palette: brass fret wire on a warm neutral; green marks "playing now". */
:root {
  --bg: #f1f2ee;
  --surface: #ffffff;
  --ink: #1e1b17;
  --muted: #6a6359;
  --line: #d9d6cd;
  --accent: #8f5f0c;
  --accent-ink: #ffffff;
  --accent-soft: #f3e6cc;
  --now: #1f6f5c;
  --now-soft: #d8ece5;
  --danger: #b3402e;
  --shadow: 0 1px 2px rgb(30 27 23 / .06), 0 8px 24px rgb(30 27 23 / .08);
  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f; --surface: #201b16; --ink: #efe7dc; --muted: #a6998a; --line: #3a322a;
    --accent: #e0aa48; --accent-ink: #1b1409; --accent-soft: #3a2c15; --now: #5cc8a8; --now-soft: #173a31;
    --danger: #e0735f; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15120f; --surface: #201b16; --ink: #efe7dc; --muted: #a6998a; --line: #3a322a;
  --accent: #e0aa48; --accent-ink: #1b1409; --accent-soft: #3a2c15; --now: #5cc8a8; --now-soft: #173a31;
  --danger: #e0735f; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 56px;
}
[hidden] { display: none !important; }
.wrap { max-width: 980px; margin: 0 auto; display: grid; gap: 22px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
h2 { font-size: 19px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
.lede { color: var(--muted); max-width: 62ch; margin-top: 8px; }
.label { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hint { font-size: 12.5px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.spread { justify-content: space-between; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px;
  display: grid; gap: 14px; min-width: 0;
  animation: rise .5s var(--ease) both;
}
@keyframes rise { from { transform: translateY(8px); } }

button, select, input, .btn {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px;
}
button, .btn { cursor: pointer; transition: border-color .15s, background .15s, transform .12s var(--ease), box-shadow .15s; }
button:hover:not(:disabled), .btn:hover { border-color: var(--accent); }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .55; cursor: default; }
input { width: 100%; }
input:focus, select:focus { border-color: var(--accent); }
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.primary:hover:not(:disabled) { filter: brightness(1.07); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--line); }
.danger { color: var(--danger); }
.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lock { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; }

/* Header */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.topbar-in { max-width: 980px; margin: 0 auto; display: flex; gap: 12px; align-items: center; justify-content: space-between; padding-block: 10px; }
.brand { display: flex; gap: 10px; align-items: center; font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.brand svg { color: var(--accent); }
.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip.premium { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.hero { padding-top: 26px; }

/* Load */
.drop {
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 22px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  transition: border-color .2s, background .2s, transform .2s var(--ease); cursor: pointer;
}
.drop:hover { border-color: var(--accent); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.drop strong { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
#file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.status { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); min-height: 22px; }
.bar { flex: 0 0 140px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; position: relative; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.bar > i::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .35), transparent);
  animation: shimmer 1.2s linear infinite; transform: translateX(-100%);
}
@keyframes shimmer { to { transform: translateX(100%); } }
.source { font-size: 14px; }
.source b { font-weight: 600; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: 1px; }
audio { width: 100%; }

/* Now / next */
.stage { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.slot { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; gap: 16px; align-items: center; min-width: 0; background: var(--surface); transition: border-color .3s, background .3s; }
.slot.now { border-color: var(--now); background: var(--now-soft); }
.slot .big { font-family: var(--font-display); font-weight: 800; font-size: 54px; line-height: 1; letter-spacing: -0.02em; }
.slot.next .big { font-size: 34px; color: var(--muted); }
.slot .sub { font-size: 13px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.slot .meta { min-width: 0; }
.swap { animation: swap .35s var(--ease); }
@keyframes swap { from { opacity: .2; transform: translateY(6px) scale(.96); } }
.countdown { height: 3px; border-radius: 2px; background: var(--line); margin-top: 8px; overflow: hidden; width: 120px; max-width: 100%; }
.countdown > i { display: block; height: 100%; background: var(--now); width: 0; }

/* Settings */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 18px; }
.field { display: grid; gap: 5px; }
.field select, .field input[type=range] { width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 7px 10px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.keyline { font-size: 14px; }
.keyline b { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.capohint { color: var(--accent); font-weight: 600; }
input[type=range] { accent-color: var(--accent); padding: 0; border: 0; }

/* Timeline */
.timeline { overflow-x: auto; padding-bottom: 6px; scroll-behavior: smooth; }
.track { display: flex; gap: 3px; min-height: 64px; }
.blk {
  flex: 0 0 auto; border: 1px solid var(--line); border-radius: 7px; padding: 6px 7px;
  display: flex; flex-direction: column; justify-content: space-between; text-align: left;
  background: var(--bg); overflow: hidden; position: relative;
}
.blk b { font-family: var(--font-display); font-size: 16px; font-weight: 600; white-space: nowrap; }
.blk span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.blk.nc b { color: var(--muted); font-weight: 400; }
.blk.on { background: var(--now-soft); border-color: var(--now); }
.blk.on b { color: var(--now); }
.blk .prog { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--now); width: 0; }

/* Chord shapes */
.shapes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.shape { border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px 6px; text-align: center; display: grid; justify-items: center; gap: 2px; transition: border-color .25s, background .25s, transform .25s var(--ease); }
.shape .nm { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.shape .snd { font-size: 11.5px; color: var(--muted); min-height: 16px; }
.shape .tabtxt { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: .05em; }
.shape.on { border-color: var(--now); background: var(--now-soft); transform: translateY(-2px); }
svg.dia { color: var(--ink); overflow: visible; }
svg.dia .str { stroke: var(--muted); stroke-width: 1; }
svg.dia .frt { stroke: var(--line); stroke-width: 1.2; }
svg.dia .nut { stroke: var(--ink); stroke-width: 4; }
svg.dia .dot { fill: var(--ink); }
svg.dia .open { fill: none; stroke: var(--ink); stroke-width: 1.4; }
svg.dia text { fill: var(--muted); font-family: var(--font-body); font-size: 10px; }
svg.dia .mute { fill: var(--muted); font-size: 11px; }

/* Tab */
.tabwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
pre#tab { margin: 0; padding: 14px 16px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.45; color: var(--ink); }

/* Library */
.libtools { display: grid; grid-template-columns: 1fr 200px; gap: 8px; }
.songs { display: grid; gap: 6px; }
.song { display: flex; gap: 6px; align-items: stretch; animation: rise .35s var(--ease) both; }
.song-open { flex: 1; min-width: 0; text-align: left; display: grid; gap: 2px; padding: 10px 14px; background: var(--bg); }
.song-open b { font-family: var(--font-display); font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-open span { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.song.on .song-open { border-color: var(--now); background: var(--now-soft); }
.song.on .song-open b { color: var(--now); }
.song-edit { display: grid; grid-template-columns: 1fr 180px auto auto; gap: 6px; padding: 8px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.upsell { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px; border-radius: 10px; background: var(--bg); border: 1px dashed var(--line); }

/* Tuner */
.strings { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.str-btn { display: grid; gap: 2px; justify-items: center; padding: 14px 6px 12px; border-radius: 12px; background: var(--bg); }
.str-btn .n { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; }
.str-btn .n sub { font-size: 13px; font-weight: 600; color: var(--muted); vertical-align: 0; margin-left: 1px; }
.str-btn .s { font-size: 11.5px; color: var(--muted); }
.str-btn .hz { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.str-btn .gauge { width: 70%; background: var(--muted); border-radius: 1px; margin: 6px 0 2px; }
.str-btn.on { border-color: var(--now); background: var(--now-soft); }
.str-btn.on .n { color: var(--now); }
.str-btn.on .gauge { background: var(--now); animation: ring .5s ease-in-out infinite alternate; }
@keyframes ring { from { transform: scaleX(1); } to { transform: scaleX(.82); } }
.tunetips { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); display: grid; gap: 3px; max-width: 70ch; }
.notes { font-size: 13.5px; color: var(--muted); display: grid; gap: 6px; max-width: 70ch; }

/* Dialogs */
dialog {
  border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink);
  width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px) scale(.98);
  transition: opacity .22s var(--ease), transform .22s var(--ease), overlay .22s allow-discrete, display .22s allow-discrete;
}
dialog[open] { opacity: 1; transform: none; }
@starting-style { dialog[open] { opacity: 0; transform: translateY(12px) scale(.98); } }
dialog::backdrop { background: rgb(15 12 9 / .45); backdrop-filter: blur(3px); transition: opacity .22s; }
dialog.wide { width: min(640px, calc(100vw - 32px)); }
.dlg { padding: 22px; display: grid; gap: 16px; }
.dlg-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.dlg-head h2 { font-size: 22px; }
.close { padding: 4px 9px; font-size: 18px; line-height: 1; }
form.stack { display: grid; gap: 12px; }
form.stack label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; }
.err { color: var(--danger); font-size: 13.5px; min-height: 1px; }
.ok:empty, .err:empty { display: none; }
.ok { color: var(--now); background: var(--now-soft); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
/* Google's sign-in button guidelines: white (or dark) surface, the four-colour G, Roboto-like label. */
.gbtn {
  display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none;
  background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 8px; padding: 10px 14px;
  font-family: "Roboto", var(--font-body); font-weight: 500; font-size: 14px;
  transition: background .15s, box-shadow .15s, transform .12s var(--ease);
}
.gbtn:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgb(60 64 67 / .3); }
.gbtn:active { transform: scale(.98); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gbtn { background: #131314; color: #e3e3e3; border-color: #8e918f; } }
:root[data-theme="dark"] .gbtn { background: #131314; color: #e3e3e3; border-color: #8e918f; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.linkish { background: none; border: 0; padding: 2px 0; color: var(--accent); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover:not(:disabled) { border: 0; filter: brightness(1.15); }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tabs button { border: 0; border-radius: 0; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--surface); }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; align-content: start; position: relative; }
.price.best { border-color: var(--accent); }
.price .amt { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.price .amt small { font-size: 14px; color: var(--muted); font-weight: 500; }
.price .save { position: absolute; top: -10px; right: 12px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: 2px 8px; border-radius: 999px; }
.compare { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.compare th, .compare td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.compare th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.compare td:not(:first-child), .compare th:not(:first-child) { text-align: center; width: 90px; }
.yes { color: var(--now); font-weight: 600; }
.acct dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.acct dt { color: var(--muted); }
.acct dd { margin: 0; overflow-wrap: anywhere; }

/* Terms and other text pages */
.doc { max-width: 72ch; margin: 0 auto; padding-block: 32px 24px; display: grid; gap: 22px; }
.doc h1 { margin-bottom: -10px; }
.doc h2 { font-size: 20px; margin-bottom: 8px; scroll-margin-top: 80px; }
.doc section { display: grid; gap: 10px; }
.doc ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.doc a { color: var(--accent); text-underline-offset: 3px; }
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; }
.toc a { text-decoration: none; color: var(--ink); }
.toc a:hover { color: var(--accent); }
.fill { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 4px; font-weight: 600; }
.draft-note { border: 1.5px dashed var(--accent); border-radius: 12px; padding: 12px 16px; background: var(--surface); font-size: 14px; }
.brand-link { color: inherit; text-decoration: none; }
.doc code { font-family: var(--font-mono); font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.summary { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--surface); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.datatable { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.datatable th, .datatable td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.datatable tr:last-child td { border-bottom: 0; }
.datatable th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface); }
.datatable td:first-child { font-weight: 600; white-space: nowrap; }
.sitefoot { max-width: 980px; margin: 8px auto 0; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; font-size: 13px; color: var(--muted); }
.sitefoot a { color: var(--muted); text-underline-offset: 3px; }
.sitefoot a:hover { color: var(--accent); }
.fine { font-size: 12.5px; color: var(--muted); }
.fine a { color: var(--accent); text-underline-offset: 3px; }

/* Toasts */
.toasts {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px));
}
.toast {
  background: var(--ink); color: var(--surface); border-radius: 10px; padding: 10px 14px; font-size: 14px; box-shadow: var(--shadow);
  animation: toastIn .3s var(--ease) both;
}
.toast.good { background: var(--now); color: #fff; }
.toast.bad { background: var(--danger); color: #fff; }
.toast.out { animation: toastOut .25s ease-in both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

@media (max-width: 640px) {
  .stage { grid-template-columns: 1fr; }
  .slot .big { font-size: 44px; }
  .drop { padding: 16px; }
  .strings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prices { grid-template-columns: 1fr; }
  .libtools { grid-template-columns: 1fr; }
  .song-edit { grid-template-columns: 1fr 1fr; }
  .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
