/* Junkbox.tools — Military Workout styles (shared by RU + EN pages) */
:root {
  --bg: #101210; --surface: #181b17; --surface-2: #20241f; --border: #2a2f28; --border-2: #3a4137;
  --text: #eef0e8; --dim: #959b8d;
  --accent: #a8bf5a; --on-accent: #10120f; --ink: #b9cf6a;
  --soft: rgba(168, 191, 90, .12);
  --warn: #e0a43a; --bad: #e0614a; --ok: #8fc35b;
  --shadow: none;
  --ui: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f3ec; --surface: #ffffff; --surface-2: #efefe6; --border: #e3e3d8; --border-2: #d0d0c2;
    --text: #151812; --dim: #686c5f;
    --accent: #4f5f22; --on-accent: #ffffff; --ink: #4f5f22;
    --soft: rgba(79, 95, 34, .10);
    --warn: #a86a08; --bad: #b7381f; --ok: #3f7d1c;
    --shadow: 0 6px 20px rgba(21, 24, 18, .06);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f3f3ec; --surface: #ffffff; --surface-2: #efefe6; --border: #e3e3d8; --border-2: #d0d0c2;
  --text: #151812; --dim: #686c5f;
  --accent: #4f5f22; --on-accent: #ffffff; --ink: #4f5f22;
  --soft: rgba(79, 95, 34, .10);
  --warn: #a86a08; --bad: #b7381f; --ok: #3f7d1c;
  --shadow: 0 6px 20px rgba(21, 24, 18, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--ui); min-height: 100vh; padding: 0 16px 40px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font-family: inherit; }
.wrap { max-width: 720px; margin: 0 auto; }

h1 { font-weight: 800; font-size: clamp(26px, 7vw, 34px); margin: 8px 0 6px; letter-spacing: -.02em; line-height: 1.08; }
.sub { color: var(--dim); font-size: 14px; margin-bottom: 18px; line-height: 1.5; }
h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 0 0 12px; }

.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 14px; }
.tabs button { height: 42px; border: none; border-radius: 12px; background: transparent; color: var(--dim); font-size: 14px; font-weight: 700; cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.pane { display: none; }
.pane.on { display: block; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--dim); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.field { margin-top: 16px; }
.field:first-child { margin-top: 0; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; margin-top: 16px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.seg button { height: 40px; border: none; border-radius: 10px; background: transparent; color: var(--dim); font-size: 14px; font-weight: 600; cursor: pointer; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }

.fmt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fmt button { text-align: left; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 14px; padding: 10px 12px; cursor: pointer; min-height: 62px; }
.fmt button b { display: block; font-size: 14px; margin-bottom: 2px; }
.fmt button span { display: block; font-size: 12px; color: var(--dim); line-height: 1.3; }
.fmt button.on { border-color: var(--accent); background: var(--soft); box-shadow: inset 0 0 0 1px var(--accent); }

input[type=number], input[type=text], select {
  width: 100%; height: 48px; border: 1px solid var(--border); border-radius: 14px; padding: 0 12px;
  background: var(--surface-2); color: var(--text); font-size: 16px;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 54px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 10px; transition: transform .08s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); margin-top: 18px; }
.btn-sm { height: 40px; font-size: 14px; border-radius: 12px; width: auto; padding: 0 14px; margin: 0; }
.link { background: none; border: none; color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0; }

.today { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--soft); color: var(--text); font-size: 14px; line-height: 1.4; margin-bottom: 14px; }
.today b { color: var(--ink); }

/* plan output */
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.plan-head h3 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.plan-meta { color: var(--dim); font-size: 13px; margin-bottom: 14px; line-height: 1.5; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.stat b { display: block; font-size: 20px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--dim); }
.block { margin-top: 16px; }
.block-t { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin-bottom: 8px; }
.block-t span { color: var(--dim); font-weight: 600; text-transform: none; letter-spacing: 0; }
.ex { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.ex:first-of-type { border-top: none; }
.ex .n { flex: 0 0 28px; height: 28px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--dim); }
.ex .t { flex: 1; min-width: 0; }
.ex .t b { display: block; font-size: 15px; font-weight: 650; }
.ex .t span { display: block; font-size: 12.5px; color: var(--dim); line-height: 1.4; margin-top: 2px; }
.ex .d { flex: 0 0 auto; font-weight: 800; font-size: 14px; background: var(--soft); color: var(--ink); padding: 6px 10px; border-radius: 10px; white-space: nowrap; }
.ex .sw { flex: 0 0 auto; border: 1px solid var(--border); background: transparent; color: var(--dim); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.note { font-size: 13px; color: var(--dim); line-height: 1.5; margin-top: 8px; }
.ladder { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ladder span { font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 8px; background: var(--surface-2); color: var(--dim); }

/* 8-week program grid */
.prog { display: grid; grid-template-columns: 54px repeat(3, minmax(0, 1fr)); gap: 6px; font-size: 12px; }
.prog .h { color: var(--dim); font-weight: 700; text-align: center; padding: 4px 0; }
.prog .w { color: var(--dim); font-weight: 700; display: flex; align-items: center; }
.prog button { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 10px; height: 40px; font-size: 12px; font-weight: 600; cursor: pointer; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog button.done { background: var(--soft); border-color: transparent; color: var(--ink); }
.prog button.done::before { content: '✓ '; }
.prog button.next { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.prog button.dl { opacity: .75; font-style: italic; }
.legend { font-size: 12px; color: var(--dim); margin-top: 10px; line-height: 1.5; }

/* test */
.tst { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.tst:first-of-type { border-top: none; padding-top: 0; }
.tst b { display: block; font-size: 15px; }
.tst span { display: block; font-size: 12px; color: var(--dim); line-height: 1.35; margin-top: 2px; }
.tst .go { margin-top: 6px; }
.res-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 10px; align-items: center; padding: 8px 0; font-size: 14px; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.res-row .p { text-align: right; font-weight: 800; }
.grade { text-align: center; padding: 16px; border-radius: 16px; background: var(--soft); margin-bottom: 10px; }
.grade b { display: block; font-size: 34px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.grade span { font-size: 14px; color: var(--dim); }

/* history */
.hist-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
.hist-item:first-of-type { border-top: none; }
.hist-item span { color: var(--dim); font-size: 13px; white-space: nowrap; }
.empty { color: var(--dim); font-size: 14px; text-align: center; padding: 8px 0; }

/* player (full screen) */
.player { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: none; flex-direction: column; padding: max(14px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); }
.player.on { display: flex; }
.pl-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; font-weight: 600; }
.pl-x { border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 40px; height: 40px; border-radius: 12px; font-size: 18px; cursor: pointer; }
.pl-prog { height: 4px; background: var(--surface-2); border-radius: 2px; margin: 12px 0 0; overflow: hidden; }
.pl-prog i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.pl-body { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px; min-height: 0; }
.pl-tag { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--ink); }
.pl-tag.rest { background: rgba(127, 127, 127, .14); color: var(--dim); }
.pl-name { font-size: clamp(26px, 8vw, 40px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; max-width: 560px; }
.pl-cue { font-size: 15px; color: var(--dim); line-height: 1.5; max-width: 460px; }
.pl-big { font-size: clamp(72px, 26vw, 140px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.pl-big small { font-size: .28em; font-weight: 700; color: var(--dim); letter-spacing: 0; margin-left: 6px; }
.pl-list { font-size: 18px; font-weight: 700; line-height: 1.7; }
.pl-next { font-size: 13px; color: var(--dim); }
.pl-next b { color: var(--text); font-weight: 650; }
.pl-btns { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 10px; }
.pl-btns .btn { margin: 0; height: 64px; }
.pl-btns .btn-primary { font-size: 18px; }
.pl-clock { font-variant-numeric: tabular-nums; }
.tap { width: min(70vw, 280px); aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--accent); background: var(--soft); color: var(--text); font-size: 64px; font-weight: 800; cursor: pointer; font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.tap:active { transform: scale(.97); }
.tap small { display: block; font-size: 13px; font-weight: 600; color: var(--dim); }
body.locked { overflow: hidden; }

@media (min-width: 600px) {
  .row2.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* exercise pictures */
.mw-media { position: relative; background: #fff; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; }
.mw-media .mw-f { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.mw-media .mw-f.on { opacity: 1; }
.mw-fig { background: var(--surface-2); color: var(--text); }
.mw-fig svg { position: absolute; inset: 3% 2%; width: 96%; height: 94%; }
.mw-fig svg g { transition: opacity .2s; }
.thumbw { position: relative; flex: 0 0 76px; width: 76px; }
.thumbw .mw-media { border-radius: 10px; }
.thumbw i { position: absolute; left: 4px; top: 4px; font-style: normal; font-size: 11px; font-weight: 800; background: rgba(0, 0, 0, .6); color: #fff; border-radius: 6px; padding: 1px 6px; }
.ex[data-id] { cursor: pointer; }
.ex.open { border-bottom: none; }
.ex-big { padding: 0 0 12px; }
.ex-big .mw-media { max-width: 420px; margin: 0 auto; }
.pl-body .mw-media.pl { width: min(100%, 440px); max-height: 34vh; aspect-ratio: 4 / 3; flex-shrink: 1; }
.pl-body .mw-media.peek { width: min(70%, 300px); opacity: .85; }
.pl-body.has-media { justify-content: flex-start; padding-top: 14px; }
.pl-body.has-media .pl-big { font-size: clamp(56px, 17vw, 96px); }
.pl-body.has-media .pl-name { font-size: clamp(22px, 6.5vw, 34px); }
.pl-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(100%, 460px); }
@media (max-height: 700px) { .pl-body .mw-media.pl { max-height: 28vh; } .pl-body .pl-cue { display: none; } }
