/* Themen auf der Tipps-Seite: Bildkacheln statt Text-Knöpfen.
   Eine Reihe mit den ersten Themen (am Handy drei und „Alle“), alle weiteren in einem Blatt, das von unten kommt.
   Jede Kachel zeigt das Foto des zugkräftigsten Tipps ihres Themas; die Zahl oben rechts sagt, wie viele Tipps es gibt. */
.tt-row { display: grid; grid-template-columns: repeat(8, minmax(0, 116px)); gap: 14px; margin: 4px 0 18px; } /* am großen Bildschirm nicht größer als nötig */
.tt-row[hidden] { display: none; }
.tt-row > .tt:nth-child(n+8):not(.tt-all) { display: none; } /* breit: sieben Themen und „Alle“ */

.tt { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  animation: tt-in .5s var(--spring) both; animation-delay: calc(var(--i, 0) * 45ms); }
.tt-img { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 24px; background: #fff; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 14px 26px -18px rgba(40, 25, 80, .45), 0 0 0 1px var(--line); transition: transform .35s var(--spring), box-shadow .3s var(--ease); }
.tt-img img { width: 100%; height: 100%; object-fit: contain; padding: 13%; transition: transform .45s var(--spring); }
.tt-none { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); background: var(--panel-2); }
.tt-none svg { width: 38%; height: 38%; }
.tt-img small { position: absolute; top: 7px; right: 7px; min-width: 22px; padding: 2px 7px; border-radius: 999px; background: rgba(22, 20, 29, .78); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1.5; text-align: center; font-variant-numeric: tabular-nums; }
.tt-name { max-width: 100%; font-size: 12.5px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word;
  hyphens: auto; hyphenate-limit-chars: 15 6 6; -webkit-hyphenate-limit-before: 6; -webkit-hyphenate-limit-after: 6; } /* nur wirklich lange Wörter trennen („Multifunktions-drucker“), nicht „Smartwat-ches“ */
@media (hover: hover) { .tt:hover .tt-img { transform: translateY(-3px); } .tt:hover .tt-img img { transform: scale(1.07); } }
.tt:active .tt-img { transform: scale(.94); transition-duration: .12s; }
.tt:focus-visible { outline: none; }
.tt:focus-visible .tt-img { box-shadow: 0 0 0 3px rgba(240, 43, 65, .45); }

/* Gewählt: roter Rand, Haken, Name in Rot */
.tt.active .tt-img { box-shadow: 0 0 0 2.5px var(--red), 0 16px 26px -16px rgba(240, 43, 65, .7); }
.tt.active .tt-name { color: var(--red-deep); }
.tt.active .tt-img small { background: var(--red); }
.tt-check { position: absolute; left: 7px; top: 7px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; animation: tt-pop .45s var(--spring) both; }
.tt-check svg { width: 13px; height: 13px; stroke-width: 3; }

/* „Alle Themen“: ein kleiner Stapel der nächsten Bilder */
.tt-stack { background: var(--panel-2); box-shadow: 0 0 0 1px var(--line); }
.tt-stack img { position: absolute; width: 46%; height: 46%; padding: 4%; border-radius: 30%; background: #fff; box-shadow: 0 6px 12px -8px rgba(40, 25, 80, .6), 0 0 0 1px var(--line); }
.tt-stack img:nth-of-type(1) { left: 9%; top: 11%; transform: rotate(-8deg); }
.tt-stack img:nth-of-type(2) { right: 9%; top: 16%; transform: rotate(7deg); }
.tt-stack img:nth-of-type(3) { left: 27%; bottom: 8%; transform: rotate(-2deg); }
.tt-stack b { position: absolute; right: 7px; bottom: 7px; padding: 2px 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 1.5; }
.tt-all .tt-name { color: var(--red-deep); }

/* Blatt mit allen Themen: kommt von unten, wie ein Blatt in einer App */
.tt-sheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(560px, 100%); max-width: 100%; max-height: min(82dvh, 720px); padding: 8px 18px calc(env(safe-area-inset-bottom, 0px) + 22px); border: 0; border-radius: 30px 30px 0 0;
  background: var(--bg); color: var(--text); box-shadow: 0 -24px 60px -24px rgba(20, 10, 50, .5); overflow-y: auto; overscroll-behavior: contain; }
.tt-sheet[open] { animation: tt-up .42s var(--ease) both; }
.tt-sheet.closing { animation: tt-down .24s ease-in both; }
.tt-sheet::backdrop { background: rgba(22, 20, 29, .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: tt-veil .3s ease both; }
.tt-sheet.closing::backdrop { opacity: 0; transition: opacity .24s ease; }
.tt-grab { width: 38px; height: 5px; border-radius: 999px; background: rgba(24, 20, 45, .18); margin: 2px auto 10px; }
.tt-head { position: sticky; top: -8px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px 12px; background: var(--bg); }
.tt-head b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.tt-head small { display: block; font-size: 13px; color: var(--muted); }
.tt-close { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--panel-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.tt-close svg { width: 16px; height: 16px; }
.tt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; padding: 4px 2px 6px; }
.tt-grid .tt-name { font-size: 13.5px; }
@media (min-width: 721px) {
  .tt-sheet { inset: 0; margin: auto; border-radius: 30px; height: fit-content; padding-bottom: 22px; } /* am großen Bildschirm ein Fenster in der Mitte */
  .tt-sheet[open] { animation-name: tt-pop; }
  .tt-grab { display: none; }
  .tt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Handy: drei Themen und „Alle“ in einer Reihe */
@media (max-width: 720px) {
  .tt-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 14px; }
  .tt-row > .tt:nth-child(n+4):not(.tt-all) { display: none; }
  .tt-img { border-radius: 22px; }
  .tt-name { font-size: 11.5px; letter-spacing: -.02em; }
}

@keyframes tt-in { 0% { opacity: 0; transform: translateY(10px) scale(.9); } 100% { opacity: 1; transform: none; } }
@keyframes tt-pop { 0% { opacity: 0; transform: scale(.6); } 100% { opacity: 1; transform: none; } }
@keyframes tt-up { 0% { transform: translateY(100%); } 100% { transform: none; } }
@keyframes tt-down { 0% { transform: none; } 100% { transform: translateY(100%); } }
@keyframes tt-veil { 0% { opacity: 0; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tt, .tt-check, .tt-sheet[open], .tt-sheet.closing, .tt-sheet::backdrop { animation: none !important; } .tt-img, .tt-img img { transition: none; } }
