/* Jaxx Guitar — warm wood + amber theme (sibling of Hayden Keys' pastel piano theme). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
:root {
  --jg-bg: #fbf4ea;
  --jg-bg-2: #f3e7d6;
  --jg-panel: #ffffff;
  --jg-border: #e8d9c4;
  --jg-text: #2e2419;
  --jg-text-dim: #75644f;
  --jg-accent: #c46a1f;      /* amber / sunburst */
  --jg-accent-soft: #f6d9b5;
  --jg-accent-2: #2f8f83;    /* teal */
  --jg-accent-2-soft: #c5ebe5;
  --jg-wood: #6b3f1f;
  --jg-wood-2: #8a5a33;
  --jg-stage: #221a14;
  --jg-good: #3fa35f;
  --jg-bad: #c94a4a;
  --jg-purple: #7d5bc9;
  --jg-purple-soft: #ece4fb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--jg-text); min-height: 100vh;
  background: linear-gradient(160deg, var(--jg-bg), var(--jg-bg-2)); background-attachment: fixed;
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
main { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.jg-hidden { display: none !important; }
.jg-header { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 16px 16px 6px; flex-wrap: wrap; }
.jg-logo { width: 54px; height: 54px; border-radius: 14px; }
.jg-header h1 { margin: 0; font-size: 1.9rem; color: var(--jg-wood); letter-spacing: 0.5px; }
.jg-tagline { margin: 0; color: var(--jg-text-dim); font-size: 0.9rem; }
.jg-level-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; background: var(--jg-panel); border: 1px solid var(--jg-border); border-radius: 999px; padding: 3px 10px; }
.jg-level-chip:empty { display: none; }
.jg-level-bar { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--jg-accent-soft); overflow: hidden; }
.jg-level-bar span { display: block; height: 100%; background: var(--jg-accent); }
.jg-tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding: 8px 12px; }
.jg-tab { border: 1px solid var(--jg-border); background: var(--jg-panel); color: var(--jg-text); border-radius: 999px; padding: 8px 16px; font-size: 0.95rem; cursor: pointer; min-height: 40px; }
.jg-tab-active { background: var(--jg-accent); color: #fff; border-color: var(--jg-accent); }
.jg-footer { text-align: center; font-size: 0.8rem; color: var(--jg-text-dim); padding: 24px 16px; }
.jg-footer a { color: var(--jg-accent); }

.jg-btn, .hk-btn { border: 1px solid var(--jg-border); background: var(--jg-panel); color: var(--jg-text); border-radius: 10px; padding: 9px 14px; font-size: 0.95rem; cursor: pointer; min-height: 40px; }
.jg-btn:hover, .hk-btn:hover { border-color: var(--jg-accent); }
.jg-btn-primary { background: var(--jg-accent); color: #fff; border-color: var(--jg-accent); }
.jg-btn-small { padding: 5px 10px; font-size: 0.82rem; min-height: 32px; }
.jg-pill { border: 1px solid var(--jg-border); background: var(--jg-panel); color: var(--jg-text-dim); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 0.82rem; min-height: 32px; }
.jg-pill-active { color: var(--jg-text); border-color: var(--jg-accent); background: var(--jg-accent-soft); }
.jg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.jg-label { color: var(--jg-text-dim); font-size: 0.82rem; }
.jg-note { color: var(--jg-text-dim); font-size: 0.85rem; font-style: italic; }
.jg-card { background: var(--jg-panel); border: 1px solid var(--jg-border); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }

/* Mascot speech */
.jg-say { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; }
.jg-avatar { flex: 0 0 auto; width: 76px; height: 76px; display: flex; align-items: flex-end; justify-content: center; }
.jg-avatar img { max-width: 100%; max-height: 100%; object-fit: contain; }
.jg-bubble { background: var(--jg-panel); border: 1px solid var(--jg-border); border-radius: 14px; padding: 10px 14px; line-height: 1.45; }
.jg-bubble h3 { margin: 2px 0 6px; }
.jg-bubble p { margin: 6px 0; }

/* Fretboard */
.jg-fretboard { width: 100%; }
.jg-fretboard-svg { display: block; width: 100%; height: auto; touch-action: manipulation; user-select: none; }
.jg-wood { fill: var(--jg-wood); }
.jg-fret { stroke: #d9d2c4; stroke-width: 2.2; }
.jg-nut { fill: #f1ead9; }
.jg-inlay { fill: #e9dcc2; opacity: 0.65; }
.jg-string { stroke: #e9e2d0; }
.jg-string-name { font-size: 13px; font-weight: bold; fill: var(--jg-text-dim); }
.jg-fret-num { font-size: 11px; fill: var(--jg-text-dim); text-anchor: middle; }
.jg-hit { fill: transparent; cursor: pointer; }
.jg-dot { stroke: #fff; stroke-width: 2; }
.jg-dot-label { font-size: 12px; font-weight: bold; fill: #fff; text-anchor: middle; pointer-events: none; }
.jg-dot-label-dark { fill: var(--jg-text); }
.jg-open { fill: transparent; stroke: var(--jg-accent-2); stroke-width: 3; }
.jg-mute { font-size: 20px; font-weight: bold; fill: var(--jg-bad); text-anchor: middle; }
.jg-barre { fill: rgba(255,255,255,0.35); stroke: #fff; stroke-width: 2; }
.jg-root { fill: var(--jg-accent) !important; }
.jg-ghost { fill: rgba(255,255,255,0.25) !important; stroke: rgba(255,255,255,0.5); }
.jg-good { fill: var(--jg-good) !important; }
.jg-bad { fill: var(--jg-bad) !important; }
.jg-tap-flash { fill: rgba(255,255,255,0.55); pointer-events: none; }

.jg-highway { position: relative; width: 100%; height: 110px; background: var(--jg-stage); border-radius: 10px 10px 0 0; overflow: hidden; }
.jg-highway canvas { width: 100%; height: 100%; display: block; }
.jg-instrument { margin-top: 8px; }

/* Chord diagrams */
.jg-diagram { width: 108px; height: auto; display: inline-block; }
.jg-diagram-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.jg-dg-name { font-size: 15px; font-weight: bold; text-anchor: middle; fill: var(--jg-text); }
.jg-dg-line { stroke: #6d5c47; stroke-width: 1.2; }
.jg-dg-nut { stroke-width: 4; }
.jg-dg-dot { fill: var(--jg-wood); }
.jg-dg-finger { font-size: 10px; fill: #fff; text-anchor: middle; font-weight: bold; }
.jg-dg-open { fill: none; stroke: #6d5c47; stroke-width: 1.4; }
.jg-dg-top { font-size: 13px; text-anchor: middle; fill: var(--jg-bad); }
.jg-dg-fretno { font-size: 11px; text-anchor: end; fill: var(--jg-text-dim); }
.jg-dg-barre { fill: var(--jg-wood); }

/* Tab */
.jg-tab-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--jg-border); border-radius: 10px; margin: 8px 0; }
.jg-tabsvg { display: block; max-width: none; }
.jg-tab-line { stroke: #9a8b77; stroke-width: 1; }
.jg-tab-bar { stroke: #6d5c47; stroke-width: 1.4; }
.jg-tab-sname { font-size: 11px; fill: var(--jg-text-dim); }
.jg-tab-clef { font-size: 11px; font-weight: bold; fill: var(--jg-text); }
.jg-tab-bg { fill: #fff; }
.jg-tab-num { font-size: 13px; font-weight: bold; text-anchor: middle; fill: var(--jg-text); }
.jg-tab-now { fill: var(--jg-accent); }
.jg-tab-done { fill: #aaa; }
.jg-tab-label { font-size: 10px; text-anchor: middle; fill: var(--jg-accent-2); }

/* Lessons layout */
.jg-lessons-layout { display: flex; gap: 18px; align-items: flex-start; }
.jg-lesson-main { flex: 1 1 auto; min-width: 0; }
.jg-lesson-sidebar { flex: 0 0 250px; position: sticky; top: 10px; }
.jg-roadmap { background: var(--jg-panel); border: 1px solid var(--jg-border); border-radius: 12px; padding: 12px; }
.jg-roadmap h3 { margin: 0 0 4px; }
.jg-roadmap-list { display: flex; flex-direction: column; gap: 5px; max-height: 70vh; overflow-y: auto; margin-top: 6px; }
.jg-node { display: flex; gap: 8px; align-items: center; text-align: left; border: 1px solid var(--jg-border); background: var(--jg-panel); border-radius: 10px; padding: 7px 9px; cursor: pointer; font-size: 0.85rem; color: var(--jg-text); position: relative; }
.jg-node[disabled] { opacity: 0.45; cursor: not-allowed; }
.jg-node-done { background: var(--jg-accent-soft); border-color: var(--jg-accent); }
.jg-node-current { border-color: var(--jg-accent-2); box-shadow: 0 0 0 2px var(--jg-accent-2-soft); }
.jg-node-num { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--jg-bg-2); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: bold; }
.jg-node-done .jg-node-num { background: var(--jg-accent); color: #fff; }
.jg-tag { font-size: 0.62rem; border: 1px solid var(--jg-border); border-radius: 6px; padding: 0 5px; margin-left: 4px; color: var(--jg-text-dim); }
.jg-section-head { margin: 14px 0 4px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--jg-text-dim); }
.jg-lesson-player { padding: 6px 0; }
.jg-exit { background: none; border: none; color: var(--jg-text-dim); cursor: pointer; font-size: 0.9rem; padding: 4px 0; }
.jg-step { color: var(--jg-text-dim); font-size: 0.82rem; margin: 4px 0; }
.jg-controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin: 10px 0; }
.jg-big { font-size: 2.6rem; font-weight: 800; color: var(--jg-accent); text-align: center; margin: 4px 0; }
.jg-quests { background: var(--jg-panel); border: 1px solid var(--jg-border); border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.jg-quest { font-size: 0.9rem; margin: 3px 0; }
.jg-quest-done { color: var(--jg-good); text-decoration: line-through; }
.jg-stars { color: #e1a62b; font-size: 1.2rem; letter-spacing: 2px; }
.jg-score { font-weight: 600; margin: 6px 0; }
.jg-review-banner { display: block; margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; background: var(--jg-purple-soft); border: 1px solid var(--jg-purple); color: var(--jg-text); }

/* Songs */
.jg-song-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.jg-song { background: var(--jg-panel); border: 1px solid var(--jg-border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.jg-song h3 { margin: 0; font-size: 1rem; }
.jg-song-meta { font-size: 0.82rem; color: var(--jg-text-dim); }
.jg-badge { display: inline-block; font-size: 0.68rem; border-radius: 6px; padding: 1px 6px; border: 1px solid var(--jg-border); margin-right: 4px; }
.jg-badge-ok { background: #e6f4ea; border-color: #b8dfc4; }
.jg-badge-warn { background: #fdf0dc; border-color: #f0d3a3; }
.jg-capo { font-size: 0.82rem; color: var(--jg-accent-2); font-weight: 600; }

/* Tuner */
.jg-tuner-strings { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.jg-tuner-string { min-width: 54px; }
.jg-tuner-big { text-align: center; font-size: 3rem; font-weight: 800; margin: 6px 0; }
.jg-tuner-meter { position: relative; width: min(420px, 100%); height: 70px; margin: 0 auto; border-radius: 70px 70px 0 0; background: var(--jg-panel); border: 2px solid var(--jg-border); border-bottom: none; overflow: hidden; }
.jg-tuner-needle { position: absolute; left: 50%; bottom: 0; width: 3px; height: 64px; background: var(--jg-text-dim); transform-origin: bottom center; transition: transform 0.12s ease-out; }
.jg-tuner-center { position: absolute; left: 50%; top: 0; width: 2px; height: 12px; background: var(--jg-text); transform: translateX(-50%); }
.jg-tuner-ok .jg-tuner-meter { background: #e3f6e9; border-color: var(--jg-good); }
.jg-tuner-ok .jg-tuner-needle { background: var(--jg-good); }
.jg-tuner-msg { text-align: center; min-height: 1.4em; font-weight: 600; }

/* Tuner widget (pitch.js), shared with Hayden Keys */
.hk-tuner { margin: 10px 0; }
.hk-tuner-display { margin-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 12px; border: 2px solid transparent; }
.hk-tuner-dial { position: relative; width: 140px; height: 70px; overflow: hidden; border: 2px solid var(--jg-border); border-bottom: none; border-radius: 70px 70px 0 0; background: var(--jg-bg); }
.hk-tuner-center-mark { position: absolute; left: 50%; top: 0; width: 2px; height: 10px; background: var(--jg-text-dim); transform: translateX(-50%); }
.hk-tuner-needle { position: absolute; left: 50%; bottom: 0; width: 2px; height: 64px; background: var(--jg-text-dim); transform-origin: bottom center; transform: translateX(-50%) rotate(0deg); transition: transform 0.15s ease-out; }
.hk-tuner-needle.hk-tuner-in-tune { background: var(--jg-good); }
.hk-tuner-needle.hk-tuner-off { background: var(--jg-accent); }
.hk-tuner-readout, .hk-tuner-heard { font-size: 0.85rem; margin: 0; text-align: center; }
.hk-tuner-scale { display: flex; justify-content: space-between; width: 150px; font-size: 0.62rem; color: var(--jg-text-dim); }
.hk-tuner-matched .hk-tuner-display { background: #e3f6e9; border-color: var(--jg-good); }
.hk-tuner-matched .hk-tuner-readout { color: #217a3d; font-weight: bold; }

/* Gamification */
#jg-toasts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.jg-toast { background: #2e2419; color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 0.85rem; transition: opacity 0.4s, transform 0.4s; }
.jg-toast-big { background: var(--jg-accent); font-weight: bold; }
.jg-toast-out { opacity: 0; transform: translateY(-8px); }
.jg-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.jg-confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: jg-fall 2.2s ease-in forwards; }
@keyframes jg-fall { to { top: 105%; transform: translateX(40px) rotate(720deg); } }

.jg-choose { display: flex; flex-direction: column; gap: 6px; }
.jg-choose .jg-btn { text-align: left; }
.jg-sub { display: block; font-size: 0.78rem; color: var(--jg-text-dim); margin-top: 2px; }
.jg-quiz-ok { color: var(--jg-good); font-weight: 600; }
.jg-quiz-bad { color: var(--jg-bad); font-weight: 600; }
.jg-strum { font-size: 1.6rem; letter-spacing: 6px; font-weight: bold; color: var(--jg-accent); }
.jg-strum span.jg-now { color: var(--jg-accent-2); text-decoration: underline; }
.jg-fact { border-left: 4px solid var(--jg-accent); padding-left: 10px; }
table.jg-table { border-collapse: collapse; font-size: 0.88rem; margin: 6px 0; }
.jg-table th, .jg-table td { border: 1px solid var(--jg-border); padding: 4px 10px; text-align: left; }
.jg-table th { background: var(--jg-bg-2); }

@media (max-width: 760px) {
  .jg-lessons-layout { flex-direction: column; align-items: stretch; }
  .jg-lesson-main { width: 100%; }
  .jg-lesson-sidebar { position: static; width: 100%; flex: 1 1 auto; order: 2; }
}
/* Landscape phones: instrument pinned at the bottom, no sidebar */
@media (orientation: landscape) and (max-height: 500px) {
  .jg-header { padding: 4px 10px; }
  .jg-logo { width: 30px; height: 30px; }
  .jg-header h1 { font-size: 1.1rem; }
  .jg-tagline { display: none; }
  .jg-tab { padding: 5px 12px; min-height: 34px; }
  .jg-lesson-sidebar { display: none; }
  .jg-lesson-player { display: flex; flex-direction: column; }
  .jg-lesson-content { order: 1; }
  .jg-controls { order: 2; margin: 6px 0; }
  .jg-instrument { order: 3; position: sticky; bottom: 0; z-index: 5; background: var(--jg-bg); }
  .jg-highway { height: 56px; }
}
/* Any orientation. In portrait on a phone the instrument keeps a usable
   size and scrolls sideways (frets 0-5 show first, where beginner shapes
   live); a small dismissible tip suggests turning sideways. */
.jg-rotate-tip { display: none; }
@media (orientation: portrait) and (max-width: 700px) {
  .jg-rotate-tip { display: block; position: fixed; left: 12px; right: 12px; top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 50; animation: jg-tip-out 0.6s ease-in 9s forwards; box-shadow: 0 4px 16px rgba(0,0,0,0.15); padding: 6px 10px; border: 1px solid var(--jg-border); border-radius: 10px; background: var(--jg-panel); color: var(--jg-text-dim); font-size: 0.82rem; text-align: left; cursor: pointer; }
  .jg-rotate-tip span { float: right; }
  .jg-instrument-host, .jg-dr-board { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .jg-instrument { min-width: 720px; }
  .jg-header h1 { font-size: 1.4rem; }
  .jg-tab { padding: 6px 12px; }
}

/* Instrument: inline on big screens, pinned to the bottom on landscape phones */
.jg-instrument-host { margin: 8px 0; }
@media (orientation: landscape) and (max-height: 500px) { .jg-instrument-host { position: sticky; bottom: 0; z-index: 5; background: var(--jg-bg); padding-top: 4px; } }
.jg-instrument-host .jg-instrument { margin-top: 0; }
.jg-instrument-host .jg-fb { background: var(--jg-bg); }
.jg-dg-btn { padding: 2px; background: var(--jg-panel); }
.jg-practice .jg-row strong { margin-right: 4px; }
details > summary { list-style: none; cursor: pointer; margin: 4px 0; }
details > summary::-webkit-details-marker { display: none; }
.jg-song-q { text-align: left; cursor: text; }

/* "Did you know?" fun facts */
.jg-funfact { position: fixed; inset: 0; z-index: 10001; background: rgba(34, 26, 20, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.jg-funfact-card { background: var(--jg-panel); border-radius: 18px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 18px 20px; box-shadow: 0 12px 40px rgba(0,0,0,0.25); border-top: 6px solid var(--jg-accent); line-height: 1.5; }
.jg-funfact-card h3 { margin: 4px 0 8px; }
.jg-funfact-kicker { font-weight: 700; color: var(--jg-accent); }

@keyframes jg-tip-out { to { opacity: 0; visibility: hidden; } }

/* Jaxx the kitten */
.jg-inline-mascot { width: 44px; height: 44px; object-fit: contain; }
.jg-hero-mascot { display: block; width: 120px; height: 120px; object-fit: contain; margin: 0 auto 4px; }
.jg-funfact-img { float: right; width: 96px; height: 96px; object-fit: contain; margin: -6px -6px 4px 8px; }
@media (orientation: landscape) and (max-height: 500px) { .jg-avatar { width: 56px; height: 56px; } .jg-hero-mascot { width: 84px; height: 84px; } }

/* Lesson complete: musical notes falling from the sky */
.jg-notefall { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.jg-notefall span { position: absolute; top: -40px; font-weight: bold; text-shadow: 0 1px 2px rgba(0,0,0,0.15); animation-name: jg-note-fall, jg-note-sway; animation-timing-function: ease-in, ease-in-out; animation-iteration-count: 1, infinite; animation-direction: normal, alternate; animation-fill-mode: forwards, none; }
@keyframes jg-note-fall { 0% { top: -40px; opacity: 0; } 10% { opacity: 1; } 85% { opacity: 1; } 100% { top: 105%; opacity: 0; } }
@keyframes jg-note-sway { from { transform: translateX(-14px) rotate(-12deg); } to { transform: translateX(14px) rotate(12deg); } }

/* Jaxx moves: a gentle sway while talking, a hop when you finish, a
   wiggle on fun facts. Respects reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  .jg-avatar img, .jg-hero-mascot, .jg-inline-mascot { transform-origin: 50% 90%; animation: jg-sway 3.2s ease-in-out infinite; }
  .jg-say:hover .jg-avatar img { animation: jg-hop 0.6s ease-out 2; }
  .jg-mascot-celebrate img, img.jg-mascot-celebrate { animation: jg-hop 0.7s ease-out infinite; }
  .jg-funfact-img { animation: jg-wiggle 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
  .jg-practice-playing ~ * .jg-avatar img, body.jg-playing .jg-avatar img { animation: jg-bop 0.5s ease-in-out infinite; }
}
@keyframes jg-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-2px); } }
@keyframes jg-hop { 0%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-14px) scale(1.05, 0.95); } 55% { transform: translateY(0) scale(0.96, 1.04); } }
@keyframes jg-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes jg-bop { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }

/* People photos and click-to-load videos */
.jg-people { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.jg-person { margin: 0; width: 150px; }
.jg-person img { width: 150px; height: 150px; object-fit: cover; object-position: 50% 25%; border-radius: 12px; border: 1px solid var(--jg-border); display: block; background: var(--jg-bg-2); }
.jg-person figcaption { font-size: 0.78rem; margin-top: 4px; line-height: 1.3; }
.jg-person figcaption span { display: block; color: var(--jg-text-dim); font-size: 0.68rem; }
.jg-video { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.jg-video-frame { position: relative; width: min(560px, 100%); aspect-ratio: 16 / 9; }
.jg-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 10px; }
.jg-home .jg-say { margin-bottom: 14px; }
.jg-home .jg-bubble { max-width: 620px; }
.jg-home .jg-funfact-open { margin-top: 6px; }

/* Upload: big Play above the fretboard, settings below it */
.jg-upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.jg-upload-pick { display: inline-block; margin: 6px 0; padding: 14px 24px; border-radius: 999px; font-size: 1.15rem; font-weight: 800; color: #fff; cursor: pointer; background: linear-gradient(135deg, var(--jg-accent), #e08a3c); box-shadow: 0 6px 16px rgba(196, 106, 31, 0.3); position: relative; }
.jg-upload-fine { font-size: 0.72rem; line-height: 1.35; color: var(--jg-text-dim); margin: 6px 0 0; }
.jg-upload-bigplay { display: block; width: 100%; margin: 10px 0 6px; min-height: 60px; font-size: 1.4rem; font-weight: 800; border: none; border-radius: 16px; color: #fff; cursor: pointer; background: linear-gradient(135deg, var(--jg-accent), var(--jg-accent-2)); box-shadow: 0 6px 16px rgba(196, 106, 31, 0.3); }
.jg-upload-settings { margin: 10px 0; border: 1px solid var(--jg-border); border-radius: 14px; background: var(--jg-panel); padding: 4px 12px; }
.jg-upload-settings > summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style: none; }
.jg-upload-settings > summary::-webkit-details-marker { display: none; }
.jg-up-match { background: var(--jg-accent-soft); border-radius: 12px; padding: 8px 10px; margin: 8px 0; }
.jg-up-rec-box { display: flex; gap: 12px; align-items: center; background: #fff; border: 2px solid var(--jg-accent-soft); border-radius: 16px; padding: 10px 12px; margin: 8px 0; }
.jg-up-rec-box b { font-size: 1.15rem; }
.jg-up-rec-art { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }

/* ===== Clean home: big tiles, one card, upload ===== */
.jg-header { flex-direction: column !important; text-align: center; gap: 2px !important; }
.jg-header .jg-logo { width: 64px; height: 64px; }
.jg-level-chip { display: none !important; }
.jg-tagline { font-weight: 600; }
.jg-tabs { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 8px !important; max-width: 560px; margin: 8px auto 14px; padding: 0 12px !important; }
.jg-tab { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 84px !important; padding: 8px 4px !important;
  border-radius: 18px !important; border: 2px solid var(--jg-border) !important; background: #fff !important; color: var(--jg-text) !important;
  font-weight: 800; font-size: 0.92rem !important; box-shadow: 0 6px 14px rgba(107, 63, 31, 0.10); }
.jg-tab-active { border-color: var(--jg-accent) !important; background: linear-gradient(160deg, #fff4e6, #fff) !important; box-shadow: 0 8px 20px rgba(196, 106, 31, 0.25); }
.jg-home-clean { max-width: 560px; margin: 0 auto; padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }
.jg-hero-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border-radius: 24px; border: none; text-align: left; cursor: pointer;
  background: linear-gradient(135deg, #fff1df, #e7f6f3); box-shadow: 0 10px 26px rgba(107, 63, 31, 0.14); }
.jg-hero-card .jg-avatar { width: 110px; height: 110px; flex: 0 0 auto; }
.jg-hero-card .jg-avatar img { width: 100%; height: 100%; object-fit: contain; }
.jg-hero-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.jg-hero-kicker { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--jg-accent); }
.jg-hero-title { font-size: 1.35rem; font-weight: 900; color: var(--jg-text); }
.jg-hero-bar { height: 8px; border-radius: 99px; background: #fff; overflow: hidden; }
.jg-hero-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--jg-accent), var(--jg-accent-2)); }
.jg-hero-meta { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; color: var(--jg-text-dim); }
.jg-hero-cta { align-self: flex-start; margin-top: 4px; padding: 10px 20px; border-radius: 999px; background: linear-gradient(135deg, var(--jg-accent), #e08a3c); color: #fff; font-weight: 900; font-size: 1.05rem; }
.jg-home-upload { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 20px; border: 2px dashed #e7c79f; background: #fff; text-align: left; cursor: pointer; }
.jg-home-upload > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.jg-home-upload b { font-size: 1.1rem; }
.jg-home-upload > span:nth-child(2) > span { font-size: 0.9rem; color: var(--jg-text-dim); }
.jg-home-upload-go { padding: 8px 14px; border-radius: 999px; background: var(--jg-accent-2); color: #fff; font-weight: 800; }
.jg-footer-link { background: none; border: none; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
/* Footer (privacy, credits) only on the About page, not the home screen */
body[data-tab="practice"] .jg-footer, body[data-tab="tuner"] .jg-footer { display: none; }
body[data-tab="lessons"] .jg-footer, body[data-tab="songs"] .jg-footer { display: none; }

/* Song screen: cover art, key, chords by section */
.jg-song-card { display: flex; gap: 14px; align-items: center; margin: 6px 0 10px; }
.jg-song-art { flex: 0 0 auto; width: 92px; height: 92px; border-radius: 18px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--jg-accent), var(--jg-accent-2)); box-shadow: 0 6px 16px rgba(107, 63, 31, 0.2); }
.jg-song-art span { color: #fff; font-weight: 900; font-size: 1.6rem; }
.jg-song-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jg-song-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.jg-song-info h2 { margin: 0; font-size: 1.35rem; }
.jg-song-info p { margin: 0; color: var(--jg-text-dim); }
.jg-song-key { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #fff1df; color: var(--jg-wood); font-weight: 800; font-size: 0.9rem; }
.jg-song-prog { background: var(--jg-panel); border: 1px solid var(--jg-border); border-radius: 16px; padding: 10px 12px; margin-bottom: 10px; }
.jg-song-prog-title { font-weight: 800; font-size: 0.85rem; color: var(--jg-accent); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.jg-song-prog-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; padding: 5px 0; border-top: 1px dashed var(--jg-border); }
.jg-song-prog-row:first-of-type { border-top: none; }
.jg-song-prog-row span { font-size: 0.85rem; color: var(--jg-text-dim); }
.jg-song-prog-row b { display: flex; gap: 6px; flex-wrap: wrap; }
.jg-song-prog-row i { font-style: normal; font-weight: 900; min-width: 34px; text-align: center; padding: 3px 8px; border-radius: 10px; background: #fff; border: 2px solid var(--jg-accent-soft); }
.jg-icon, .hk-icon { vertical-align: -0.2em; }
.jg-phone-note { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; padding: 8px 12px; border-radius: 14px; background: #fff7e0; border: 1px dashed #f2b630; font-size: 0.88rem; color: #5a4a2a; }
/* Chord Ear Gym */
.jg-gym-head { display: flex; gap: 10px; align-items: center; font-size: 0.95rem; }
.jg-gym-head b { flex: 1; color: var(--jg-accent); }
.jg-gym-ask { text-align: center; font-size: 1.3rem; font-weight: 900; margin: 10px 0; }
.jg-gym-ask small { font-size: 0.85rem; font-weight: 600; color: var(--jg-text-dim); }
.jg-gym-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.jg-gym-choice { padding: 16px 8px; border-radius: 16px; border: 3px solid var(--jg-border); background: #fff; font-size: 1.4rem; font-weight: 900; cursor: pointer; }
.jg-gym-choice:disabled { opacity: 0.7; cursor: default; }
.jg-gym-right { border-color: var(--jg-good) !important; background: #e6f7ea !important; opacity: 1 !important; }
.jg-gym-wrong { border-color: #e4573d !important; background: #fde8e4 !important; opacity: 1 !important; }
.jg-gym-reply { text-align: center; margin-top: 8px; }

/* ===== Song library: Netflix-style rows (scroll sideways in a row, down between genres) ===== */
.jg-lib-row { margin: 6px 0 18px; }
.jg-lib-row h3 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 900; color: var(--jg-wood); }
.jg-lib-scroll { display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 2px 16px 10px; margin: 0 -16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.jg-lib-scroll::-webkit-scrollbar { display: none; }
.jg-lib-card { flex: 0 0 auto; width: 138px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 3px; text-align: left; background: none; border: none; padding: 0; cursor: pointer; }
.jg-lib-art { position: relative; display: block; width: 138px; height: 138px; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, var(--jg-accent), var(--jg-accent-2)); box-shadow: 0 6px 16px rgba(46, 36, 25, 0.22); }
.jg-lib-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s; }
.jg-lib-card:active .jg-lib-art img, .jg-lib-card:hover .jg-lib-art img { transform: scale(1.05); }
.jg-lib-initials { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; font-size: 3rem; font-weight: 900; }
.jg-lib-play { position: absolute; right: 8px; bottom: 8px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35)); }
.jg-lib-tag { position: absolute; left: 6px; top: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); font-size: 0.72rem; font-weight: 800; }
.jg-lib-title { font-weight: 800; font-size: 0.95rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jg-lib-artist { font-size: 0.8rem; color: var(--jg-text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 768px) { .jg-lib-card, .jg-lib-art { width: 168px; } .jg-lib-art { height: 168px; } }

.jg-home-credit { margin: 22px 0 8px; text-align: center; font-size: 0.75rem; color: var(--jg-text-dim); }
.jg-home-credit a { color: inherit; }

/* How it works: technology tour + tip jar */
.jg-tech { max-width: 760px; margin: 0 auto; padding: 0 16px 24px; }
.jg-tech h2 { margin-bottom: 2px; color: var(--jg-wood); }
.jg-tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 12px 0 18px; }
.jg-tech-card { background: #fff; border: 2px solid var(--jg-border); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.jg-tech-card b { font-size: 1.1rem; }
.jg-tech-card p { margin: 0; font-size: 0.92rem; color: var(--jg-text-dim); line-height: 1.45; }
.jg-tipjar { padding: 16px; border-radius: 20px; background: linear-gradient(135deg, #fff1df, #e7f6f3); border: 2px solid var(--jg-border); }
.jg-tipjar h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.jg-tipjar p { margin: 0 0 10px; }
.jg-tip-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.jg-tip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 16px; border: none; background: linear-gradient(135deg, var(--jg-accent), #e08a3c); color: #fff; cursor: pointer; }
.jg-tip b { font-size: 1.2rem; }
.jg-tip span { font-size: 0.78rem; }
.jg-tip:disabled { opacity: 0.6; }
.jg-tip-status, .jg-tip-note { font-size: 0.85rem; color: var(--jg-text-dim); }
.jg-home-how { display: flex; align-items: center; gap: 6px; margin: 8px auto 0; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--jg-border); background: #fff; color: var(--jg-wood); font-weight: 700; font-size: 0.9rem; cursor: pointer; }

/* ===== Jaxx the kitten (flat, animated) =====
   Calm by default (breathing, blinking, glancing, tail swish); big moves
   play once or twice, then settle. */
.jk-kitten { display: block; width: 100%; height: 100%; overflow: visible; }
.jk-kitten .jk-fur { fill: #f2994a; }
.jk-kitten .jk-cream { fill: #fde9cf; }
.jk-kitten .jk-ear-in { fill: #f7b9a6; }
.jk-kitten .jk-pad { fill: #f4b6c4; }
.jk-kitten .jk-tail { stroke: #f2994a; stroke-width: 20; }
.jk-kitten .jk-tail-stripes, .jk-kitten .jk-stripe-line { stroke: #d9772a; stroke-width: 4.5; stroke-linecap: round; fill: none; }
.jk-kitten .jk-eye { fill: #fff; }
.jk-kitten .jk-pupil { fill: #2a2a3a; }
.jk-kitten .jk-line { fill: none; stroke: #2a2a3a; stroke-width: 4.5; stroke-linecap: round; }
.jk-kitten .jk-cheek { fill: #f7a1bf; opacity: 0.45; }
.jk-kitten .jk-nose { fill: #e7849c; }
.jk-kitten .jk-whisker { stroke: #c9a27a; stroke-width: 1.6; stroke-linecap: round; }
.jk-kitten .jk-bow path { fill: #2f8f83; }
.jk-kitten .jk-bow circle { fill: #226b62; }
.jk-kitten .jk-gbody { fill: #8a5a33; }
.jk-kitten .jk-gtop { fill: #f0c27b; }
.jk-kitten .jk-hole { fill: #3a2614; }
.jk-kitten .jk-neck { fill: #6b3f1f; }
.jk-kitten .jk-head-stock { fill: #4a2b14; }
.jk-kitten .jk-bridge { fill: #4a2b14; }
.jk-kitten .jk-gstrings { stroke: #fff6e0; stroke-width: 1; }
.jk-kitten .jk-sweat { fill: #8fd0f5; }
.jk-kitten .jk-sparkles path { fill: #f5c542; }
.jk-kitten .jk-notes text, .jk-kitten .jk-zzz text { font: 800 22px system-ui, sans-serif; fill: #2f8f83; }
.jk-kitten .jk-zzz text { fill: #4a9bc9; font-size: 18px; }
.jk-kitten .jk-shout { font: 900 19px system-ui, sans-serif; fill: #c46a1f; }
.jk-kitten .jk-ugh { fill: #8a8399; font-size: 16px; }
.jk-kitten g, .jk-kitten text, .jk-kitten .jk-tail-stripes { transform-box: fill-box; }
.jk-kitten .jk-arm-l { transform-box: view-box; transform-origin: 57px 142px; }
.jk-kitten .jk-arm-r { transform-box: view-box; transform-origin: 143px 142px; }
.jk-kitten .jk-head { transform-box: view-box; transform-origin: 100px 150px; }
.jk-kitten .jk-tail { transform-box: view-box; transform-origin: 140px 196px; }
.jk-kitten .jk-all, .jk-kitten .jk-live { transform-box: view-box; transform-origin: 100px 214px; }
.jk-kitten .jk-eyes, .jk-kitten .jk-shout { transform-origin: 50% 50%; }
.jk-kitten .jk-guitar { transform-box: view-box; transform-origin: 100px 170px; }
/* Resting poses */
.jk-cheer .jk-arm-l, .jk-jump .jk-arm-l { transform: rotate(150deg); } .jk-cheer .jk-arm-r, .jk-jump .jk-arm-r { transform: rotate(-150deg); }
.jk-think .jk-head { transform: rotate(-7deg); }
.jk-oops .jk-arm-l { transform: rotate(30deg); }
.jk-spin .jk-arm-l { transform: rotate(90deg); } .jk-spin .jk-arm-r { transform: rotate(-90deg); }
.jk-yarn .jk-arm-r { transform: rotate(-40deg); }
.jk-fish .jk-arm-l { transform: rotate(-35deg); } .jk-fish .jk-arm-r { transform: rotate(35deg); }
.jk-tangled .jk-arm-l { transform: rotate(40deg); } .jk-tangled .jk-arm-r { transform: rotate(-40deg); }
.jk-rockout .jk-guitar { transform: rotate(-18deg) translateY(-6px); }
.jk-kitten .jk-shout:not(.jk-ugh) { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .jk-kitten .jk-live { animation: jk-breathe 3.6s ease-in-out infinite; }
  .jk-kitten .jk-eyes { animation: jk-blink 5s infinite; }
  .jk-kitten .jk-look { animation: jk-glance 8s ease-in-out infinite; }
  .jk-kitten .jk-tail { animation: jk-swish 3.2s ease-in-out infinite; }
  .jk-kitten .jk-ear-r { animation: jk-twitch 7s ease-in-out infinite; transform-origin: 30% 90%; }
  .jk-wave .jk-arm-r { animation: jk-wave 2.2s ease-in-out 1; }
  .jk-play .jk-strum-paw { animation: jk-strum 0.42s ease-in-out infinite; }
  .jk-play .jk-notes text, .jk-sing .jk-notes text, .jk-rockout .jk-notes text { animation: jk-float 1.8s ease-out infinite; }
  .jk-play .jk-notes text:nth-child(2), .jk-sing .jk-notes text:nth-child(2), .jk-rockout .jk-notes text:nth-child(2) { animation-delay: 0.9s; }
  .jk-sleep .jk-zzz text { animation: jk-float 2.4s ease-out infinite; }
  .jk-sleep .jk-zzz text:nth-child(2) { animation-delay: 0.8s; } .jk-sleep .jk-zzz text:nth-child(3) { animation-delay: 1.6s; }
  .jk-oops .jk-all { animation: jk-shake 0.5s ease-in-out 2; }
  .jk-kitten .jk-sweat { animation: jk-drip 1.4s ease-in 3 forwards; }
  .jk-cheer .jk-all, .jk-spin .jk-all { animation: jk-spin 0.75s cubic-bezier(.3,.7,.4,1) 1; transform-origin: 100px 120px; }
  .jk-cheer .jk-sparkles, .jk-jump .jk-sparkles { animation: jk-sparkle 1.4s ease-out 1 forwards; }
  .jk-spin .jk-swoosh { animation: jk-sparkle 0.8s ease-out 1 forwards; }
  .jk-jump .jk-all { animation: jk-leap 0.8s ease-out 2; }
  .jk-rockout .jk-all { animation: jk-hop 0.5s ease-in-out 3; }
  .jk-rockout .jk-head { animation: jk-headbang 0.5s ease-in-out 3; }
  .jk-rockout .jk-strum-paw { animation: jk-strum 0.25s ease-in-out 6; }
  .jk-rockout .jk-shout, .jk-fish .jk-shout { animation: jk-pop 1.6s ease-out 1; }
  .jk-yarn .jk-yarn { animation: jk-roll 0.9s ease-in-out 3; }
  .jk-yarn .jk-arm-r { animation: jk-bat 0.45s ease-in-out 6; }
  .jk-fish .jk-head { animation: jk-munch 0.4s ease-in-out 5; }
  .jk-tangled .jk-all { animation: jk-wriggle 0.6s ease-in-out 3; }
}
@keyframes jk-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.02); } }
@keyframes jk-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@keyframes jk-glance { 0%, 30%, 100% { transform: translateX(0); } 38%, 50% { transform: translateX(-3px); } 58%, 70% { transform: translateX(3px); } 78% { transform: translateX(0); } }
@keyframes jk-swish { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-9deg); } }
@keyframes jk-twitch { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(9deg); } 94% { transform: rotate(-4deg); } }
@keyframes jk-wave { 0% { transform: rotate(0); } 15% { transform: rotate(-150deg); } 32% { transform: rotate(-115deg); } 50% { transform: rotate(-150deg); } 68% { transform: rotate(-115deg); } 82% { transform: rotate(-150deg); } 100% { transform: rotate(0); } }
@keyframes jk-strum { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(3px, 8px); } }
@keyframes jk-float { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
@keyframes jk-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes jk-drip { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
@keyframes jk-spin { 0% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-12px) rotate(0); } 80% { transform: translateY(-12px) rotate(360deg); } 100% { transform: translateY(0) rotate(360deg); } }
@keyframes jk-sparkle { 0% { opacity: 0; } 30%, 60% { opacity: 1; } 100% { opacity: 0; } }
@keyframes jk-leap { 0%, 100% { transform: translateY(0) scale(1, 1); } 20% { transform: scale(1.05, 0.94); } 55% { transform: translateY(-24px) scale(0.97, 1.04); } }
@keyframes jk-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes jk-headbang { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(8deg) translateY(4px); } }
@keyframes jk-pop { 0% { transform: scale(0); opacity: 0; } 15% { transform: scale(1.2); opacity: 1; } 25%, 75% { transform: scale(1); opacity: 1; } 100% { opacity: 0; } }
@keyframes jk-roll { 0%, 100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(-10px) rotate(-60deg); } }
@keyframes jk-bat { 0%, 100% { transform: rotate(-40deg); } 50% { transform: rotate(-70deg); } }
@keyframes jk-munch { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2px) rotate(-2deg); } }
@keyframes jk-wriggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
/* Jaxx's own cat-like moves (different from Hayden's panda) */
.jk-wave .jk-guitar, .jk-cheer .jk-guitar, .jk-jump .jk-guitar { transform: rotate(-10deg); }
.jk-sleep .jk-guitar { transform: rotate(14deg) translate(6px, 4px); }
@media (prefers-reduced-motion: no-preference) {
  /* slow "cat blink" (a cat's way of saying I like you), not a quick blink */
  .jk-kitten .jk-eyes { animation: jk-slowblink 7s ease-in-out infinite; }
  /* idle: a little strum every few seconds, guitar bobbing */
  .jk-idle .jk-strum-paw { animation: jk-idlestrum 6s ease-in-out infinite; }
  .jk-idle .jk-guitar, .jk-think .jk-guitar { animation: jk-gbob 6s ease-in-out infinite; }
  .jk-play .jk-guitar { animation: jk-gbob 0.84s ease-in-out infinite; }
  .jk-kitten .jk-ear-l { animation: jk-flick 9s ease-in-out 2s infinite; transform-origin: 70% 90%; }
  .jk-cheer .jk-guitar, .jk-jump .jk-guitar { animation: jk-raise 1.2s ease-out 1; }
}
@keyframes jk-slowblink { 0%, 86%, 100% { transform: scaleY(1); } 90%, 94% { transform: scaleY(0.12); } }
@keyframes jk-idlestrum { 0%, 80%, 100% { transform: translate(0, 0); } 84%, 92% { transform: translate(3px, 8px); } 88%, 96% { transform: translate(0, 0); } }
@keyframes jk-gbob { 0%, 80%, 100% { transform: rotate(0); } 88% { transform: rotate(-3deg); } }
@keyframes jk-flick { 0%, 90%, 100% { transform: rotate(0); } 93% { transform: rotate(-10deg); } 96% { transform: rotate(3deg); } }
@keyframes jk-raise { 0% { transform: rotate(-10deg) translateY(0); } 40% { transform: rotate(-24deg) translateY(-14px); } 100% { transform: rotate(-10deg); } }

/* ===== Simple lesson cards (Jaxx) ===== */
.jg-cards { max-width: 720px; margin: 0 auto; padding: 0 12px 24px; }
.jg-cards-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: 6px 0 8px; background: linear-gradient(var(--jg-bg) 80%, transparent); }
.jg-cards-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--jg-border); background: #fff; font-size: 1.1rem; cursor: pointer; }
.jg-cards-back { border: 1px solid var(--jg-border); background: #fff; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.jg-cards-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.jg-cards-count { padding: 3px 10px; border-radius: 999px; background: #fff1df; color: var(--jg-accent); font-weight: 800; font-size: 0.85rem; }
.jg-cards-thread { display: flex; flex-direction: column; gap: 8px; }
.jg-cmsg { display: flex; align-items: flex-end; gap: 8px; animation: jg-card-in 0.25s ease-out; }
.jg-cavatar { flex: 0 0 auto; width: 62px; height: 70px; }
.jg-cbubble { background: #fff; border: 2px solid var(--jg-accent-soft); border-radius: 20px; border-bottom-left-radius: 6px; padding: 12px 16px; font-size: 1.08rem; line-height: 1.45; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); }
.jg-cbubble b { color: var(--jg-accent); }
.jg-cme { justify-content: flex-end; }
.jg-cme .jg-cbubble { background: linear-gradient(135deg, #f2994a, var(--jg-accent)); color: #fff; border: none; border-radius: 20px 20px 6px 20px; }
.jg-cmore { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin: 8px 0; }
.jg-chip-hint { font-size: 0.85rem; font-weight: 700; color: var(--jg-accent); }
.jg-chip { background: linear-gradient(135deg, #f2994a, var(--jg-accent)); color: #fff; border: none; border-radius: 22px 22px 6px 22px; padding: 12px 18px; font-size: 1.05rem; font-weight: 800; cursor: pointer; box-shadow: 0 6px 16px rgba(196, 106, 31, 0.3); }
@media (prefers-reduced-motion: no-preference) { .jg-chip { animation: jg-chip-pulse 1.6s ease-in-out infinite; } }
@keyframes jg-chip-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes jg-card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.jg-card-phone { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0 70px; padding: 8px 12px; border-radius: 14px; background: #fff7e0; border: 1px dashed #f2b630; font-size: 0.88rem; color: #5a4a2a; }
.jg-card-board { margin-top: 10px; }
.jg-card-extra { margin-top: 8px; }
.jg-card-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.jg-card-step { flex: 1 1 100%; text-align: center; font-size: 1.05rem; padding: 8px 10px; border-radius: 14px; background: #fff1df; }
.jg-card-step b { color: var(--jg-accent); }
.jg-card-wrong { border-color: #e4573d !important; background: #fde8e4 !important; }
.jg-card-next-auto { position: relative; overflow: hidden; }
@media (max-width: 520px) { .jg-card-phone { margin-left: 0; } .jg-cavatar { width: 52px; height: 60px; } .jg-cbubble { font-size: 1rem; } }
body.jg-lesson-open .jg-header, body.jg-lesson-open .jg-tabs, body.jg-lesson-open .jg-footer { display: none !important; }
body.jg-lesson-open main { padding-top: env(safe-area-inset-top, 0px); }
.jg-logo { width: 64px !important; height: 72px !important; border-radius: 0 !important; }
.jg-avatar svg, .jg-hero-mascot svg, .jg-inline-mascot svg, .jg-funfact-img svg { width: 100%; height: 100%; }
div.jg-hero-mascot { width: 150px; height: 170px; margin: 0 auto; }
div.jg-inline-mascot { width: 56px; height: 62px; flex: 0 0 auto; }
div.jg-funfact-img { width: 110px; height: 124px; float: right; }
