/* ============================================================
   גיטר-קואץ' - מערכת עיצוב
   כהה, חמים, רגוע. עוגן: עץ הגיטרה (ענבר) על פחם עמוק.
   ============================================================ */

@font-face {
  font-family: "Assistant"; font-weight: 400 800; font-display: swap;
  src: url("fonts/assistant-hebrew.woff2") format("woff2");
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Assistant"; font-weight: 400 800; font-display: swap;
  src: url("fonts/assistant-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212;
}

:root {
  /* משטחים */
  --bg: #0E1117;
  --bg-glow: radial-gradient(120% 80% at 50% -10%, #1b2331 0%, #0E1117 60%);
  --surface: #161B24;
  --surface-2: #1D2430;
  --surface-3: #242D3B;
  --line: #2A3342;
  --line-soft: rgba(255,255,255,.07);

  /* טקסט */
  --text: #ECEEF2;
  --muted: #97A1B2;
  --faint: #6B7689;

  /* צבעי מותג */
  --amber: #E8A94D;         /* עץ הגיטרה - הצבע המוביל */
  --amber-soft: #F3C583;
  --amber-deep: #B87A2B;
  --teal: #4FD1C5;          /* מצב מנגינה */
  --ok: #58D68D;
  --warn: #F2C14E;
  --err: #F0776C;

  /* טיפוגרפיה */
  --f: "Assistant", -apple-system, "Segoe UI", sans-serif;

  /* מרווחים וקימור */
  --r-sm: 10px; --r: 16px; --r-lg: 22px; --r-xl: 28px;
  --pad: 18px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --shadow-soft: 0 4px 16px rgba(0,0,0,.3);

  /* z-scale */
  --z-nav: 30; --z-sheet: 40; --z-toast: 50;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { overflow-x: clip; }
[hidden] { display: none !important; }

body {
  font-family: var(--f);
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { appearance: none; border: 0; background: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }

.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- פריסה ---------- */
.screen { display: none; padding: calc(env(safe-area-inset-top) + 14px) var(--pad) 24px; max-width: 620px; margin: 0 auto; }
.screen.active { display: block; animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow { color: var(--faint); font-size: .82rem; font-weight: 600; letter-spacing: .02em; }
h1 { font-size: 1.55rem; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
h3 { font-size: .95rem; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

/* ---------- מסך הבית ---------- */
.home-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.home-head .txt { flex: 1; min-width: 0; }

.streak {
  width: 62px; height: 62px; flex: none; position: relative;
  display: grid; place-items: center;
}
.streak svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.streak .num { font-size: 1.15rem; font-weight: 800; line-height: 1; color: var(--amber); font-variant-numeric: tabular-nums; }
.streak .lbl { font-size: .6rem; color: var(--faint); margin-top: 1px; }

.today {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #2A2013 0%, var(--surface-2) 55%);
  border: 1px solid rgba(232,169,77,.28);
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.today::after {
  content: ""; position: absolute; inset-inline-end: -50px; top: -60px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,169,77,.20), transparent 65%);
  pointer-events: none;
}
.today .kicker { display: flex; align-items: center; gap: 7px; color: var(--amber); font-size: .82rem; font-weight: 700; margin-bottom: 8px; }
.today h1 { margin-bottom: 6px; }
.today .meta { display: flex; gap: 14px; color: var(--muted); font-size: .87rem; margin: 10px 0 16px; }
.today .meta span { display: inline-flex; align-items: center; gap: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 52px; width: 100%; padding: 0 22px;
  border-radius: 999px; font-weight: 800; font-size: 1.02rem;
  background: linear-gradient(180deg, var(--amber-soft), var(--amber));
  color: #241604;
  box-shadow: 0 6px 18px rgba(232,169,77,.26);
  transition: filter .18s ease, box-shadow .18s ease;
}
.btn:active { filter: brightness(.94); }
.btn.ghost { background: var(--surface-3); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.btn.sm { min-height: 44px; font-size: .92rem; width: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 13px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .88rem; font-weight: 700; color: var(--muted);
}
.chip.on { color: var(--amber); border-color: rgba(232,169,77,.4); background: rgba(232,169,77,.09); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  padding: 15px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  text-align: start; min-height: 92px;
  transition: border-color .18s ease, background .18s ease;
}
.tile:active { background: var(--surface-2); }
.tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; min-height: 74px; }
.tile.wide .t { flex: none; }
.tile.wide .s { flex: 1; }
.tile .t { font-weight: 700; font-size: .95rem; }
.tile .s { font-size: .78rem; color: var(--faint); }
.tile svg { color: var(--amber); }

.week-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ring-mini { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; }
.ring-mini svg { position: absolute; inset: 0; }
.ring-mini span { font-size: .72rem; font-weight: 800; color: var(--teal); direction: ltr; }

/* רשימת שיעורים */
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: start;
  padding: 13px 14px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
}
.row .idx {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  background: var(--surface-3); color: var(--muted);
}
.row.done .idx { background: rgba(88,214,141,.14); color: var(--ok); }
.row.current { border-color: rgba(232,169,77,.45); background: rgba(232,169,77,.06); }
.row.current .idx { background: var(--amber); color: #241604; }
.row.locked { opacity: .45; }
.row .txt { flex: 1; min-width: 0; }
.row .txt .t { display: block; font-weight: 700; font-size: .95rem; }
.row .txt .s { display: block; font-size: .78rem; color: var(--faint); margin-top: 2px; }

.song {
  display: block; width: 100%; text-align: start;
  padding: 15px; border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
}
.song .top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.song .t { font-weight: 800; font-size: 1.02rem; }
.song .a { font-size: .82rem; color: var(--faint); }
.song .b { display: block; font-size: .85rem; color: var(--muted); margin: 6px 0 10px; }
.song .need { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.song .lock { display: flex; }
.song .need .c {
  min-height: 28px; padding: 0 10px; border-radius: 999px; direction: ltr;
  background: var(--surface-3); border: 1px solid var(--line);
  font-size: .8rem; font-weight: 700; color: var(--muted);
  display: inline-flex; align-items: center;
}
.song .need .c.have { color: var(--amber); border-color: rgba(232,169,77,.4); background: rgba(232,169,77,.1); }
.song .lock { font-size: .78rem; color: var(--faint); margin-top: 9px; display: flex; align-items: center; gap: 6px; }

/* ---------- הפרטבורד ---------- */
.board-wrap {
  direction: ltr;
  background: linear-gradient(180deg, #1A2029, #12171F);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 12px 10px;
  box-shadow: var(--shadow);
}
.board-wrap svg { width: 100%; height: auto; display: block; }

.board-head {
  direction: rtl; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.board-name { font-size: 1.6rem; font-weight: 800; letter-spacing: .01em; line-height: 1; }
.board-name.melody { color: var(--teal); }
.board-name.chord { color: var(--amber); }
.board-sub { font-size: .8rem; color: var(--faint); }

.beatrail { direction: ltr; display: flex; gap: 7px; justify-content: center; margin-top: 12px; }
.beat {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--faint); transition: background .12s ease, color .12s ease, transform .12s ease;
}
.beat.on { background: rgba(232,169,77,.16); border-color: rgba(232,169,77,.5); color: var(--amber); transform: translateY(-2px); }
.beat.rest { opacity: .4; }

/* ---------- נגן השיעור ---------- */
.player-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.iconbtn {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
}
.progress-dots { display: flex; gap: 5px; flex: 1; }
.progress-dots i { height: 4px; flex: 1; border-radius: 2px; background: var(--line); transition: background .25s ease; }
.progress-dots i.done { background: var(--amber); }

.step-body { margin: 16px 0 14px; }
.step-body h1 { font-size: 1.3rem; margin-bottom: 8px; }
.step-body p { color: var(--muted); font-size: .97rem; }
.step-body .tip {
  margin-top: 12px; padding: 12px 14px; border-radius: var(--r);
  background: rgba(79,209,197,.08); border: 1px solid rgba(79,209,197,.22);
  color: #BFEFE9; font-size: .89rem;
}
.step-body .tip b { color: var(--teal); }

.transport { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.transport .main { display: flex; align-items: center; gap: 12px; }
.playbtn {
  width: 68px; height: 68px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--amber-soft), var(--amber));
  color: #241604; box-shadow: 0 8px 22px rgba(232,169,77,.3);
}
.playbtn.playing { background: var(--surface-3); color: var(--amber); box-shadow: none; border: 1px solid var(--line); }

.tempo { flex: 1; }
.tempo .lbl { display: flex; justify-content: space-between; font-size: .8rem; color: var(--faint); margin-bottom: 6px; }
.tempo .val { color: var(--amber); font-weight: 800; font-variant-numeric: tabular-nums; }
input[type=range] {
  direction: ltr; width: 100%; height: 30px; appearance: none; background: none;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px; background: var(--surface-3);
}
input[type=range]::-webkit-slider-thumb {
  appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%;
  background: var(--amber); border: 3px solid #12171F; box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.toggles { display: flex; gap: 10px; }
.toggle {
  flex: 1; min-height: 46px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  font-weight: 700; font-size: .88rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.toggle.on { color: var(--amber); border-color: rgba(232,169,77,.45); background: rgba(232,169,77,.08); }

.countin {
  position: fixed; inset: 0; z-index: var(--z-sheet);
  display: grid; place-items: center;
  background: rgba(14,17,23,.86); backdrop-filter: blur(6px);
  font-size: 5rem; font-weight: 800; color: var(--amber);
}

/* ---------- טיונר ---------- */
.tuner-dial { position: relative; padding: 6px 0 4px; text-align: center; }
.tuner-note { font-size: 4.2rem; font-weight: 800; line-height: 1; direction: ltr; }
.tuner-note.ok { color: var(--ok); }
.tuner-hz { color: var(--faint); font-size: .9rem; direction: ltr; margin-top: 4px; }
.tuner-bar { position: relative; height: 10px; border-radius: 5px; background: var(--surface-3); margin: 26px 0 10px; }
.tuner-bar .mid { position: absolute; left: 50%; top: -7px; width: 2px; height: 24px; background: var(--line); transform: translateX(-50%); }
.tuner-bar .needle {
  position: absolute; top: -8px; width: 8px; height: 26px; border-radius: 5px;
  background: var(--amber); transform: translateX(-50%); left: 50%;
  box-shadow: 0 0 14px rgba(232,169,77,.55);
  transition: left .12s ease, background .2s ease, box-shadow .2s ease;
}
.tuner-bar .needle.ok { box-shadow: 0 0 16px rgba(88,214,141,.6); }
.tuner-bar .needle.ok { background: var(--ok); }
.tuner-scale { display: flex; justify-content: space-between; color: var(--faint); font-size: .74rem; direction: ltr; }
.strings6 { display: flex; gap: 8px; margin-top: 20px; direction: ltr; }
.strings6 button {
  flex: 1; min-height: 56px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.strings6 button .n { font-weight: 800; font-size: 1.05rem; }
.strings6 button .h { font-size: .66rem; color: var(--faint); }
.strings6 button.target { border-color: var(--amber); color: var(--amber); background: rgba(232,169,77,.08); }

/* ---------- התקדמות ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { padding: 14px 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.stat .v { font-size: 1.5rem; font-weight: 800; color: var(--amber); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .k { font-size: .75rem; color: var(--faint); }
.week { display: flex; gap: 6px; justify-content: space-between; direction: rtl; }
.week div { flex: 1; text-align: center; }
.week .d { width: 100%; aspect-ratio: 1; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--faint); font-size: .8rem; font-weight: 700; }
.week .d.on { background: rgba(232,169,77,.16); border-color: rgba(232,169,77,.45); color: var(--amber); }
.week .d.future { opacity: .4; border-style: dashed; }
.week .lbl { font-size: .7rem; color: var(--faint); margin-top: 5px; }

/* ---------- ניווט תחתון ---------- */
.nav {
  position: fixed; z-index: var(--z-nav);
  inset-inline: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(22,27,36,.92);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow);
  max-width: 600px; margin: 0 auto;
}
.nav button {
  min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: .68rem; font-weight: 700;
  transition: color .18s ease;
}
.nav button.on { color: var(--amber); }
.nav button svg { width: 22px; height: 22px; }

.toast {
  position: fixed; z-index: var(--z-toast); inset-inline: 24px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 16px; text-align: center;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease; pointer-events: none;
  max-width: 420px; margin: 0 auto;
}
.toast.show { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
