/* قاعدة الألوان: الثابت أسود + أبيض + ذهبي. الألوان التانية للنتائج بس. */
:root {
  --bg: #0b0b0d;
  --card: #17171b;
  --card-2: #1d1d22;
  --line: #2a2a30;
  --line-2: #3a3a42;
  --text: #f5f5f2;
  --muted: #a1a1a8;
  --gold: #d4af37;
  --gold-bg: #1d1a10;
  /* نتائج وحالات */
  --ok: #7ed4a6;
  --ok-bg: #111a14;
  --warn: #f08c5a;
  --info: #7fb2f0;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.muted { color: var(--muted); }
.small { font-size: 12px; }

.header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.header h1 { margin: 0; font-size: 20px; font-weight: 700; }

.unit-toggle { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.unit-toggle button {
  min-width: 48px; min-height: 40px; border: none; background: var(--card); color: var(--muted);
}
.unit-toggle button[aria-pressed="true"] { background: var(--gold); color: var(--bg); font-weight: 700; }

.note {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; font-size: 14px; line-height: 1.6;
}
.note b { color: var(--gold); }

.offline {
  font-size: 12px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: 10px; padding: 8px;
}

.ex-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.ex-tabs button {
  flex: 0 0 auto; min-height: 40px; padding: 0 12px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px;
}
.ex-tabs button[aria-current="true"] { border-color: var(--gold); color: var(--gold); font-weight: 700; }
.ex-tabs button.done::before { content: "✓ "; color: var(--ok); }

.technique {
  height: 150px; border-radius: var(--radius); background: var(--card-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; color: var(--muted); text-decoration: none;
}
.technique .play {
  width: 52px; height: 52px; border-radius: 26px; background: var(--gold);
  display: flex; align-items: center; justify-content: center;
}

.last-time {
  display: flex; justify-content: space-between; font-size: 13px;
  background: var(--card); border-radius: 12px; padding: 10px 14px;
}

.ex-note { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }

.sets { display: flex; flex-direction: column; gap: 6px; }
.set-row {
  display: grid; grid-template-columns: 36px 1.3fr 1fr 0.8fr 0.8fr; gap: 6px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
}
.set-row.head { background: none; border: none; font-size: 11px; color: var(--muted); padding: 0 6px; }
.set-row.top { border-color: var(--gold); background: var(--gold-bg); }
.set-row.done { background: var(--ok-bg); border-color: transparent; }
.set-row .target { font-size: 13px; }
.set-row .target small { display: block; font-size: 11px; color: var(--muted); }
.set-row input {
  width: 100%; min-width: 0; height: 40px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--bg); text-align: center; font-size: 15px;
}
.set-row input:focus { outline: 2px solid var(--gold); outline-offset: 0; }
.check {
  width: 36px; height: 40px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--muted); font-weight: 700;
}
.set-row.done .check { background: var(--ok); color: var(--bg); border-color: var(--ok); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn {
  min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  font-size: 14px;
}
.btn.outline { border-color: var(--gold); color: var(--gold); background: transparent; font-weight: 600; }
.btn.primary { border: none; background: var(--gold); color: var(--bg); font-weight: 700; font-size: 16px; }
.btn.timer-on { border-color: var(--gold); color: var(--gold); font-weight: 700; }

.footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
