/* Trainingsgenerator */
.muted { color: var(--muted); }
.tg-hint { font-size: .85rem; color: var(--muted); margin: 10px 0 0; }
button.big { padding: 14px 20px; font-size: 1.08rem; width: 100%; }
.linkish { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 500; }
.tg-inline { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Tages-Challenge */
.tg-daily { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 20px; padding: 14px 16px; text-align: left;
  background: linear-gradient(120deg, #312e81, #4f46e5 60%, #db2777); color: #fff; border: 0; border-radius: var(--radius); }
.tg-daily:hover { filter: brightness(1.06); }
.tg-daily.done { background: linear-gradient(120deg, #065f46, #059669); }
.tg-daily-icon { font-size: 1.8rem; }
.tg-daily-text { display: flex; flex-direction: column; flex: 1; line-height: 1.35; }
.tg-daily-text small { opacity: .85; font-weight: 500; }
.tg-daily-go { font-weight: 700; white-space: nowrap; }

/* Geteilte Challenge */
.tg-shared { border-color: var(--accent); }
.tg-shared h2 { margin: 4px 0 12px; font-size: 1.3rem; }
.tg-kicker { font-size: .85rem; font-weight: 700; color: var(--accent); }

/* Steuerung */
.tg-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tg-modes .seg { flex-wrap: wrap; }
.tg-streak { font-weight: 700; background: #fff4e5; color: #9a3412; padding: 4px 10px; border-radius: 999px; font-size: .9rem; }
@media (prefers-color-scheme: dark) { .tg-streak { background: #3b2410; color: #fdba74; } }
.tg-opts { display: grid; gap: 12px; margin: 16px 0; }
.tg-opt { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; }
.tg-opt > span:first-child { font-size: .9rem; color: var(--muted); }
.tg-opt .seg { justify-self: start; flex-wrap: wrap; }
.tg-opt select { justify-self: start; }
@media (max-width: 560px) { .tg-opt { grid-template-columns: 1fr; gap: 4px; } }
.tg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-chip { padding: 5px 12px; border-radius: 999px; font-weight: 500; font-size: .9rem; }
.tg-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tg-chip.static { border: 1px solid var(--border); cursor: default; }
.tg-roll { width: 100%; padding: 14px; font-size: 1.15rem; }
.tg-suit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .tg-suit-grid { grid-template-columns: 1fr; } }
.tg-suit { display: flex; align-items: center; gap: 8px; color: var(--text); }
.tg-suit b { font-size: 1.4rem; width: 1.2em; text-align: center; }
.tg-suit.red b { color: #dc2626; }
.tg-suit select { flex: 1; min-width: 0; }

/* Ergebnis */
.tg-result-head h2 { margin: 0; font-size: 1.25rem; }
.tg-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.tg-list li { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.tg-list li.locked { border-color: var(--accent); }
.tg-list li.done .tg-val, .tg-list li.done .tg-name { text-decoration: line-through; opacity: .55; }
.tg-check { width: 30px; height: 30px; padding: 0; border-radius: 50%; flex: none; font-size: 1rem; line-height: 1; }
.tg-check[aria-pressed="true"] { background: #16a34a; border-color: #16a34a; color: #fff; }
.tg-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.tg-val { font-weight: 800; font-size: 1.15rem; min-width: 76px; font-variant-numeric: tabular-nums; }
.tg-name { flex: 1; min-width: 0; }
.tg-ico { border: 0; background: none; padding: 4px 6px; font-size: 1.1rem; opacity: .65; }
.tg-ico:hover, .tg-ico.on { opacity: 1; }
.tg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-actions.center { justify-content: center; }

/* Fertig */
.tg-finish { text-align: center; }
.tg-finish h2 { margin: 0; }
.tg-finish-big { font-size: 3rem; line-height: 1; }
.tg-feedback { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 14px 0; }

/* Übungen */
.tg-ex summary { cursor: pointer; font-weight: 700; }
.tg-ex h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.tg-ex-list { list-style: none; padding: 0; margin: 0; }
.tg-ex-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); }
.tg-ex-list li.off .tg-ex-on span { opacity: .45; }
.tg-ex-on { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .95rem; min-width: 0; }
.tg-ex-on small { color: var(--muted); }
.tg-range { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tg-range input { width: 64px; padding: 5px 6px; text-align: center; }
.tg-range small { color: var(--muted); width: 34px; }
.tg-ex-add-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-ex-add-row input[type="text"] { flex: 1 1 180px; }
.tg-ex-add-row input[type="number"] { width: 76px; }
.tg-ex-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Dialoge */
.tg-noscroll { overflow: hidden; }
.tg-modal { position: fixed; inset: 0; background: rgba(10, 12, 25, .55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .tg-modal { align-items: center; } }
.tg-sheet { background: var(--surface); width: 100%; max-width: 860px; max-height: 94vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 18px 22px; }
@media (min-width: 700px) { .tg-sheet { border-radius: 18px; } }
.tg-modal.full .tg-sheet { max-width: 560px; height: 100%; max-height: none; border-radius: 0; display: flex; flex-direction: column; }
@media (min-width: 700px) { .tg-modal.full .tg-sheet { height: auto; min-height: 560px; border-radius: 18px; } }
.tg-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tg-x { border: 0; background: none; font-size: 1.2rem; padding: 4px 8px; }

/* Teilen */
.tg-share { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
@media (max-width: 640px) { .tg-share { grid-template-columns: 1fr; } }
.tg-share-preview { display: flex; justify-content: center; }
.tg-share-canvas { width: 100%; max-width: 260px; height: auto; border-radius: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .2); }
@media (max-width: 640px) { .tg-share-canvas { max-width: 200px; } }
.tg-share-side { display: grid; gap: 12px; }
.tg-field { display: grid; gap: 4px; }
.tg-share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-share-row button { flex: 1 1 auto; }

/* Geführter Modus */
.tg-guided { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 10px 0 20px; }
.tg-g-progress { width: 100%; font-size: .9rem; color: var(--muted); }
.tg-g-bar { height: 6px; background: var(--accent-soft); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.tg-g-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.tg-g-name { font-size: 1.6rem; font-weight: 800; line-height: 1.25; }
.tg-g-name.small { font-size: 1.05rem; font-weight: 500; color: var(--muted); }
.tg-g-name.small b { color: var(--text); }
.tg-g-big { font-size: clamp(4rem, 22vw, 7rem); font-weight: 900; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.tg-g-big.rest { color: var(--muted); }
.tg-g-unit { color: var(--muted); margin-top: -10px; }
.tg-guided .big { max-width: 360px; }

/* Karte */
.tg-card { position: relative; width: 190px; height: 266px; background: #fff; color: #111827; border-radius: 16px; border: 1px solid #d1d5db; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); display: flex; align-items: center; justify-content: center; animation: tg-flip .35s ease; }
.tg-card.red { color: #dc2626; }
.tg-card-suit { font-size: 6rem; line-height: 1; }
.tg-card-corner { position: absolute; top: 10px; left: 14px; font-weight: 800; font-size: 1.3rem; line-height: 1.05; text-align: center; }
.tg-card-corner.br { top: auto; left: auto; bottom: 10px; right: 14px; transform: rotate(180deg); }
@keyframes tg-flip { from { transform: rotateY(90deg); } to { transform: none; } }
.tg-card-totals { display: flex; gap: 14px; color: var(--muted); font-weight: 700; }
.tg-card-totals .red { color: #dc2626; }

/* Hinweis-Toast */
.tg-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #111827; color: #fff; padding: 10px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.tg-toast.on { opacity: 1; transform: translate(-50%, 0); }

.tg-shared-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 4px; }
.tg-shared-list b { display: inline-block; min-width: 70px; }
@media (max-width: 560px) {
  .tg-top { align-items: stretch; }
  .tg-modes, .tg-modes .seg { width: 100%; }
  .tg-modes .seg { display: grid; grid-template-columns: 1fr 1fr; }
  .tg-modes .seg-btn + .seg-btn { border-left: 0; }
  .tg-modes .seg-btn:nth-child(even) { border-left: 1px solid var(--border); }
  .tg-modes .seg-btn:nth-child(n+3) { border-top: 1px solid var(--border); }
  .tg-streak { align-self: flex-start; }
}
.tg-sync { font-size: .85rem; color: var(--muted); margin: 10px 0 0; text-align: center; }
