/* Minnesinger phone page: one column, thumb-sized, in the logo's cream, navy, red, and gold (same tokens as styles.css). */
/* Nunito bundled (OFL) so the phone app looks right offline; Google Fonts is the fallback on the web. */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('assets/fonts/Nunito.woff2') format('woff2'); }
:root {
  --bg: #f7f2e7;
  --panel: #fffdf8;
  --panel2: #f1eadb;
  --line: #ddd2bd;
  --text: #1f2350;
  --muted: #545a7d;
  --accent: #c8391f;
  --accent2: #8a5a00;
  --gold: #e8b043;
  --blue: #2f5bd3;
  --ui: 'Nunito', 'Segoe UI', Roboto, system-ui, sans-serif;
  --tabh: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 var(--ui);
  min-height: 100vh;
  padding-bottom: calc(var(--tabh) + env(safe-area-inset-bottom, 0px));
  overscroll-behavior-y: contain;
}
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1 { font-size: 22px; font-weight: 800; margin: 4px 0 4px; }
h2 { font-size: 17px; font-weight: 800; margin: 22px 0 8px; }
.hint { color: var(--muted); margin: 0 0 14px; }
b { font-weight: 800; }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.top .mark { width: 30px; height: 30px; }
.top .word { height: 20px; width: auto; }
.top .title { flex: 1; min-width: 0; text-align: right; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .fullapp { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 12px;
  background: var(--text, #1f2350); color: #fff; font-weight: 800; font-size: 14px; text-decoration: none; }

main { max-width: 560px; margin: 0 auto; padding: 14px 16px 24px; }

/* controls: at least 48px tall for thumbs */
button {
  font: 700 15px/1.2 var(--ui); color: var(--text); background: #fff;
  border: 1px solid var(--line); border-radius: 14px;
  min-height: 48px; padding: 10px 16px; cursor: pointer;
  box-shadow: 0 1px 0 #1f23500d; touch-action: manipulation;
}
button:active { background: var(--panel2); }
button:disabled { opacity: .5; }
button.primary { background: linear-gradient(135deg, #d34027, #e3602f); border-color: transparent; color: #fff; font-weight: 800; }
button.primary:active { background: #bd341d; }
button.hot { background: var(--gold); border-color: #d39a2c; font-weight: 800; }
button.ghost { background: transparent; border-style: dashed; }
button.big { width: 100%; min-height: 56px; font-size: 17px; margin-top: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.row > button { flex: 1 1 140px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.col > button.big { margin-top: 0; }
.grid2, .grid3 { display: grid; gap: 10px; align-items: end; }
.grid2 { grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: 1fr 1fr 1.4fr; }

.field { display: block; font-weight: 700; color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.field input[type=text], .field input[type=number], .field select, .field textarea {
  display: block; width: 100%; margin-top: 4px;
  font: 600 16px/1.3 var(--ui); color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  min-height: 48px; padding: 10px 12px;
}
.field textarea {
  font: 14px/1.35 ui-monospace, 'Roboto Mono', Consolas, monospace;
  white-space: pre; overflow: auto; min-height: 220px; resize: vertical;
}
.field.check { display: flex; align-items: center; gap: 10px; min-height: 48px; color: var(--text); font-size: 15px; }
.field.check input { width: 26px; height: 26px; accent-color: var(--accent); }
.found { color: var(--accent2); font-weight: 700; margin: 4px 0; }

/* tempo stepper */
.stepper { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.stepper button { width: 48px; padding: 0; font-size: 22px; }
.stepper output { flex: 1; text-align: center; font-size: 20px; font-weight: 800; color: var(--text); }

/* the record button */
.recwrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 26px 0 6px; }
.rec {
  width: 132px; height: 132px; border-radius: 50%; padding: 0;
  background: #fff; border: 6px solid var(--accent);
  display: grid; place-items: center; box-shadow: 0 6px 18px #c8391f33;
}
.rec .dot { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); transition: border-radius .15s, transform .15s; }
.rec.on .dot { border-radius: 12px; transform: scale(.75); }
.rec.on { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px #c8391f22; } }
.reclabel { font-size: 18px; font-weight: 800; }
.beats { display: flex; gap: 8px; min-height: 18px; }
.beats i { width: 16px; height: 16px; border-radius: 50%; background: var(--line); }
.beats i.on { background: var(--gold); }
.beats i.on.one { background: var(--accent); }
.status { min-height: 22px; text-align: center; color: var(--muted); font-weight: 600; }
.status b { color: var(--text); }

/* lead sheet */
.sheetbar {
  position: sticky; top: calc(47px + env(safe-area-inset-top, 0px)); z-index: 4;
  display: flex; gap: 10px; align-items: center;
  margin: -14px -16px 10px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.sheetbar .pos { flex: 1; text-align: right; color: var(--accent2); font-weight: 700; font-size: 14px; }
.sheet { background: #fffdf8; border: 1px solid var(--line); border-radius: 14px; min-height: 160px; overflow: hidden; padding: 4px 0; }
.sheet .empty { color: var(--muted); padding: 24px 16px; text-align: center; margin: 0; }
.sheet svg { max-width: 100%; height: auto; }

/* songs */
.songs .item {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 6px 6px 6px 14px; margin: 8px 0; min-height: 60px;
}
.songs .item .open { flex: 1; text-align: left; border: 0; background: none; box-shadow: none; padding: 6px 0; }
.songs .item .open small { display: block; color: var(--muted); font-weight: 600; font-size: 13px; }
.songs .item .del { width: 48px; padding: 0; color: var(--accent); }
.songs .none { color: var(--muted); }

/* bottom tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabs button {
  height: var(--tabh); border: 0; border-radius: 0; background: none; box-shadow: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 13px; color: var(--muted); padding: 4px 0;
}
.tabs button span { font-size: 21px; line-height: 1; }
.tabs button.on { color: var(--accent); }
.tabs button.on span { transform: scale(1.1); }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabh) + 12px + env(safe-area-inset-bottom, 0px)); z-index: 9;
  background: var(--text); color: #fff; border-radius: 14px; padding: 12px 16px; font-weight: 600;
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
