/* v1.17 Trening podstawowy i Szkoła Trików w jednej palecie gry: grafitowe karty, limonka (--acc) dla wyboru i przycisków,
   kolor grupy umiejętności (--gc: Atak, Rozgrywanie, Obrona, Bramka, Fizyczne) na zakładkach i kartach.
   (v1.15 miał bursztynowy motyw „złota jesień” z biało-czerwonym paskiem, gryzł się z resztą gry). */
.tr2, .tr2-cats, .tr2-hx, .tmodal {
  --t-amb: var(--acc, #c6ff00); --t-white: #f2f5f8; --t-red: #ff5d5d;
  --t-card: rgba(14, 16, 21, .86); --t-card2: rgba(22, 25, 32, .82); --t-line: rgba(255, 255, 255, .08);
}
.tr2 {
  display: flex; flex-direction: column; gap: 12px;
}
.tr2 .btn.primary { background: linear-gradient(180deg, #d8ff3d, #a8e000); color: #0b0d10; border-color: transparent; }
.tr2 .btn.primary:disabled { filter: grayscale(.6); opacity: .55; }
.tr2 .ib { background: rgba(255, 255, 255, .06); border: 1px solid var(--t-line); color: var(--text); border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; }

/* nagłówek Treningu: rozwijane „W toku” (kolejka) i „Premie treningowe” po prawej, kategorie przyklejone od spodu */
#view .vhead.vh79:has(+ .tr2-cats) { margin-bottom: 0; border-radius: 16px 16px 0 0; border-bottom: 0; overflow: visible; position: relative; z-index: 5; }
.tr2-hx { margin-left: auto; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.tr2-dd { position: relative; background: rgba(12, 14, 19, .86); border: 1px solid var(--t-line); border-radius: 12px; backdrop-filter: blur(6px); color: var(--text); }
.tr2-dd > summary, .tr2-dd > .tr2-sumr { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; list-style: none; position: relative; overflow: hidden; border-radius: 12px; }
.tr2-dd > .tr2-sumr { cursor: default; }
.tr2-dd > summary::-webkit-details-marker { display: none; }
.tr2-dd summary small, .tr2-dd .tr2-sumr small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .6px; color: var(--t-amb); }
.tr2-dd summary b, .tr2-dd .tr2-sumr b { color: var(--t-white); }
.tr2-dd[open] { border-color: rgba(198, 255, 0, .45); }
.tr2-dd .dd-ar { font-style: normal; color: var(--t-amb); transition: transform .15s; }
.tr2-dd[open] .dd-ar { transform: rotate(180deg); }
.tr2-run { min-width: 300px; }
.tr2-run .sk, .tr2-run .trico { width: 30px; height: 30px; }
.tr2-run .tst-time { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--t-amb); }
.tr2-run .pb { position: absolute; left: 0; right: 0; bottom: 0; }
.tr2-run.idle span { font-size: 22px; }
.tr2-bon summary small { color: var(--muted); }
.tr2-bon summary b { color: #4fe08a !important; }
.tr2-bon .bon-ico { font-size: 20px; }
.tr2-ddp { position: absolute; right: 0; top: calc(100% + 6px); min-width: 100%; width: max-content; max-width: min(420px, 90vw); z-index: 40; background: #12151b; border: 1px solid rgba(198, 255, 0, .3); border-radius: 12px; padding: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); display: flex; flex-direction: column; gap: 6px; }
.tr2-qi { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--t-line); border-radius: 9px; padding: 6px 9px; }
.tr2-qi b { display: block; font-size: 13px; color: var(--t-white); }
.tr2-qi small { color: var(--muted); font-size: 11px; }
.tr2-qr { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tr2-qr small { color: var(--t-amb); font-variant-numeric: tabular-nums; }
.tr2-qr .x { background: rgba(255, 93, 93, .12); border: 1px solid rgba(255, 93, 93, .4); color: #ff8b96; border-radius: 7px; width: 26px; height: 26px; cursor: pointer; }
.tr2-bonl { font-size: 13px; min-width: 240px; }
.tr2-bonl > div { display: flex; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--t-line); padding-top: 4px; }
.tr2-bonl > div:first-child { border-top: 0; padding-top: 0; }
.tr2-bonl b { color: #4fe08a; white-space: nowrap; }

/* kategorie */
.tr2-cats { display: flex; gap: 6px; background: var(--t-card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 16px 16px; padding: 6px 8px 8px; margin: 0 0 14px; overflow-x: auto; position: relative; }
.tr2-cats::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gc, var(--t-amb)) 20%, var(--gc, var(--t-amb)) 80%, transparent); opacity: .7; }
:where(.tr2-cats button) { --gc: var(--t-amb); }
.tr2-cats button { position: relative; cursor: pointer; flex: 1 1 0; min-width: 120px; display: flex; align-items: center; justify-content: center; gap: 6px; background: transparent; border: 1px solid transparent; color: var(--muted); border-radius: 9px; padding: 9px 10px; font-weight: 600; white-space: nowrap; }
.tr2-cats button .gico, .tr2-cats button .trico { width: 18px; height: 18px; }
.tr2-cats button:hover { color: var(--t-white); background: rgba(255, 255, 255, .04); }
.tr2-cats button.on { background: color-mix(in srgb, var(--gc) 14%, transparent); border-color: color-mix(in srgb, var(--gc) 55%, transparent); color: var(--t-white); box-shadow: inset 0 -2px 0 var(--gc); }
.tr2-cats button small { color: var(--muted); font-weight: 600; font-size: 11px; }
.tr2-cats button.on small { color: var(--gc); }
.tr2-cats .tf-ico { width: 26px; height: 26px; flex: none; display: inline-grid; place-items: center; font-size: 15px; line-height: 1; }
.tr2-cats .tf-ico img { width: 26px; height: 26px; }

/* układ: karty na całą szerokość (v1.15b bez planu trenera) */
.tr2-main { display: block; }

/* pasek nad kartami: suma kategorii, czas, energia, drinki */
.tr2-work { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tr2-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--t-card); border: 1px solid var(--t-line); border-radius: 12px; padding: 8px 10px; }
.tr2-sum { display: flex; align-items: center; gap: 8px; }
.tr2-sum .gico, .tr2-sum .trico { width: 30px; height: 30px; }
.tr2-sum small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .5px; }
.tr2-sum b { font-size: 20px; color: var(--t-white); font-variant-numeric: tabular-nums; }
.tr2-durs { display: flex; gap: 3px; margin-left: auto; flex-wrap: wrap; }
.tr2-durs button, .tr2-ints button { background: transparent; border: 1px solid transparent; color: var(--muted); border-radius: 7px; padding: 5px 9px; font-size: 13px; font-weight: 600; }
.tr2-durs button.long::after { content: ' 🌙'; font-size: 10px; }
.tr2-durs button:hover { color: var(--t-white); }
.tr2-durs button.on { background: var(--t-amb); color: #0b0d10; }
.tr2-ints { display: flex; gap: 2px; border-left: 1px solid var(--t-line); padding-left: 8px; }
.tr2-ints button { padding: 4px 6px; }
.tr2-ints button .trico { width: 20px; height: 20px; }
.tr2-ints button.on { border-color: var(--ic); background: color-mix(in srgb, var(--ic) 18%, transparent); }
.tr2-drink { border: 1px solid var(--t-amb) !important; background: transparent !important; color: var(--t-white) !important; }
.tr2-drink.on { background: rgba(198, 255, 0, .14) !important; }

/* karty umiejętności */
.tc2s { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
:where(.tc2) { --gc: var(--t-amb); }
.tc2 { background: linear-gradient(180deg, color-mix(in srgb, var(--gc) 9%, transparent), transparent 45%), var(--t-card); border: 1px solid var(--t-line); border-top: 3px solid var(--gc); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; backdrop-filter: blur(6px); }
.tc2.wide { grid-column: 1 / -1; }
.tc2-h { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tc2-h b { display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: .5px; font-size: 14px; color: var(--t-white); }
.tc2-um { border: 1px solid color-mix(in srgb, var(--gc) 60%, transparent); color: var(--gc); border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc2-b { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; }
.tc2-badge { aspect-ratio: 1; border-radius: 14px; display: grid; place-items: center; align-content: center; background: linear-gradient(160deg, color-mix(in srgb, var(--gc) 55%, #fff), var(--gc) 75%); color: #0b0d10; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .12); }
.tc2-badge b { font-family: var(--display); font-size: 30px; line-height: .9; }
.tc2-badge b i { font-style: normal; font-size: 14px; }
.tc2-badge small { font-size: 9px; font-weight: 700; opacity: .75; }
.tc2-badge.zero { background: rgba(255, 255, 255, .08); color: var(--muted); box-shadow: none; }
.tc2-rows { display: flex; flex-direction: column; gap: 3px; background: rgba(0, 0, 0, .25); border-radius: 9px; padding: 6px 8px; font-size: 12px; }
.tc2-rows > div { display: flex; justify-content: space-between; gap: 6px; }
.tc2-rows span { color: var(--muted); white-space: nowrap; }
.tc2-rows b { text-align: right; white-space: nowrap; }
.tc2-rows s { color: var(--muted); font-weight: 400; }
.tc2-rows em { font-style: normal; color: #4fe08a; }
.tc2-bonus { color: var(--muted); font-size: 11px; }
.tc2-bonus.on { color: #4fe08a; }
.tc2 .btn { margin-top: auto; font-weight: 800; letter-spacing: .4px; }
.tr2 .tqueue { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* okno: Drinki */
.tmodal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 80; display: grid; place-items: center; padding: 16px; }
.tmodal { width: min(440px, 100%); max-height: 90vh; overflow: auto; background: #12151b; border: 1px solid rgba(198, 255, 0, .3); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.tm-h { display: flex; justify-content: space-between; align-items: center; }
.tm-h b { color: var(--t-white, #f6f1ea); letter-spacing: .6px; }
.tm-info { margin: 0; background: rgba(0, 229, 255, .07); border: 1px solid rgba(0, 229, 255, .25); border-radius: 9px; padding: 8px 10px; font-size: 13px; }
.tm-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; background: rgba(255, 255, 255, .04); border: 1px solid var(--t-line); border-radius: 10px; padding: 8px 10px; }
.tm-row.off { opacity: .55; }
.tm-ico { font-size: 30px; text-align: center; }
.tm-row b { display: block; }
.tm-row em { font-style: normal; font-weight: 800; color: #4fe08a; }
.tm-row small { display: block; color: var(--muted); font-size: 11px; }
.tm-r { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }

@media (max-width: 1300px) { .tc2s { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .tc2s { grid-template-columns: 1fr; }
  .tr2-cats button { min-width: 0; flex: 0 0 auto; }
  .tr2-durs { margin-left: 0; width: 100%; }
  .tr2-ints { border-left: 0; padding-left: 0; }
  .tr2-run { min-width: 0; }
  .tr2-hx { margin-left: 0; width: 100%; justify-content: stretch; }
  .tr2-hx > .tr2-dd { flex: 1 1 100%; }
  .tr2-ddp { left: 0; right: 0; max-width: none; width: auto; }
}

/* v1.17 Szkoła Trików: nagłówek i zakładki rodzin jak w Treningu podstawowym */
.tr2-sumbtn { padding: 0; font: inherit; text-align: left; cursor: pointer; }
.tr2-sumbtn .tr2-sumr { cursor: pointer; }
.tr2-sumbtn:hover { border-color: rgba(198, 255, 0, .45); }
.tr2-run .tr2-sumr > .tf-ico { width: 30px; height: 30px; font-size: 24px; display: grid; place-items: center; }
.tr2-run .tr2-sumr > .tf-ico img { width: 30px; height: 30px; }
.tr2-run.tr2-sumbtn .tst-time { margin-left: auto; }
.tr2-bonl .sk { width: 18px; height: 18px; vertical-align: middle; }
.tfam-bar button { min-width: 110px; }

/* v1.17 przycisk TRENUJ w kolorze grupy umiejętności karty (pozycyjny zostaje limonkowy) */
.tr2 .tc2 .btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--gc) 70%, #fff), var(--gc) 60%); color: #0b0d10; box-shadow: 0 3px 0 color-mix(in srgb, var(--gc) 55%, #000), 0 0 14px color-mix(in srgb, var(--gc) 30%, transparent); }
.tr2 .tc2 .btn.primary:hover:not(:disabled) { filter: brightness(1.08); }

.tr-debut { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 12px; }

/* v1.30: wolne boisko jako wezwanie do treningu + premie ze wszystkimi źródłami */
.tr2-run.idle { border-color: rgba(198,255,0,.35); animation: trIdle 2.4s ease-in-out infinite; }
.tr2-run.idle:hover { border-color: var(--acc); }
@keyframes trIdle { 0%, 100% { box-shadow: 0 0 0 rgba(198,255,0,0); } 50% { box-shadow: 0 0 16px rgba(198,255,0,.28); } }
@media (prefers-reduced-motion: reduce) { .tr2-run.idle { animation: none; } }
.tr2-run.idle .tr2-sumr { width: 100%; }
.tr2-run.idle .idle-ico { width: 30px; height: 30px; display: grid; place-items: center; font-size: 22px; }
.tr2-run.idle .idle-ico img { width: 30px; height: 30px; object-fit: contain; }
.tr2-run.idle b .sk { width: 18px; height: 18px; vertical-align: -3px; }
.tr2-run.idle em { display: block; font-style: normal; font-size: 10px; color: var(--muted); }
.tr2-run.idle .dd-ar { margin-left: auto; color: var(--acc); font-size: 16px; }
.tr2-bon:not(.on) summary b { color: var(--muted) !important; }
.tr2-bon .bon-ico img { width: 28px; height: 28px; object-fit: contain; display: block; }
.tr2-bonl .bs { align-items: center; }
.tr2-bonl .bs span small { display: block; font-size: 11px; color: var(--muted); }
.tr2-bonl .bs.off span { opacity: .75; }
.tr2-bonl .bs.tot { border-top: 1px solid rgba(79,224,138,.4); font-weight: 700; }
