/* Stringalator: Mr J's music room. Warm wood and Alator gold. */
:root {
  --gold: #ffc21a;
  --ink: #1d1a16;
  --wood: #c8843d;
  --paper: #fffaf1;
  --muted: #7a6f60;
  --dot: #e8541e;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
/* No double-tap zoom on iPads (app.js does the rest), and no copy menu on a long press. */
body { display: flex; flex-direction: column; background: #f6e3cc; color: var(--ink); touch-action: manipulation;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

/* ── Top bar ── */
.bar { flex: none; display: flex; align-items: center; gap: 14px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: 3px; font-size: 18px; }
.logo { width: 30px; height: 30px; background: url(icon.svg) center / contain no-repeat; }
.inst { display: flex; background: rgba(255, 255, 255, .1); border-radius: 999px; padding: 3px; margin: 0 auto; }
.inst button { border: 0; background: none; color: #fff; padding: 8px 18px; border-radius: 999px; font-weight: 800; font-size: 16px; }
.inst button.on { background: var(--gold); color: #111; }
.where { font-size: 14px; color: #ddd; font-weight: 700; min-width: 150px; text-align: right; }

/* ── The room ── */
.room { position: relative; flex: 1; min-height: 0; display: flex; align-items: stretch; gap: 16px; padding: 14px 18px 0;
  background: url(art/background.webp) center bottom / cover no-repeat; }
.teacher { position: relative; flex: 0 0 42%; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.people { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 78%; min-height: 0; overflow: hidden; border-radius: 18px; }
.fig { position: relative; height: 100%; aspect-ratio: 2 / 3; flex: none; transition: transform .7s ease-in-out; }
.mrj { display: block; width: 100%; height: 100%; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .18)); }
.neck { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.neck .ndot { fill: #ff6a2b; stroke: #fff; stroke-width: 1; animation: pop .35s ease-out both; transform-box: fill-box; transform-origin: center; }
.neck .ndot text, .neck .nbarre { fill: #fff; stroke: none; font-weight: 900; text-anchor: middle; dominant-baseline: central; animation: pop .35s ease-out both; }
.neck .nmark { fill: #ff4040; font-weight: 900; font-size: 9px; text-anchor: middle; }
.neck .nopen { fill: none; stroke: #2ecc71; stroke-width: 1.4; }
@keyframes pop { 0% { opacity: 0; transform: scale(.2); } 70% { opacity: 1; transform: scale(1.25); } 100% { transform: scale(1); } }
.zoom { position: absolute; right: 10px; top: 10px; z-index: 3; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 900; font-size: 16px;
  background: var(--ink); color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.wayne.away { opacity: 0; transition: opacity .3s; }
.wayne { position: relative; z-index: 2; height: 30%; max-width: 30%; object-fit: contain; object-position: bottom; margin-left: -4%; transform-origin: bottom center; }
.wayne.hop { animation: hop .5s ease-out; }
@keyframes hop { 0%, 100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-14%) rotate(-6deg); } 70% { transform: translateY(0) rotate(4deg); } }
.bubble { position: relative; align-self: center; max-width: 92%; background: #fff; border: 3px solid var(--ink); border-radius: 22px; padding: 12px 16px;
  font-size: clamp(15px, 1.9vw, 20px); font-weight: 700; line-height: 1.35; margin-bottom: 10px; box-shadow: 0 6px 0 rgba(0, 0, 0, .12); }
.bubble::after { content: ''; position: absolute; left: 38%; bottom: -16px; border: 14px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.bubble b { color: #b35b00; }

/* ── The chord card ── */
.card { flex: 1; align-self: center; max-height: 100%; overflow: auto; background: rgba(255, 250, 241, .96); border-radius: 24px; padding: 16px 20px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); border-top: 8px solid var(--gold); display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 14px; }
.stage { font-size: 13px; font-weight: 800; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
.chord-name { font-size: clamp(56px, 9vw, 96px); font-weight: 900; line-height: 1; margin: 4px 0 0; }
.chord-full { font-size: 17px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.diagram { width: min(300px, 60vw); height: auto; max-height: 42vh; }
.diagram .str { stroke: #3a332b; stroke-width: 2; }
.diagram .fret { stroke: #8a7a66; stroke-width: 2; }
.diagram .nut { stroke: var(--ink); stroke-width: 8; }
.diagram .dot { fill: var(--dot); }
.diagram .num { fill: #fff; font-weight: 900; font-size: 17px; text-anchor: middle; dominant-baseline: central; }
.diagram .mark { font-weight: 900; font-size: 18px; text-anchor: middle; fill: var(--ink); }
.diagram .sname { font-weight: 800; font-size: 15px; text-anchor: middle; fill: var(--muted); }
.diagram .fretno { font-weight: 800; font-size: 14px; fill: var(--muted); }
.strum { margin-top: 10px; border: 0; background: var(--ink); color: #fff; border-radius: 999px; padding: 12px 30px; font-weight: 900; font-size: 19px; }
.strum:active { transform: translateY(2px); }
.key-help { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* ── Practice ── */
.practice h2 { margin: 2px 0 6px; font-size: clamp(24px, 3.4vw, 34px); }
.p-now { display: flex; align-items: center; gap: 16px; justify-content: center; }
.p-now .big { font-size: clamp(54px, 8vw, 84px); font-weight: 900; }
.p-next { font-size: 18px; color: var(--muted); font-weight: 800; }
.beats { display: flex; gap: 10px; margin: 6px 0 10px; }
.beats i { width: 18px; height: 18px; border-radius: 50%; background: #e2d6c4; }
.beats i.on { background: var(--gold); box-shadow: 0 0 0 3px #ffe7a3; }
.p-controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; }
.p-controls label { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.p-controls input { width: 140px; accent-color: var(--wood); }
.go-btn { border: 0; background: var(--gold); border-radius: 999px; padding: 12px 26px; font-weight: 900; font-size: 18px; }
.done h2 { font-size: clamp(30px, 4vw, 42px); margin: 6px 0; }

/* ── Back / Next ── */
.nav { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: var(--ink); }
.navbtn { border: 0; border-radius: 999px; padding: 13px 26px; font-weight: 900; font-size: 18px; background: rgba(255, 255, 255, .14); color: #fff; }
.navbtn.go { background: var(--gold); color: #111; }
.navbtn:disabled { opacity: .35; }
.dots { flex: 1; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
.dots i.done { background: rgba(255, 194, 26, .55); }
.dots i.now { background: var(--gold); transform: scale(1.35); }
.dots i.gap { width: 6px; background: none; }

/* iPad portrait and phones: Mr J above the card. */
@media (orientation: portrait), (max-width: 760px) {
  /* The room picture behind Mr J only, so he and Wayne sit on the floor. */
  .room { flex-direction: column; gap: 10px; padding-top: 10px; background: #f6e3cc; }
  .teacher { flex: 0 0 36%; flex-direction: row; align-items: flex-end; border-radius: 20px; overflow: hidden; padding: 0 10px;
    background: url(art/background.webp) center 92% / cover no-repeat; }
  .people { height: 100%; flex: 0 0 48%; }
  .bubble { align-self: center; margin: 0 0 30px; }
  .bubble::after { left: -16px; bottom: 26px; border: 14px solid transparent; border-right-color: var(--ink); border-left: 0; }
  .teacher { flex-direction: row-reverse; }
  .card { align-self: stretch; flex: 1; }
  .where { display: none; }
}
