/* nauka.css — trening: ekran „Trening” (bohater z celem dnia, poziomy, zakładki, kafle motywów, debiuty,
   końcówki), ekran zadania od trenera, karta wyniku od dołu, plakietka „Trener patrzy” i podgląd dla
   trenera (?podglad=1). Te same żetony motywu co reszta gry (mosiądz na orzechu / na pergaminie),
   jedno światło z góry, cel dotyku ≥ 44 px, ruch tylko transform/opacity. */

/* ——— ekran „Trening” ——— */
.tr {
  position: fixed; inset: 0; z-index: 6; display: flex; flex-direction: column; color: var(--text);
  padding: var(--safe-top, 0px) var(--safe-right, 0px) 0 var(--safe-left, 0px);
  background:
    radial-gradient(120% 60% at 50% -12%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 62%),
    color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.05); backdrop-filter: blur(16px) saturate(1.05);
}
body:not([data-booted]) .tr, body:not([data-booted]) .tz { visibility: hidden; }
.tr-head {
  flex: none; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; max-width: 1128px; margin: 0 auto; padding: 10px 14px 8px;
}
.tr-h { min-width: 0; }
.tr-h h1 {
  margin: 0; font-family: var(--serif); font-size: clamp(27px, 7vw, 36px); font-weight: 700; line-height: 1.02; padding-right: 3px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tr-h p { margin: 4px 0 0; font-size: 12.5px; font-weight: 800; color: var(--text-3); letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-badges { display: flex; gap: 6px; }
.tr-badge {
  display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 14px 0 11px; border-radius: 999px;
  background: linear-gradient(180deg, var(--card-3), var(--card-2)); border: 1px solid var(--edge); box-shadow: var(--lift-s);
  font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.tr-badge .ic { width: 20px; height: 20px; color: #f08a2c; filter: drop-shadow(0 1px 2px rgba(240, 120, 30, .35)); }
.tr-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  padding: 2px 14px calc(var(--safe-bottom, 0px) + 28px);
}
.tr-scroll > * { max-width: 1100px; margin-left: auto; margin-right: auto; }

/* bohater: cel dnia, ranking, duży przycisk */
.tr-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ring tx" "go go"; align-items: center; gap: 14px 16px;
  padding: 16px; border-radius: 20px; position: relative; overflow: hidden;
  background: linear-gradient(155deg, var(--card-3), var(--card-2) 45%, var(--card)); border: 1px solid var(--edge-strong); box-shadow: var(--lift);
}
.tr-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(90% 120% at 0% 0%, color-mix(in srgb, var(--gold-2) 16%, transparent), transparent 55%); }
.tr-ring { grid-area: ring; position: relative; width: 84px; height: 84px; display: flex; align-items: baseline; justify-content: center; padding-top: 25px; }
.tr-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tr-ring circle { fill: none; stroke-width: 7; }
.tr-ring .bg { stroke: var(--track); }
.tr-ring .fg { stroke: var(--gold); stroke-linecap: round; }
.tr-ring .fg.zero, .tz-ring .fg.zero { opacity: 0; }
.tr-ring b { position: relative; font-size: 27px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.tr-ring small { position: relative; font-size: 13px; font-weight: 800; color: var(--text-3); }
.tr-hero-tx { grid-area: tx; display: grid; gap: 3px; min-width: 0; position: relative; }
.tr-hero-tx small { font-size: 11.5px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.tr-hero-tx b {
  font-size: clamp(34px, 9vw, 44px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 60%, var(--gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tr-hero-tx span { font-size: 13px; font-weight: 700; color: var(--text-2); line-height: 1.3; }
.tr-go { grid-area: go; width: 100%; max-width: none; min-height: 56px; font-size: 17px; position: relative; }
.tr-go span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* talia „Twoje błędy” */
.tr-bledy { width: 100%; margin-top: 12px; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 66px; padding: 10px 14px; text-align: left; cursor: pointer;
  border-radius: var(--r-l); border: 1px solid color-mix(in srgb, var(--red) 45%, var(--edge)); background: linear-gradient(160deg, color-mix(in srgb, var(--red) 14%, var(--card-2)), var(--card)); box-shadow: var(--lift-s); }
.tr-bledy.pusto { opacity: .6; cursor: default; border-color: var(--edge); background: var(--card-2); }
.tr-bledy-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, #e8a08f, #c2503b); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 3px 8px rgba(0, 0, 0, .25); }
.tr-bledy.pusto .tr-bledy-ic { background: linear-gradient(180deg, #c9f0d3, var(--good)); color: #0f3d1f; }
.tr-bledy-n { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 999px; display: grid; place-items: center; font-size: 19px; font-weight: 900; color: #fff; background: #c2503b; }

/* poziom zadań */
.tr-bandbox { margin-top: 16px; display: grid; gap: 8px; justify-items: start; }
.tr-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; }
.tr-bchip {
  min-height: 54px; padding: 6px 4px; border-radius: var(--r-m); cursor: pointer; display: grid; place-content: center; gap: 2px; text-align: center;
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--edge); box-shadow: var(--lift-s);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast);
}
.tr-bchip b { font-size: 15.5px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-bchip small { font-size: 11.5px; font-weight: 800; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-bchip:active { transform: scale(.96); }
.tr-bchip.on {
  color: var(--gold-ink); border-color: transparent;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 60%, var(--gold-3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 0 rgba(0, 0, 0, .18), 0 6px 16px color-mix(in srgb, var(--gold) 38%, transparent);
}
.tr-bchip.on small { color: color-mix(in srgb, var(--gold-ink) 72%, transparent); }

/* zakładki (przyklejone u góry przewijania) */
.tr-tabs {
  position: sticky; top: -2px; z-index: 3; margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px;
  border-radius: 17px; background: color-mix(in srgb, var(--card) 94%, transparent); border: 1px solid var(--edge); box-shadow: var(--lift-s);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.tr-tab {
  min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 6px; border-radius: 13px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); font-size: 15px; font-weight: 800; cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.tr-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-tab .ic { width: 20px; height: 20px; color: var(--gold); flex: none; }
.tr-tab.on { background: linear-gradient(180deg, var(--card-3), var(--card-2)); color: var(--text); border-color: var(--edge-strong); box-shadow: var(--lift-s); }

/* grupy i kafle motywów */
.tr-panel { min-height: 40vh; }
.tr-group { margin-top: 18px; }
.tr-group .section, .tr-panel > .section { width: 100%; margin: 4px 0 10px; }
.tr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tr-tile {
  position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 70px; padding: 10px 10px 14px;
  text-align: left; cursor: pointer; overflow: hidden; border-radius: var(--r-m);
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--edge); box-shadow: var(--lift-s);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast);
}
.tr-tile:hover { border-color: var(--edge-strong); }
.tr-tile:active { transform: scale(.97); }
.tr-ic {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--gold-ink);
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 60%, var(--gold-3)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 3px 8px rgba(0, 0, 0, .25);
}
.tr-ic .ic { width: 23px; height: 23px; }
.tr-ic.sm { width: 38px; height: 38px; }
.tr-ic.sm .ic { width: 20px; height: 20px; }
.tr-num { font-family: var(--serif); font-size: 21px; font-weight: 700; line-height: 1; }
.tr-tt { display: grid; gap: 3px; min-width: 0; }
.tr-tt b { font-size: 14.5px; font-weight: 800; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.tr-tile.empty { opacity: .48; cursor: default; box-shadow: none; }
.tr-tile.empty:active { transform: none; }
.tr-tt small { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; font-size: 12px; font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tr-tt .sep { width: 6px; }
.ic.mini { width: 13px; height: 13px; color: var(--gold); flex: none; }
.tr-pr { position: absolute; left: 10px; right: 10px; bottom: 6px; height: 3px; border-radius: 3px; background: var(--track); overflow: hidden; }
.tr-pr i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); }
.tr-tile.loading { pointer-events: none; }
.tr-tile.loading::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 230, 180, .22) 50%, transparent 80%);
  animation: trShine .9s linear infinite;
}
@keyframes trShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.tr-wait { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.tr-wait .skeleton { height: 70px; border-radius: var(--r-m); }
.tr-error { display: grid; justify-items: center; gap: 12px; margin-top: 24px; text-align: center; }
.tr-error p, .tr-empty { margin: 0; color: var(--text-2); font-size: 15px; font-weight: 700; text-align: center; padding: 12px; }

.tr-credit { margin: 26px auto 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--text-3); }

/* debiuty */
.tr-search {
  display: flex; align-items: center; gap: 8px; height: 52px; margin-top: 14px; padding: 0 6px 0 14px; border-radius: var(--r-m); cursor: text;
  background: var(--card-2); border: 1px solid var(--edge-strong); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .14);
}
.tr-search:focus-within { border-color: var(--gold); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .14), 0 0 0 3px color-mix(in srgb, var(--gold) 28%, transparent); }
.tr-search > .ic { color: var(--gold); flex: none; }
.tr-search input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: transparent; color: var(--text);
  font: inherit; font-size: 16px; font-weight: 700; -webkit-appearance: none; appearance: none; -webkit-user-select: text; user-select: text;
}
.tr-search input::placeholder { color: var(--text-3); }
.tr-search input::-webkit-search-cancel-button, .tr-search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.tr-clear { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--card-3); color: var(--text-2); cursor: pointer; }
.tr-clear .ic { width: 18px; height: 18px; }
.tr-results .section { width: 100%; margin: 18px 0 2px; }
.tr-list { display: grid; gap: 6px; margin-top: 10px; }
.tr-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 60px; padding: 8px 12px; text-align: left; cursor: pointer;
  border-radius: var(--r-m); background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--edge); box-shadow: var(--lift-s);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast);
}
.tr-row:hover { border-color: var(--edge-strong); }
.tr-row:active { transform: scale(.985); }
.tr-row .mode-go .ic { width: 18px; height: 18px; }
.tr-row.tr-var { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.eco { font-size: 12px; font-weight: 900; padding: 5px 7px; border-radius: 8px; background: var(--card-3); border: 1px solid var(--edge); color: var(--gold); font-variant-numeric: tabular-nums; }
.tr-san { display: block !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px !important; color: var(--text-2); }
.tr-san .no { color: var(--text-3); font-weight: 800; margin-right: 1px; }
.tr-san .san { display: inline-flex; vertical-align: -2px; }
.tr-san .ic.fig { width: 14px; height: 14px; }
.tr-len { font-size: 12px; font-weight: 800; color: var(--text-3); white-space: nowrap; }
.tr-mark { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 900; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tr-mark.done, .tr-mark.done .ic { color: var(--good); }
.tr-row .tr-mark.done .ic { width: 22px; height: 22px; }
.tr-fam { margin-top: 12px; display: grid; gap: 12px; }
.tr-crumb {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 10px; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--edge); background: var(--card-2); font-size: 14px; font-weight: 800; color: var(--text-2); box-shadow: var(--lift-s);
}
.tr-crumb .ic { width: 18px; height: 18px; color: var(--gold); }
.tr-fam-title { margin: 0; font-family: var(--serif); font-size: clamp(25px, 6.6vw, 34px); line-height: 1.1; text-wrap: balance; }
.tr-fam-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tr-color { align-items: center; flex-wrap: nowrap; }
.tr-color .field-label { margin-right: 4px; }
.tr-color .seg { display: inline-flex; align-items: center; }
.seg .dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; margin-right: 7px; flex: none; }
.seg .dot.w { background: linear-gradient(180deg, #fffbf1, #cdb88f); box-shadow: 0 0 0 1px rgba(60, 40, 20, .35); }
.seg .dot.b { background: linear-gradient(180deg, #5b4a3f, #110d0a); box-shadow: 0 0 0 1px rgba(255, 240, 210, .25); }
.tr-fampz { min-width: 0; }
.tr-fam-note { text-align: left; max-width: none; }
.tr-more { margin: 14px auto 0; display: flex; }

/* końcówki */
.tr-grid.eg .tr-tile { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; min-height: 140px; padding: 12px 12px 12px; }
.tr-tile.eg.done { border-color: color-mix(in srgb, var(--good) 55%, var(--edge)); }
.eg-figs { display: flex; align-items: center; height: 32px; }
.eg-figs .ic.fig { width: 28px; height: 28px; margin-right: -3px; }
.eg-figs .fig.w { color: #fbf3e0; filter: drop-shadow(.7px 0 0 #6b4a22) drop-shadow(-.7px 0 0 #6b4a22) drop-shadow(0 .7px 0 #6b4a22) drop-shadow(0 -.7px 0 #6b4a22); }
.eg-figs .fig.b { color: #241c17; filter: drop-shadow(0 1px 0 rgba(255, 240, 210, .4)); }
body[data-theme="dark"] .eg-figs .fig.b { filter: drop-shadow(.6px 0 0 rgba(240, 220, 180, .55)) drop-shadow(-.6px 0 0 rgba(240, 220, 180, .55)) drop-shadow(0 -.6px 0 rgba(240, 220, 180, .55)); }
.eg-figs .vs { font-style: normal; font-size: 10.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 8px 0 9px; }
.tr-tile.eg .tr-tt b { font-size: 15.5px; }
.eg-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.eg-stars { display: inline-flex; gap: 1px; }
.eg-stars .ic { width: 15px; height: 15px; }
.eg-stars .ic.on { color: var(--gold); }
.eg-stars .ic.off { color: var(--track); }

@media (min-width: 560px) { .tr-grid, .tr-wait { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) {
  .tr-hero { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ring tx go"; }
  .tr-go { width: auto; min-width: 270px; max-width: 360px; }
  .tr-band { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 900px) { .tr-grid, .tr-wait { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tr-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .tr-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* telefon w poziomie: niski ekran — nagłówek i bohater ciaśniej, więcej miejsca na kafle */
@media (max-height: 520px) {
  .tr-head { padding: 6px 14px 4px; }
  .tr-h h1 { font-size: 26px; }
  .tr-hero { padding: 10px 14px; gap: 10px 14px; }
  .tr-ring { width: 64px; height: 64px; padding-top: 17px; }
  .tr-ring b { font-size: 22px; }
  .tr-hero-tx b { font-size: 30px; }
  .tr-go { min-height: 50px; }
  .tr-bandbox { margin-top: 10px; }
  .tr-bchip { min-height: 46px; }
  .tr-tabs { margin-top: 10px; }
}
@media (max-width: 560px) {
  .tr-tab { flex-direction: column; gap: 1px; min-height: 52px; font-size: 12.5px; padding: 4px 2px; }
  .tr-tab .ic { width: 19px; height: 19px; }
}
@media (max-width: 440px) {
  .tr-tile { grid-template-columns: 38px minmax(0, 1fr); gap: 9px; padding: 9px 9px 13px; }
  .tr-ic { width: 38px; height: 38px; }
  .tr-tt b { font-size: 14px; }
  .tr-bchip small { font-size: 11px; }
}
@media (max-width: 370px) {
  .tr-tile { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; padding: 9px 8px 13px; }
  .tr-ic { width: 36px; height: 36px; }
  .tr-ic .ic { width: 20px; height: 20px; }
  .tr-tt b { font-size: 13.5px; }
  .tr-row { gap: 8px; padding: 8px 10px; }
}

/* ——— ekran zadania od trenera ——— */
.tz {
  position: fixed; inset: 0; z-index: 7; display: grid; place-items: center; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(var(--safe-top, 0px) + 16px) calc(var(--safe-right, 0px) + 14px) calc(var(--safe-bottom, 0px) + 16px) calc(var(--safe-left, 0px) + 14px);
  background:
    radial-gradient(100% 55% at 50% 0%, color-mix(in srgb, var(--gold) 24%, transparent), transparent 65%),
    color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.tz-card {
  width: min(100%, 470px); display: grid; justify-items: center; gap: 14px; text-align: center; padding: clamp(20px, 5.5vw, 30px);
  border-radius: 24px; background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--edge-strong); box-shadow: var(--lift);
  position: relative; overflow: hidden;
}
.tz-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--gold-3), var(--gold-2), var(--gold-3)); }
.tz-kicker {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-2), var(--gold) 60%, var(--gold-3)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 4px 10px rgba(0, 0, 0, .25);
}
.tz-kicker .ic { width: 19px; height: 19px; }
.tz-title { margin: 0; font-family: var(--serif); font-size: clamp(27px, 7.4vw, 38px); font-weight: 700; line-height: 1.08; text-wrap: balance; }
.tz-from { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px; font-size: 15px; font-weight: 800; color: var(--text-2); }
.tz-from > span:not(.tz-ava):not(.tz-due) { margin-left: -4px; }
.tz-ava { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.tz-due { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card-3); border: 1px solid var(--edge); font-size: 13.5px; }
.tz-due.soon { color: #e39a2d; border-color: rgba(227, 154, 45, .5); }
.tz-due.late { color: var(--red); border-color: color-mix(in srgb, var(--red) 50%, transparent); }
.tz-what { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 6px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--card-3); border: 1px solid var(--edge); color: var(--text-2); }
.tz-ring { position: relative; width: 140px; height: 140px; display: grid; place-items: center; }
.tz-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tz-ring circle { fill: none; stroke-width: 9; }
.tz-ring .bg { stroke: var(--track); }
.tz-ring .fg { stroke: var(--gold); stroke-linecap: round; }
.tz-ring b { position: relative; font-size: 44px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.tz-ring b small { font-size: 20px; color: var(--text-3); font-weight: 800; }
.tz-card.done .tz-ring .fg { stroke: var(--good); }
.tz-stats { display: flex; gap: 10px; }
.tz-stats span { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 999px; font-weight: 900; font-size: 16px; background: var(--card-3); border: 1px solid var(--edge); font-variant-numeric: tabular-nums; }
.tz-stats .ok .ic { color: var(--good); width: 16px; height: 16px; }
.tz-stats .bad .ic { color: var(--red); width: 16px; height: 16px; }
.tz-acts { display: grid; gap: 8px; width: min(100%, 330px); }
.tz-acts .btn { width: 100%; max-width: none; }
.tz-go { min-height: 58px; font-size: 18px; }
.tz-go:disabled { filter: saturate(.4) brightness(.9); cursor: default; }
.tz-note { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--text-3); }
@media (max-height: 560px) and (min-width: 600px) {
  .tz-card { width: min(100%, 780px); grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "kick kick" "ring title" "ring from" "ring what" "stats acts" "note note"; justify-items: start; text-align: left; gap: 10px 22px; padding: 18px 24px; }
  .tz-kicker { grid-area: kick; }
  .tz-title { grid-area: title; }
  .tz-from { grid-area: from; justify-content: flex-start; }
  .tz-what { grid-area: what; justify-content: flex-start; }
  .tz-ring { grid-area: ring; width: 120px; height: 120px; align-self: center; }
  .tz-stats { grid-area: stats; justify-self: center; }
  .tz-acts { grid-area: acts; grid-template-columns: 1fr 1fr; width: 100%; }
  .tz-note { grid-area: note; }
  .tz-card .dlg-tip { grid-column: 1 / -1; }
}

/* ——— karta wyniku od dołu (łamigłówka, linia, końcówka, element zadania) ——— */
.sheet {
  position: fixed; z-index: 12; left: var(--bar-bottom-x); width: var(--bar-bottom-w); bottom: 0; min-height: calc(100% - var(--bar-bottom-y));
  padding-bottom: calc(var(--safe-bottom, 0px) + 8px); display: flex; align-items: flex-end; pointer-events: none;
}
.sheet-in {
  pointer-events: auto; width: 100%; display: grid; gap: 9px; padding: 12px; border-radius: 20px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--card-2) 97%, transparent), var(--card)); border: 1px solid var(--edge-strong); box-shadow: var(--lift), 0 -6px 24px rgba(0, 0, 0, .25);
}
.sheet-in::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--gold-2), transparent); }
.sheet-in.ok::before { background: linear-gradient(90deg, transparent, var(--good), transparent); }
.sheet-in.bad::before { background: linear-gradient(90deg, transparent, var(--red), transparent); }
.sheet.in .sheet-in { animation: sheetIn 340ms var(--ease) both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(26px) scale(.98); } }
.sheet-head { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.sheet-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--card-3); color: var(--gold); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 3px 8px rgba(0, 0, 0, .25); }
.sheet-ic .ic { width: 24px; height: 24px; stroke-width: 2.6; }
.sheet-in.ok .sheet-ic { color: #0f3d1f; background: linear-gradient(180deg, #d5f5dd, var(--good)); }
.sheet-in.bad .sheet-ic { color: #fff; background: linear-gradient(180deg, #e8a08f, #c2503b); }
.sheet-tx { display: grid; gap: 1px; min-width: 0; }
.sheet-title { font-family: var(--serif); font-size: 21px; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-sub { font-size: 13px; font-weight: 700; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-score { font-size: 25px; font-weight: 900; font-variant-numeric: tabular-nums; padding: 0 2px; }
.sheet-score.up { color: var(--good); }
.sheet-score.down { color: var(--red); }
.sheet-text { margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.42; color: var(--text); text-wrap: pretty; }
.sheet.lesson .sheet-ic { color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-2), var(--gold) 60%, var(--gold-3)); }
.sheet-chips { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.sheet-chips::-webkit-scrollbar { display: none; }
.sheet-chips .chip { flex: none; font-size: 12.5px; padding: 5px 10px; color: var(--text); }
.sheet-chips .chip.gold { color: var(--gold-ink); border-color: transparent; background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.sheet-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; font-weight: 700; color: var(--text-3); padding: 0 2px; }
.sheet-stats .st { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.sheet-stats b { font-size: 15px; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; }
.sheet-acts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 8px; }
.sheet-acts .btn { width: 100%; min-width: 0; max-width: none; min-height: 52px; font-size: 15px; padding: 8px 10px; }
.sheet-acts .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.sheet-acts .btn.primary { font-size: 17px; }
.sheet-acts.n1 .btn { grid-column: 1 / -1; }
.sheet-acts.n2 .btn.ghost { order: 1; }
.sheet-acts.n2 .btn.primary { order: 2; }
.sheet-acts.n3 { grid-template-columns: 1fr 1fr; }
.sheet-acts.n3 .btn.primary { grid-column: 1 / -1; min-height: 54px; }
@media (max-height: 700px) { .sheet-in { gap: 7px; padding: 10px; } .sheet-acts .btn { min-height: 48px; } .sheet-title { font-size: 19px; } }
body[data-sheet] #tools, body[data-sheet] #barBottom { visibility: hidden; }
body[data-layout="side"] .sheet {
  left: var(--bar-top-x); width: var(--bar-top-w); top: auto; bottom: auto; min-height: 0; padding: 0;
  top: calc(var(--bar-bottom-y) + var(--bar-bottom-h)); transform: translateY(-100%);
}
body[data-layout="side"][data-sheet] .move-list { visibility: hidden; }

/* ——— trener patrzy / mówi ——— */
.coach-badge {
  position: fixed; z-index: 16; top: calc(var(--safe-top, 0px) + 8px); right: calc(var(--safe-right, 0px) + 10px); pointer-events: none;
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap;
  background: color-mix(in srgb, var(--card) 90%, transparent); border: 1px solid var(--edge-strong); box-shadow: var(--lift-s); color: var(--text);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: recordIn 400ms var(--ease) both;
}
.coach-badge .ic { width: 16px; height: 16px; color: var(--gold); }
.coach-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #e2402f; animation: livePulse 1.6s ease-in-out infinite; }
.coach-badge.talk .dot { background: #3fbf6a; }
.coach-badge .cb-n { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; }
.coach-badge .cb-l + .cb-n::before { content: "· "; }
@media (max-width: 599px) {
  body[data-screen="play"] .coach-badge.named { gap: 5px; padding: 0 11px 0 9px; }
  body[data-screen="play"] .coach-badge.named .cb-l { display: none; }
  body[data-screen="play"] .coach-badge.named .cb-n::before { content: none; }
}
/* W partii plakietka siedzi w pasku rywala, po prawej (na miejscu zbitych figur), nie nad planszą i nie na stanie gracza. */
body[data-screen="play"] .coach-badge { top: calc(var(--bar-top-y) + (var(--bar-top-h) - 30px) / 2); right: auto; left: calc(var(--bar-top-x) + var(--bar-top-w) - 10px); transform: translateX(-100%); }
body[data-sheet] .coach-badge { visibility: hidden; }
@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }

/* ——— podgląd dla trenera ——— */
body[data-screen="podglad"] #menu, body[data-screen="podglad"] .bar, body[data-screen="podglad"] #tools, body[data-screen="podglad"] .move-list { display: none !important; }
body[data-screen="podglad"] #table { cursor: default; }
.tv-label {
  position: fixed; z-index: 5; left: var(--tv-x); width: var(--tv-w); top: max(calc(var(--safe-top, 0px) + 6px), var(--tv-top)); height: 44px;
  display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 14px; color: #f6ecd8; overflow: hidden;
  background: linear-gradient(180deg, rgba(30, 18, 9, .94), rgba(16, 10, 5, .94)); border: 1px solid rgba(214, 170, 82, .6);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 230, 190, .14);
}
.tv-label::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, #d6aa52, transparent); }
.tv-live { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #e2402f; box-shadow: 0 0 10px rgba(226, 64, 47, .85); animation: livePulse 1.6s ease-in-out infinite; }
.tv-live-tx { flex: none; font-size: 12px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; color: #ff8d7a; }
.tv-tx {
  flex: 1; min-width: 0; font-size: 16px; font-weight: 900; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(180deg, #fbe6ad, #d6aa52 70%); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ——— zakładka „Repertuar”: debiuty białymi i czarnymi (repertuar.js) ——— */
.rp-intro { margin: 14px 0 0; }
.rp-group { margin-top: 14px; }
.rp-dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; flex: none; }
.rp-dot.w { background: linear-gradient(180deg, #fffbf1, #cdb88f); box-shadow: 0 0 0 1px rgba(60, 40, 20, .38); }
.rp-dot.b { background: linear-gradient(180deg, #5b4a3f, #110d0a); box-shadow: 0 0 0 1px rgba(255, 240, 210, .3); }
.rp-sub { margin: 12px 2px 8px; font-size: 13px; font-weight: 900; color: var(--text-2); letter-spacing: .03em; }
.rp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.tr-tile.rp-tile { grid-template-columns: 48px minmax(0, 1fr) auto; min-height: 66px; padding: 9px 12px; gap: 12px; }
.tr-tile.rp-tile.done { border-color: color-mix(in srgb, var(--good) 55%, var(--edge)); }
.rp-key { width: 48px; height: 48px; border-radius: 30%; display: grid; place-items: center; font-weight: 900; font-size: 15px; }
.rp-key .ic.fig { width: 16px; height: 16px; }
.rp-key.w { color: #3b2a18; background: linear-gradient(155deg, #fffdf6, #efe3c6 55%, #cbb588); box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(120, 85, 35, .28), 0 0 0 1px rgba(90, 60, 25, .28), 0 3px 8px rgba(0, 0, 0, .25); }
.rp-key.b { color: #f3e7cc; background: linear-gradient(155deg, #5e4d42, #2b221d 55%, #0f0b08); box-shadow: inset 0 1px 0 rgba(255, 240, 220, .24), inset 0 -2px 0 rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 235, 200, .14), 0 3px 8px rgba(0, 0, 0, .3); }
.rp-zapis .no { color: var(--text-3); font-weight: 800; margin-right: 1px; }
.rp-zapis .san { display: inline-flex; vertical-align: -2px; }
.rp-zapis .ic.fig { width: 14px; height: 14px; }
.rp-tile .tr-san { margin-top: 1px; }
@media (min-width: 560px) { .rp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .rp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.rp-det { margin-top: 12px; display: grid; gap: 12px; }
.rp-hero { display: grid; gap: 14px; }
.rp-view { display: grid; gap: 8px; justify-items: center; align-content: start; }
.rp-board { display: block; width: min(100%, 400px); aspect-ratio: 1; height: auto; border-radius: 4px; box-shadow: var(--lift); }
.rp-nav { display: flex; align-items: center; gap: 6px; width: min(100%, 400px); }
.rp-nav .icon-btn { width: 46px; height: 46px; flex: none; }
.rp-nav .icon-btn:disabled { opacity: .38; cursor: default; box-shadow: none; }
.rp-nav .icon-btn:disabled:active { transform: none; }
.ic.rot { transform: rotate(-90deg); }
.ic.rot2 { transform: rotate(90deg); }
.rp-pos { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 3px; font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.rp-pos .no { color: var(--text-3); font-weight: 800; }
.rp-info { display: grid; gap: 10px; align-content: start; }
.rp-info .tr-fam-title { margin: 0; }
.rp-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rp-tags .chip { gap: 6px; }
.rp-tags .chip.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--edge)); }
.rp-h { margin: 2px 0 -4px; font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.rp-plan { margin: 0; font-size: 15px; line-height: 1.52; color: var(--text); text-wrap: pretty; }
.rp-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.rp-acts .btn { flex: 1 1 210px; min-width: 0; max-width: none; }
.rp-acts .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.rp-det > .section { width: 100%; margin: 6px 0 -2px; }
.rp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 1px; }
.rp-line > .no { margin-left: 6px; font-size: 13px; font-weight: 800; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rp-line > .no:first-child { margin-left: 0; }
.rp-mv { min-height: 38px; padding: 0 8px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; font-size: 15px; font-weight: 800; transition: background var(--t-fast); }
.rp-mv .san { vertical-align: middle; }
.rp-mv.later { color: var(--text-3); }
.rp-mv.off { border-style: dashed; border-color: var(--edge-strong); }
.rp-mv.on { color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); }
@media (hover: hover) { .rp-mv:not(.on):hover, .rp-row:hover { background: var(--track); } }
.rp-toline { min-height: 42px; min-width: 0; margin-left: 6px; font-size: 14px; }

.rp-best { display: grid; gap: 6px; }
.rp-best .section { width: 100%; margin: 8px 0 2px; }
.rp-best-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; font-size: 13.5px; font-weight: 800; color: var(--text-2); }
.rp-after .rp-zapis { color: var(--text); }
.rp-legend { display: inline-flex; flex-wrap: wrap; gap: 10px; font-size: 12px; font-weight: 800; color: var(--text-3); }
.rp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rp-legend i { width: 12px; height: 12px; border-radius: 3px; }
.rp-cols, .rp-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 76px; align-items: center; gap: 10px; }
.rp-cols { padding: 0 10px; font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.rp-cols span:last-child { text-align: right; }
.rp-row { min-height: 46px; padding: 4px 10px; border-radius: 12px; border: 1px solid var(--edge); background: linear-gradient(180deg, var(--card-2), var(--card)); color: var(--text); cursor: pointer; text-align: left; transition: transform var(--t-fast) var(--ease), background var(--t-fast); }
.rp-row:active { transform: scale(.985); }
.rp-row.nxt { border-color: color-mix(in srgb, var(--gold) 60%, transparent); box-shadow: inset 3px 0 0 var(--gold); }
.rp-san { display: inline-flex; align-items: center; gap: 4px; font-size: 15.5px; font-weight: 900; white-space: nowrap; }
.rp-san .ic.mini { width: 12px; height: 12px; }
.rp-bar { display: flex; height: 24px; border-radius: 7px; overflow: hidden; font-size: 11.5px; font-weight: 900; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.rp-bar i { display: grid; place-items: center; font-style: normal; white-space: nowrap; overflow: hidden; min-width: 0; }
.rp-bar .w, .rp-legend .w { background: linear-gradient(180deg, #fffaf0, #e9dcc0); color: #3b2a18; }
.rp-bar .d, .rp-legend .d { background: linear-gradient(180deg, #a59a8a, #847a6c); color: #fff; }
.rp-bar .b, .rp-legend .b { background: linear-gradient(180deg, #3a2f28, #17110d); color: #f3e7cc; }
.rp-n { text-align: right; font-size: 13px; font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-best.wait { gap: 6px; margin-top: 8px; }
.rp-best.wait .skeleton { height: 46px; border-radius: 12px; }
.rp-best .tr-credit { margin-top: 8px; }
@media (min-width: 760px) {
  .rp-hero { grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); align-items: start; gap: 22px; }
  .rp-plan { font-size: 15.5px; }
}
@media (max-width: 400px) {
  .rp-cols, .rp-row { grid-template-columns: 62px minmax(0, 1fr) 66px; gap: 8px; }
  .rp-row { padding: 4px 8px; }
  .rp-n { font-size: 12px; }
}
