/* בוזוקי מאסטר — עיצוב */
:root {
  --bg: #080f18;
  --card: #101c2a;
  --elev: #162636;
  --line: #243648;
  --text: #e8eef5;
  --dim: #8fa6bc;
  --gold: #e3b341;
  --gold2: #f0cc74;
  --aegean: #4fb3d9;
  --ok: #5fc88f;
  --bad: #d96459;
  --nav-h: 62px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Heebo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, select {
  font: inherit; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.hub-btn, .btn, .nav-item, .player-chip, .av-btn, .game-cube, .level-card,
.mode-seq-chip, .chord-map-item, .chord-tl-step {
  appearance: none; -webkit-appearance: none;
}

/* ===== SPLASH ===== */
.splash {
  position: fixed; inset: 0; z-index: 999;
  background: radial-gradient(ellipse at 50% 30%, #152840, var(--bg));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.6s, visibility 0.6s;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-logo { width: 100px; height: 100px; animation: pulse 1.5s ease infinite; }
.splash h1 { font-size: 32px; font-weight: 900; color: var(--gold2); margin-top: 16px; }
.splash p { color: var(--aegean); font-size: 14px; letter-spacing: 2px; margin-top: 4px; }
.splash-bar { width: 160px; height: 4px; background: var(--line); border-radius: 2px; margin-top: 28px; overflow: hidden; }
.splash-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--aegean)); animation: loadbar 2s ease forwards; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes loadbar { from { width: 0; } to { width: 100%; } }

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }

.screen { display: none; padding: 16px 16px 24px; animation: fadeIn 0.35s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== COMPONENTS ===== */
.btn {
  background: var(--elev); border: 1px solid var(--line); color: var(--text);
  padding: 12px 20px; min-height: 46px; border-radius: 12px; cursor: pointer;
  font-weight: 600; font-size: 15px; transition: 0.15s;
}
.btn:active { transform: scale(0.96); }
.btn.gold { background: linear-gradient(135deg, var(--gold), #c79a2e); color: #1a1408; border: none; box-shadow: 0 4px 16px rgba(227,179,65,0.3); }
.btn.ghost { background: transparent; border-color: var(--dim); color: var(--dim); }
.btn.small { padding: 8px 14px; min-height: 40px; font-size: 18px; }
.btn.icon { padding: 8px 14px; font-size: 20px; }
.btn.full { width: 100%; }
.btn.playing { background: var(--bad); color: #fff; border-color: var(--bad); }

.section-title { font-size: 22px; font-weight: 900; color: var(--gold2); margin: 8px 0 12px; }
.lead { color: var(--dim); font-size: 14px; line-height: 1.65; margin-bottom: 14px; }
.select-full { width: 100%; background: var(--elev); border: 1px solid var(--line); color: var(--text); padding: 12px; border-radius: 12px; margin-bottom: 14px; }

/* ===== ONBOARDING ===== */
.ob-wrap { padding: 24px 8px calc(var(--nav-h) + 40px); text-align: center; min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.ob-step { display: none; }
.ob-step.active { display: block; animation: fadeIn 0.4s ease; }
.ob-icon { font-size: 56px; margin-bottom: 16px; }
.ob-step h2 { font-size: 26px; color: var(--gold2); margin-bottom: 12px; }
.ob-step p { color: var(--dim); line-height: 1.75; font-size: 15px; }
.ob-dots { display: flex; gap: 8px; justify-content: center; margin: 28px 0; }
.ob-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.ob-dot.active { background: var(--gold); width: 24px; border-radius: 4px; }
.ob-btns { display: flex; gap: 12px; justify-content: center; }

/* ===== TOP BAR ===== */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 28px; }
.brand b { display: block; font-size: 17px; color: var(--gold2); }
.brand small { color: var(--dim); font-size: 11px; }
.player-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--elev); border: 1px solid var(--line); border-radius: 24px;
  padding: 6px 14px 6px 8px; cursor: pointer; color: var(--text); font-size: 14px;
}
.chip-av { font-size: 22px; }

/* ===== COMMUNITY ===== */
.comm-panel { display: flex; gap: 10px; margin-bottom: 10px; }
.comm-stat {
  flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; text-align: center;
}
.comm-stat b { display: block; font-size: 28px; color: var(--gold); }
.comm-stat span { font-size: 12px; color: var(--dim); }
.comm-banner { border-radius: 12px; padding: 14px; margin-bottom: 16px; font-size: 13.5px; line-height: 1.65; }
.comm-banner.online { background: rgba(95,200,143,0.1); border: 1px solid rgba(95,200,143,0.35); }
.comm-banner.offline { background: rgba(79,179,217,0.08); border: 1px solid rgba(79,179,217,0.25); color: var(--dim); }
.comm-group { font-weight: 700; color: var(--ok); margin-bottom: 6px; }
.comm-global-row { display: flex; gap: 20px; }
.comm-global-row b { color: var(--gold); font-size: 20px; }
.comm-banner code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* ===== LEVEL MAP ===== */
.level-map { display: flex; flex-direction: column; gap: 10px; }
.level-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: right; font: inherit; color: inherit;
  background: linear-gradient(135deg, rgba(227,179,65,0.06), transparent), var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  cursor: pointer; transition: 0.15s;
}
.level-card:disabled { cursor: not-allowed; }
.level-card:active { transform: scale(0.98); }
.level-card.locked { opacity: 0.45; cursor: not-allowed; }
.lc-num {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--elev); border: 1px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: var(--gold);
}
.lc-body { flex: 1; }
.lc-name { font-weight: 700; font-size: 16px; }
.lc-sub { font-size: 12px; color: var(--dim); }
.lc-stars { color: var(--gold); font-size: 13px; margin-top: 3px; letter-spacing: 2px; }
.lc-play { font-size: 22px; color: var(--gold); }
.lc-lock { font-size: 18px; }

.footer-note { text-align: center; color: var(--dim); font-size: 12px; margin-top: 20px; }

/* ===== PLAY ===== */
#screen-play {
  display: none;
  flex-direction: column;
  height: calc(100vh - var(--nav-h) - env(safe-area-inset-bottom));
  max-height: calc(100dvh - var(--nav-h) - env(safe-area-inset-bottom));
  padding: 12px 16px 16px;
  overflow: hidden;
}
#screen-play.active { display: flex; }
.app.play-mode { padding-bottom: env(safe-area-inset-bottom); }
.app.play-mode .bottom-nav { display: none; }
#screen-play.active {
  height: calc(100vh - env(safe-area-inset-bottom));
  max-height: 100dvh;
}

.play-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-shrink: 0; }
.play-head-text { flex: 1; min-width: 0; }
.play-top h2 { font-size: 20px; color: var(--gold2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-top small { color: var(--dim); font-size: 12px; }
.play-hud-top { text-align: left; line-height: 1.1; flex-shrink: 0; }
.play-hud-top b { color: var(--gold); font-size: 26px; font-weight: 900; display: block; }
.play-hud-top .hud-combo { font-size: 14px; font-weight: 800; color: var(--gold2); }

.play-details {
  flex-shrink: 0; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.play-details summary {
  padding: 10px 14px; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--aegean);
  list-style: none;
}
.play-details summary::-webkit-details-marker { display: none; }
.play-details[open] summary { border-bottom: 1px solid var(--line); }
.play-details .teach-box { border: none; border-radius: 0; margin: 0; padding: 12px 14px 8px; }
.play-details .pattern-row { padding: 0 14px 12px; margin: 0; }

.lane-wrap { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.lane-box {
  flex: 1; min-height: 160px; position: relative;
  border: 2px solid var(--line); border-radius: 16px;
  overflow: hidden; background: #060b12; touch-action: none; user-select: none;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5), 0 8px 32px rgba(0,0,0,0.4);
}
#game-canvas { display: block; width: 100%; height: 100%; min-height: 160px; cursor: pointer; }
.zone { position: absolute; left: 10px; font-size: 11px; font-weight: 700; pointer-events: none; opacity: 0.55; z-index: 2; }
.zone.up { top: 8px; color: var(--aegean); }
.zone.down { bottom: 8px; color: var(--gold); }
.best-float {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  font-size: 11px; font-weight: 700; color: var(--gold);
  background: rgba(8,15,24,0.7); padding: 3px 8px; border-radius: 8px;
}

.play-prep {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 20px 20px;
  background: linear-gradient(180deg, transparent 0%, transparent 45%, rgba(8,15,24,0.75) 70%, rgba(8,15,24,0.92) 100%);
  backdrop-filter: none;
  border-radius: 14px;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  pointer-events: none;
}
.play-prep .play-main,
.play-prep .bpm-strip,
.play-prep .prep-tools,
.play-prep .prep-label,
.play-prep .calib-msg { pointer-events: auto; }
.play-prep.hide, .chord-prep.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.lane-box.game-running .play-prep,
.lane-box.calibrating .play-prep {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.prep-label { font-size: 15px; color: var(--dim); font-weight: 600; }
.play-prep .play-main {
  width: min(240px, 90%); font-size: 20px; min-height: 56px;
  box-shadow: 0 8px 28px rgba(227,179,65,0.35);
}
.prep-tools { display: flex; gap: 10px; }
.play-prep .calib-msg { margin: 0; min-height: 14px; }

.game-stop {
  position: absolute; top: 10px; left: 10px; z-index: 7;
  width: 40px; height: 40px; min-height: 0; padding: 0;
  border-radius: 50%; font-size: 16px;
  background: rgba(217,100,89,0.9); border: none; color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.lane-box.game-running .game-stop { display: block !important; }
.lane-box.game-running .zone { opacity: 0.35; }

.play-dock { display: none; }
.calib-msg { text-align: center; font-size: 12px; color: var(--aegean); line-height: 1.4; }
.bpm-strip { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.bpm-box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; min-width: 88px; text-align: center; }
.bpm-box b { color: var(--gold); font-size: 22px; }
.btn.icon-mini { width: 46px; min-width: 46px; padding: 0; font-size: 18px; flex-shrink: 0; min-height: 46px; }

.teach-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-bottom: 10px; font-size: 14px; line-height: 1.7;
}
.teach-box .tip { color: var(--dim); font-size: 13px; margin-top: 8px; }

.pattern-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; }
.pat {
  width: 32px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  font-size: 18px; font-weight: 900; color: var(--aegean);
}
.pat.acc { color: var(--gold); font-size: 22px; }
.pat.rest { color: var(--line); }
.pat.note { color: var(--gold2); font-size: 15px; min-width: 36px; width: auto; padding: 0 6px; }
.pat.chord { color: var(--gold); font-size: 14px; min-width: 40px; width: auto; padding: 0 6px; }

.lane-box.lane-chords .zone { display: none; }
.lane-box.lane-highway .zone { display: none; }
.lane-box.lane-highway {
  min-height: 0;
  background: linear-gradient(180deg, #0c141c 0%, #060a10 100%);
  border: 1.5px solid rgba(180,190,200,0.22);
  box-shadow: inset 0 2px 24px rgba(0,0,0,0.5), 0 4px 20px rgba(0,0,0,0.35);
}
.lane-box.lane-highway #game-canvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: 200px;
  max-height: 360px;
  aspect-ratio: 2.5 / 1;
  cursor: crosshair;
  border-radius: 10px;
}
.lane-box.lane-highway.game-running #game-canvas {
  min-height: 210px;
  max-height: min(52vh, 380px);
}
.lane-box.lane-highway .mic-meter { bottom: 6px; height: 3px; opacity: 0.75; }
.lane-box.lane-highway .mic-status { bottom: 12px; font-size: 10px; opacity: 0.85; }
.fb-svg.fb-landscape { max-width: 100%; width: 100%; height: auto; }
.fb-svg.fb-8str { filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35)); }

/* ===== RESULTS (overlay on lane) ===== */
.lane-wrap .results-panel {
  display: none; position: absolute; inset: 0; z-index: 10;
  margin: 0; border-radius: 16px;
  background: rgba(8,15,24,0.92); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.lane-wrap .results-panel.show { display: flex; animation: fadeIn 0.35s ease; }
.results-panel.gold { border: 1px solid rgba(227,179,65,0.45); }
.results-panel.good { border: 1px solid rgba(95,200,143,0.4); }
.results-panel.ok { border: 1px solid rgba(79,179,217,0.35); }
.results-panel.work { border: 1px solid rgba(217,100,89,0.35); }
.lane-wrap .results-panel .res-inner { padding: 16px; text-align: center; width: 100%; }
.res-stars { font-size: 36px; color: var(--gold); letter-spacing: 4px; }
.res-score { font-size: 48px; font-weight: 900; color: var(--gold2); margin: 6px 0; }
.res-msg { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.btn.icon-mini.input-mode.mic { border-color: var(--ok); background: rgba(95,200,143,0.12); }
.btn.icon-mini.input-mode.touch { border-color: var(--aegean); background: rgba(79,179,217,0.12); }

.mic-meter {
  position: absolute; bottom: 36px; left: 12px; right: 12px; height: 4px;
  background: rgba(255,255,255,0.08); border-radius: 2px; z-index: 3; overflow: hidden;
}
.mic-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--gold)); transition: width 0.05s; }
.mic-status {
  position: absolute; bottom: 10px; left: 0; right: 0; text-align: center;
  font-size: 11px; color: var(--ok); z-index: 3; pointer-events: none;
}

.modes-teaser { margin-top: 16px; opacity: 0.85; }
.modes-teaser-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.modes-icon { font-size: 32px; }
.modes-teaser b { display: block; color: var(--gold2); }
.modes-teaser small { color: var(--dim); font-size: 12px; }
.soon-badge {
  margin-right: auto; font-size: 10px; font-weight: 800; color: var(--aegean);
  border: 1px solid rgba(79,179,217,0.4); padding: 3px 8px; border-radius: 8px;
}
.modes-desc { font-size: 13px; color: var(--dim); line-height: 1.6; }

.res-detail { color: var(--dim); font-size: 13px; margin-bottom: 8px; }
.res-feedback {
  font-size: 13px; color: var(--aegean); line-height: 1.55;
  margin: 0 0 12px; padding: 8px 12px;
  background: rgba(79,179,217,0.08); border-radius: 10px;
}
.res-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rec { display: inline-block; background: var(--bad); color: #fff; font-size: 13px; padding: 3px 10px; border-radius: 12px; vertical-align: middle; }

/* ===== LEADERBOARD ===== */
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
  display: grid; grid-template-columns: 32px 36px 1fr auto auto; gap: 8px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.lb-row.first { border-color: var(--gold); background: rgba(227,179,65,0.08); }
.lb-rank { font-weight: 900; color: var(--dim); text-align: center; }
.lb-row.first .lb-rank { color: var(--gold); }
.lb-av { font-size: 24px; }
.lb-name { font-weight: 600; }
.lb-stars { color: var(--gold); font-size: 12px; }
.lb-score { font-weight: 900; color: var(--gold2); font-size: 18px; }
.empty { text-align: center; color: var(--dim); padding: 24px; }

/* ===== PLAYERS ===== */
#screen-players {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 48px);
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.players-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.player-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer;
}
.player-row.active { border-color: var(--gold); background: rgba(227,179,65,0.08); }
.pr-av { font-size: 28px; }
.pr-info b { display: block; }
.pr-info small { color: var(--dim); font-size: 12px; }
.pr-badge { margin-right: auto; background: var(--gold); color: #1a1408; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 10px; }

.card-inner {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px;
}
.card-inner h3 { color: var(--gold2); margin-bottom: 12px; font-size: 16px; }
.card-inner input {
  width: 100%; background: var(--elev); border: 1px solid var(--line); color: var(--text);
  padding: 12px; border-radius: 10px; margin-bottom: 12px; font-size: 16px;
}
.player-feedback { min-height: 18px; font-size: 13px; margin: -4px 0 10px; text-align: center; }
.player-feedback.ok { color: var(--ok); font-weight: 700; }
.player-feedback.err { color: var(--bad); font-weight: 600; }
.add-player { margin-bottom: 12px; }
.avatar-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.av-btn {
  width: 44px; height: 44px; font-size: 22px; background: var(--elev);
  border: 2px solid var(--line); border-radius: 10px; cursor: pointer;
}
.av-btn.sel { border-color: var(--gold); background: rgba(227,179,65,0.15); }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  max-width: 520px; margin: 0 auto;
  display: flex; background: rgba(8,15,24,0.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px; background: none; border: none; color: var(--dim);
  font-size: 11px; font-weight: 600; cursor: pointer;
}
.nav-item span { font-size: 22px; }
.nav-item.active { color: var(--gold2); }

/* ===== HUB ===== */
.hub-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.hub-brand b { font-size: 22px; }
.hub-title {
  font-size: 20px; font-weight: 900; color: var(--gold2);
  text-align: center; margin-bottom: 18px;
}

/* קוביות משחק — כמו בחירת שחקנים */
.game-cubes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-bottom: 28px;
}

.game-cube {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--elev);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  font: inherit;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  min-height: 0;
}
.game-cube:active { transform: scale(0.94); }
.game-cube:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(227,179,65,0.35);
}

.gc-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 2px;
}
.gc-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold2);
  line-height: 1.35;
  max-width: 100%;
  word-break: break-word;
}
.gc-meta {
  font-size: 10px;
  font-weight: 600;
  color: var(--dim);
  margin-top: 2px;
}

.cube-pick {
  background: linear-gradient(160deg, rgba(227,179,65,0.22), var(--elev));
  border-color: rgba(227,179,65,0.45);
}
.cube-pick .gc-icon { filter: drop-shadow(0 2px 6px rgba(227,179,65,0.4)); }

.cube-modes {
  background: linear-gradient(160deg, rgba(79,179,217,0.2), var(--elev));
  border-color: rgba(79,179,217,0.4);
}

.cube-chords {
  background: linear-gradient(160deg, rgba(95,200,143,0.2), var(--elev));
  border-color: rgba(95,200,143,0.4);
}

@media (max-width: 380px) {
  .game-cubes { gap: 10px; }
  .gc-icon { font-size: 28px; }
  .gc-name { font-size: 11px; }
}

@media (min-width: 400px) {
  .game-cubes { gap: 16px; max-width: 420px; margin: 0 auto; }
  .gc-icon { font-size: 38px; }
  .gc-name { font-size: 13px; }
}

.splash-skip { color: var(--dim); font-size: 13px; margin-top: 16px; opacity: 0.8; }

.sub-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.sub-head h2 { font-size: 20px; color: var(--gold2); }
.sub-head small { color: var(--dim); font-size: 12px; }

.coming-soon { text-align: center; padding: 40px 20px; }
.cs-icon { font-size: 64px; margin-bottom: 16px; }
.coming-soon h3 { color: var(--gold2); margin-bottom: 12px; font-size: 20px; }
.coming-soon p { color: var(--dim); line-height: 1.75; font-size: 15px; }

/* ===== CHORDS ===== */
.section-sub {
  font-size: 16px; font-weight: 800; color: var(--gold2);
  margin: 8px 0 6px;
}
.chords-lead { color: var(--dim); font-size: 14px; line-height: 1.65; margin-bottom: 16px; }
.chords-lead + .level-map { margin-bottom: 28px; }
.chord-grid { display: flex; flex-direction: column; gap: 14px; padding-bottom: 16px; }
.chord-card-btn {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; cursor: pointer; color: var(--text); width: 100%; text-align: right;
  transition: 0.15s;
}
.chord-card-btn:active { transform: scale(0.98); border-color: var(--gold); }
.cc-rank {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: rgba(227,179,65,0.15); color: var(--gold); font-weight: 900;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.cc-diag { width: 72px; flex-shrink: 0; }
.cc-diag .chord-svg { width: 100%; height: auto; display: block; }
.cc-info { flex: 1; min-width: 0; }
.cc-info b { display: block; font-size: 17px; color: var(--gold2); }
.cc-info small { display: block; color: var(--dim); font-size: 12px; margin: 2px 0; }
.cc-info span { font-size: 11px; color: var(--aegean); }
.chord-cat-title {
  font-size: 14px; font-weight: 800; color: var(--gold);
  margin: 18px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.chord-cat-title:first-child { margin-top: 0; }
#chord-library { padding-bottom: 24px; }
.chords-more { display: none; }

.chord-play-stage {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 20px; padding: 16px 0 32px; min-height: 50vh;
}
#chord-diagram-big { width: min(280px, 90vw); }
.chord-diagram.large .chord-svg { width: 100%; filter: drop-shadow(0 8px 24px rgba(227,179,65,0.2)); }
.chord-diagram-label { text-align: center; color: var(--gold2); font-weight: 700; margin-top: 8px; }
.chord-drill-status { font-size: 16px; font-weight: 600; color: var(--dim); text-align: center; min-height: 24px; }
.chord-drill-status.ok { color: var(--ok); }
.chord-drill-status.err { color: var(--bad); }
.chord-drill-score { font-size: 22px; font-weight: 900; color: var(--gold); }
.chord-prep {
  position: relative; inset: auto; background: transparent; backdrop-filter: none;
  padding: 0;
}
.chord-prep .play-main { width: min(260px, 90vw); }

/* ---- Prep: מפת מודוס / אקורדים ---- */
#screen-prep { padding-bottom: 32px; }
.prep-stage {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 8px 0 24px;
}
.prep-badge {
  margin: 0; padding: 6px 14px; border-radius: 999px;
  background: rgba(227,179,65,0.12); border: 1px solid rgba(227,179,65,0.35);
  color: var(--gold2); font-weight: 800; font-size: 14px;
}
.prep-details { width: 100%; max-width: 420px; }
.prep-flow-hint {
  margin: 0; text-align: center; color: var(--dim); font-size: 14px; font-weight: 600;
  max-width: 340px; line-height: 1.45;
}
#prep-visual { width: 100%; max-width: 560px; }
.prep-stage .play-main { width: min(300px, 92vw); margin-top: 8px; font-size: 17px; }

/* ===== גרף לימוד ===== */
.learn-graph-box {
  background: linear-gradient(180deg, rgba(22,38,54,0.95), rgba(8,15,24,0.6));
  border: 1px solid rgba(227,179,65,0.25);
  border-radius: 16px;
  padding: 16px 14px 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.learn-graph-head { text-align: center; margin-bottom: 14px; }
.learn-graph-title {
  font-size: 17px; font-weight: 900; color: var(--gold2); margin: 0 0 6px;
}
.learn-graph-sub {
  font-size: 13px; color: var(--dim); line-height: 1.45; margin: 0;
}
.learn-fret-wrap {
  background: rgba(0,0,0,0.25); border-radius: 12px; padding: 8px 4px;
  margin-bottom: 12px; overflow-x: auto;
}
.learn-fret-svg { min-width: 280px; }
.mode-note-dot .note-ring { transition: r 0.2s, filter 0.2s; }
.mode-note-dot.pulse .note-ring {
  filter: drop-shadow(0 0 12px rgba(227,179,65,0.9));
  animation: learnPulse 1.2s ease infinite;
}
@keyframes learnPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}
.learn-seq-label {
  font-size: 13px; font-weight: 700; color: var(--aegean);
  text-align: center; margin: 12px 0 8px;
}
.learn-seq-row { margin-bottom: 8px; }

.learn-focus-panel {
  display: none;
  margin: 14px 0;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(227,179,65,0.15), rgba(79,179,217,0.08));
  border: 2px solid rgba(227,179,65,0.45);
  text-align: center;
}
.learn-focus-panel.show { display: block; }
.lfp-label {
  font-size: 14px; font-weight: 800; color: var(--gold2); margin: 0 0 12px;
}
.lfp-visual {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.lfp-big-fret {
  display: block; font-size: 48px; font-weight: 900; color: var(--gold);
  line-height: 1;
}
.lfp-big-name {
  display: block; font-size: 22px; font-weight: 800; color: #e8f0f8;
}
.lfp-chord-big { width: min(260px, 85vw); }
.lfp-chord-big .chord-diagram.large { width: 100%; }
.lfp-chord-name {
  font-size: 15px; font-weight: 700; color: var(--gold2); margin: 8px 0 0;
}
.lfp-hint {
  font-size: 13px; color: var(--dim); line-height: 1.5; margin: 12px 0 0;
  padding: 10px; background: rgba(8,15,24,0.4); border-radius: 8px;
}

.mode-diagram, .chord-map { width: 100%; }
.mode-svg, .chord-map .chord-svg { width: 100%; height: auto; display: block; }
.mode-seq-row, .chord-map-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px; margin-top: 4px; padding: 10px; border-radius: 12px;
  background: rgba(8,15,24,0.6); border: 1px solid rgba(79,179,217,0.15);
}
.mode-seq-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 12px; border-radius: 10px; background: rgba(227,179,65,0.08);
  border: 2px solid rgba(227,179,65,0.2); min-width: 56px;
  cursor: pointer; color: inherit; font: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.mode-seq-chip:active { transform: scale(0.96); }
.mode-seq-chip.active {
  border-color: var(--gold); background: rgba(227,179,65,0.22);
  box-shadow: 0 0 16px rgba(227,179,65,0.25);
}
.mode-seq-chip b { color: var(--gold); font-size: 11px; }
.mode-seq-chip span { color: #e8f0f8; font-weight: 800; font-size: 14px; }
.mode-seq-chip small { color: var(--dim); font-size: 10px; }
.mode-seq-arrow, .chord-map-arrow { color: var(--dim); font-size: 16px; font-weight: 700; padding: 0 2px; }
.mode-map-hint, .chord-map-hint {
  margin: 12px 0 0; text-align: center; color: var(--dim); font-size: 13px; line-height: 1.4;
}
.learn-chord-row { gap: 10px; }
.chord-map-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px; border-radius: 12px; background: rgba(227,179,65,0.06);
  border: 2px solid rgba(227,179,65,0.2); min-width: 80px;
  cursor: pointer; color: inherit; font: inherit;
  transition: border-color 0.15s, transform 0.1s;
}
.chord-map-item:active { transform: scale(0.96); }
.chord-map-item.active {
  border-color: var(--gold); background: rgba(227,179,65,0.18);
  box-shadow: 0 0 14px rgba(227,179,65,0.2);
}
.chord-map-item b { color: var(--gold); font-size: 16px; }
.chord-map-item small { color: var(--dim); font-size: 10px; text-align: center; }
.chord-map-item .cm-diag { width: 72px; }
.learn-timeline { margin-top: 4px; }
.chord-timeline {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  padding: 12px; border-radius: 12px;
  background: rgba(79,179,217,0.06); border: 1px dashed rgba(79,179,217,0.2);
}
.chord-tl-step {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 12px; border-radius: 10px; font-weight: 800; font-size: 14px;
  background: rgba(8,15,24,0.5); color: #c8d8e8; border: 2px solid rgba(59,86,111,0.5);
  cursor: pointer; font: inherit; min-width: 48px;
  transition: border-color 0.15s, background 0.15s;
}
.chord-tl-step b { color: var(--dim); font-size: 10px; font-weight: 700; }
.chord-tl-step span { font-size: 14px; font-weight: 800; color: var(--gold2); }
.chord-tl-step.first, .chord-tl-step.active {
  border-color: var(--gold); background: rgba(227,179,65,0.15);
  box-shadow: 0 0 12px rgba(227,179,65,0.2);
}
.chord-tl-step.active span { color: var(--gold); }
.level-card.song-level { border-color: rgba(79,179,217,0.35); }
.level-card.song-level .lc-num { background: linear-gradient(135deg, rgba(79,179,217,0.25), rgba(227,179,65,0.2)); }

/* ===== גרף לימוד — חלון אחד ===== */
.play-learn-wrap {
  flex-shrink: 0;
  margin-top: 8px;
  padding: 0 4px 4px;
  border-top: 1px solid rgba(227,179,65,0.2);
}
.play-learn-wrap[hidden] { display: none; }

.play-learn-single {
  background: linear-gradient(180deg, rgba(22,38,54,0.96), rgba(8,15,24,0.9));
  border: 2px solid rgba(201,169,98,0.45);
  border-radius: 14px;
  padding: 12px 10px 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  transition: border-color 0.2s;
}
.play-learn-single.live { border-color: rgba(79,179,217,0.65); }
.pls-caption {
  font-size: 16px; font-weight: 900; color: #e8f0f8;
  text-align: center; line-height: 1.4; margin-bottom: 10px;
}
.pls-caption.live { color: var(--gold2); }
.pls-board { display: flex; justify-content: center; }
.play-learn-single.pls-shift .pls-board {
  animation: plsShift 0.35s ease;
}
.play-learn-single.pls-tick .fb-marker.active .fb-dot {
  animation: learnPulse 0.5s ease;
}
@keyframes plsShift {
  from { opacity: 0.45; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}
.fb-wrap-live {
  max-width: min(270px, 96vw);
  margin: 0 auto;
}

/* ===== דיאגרמת בוזוקי אמיתית ===== */
.fb-host { display: flex; justify-content: center; margin: 10px 0; }
.fb-host-bottom { margin-top: 12px; margin-bottom: 4px; }
.fb-wrap-real {
  background: linear-gradient(180deg, #121820 0%, #0a0e14 100%);
  border: 1px solid rgba(160,120,60,0.28);
  border-radius: 12px;
  padding: 10px 12px 6px;
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.35);
  max-width: min(380px, 96vw);
}
.fb-wrap-compact.fb-wrap-real { max-width: min(240px, 88vw); padding: 6px 8px 2px; }
.fb-svg.real-fretboard { display: block; width: 100%; height: auto; }
.fb-marker .fb-dot { transition: filter 0.2s; }
.fb-marker.active .fb-dot {
  fill: #ffd86b;
  stroke: #fff8d0;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 10px rgba(255,216,107,0.95));
}
.fb-marker.pulse .fb-dot { animation: learnPulse 0.9s ease infinite; }
.chord-fb-host { display: flex; justify-content: center; }
.chord-fb-play { margin-top: 4px; margin-bottom: 0; }
.pli-focus-chord {
  flex-direction: column; align-items: flex-start; gap: 4px;
}
.pli-focus-chord .pli-chord-id { color: var(--gold); font-size: 15px; font-weight: 900; }
.pli-focus-chord .pli-chord-pos {
  color: #e8f0f8; font-size: 13px; font-weight: 800; letter-spacing: 0.3px;
}
.pli-focus-chord .pli-chord-hint { margin: 0; font-size: 11px; color: var(--dim); line-height: 1.4; }

.splash-glow {
  position: absolute; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(227,179,65,0.15), transparent 70%);
  pointer-events: none;
}

.screen { padding: 20px 20px 28px; }
.level-map { gap: 14px; }
.map-empty {
  text-align: center; color: var(--dim); font-size: 14px; padding: 24px 16px;
  background: rgba(8,15,24,0.5); border-radius: 12px; border: 1px dashed var(--line);
}

@media (max-width: 520px) {
  .lane-box.lane-highway #game-canvas {
    min-height: 180px;
    max-height: min(48vw * 2.5, 52vh);
  }
  .lane-box.lane-highway.game-running #game-canvas {
    min-height: 190px;
    max-height: min(56vw * 2.5, 54vh);
  }
  .play-learn-wrap { margin-top: 4px; padding: 0 2px 2px; }
  .fb-wrap-live { max-width: 100%; }
}

@media (min-width: 521px) {
  body { background: #050a10; }
  .app { box-shadow: 0 0 60px rgba(0,0,0,0.5); }
}
