/* Zufallsgenerator (tools/zufall) – auf tools.css (Nachtblau, Gelb, Exo 2). */
.z-inhalt { width: min(100% - 2 * clamp(16px, 4vw, 32px), 1180px); }
.z-leiste { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; margin-bottom: 1.2rem; }
.z-reiter { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.z-reiter::-webkit-scrollbar { display: none; }
.z-reiter button { flex: none; display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .9rem; border: 1px solid var(--rand); border-radius: 12px; background: var(--flaeche); color: var(--text-2); font: 600 .92rem 'Exo 2', sans-serif; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.z-reiter button:hover { color: #fff; border-color: var(--rand-2); }
.z-reiter button[aria-pressed="true"] { background: var(--gelb); border-color: var(--gelb); color: #111; }
.z-extras { display: flex; gap: .4rem; flex: none; }
.t-knopf.rund { width: 42px; height: 42px; padding: 0; border-radius: 50%; }
.t-knopf.rot { background: #e11d48; color: #fff; }

.z-ansicht { display: none; }
.z-ansicht.aktiv { display: grid; gap: 1.2rem; animation: z-ein .35s var(--kurve); }
@keyframes z-ein { from { opacity: 0; transform: translateY(8px); } }
.z-buehne { display: grid; justify-items: center; gap: 1rem; padding: clamp(20px, 4vw, 36px); border-radius: 24px; border: 1px solid var(--rand); background: radial-gradient(ellipse at 50% 0%, rgba(255, 198, 26, .08), transparent 60%), var(--flaeche); text-align: center; min-width: 0; }
.z-haupt-knoepfe { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.z-los { font-size: 1.08rem; padding-inline: 1.6rem; }
.z-tipp { margin: 0; }
.z-link { border: 0; background: none; padding: 0; color: var(--gelb); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.z-einstellungen { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.4rem; padding: 1.1rem 1.3rem; border-radius: 20px; border: 1px solid var(--rand); background: var(--flaeche); }
.z-einspaltig { flex-direction: column; align-items: stretch; }
.z-feld { display: grid; gap: .4rem; min-width: 0; }
.z-feld > span { color: var(--text-2); font-size: .85rem; font-weight: 600; }
.z-breit { flex: 1 1 100%; }
.z-zeile { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; }
.z-eingabe { width: 100%; padding: .65rem .85rem; border: 1px solid var(--rand-2); border-radius: 12px; background: rgba(0, 0, 0, .25); color: #fff; font: 500 1rem 'Exo 2', sans-serif; }
.z-eingabe:focus { outline: none; border-color: var(--gelb); }
input.z-eingabe[type="number"] { max-width: 9rem; }
.z-klein-feld { max-width: 7rem; margin-top: .3rem; }
textarea.z-eingabe { resize: vertical; line-height: 1.5; }
.z-stepper { display: inline-flex; align-items: center; border: 1px solid var(--rand-2); border-radius: 12px; overflow: hidden; }
.z-stepper button { width: 40px; height: 40px; border: 0; background: var(--flaeche-2); color: #fff; font-size: 1.2rem; cursor: pointer; }
.z-stepper button:hover { background: rgba(255, 198, 26, .2); }
.z-stepper output { min-width: 3rem; text-align: center; font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.z-schalter { display: inline-flex; align-items: center; gap: .6rem; color: var(--text-2); font-size: .92rem; cursor: pointer; }
.z-schalter input { position: absolute; opacity: 0; }
.z-schalter span { position: relative; flex: none; width: 40px; height: 23px; border-radius: 99px; background: var(--flaeche-2); border: 1px solid var(--rand-2); transition: background .2s; }
.z-schalter span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .25s var(--feder); }
.z-schalter input:checked + span { background: var(--gelb); border-color: var(--gelb); }
.z-schalter input:checked + span::after { transform: translateX(17px); background: #111; }
.z-schalter input:focus-visible + span { outline: 2px solid var(--gelb); outline-offset: 2px; }
.z-chip-knopf { padding: .4rem .8rem; border: 1px solid var(--rand-2); border-radius: 99px; background: var(--flaeche); color: var(--text); font: 600 .88rem 'Exo 2', sans-serif; cursor: pointer; }
.z-chip-knopf:hover { border-color: var(--gelb); }
.z-ergebnis-zeile { min-height: 1.6em; color: var(--text-2); }
.z-ergebnis-zeile b { color: #fff; }
.z-hervor { color: var(--gelb) !important; }
.z-ergebnis-gross { min-height: 1.3em; font-size: clamp(1.8rem, 6vw, 2.8rem); font-weight: 800; color: #fff; }
.z-platzhalter { font-size: 3rem; color: var(--text-3); }
.z-platzhalter-text { color: var(--text-3); }
.z-rad-raster { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.z-slf-raster { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
@media (max-width: 860px) { .z-rad-raster, .z-slf-raster { grid-template-columns: minmax(0, 1fr); } }

/* Verlauf */
.z-verlauf h3 { color: var(--text-2); font-size: .95rem; }
.z-verlauf ol { display: flex; flex-direction: column; gap: .3rem; max-height: 240px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.z-verlauf ol:empty::after { content: 'Noch nichts.'; color: var(--text-3); font-size: .9rem; }
.z-verlauf li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .35rem .6rem; border-radius: 10px; background: var(--flaeche); font-size: .92rem; }
.z-verlauf li small { margin-left: auto; color: var(--text-3); font-size: .75rem; }
.z-v-wert { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.7rem; padding: 0 .3rem; border-radius: 7px; background: var(--flaeche-2); font-weight: 700; }
.z-v-wert.gehalten { outline: 1px solid var(--gelb); }
.z-v-farbe { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--rand-2); }
.z-v-karte { font-weight: 800; } .z-v-karte.r { color: #fb7185; }

/* Würfel */
.z-wuerfel-feld { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; min-height: 96px; max-width: 760px; }
.z-wuerfel { position: relative; display: grid; place-items: center; width: clamp(64px, 14vw, 92px); aspect-ratio: 1; padding: 10px; border: 0; border-radius: 20%; background: linear-gradient(145deg, #fff, #e6e9f2); color: #111; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12), 0 12px 24px -10px rgba(0, 0, 0, .6); cursor: pointer; transition: transform .2s var(--feder); }
.z-wuerfel:hover { transform: translateY(-3px); }
.z-wuerfel.gehalten { outline: 3px solid var(--gelb); outline-offset: 3px; background: linear-gradient(145deg, #fff8dc, #f5e6a8); }
.z-wuerfel.rollt { animation: z-rollen .12s linear infinite; }
.z-wuerfel.gelandet { animation: z-landen .45s var(--feder); }
@keyframes z-rollen { 0% { transform: rotate(-12deg) translateY(-6px); } 50% { transform: rotate(12deg) translateY(2px); } 100% { transform: rotate(-12deg) translateY(-6px); } }
@keyframes z-landen { 0% { transform: scale(1.2) rotate(8deg); } 100% { transform: none; } }
.z-augen { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 100%; height: 100%; }
.z-augen i { place-self: center; width: 70%; aspect-ratio: 1; border-radius: 50%; }
.z-augen i.an { background: radial-gradient(circle at 35% 35%, #444, #0b0b0b); }
.z-wuerfel.zahl b { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; line-height: 1; }
.z-wuerfel.zahl small { position: absolute; bottom: 6px; font-size: .62rem; color: #667; font-weight: 700; }
.z-schloss { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gelb); color: #111; font-size: .7rem; }

/* Zahlen */
.z-zahlen { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; min-height: 90px; max-width: 900px; }
.z-kugel { display: grid; place-items: center; min-width: 74px; height: 74px; padding: 0 .5rem; border-radius: 99px; background: radial-gradient(circle at 35% 30%, #fff 0, #ffe38a 25%, var(--gelb) 60%, #c98f00); color: #111; font-size: 1.9rem; font-weight: 800; box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .7); animation: z-kugel .5s var(--feder) both; animation-delay: calc(var(--i, 0) * 60ms); font-variant-numeric: tabular-nums; }
.z-kugel.extra { background: radial-gradient(circle at 35% 30%, #fff 0, #fda4af 25%, #f43f5e 60%, #9f1239); color: #fff; }
.z-zahlen.viele .z-kugel { min-width: 52px; height: 52px; font-size: 1.25rem; }
@keyframes z-kugel { from { opacity: 0; transform: scale(.3) translateY(20px); } }
.z-trenner { width: 100%; color: var(--text-3); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.z-trommel { padding: 1.1rem 1.3rem; border-radius: 20px; border: 1px solid var(--rand); background: var(--flaeche); }
.z-trommel-kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.z-trommel-kopf h3 { margin: 0; } .z-trommel-kopf h3 span { color: var(--text-3); font-size: .85rem; font-weight: 600; }
.z-tafel { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 5px; }
.z-tafel span { display: grid; place-items: center; height: 38px; border-radius: 9px; background: rgba(0, 0, 0, .25); color: var(--text-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.z-tafel span.an { background: rgba(255, 198, 26, .2); color: #fff; }
.z-tafel span.neu { background: var(--gelb); color: #111; animation: z-landen .5s var(--feder); }

/* Münze */
.z-muenze-raum { perspective: 900px; padding: 10px; }
.z-muenze { position: relative; width: clamp(150px, 34vw, 200px); aspect-ratio: 1; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.2, .7, .1, 1); }
.z-seite { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; border-radius: 50%; backface-visibility: hidden; font-size: clamp(1.3rem, 4vw, 1.8rem); font-weight: 800; color: #4a3500; text-align: center; overflow-wrap: anywhere; background: radial-gradient(circle at 35% 30%, #fff6cf, #ffd34d 45%, #c98f00 100%); box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .3), inset 0 0 0 12px rgba(150, 100, 0, .35), 0 18px 34px -16px rgba(0, 0, 0, .8); }
.z-seite.hinten { transform: rotateY(180deg); background: radial-gradient(circle at 35% 30%, #f1f5f9, #cbd5e1 45%, #64748b 100%); color: #1e293b; }
.z-statistik { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1rem; color: var(--text-2); font-size: .92rem; }

/* Glücksrad */
.z-rad-huelle { position: relative; width: min(100%, 460px); aspect-ratio: 1; }
.z-rad-huelle canvas { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 8px rgba(255, 255, 255, .06), 0 24px 48px -20px rgba(0, 0, 0, .8); }
.z-rad-zeiger { position: absolute; top: -6px; left: 50%; z-index: 2; width: 0; height: 0; margin-left: -16px; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 34px solid var(--gelb); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.z-rad-mitte { position: absolute; left: 50%; top: 50%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 5px solid #0b1020; border-radius: 50%; background: var(--gelb); color: #111; font: 800 clamp(.8rem, 2.4vw, 1.05rem) 'Exo 2', sans-serif; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, .45); transition: transform .2s var(--feder); }
.z-rad-mitte:hover { transform: translate(-50%, -50%) scale(1.06); }

/* Namen & Teams */
.z-nm-ausgabe { align-content: start; min-height: 280px; }
.z-gezogen { display: grid; gap: .2rem; padding: 1rem 1.5rem; animation: z-landen .6s var(--feder); }
.z-gezogen small { color: var(--text-3); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.z-gezogen b { font-size: clamp(2.2rem, 7vw, 3.4rem); color: var(--gelb); overflow-wrap: anywhere; }
.z-reihe { display: grid; gap: .4rem; width: 100%; max-width: 420px; margin: 0; padding: 0; list-style: none; counter-reset: r; text-align: left; }
.z-reihe li { counter-increment: r; display: flex; align-items: center; gap: .8rem; padding: .55rem .8rem; border-radius: 12px; background: var(--flaeche-2); animation: z-ein .35s var(--kurve) both; animation-delay: calc(var(--i) * 50ms); }
.z-reihe li::before { content: counter(r); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--gelb); color: #111; font-weight: 800; font-size: .85rem; }
.z-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: .7rem; width: 100%; text-align: left; }
.z-team { padding: .8rem 1rem; border-radius: 16px; border-top: 4px solid var(--f); background: var(--flaeche-2); animation: z-ein .4s var(--kurve) both; animation-delay: calc(var(--i) * 80ms); }
.z-team h3 { display: flex; justify-content: space-between; margin-bottom: .4rem; color: var(--f); }
.z-team h3 small { color: var(--text-3); }
.z-team ul { margin: 0; padding-left: 1.1rem; }
.z-nm-knoepfe { justify-content: center; }

/* Stadt-Land-Fluss */
.z-buchstabe { display: grid; place-items: center; width: clamp(150px, 34vw, 210px); aspect-ratio: 1; border-radius: 34px; background: linear-gradient(150deg, var(--gelb), #f59e0b); color: #111; font-size: clamp(5rem, 16vw, 8rem); font-weight: 800; line-height: 1; box-shadow: 0 24px 44px -20px rgba(255, 198, 26, .7); }
.z-buchstabe.dreht { animation: z-rollen .12s linear infinite; }
.z-buchstabe.steht { animation: z-landen .55s var(--feder); }
.z-uhr { position: relative; width: 110px; height: 110px; }
.z-uhr svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.z-uhr circle { fill: none; stroke: var(--flaeche-2); stroke-width: 8; }
.z-uhr circle[data-bs-ring] { stroke: var(--gelb); stroke-linecap: round; stroke-dasharray: 276.5; transition: stroke-dashoffset 1s linear; }
.z-uhr b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.z-uhr.knapp circle[data-bs-ring] { stroke: #fb7185; }
.z-uhr.knapp b { color: #fb7185; animation: z-puls 1s infinite; }
@keyframes z-puls { 50% { transform: scale(1.12); } }
.z-benutzt { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; color: var(--text-3); font-size: .85rem; }
.z-benutzt span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--flaeche-2); color: var(--text-2); font-weight: 700; }
.z-kategorien { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.z-kategorien span { padding: .35rem .8rem; border-radius: 99px; background: rgba(255, 198, 26, .14); color: #ffe08a; font-weight: 700; animation: z-ein .3s var(--kurve) both; }
.z-buchstaben-wahl { display: flex; flex-wrap: wrap; gap: 4px; }
.z-bs-chip input { position: absolute; opacity: 0; }
.z-bs-chip span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--rand-2); color: var(--text-3); font-weight: 800; cursor: pointer; text-decoration: line-through; }
.z-bs-chip input:checked + span { background: rgba(255, 198, 26, .16); border-color: rgba(255, 198, 26, .5); color: #fff; text-decoration: none; }

/* Twister */
.z-twister { width: min(100%, 380px); aspect-ratio: 1; }
.z-twister svg { width: 100%; height: 100%; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .5)); }
.z-tw-glied { fill: #fff; font: 800 11px 'Exo 2', sans-serif; paint-order: stroke; stroke: rgba(0, 0, 0, .55); stroke-width: 3px; }
.z-tw-mitte { fill: #0b1020; stroke: #fff; stroke-width: 3; }
.z-tw-zeiger { transition: transform 1.6s cubic-bezier(.15, .7, .1, 1); }
.z-tw-zeiger path { fill: #fff; stroke: #0b1020; stroke-width: 2; }
.z-tw-zeiger circle { fill: var(--gelb); }
.z-tw-ergebnis { display: flex; align-items: center; justify-content: center; gap: .8rem; min-height: 3.2rem; font-size: clamp(1.4rem, 5vw, 2.2rem); }
.z-tw-ergebnis.neu b { animation: z-landen .5s var(--feder); }
.z-tw-farbe { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .8); }
.z-tw-ergebnis:not(.neu) .z-tw-farbe { display: none; }
.z-tw-countdown { margin: 0; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Rechnen */
.z-re-buehne { gap: .8rem; }
.z-re-kopf { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; color: var(--text-2); font-weight: 600; }
.z-aufgabe { padding: .6rem 1.2rem; border-radius: 20px; font-size: clamp(2.2rem, 9vw, 3.6rem); font-weight: 800; font-variant-numeric: tabular-nums; transition: background .3s, color .3s; }
.z-aufgabe.richtig { background: rgba(52, 211, 153, .15); color: var(--gruen); }
.z-aufgabe.falsch { background: rgba(251, 113, 133, .14); color: var(--rot); animation: z-wackeln .4s; }
@keyframes z-wackeln { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.z-luecke { display: inline-block; min-width: 1.4em; border-bottom: 4px solid var(--gelb); color: var(--gelb); }
.z-re-form { display: flex; gap: .6rem; width: 100%; max-width: 360px; }
.z-re-eingabe { font-size: 1.6rem; text-align: center; font-weight: 800; }
.z-tastatur { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; }
.z-tastatur button { height: 54px; border: 1px solid var(--rand-2); border-radius: 14px; background: var(--flaeche-2); color: #fff; font: 800 1.35rem 'Exo 2', sans-serif; cursor: pointer; }
.z-tastatur button:active { background: rgba(255, 198, 26, .25); }
@media (hover: hover) and (pointer: fine) { .z-tastatur { display: none; } }
.z-re-rueck { min-height: 1.5em; margin: 0; color: var(--text-2); font-weight: 600; }
.z-blatt-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; width: 100%; color: var(--text-2); }
.z-blatt { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem 1.4rem; width: 100%; margin: 0; padding-left: 1.4rem; text-align: left; font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.z-blatt u { color: var(--gruen); text-decoration: none; }
.z-blatt .z-luecke { border-bottom-width: 2px; color: inherit; }

/* Karten */
.z-karten-feld { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; min-height: 180px; }
.z-karte, .z-karte-ruecken { position: relative; width: 120px; height: 172px; border-radius: 12px; }
.z-karte { display: grid; place-items: center; background: #fff; color: #111; box-shadow: 0 14px 28px -12px rgba(0, 0, 0, .7); animation: z-karte .45s var(--feder) both; animation-delay: calc(var(--i) * 90ms); }
.z-karte.r { color: #dc2626; } .z-karte.joker { color: #7c3aed; }
@keyframes z-karte { from { opacity: 0; transform: translateY(-30px) rotateY(90deg); } }
.z-karte-ecke { position: absolute; top: 8px; left: 9px; font-weight: 800; font-size: 1rem; line-height: 1.05; text-align: center; }
.z-karte-ecke.unten { top: auto; left: auto; bottom: 8px; right: 9px; transform: rotate(180deg); }
.z-karte-mitte { font-size: 3.4rem; }
.z-karte-ruecken { background: repeating-linear-gradient(45deg, #1e3a8a 0 8px, #2547a8 8px 16px); border: 6px solid #fff; box-shadow: 0 14px 28px -12px rgba(0, 0, 0, .7); }

.z-fair { margin-top: 1.6rem; }
@media (max-width: 640px) { .z-leiste { flex-direction: column-reverse; align-items: stretch; } .z-extras { justify-content: flex-end; } .z-einstellungen { padding: 1rem; } }
@media (prefers-reduced-motion: reduce) { .z-ansicht.aktiv, .z-kugel, .z-wuerfel.gelandet, .z-buchstabe.steht, .z-karte, .z-team, .z-reihe li { animation: none; } }

/* Drucken: nur das Arbeitsblatt */
@media print {
    body.z-druck-blatt > *:not(main), body.z-druck-blatt main > *:not([data-ansicht="rechnen"]), body.z-druck-blatt .z-nicht-drucken, body.z-druck-blatt [data-wahl="reModus"], body.z-druck-blatt [data-re-ueben] { display: none !important; }
    body.z-druck-blatt, body.z-druck-blatt .z-buehne { background: #fff !important; color: #000 !important; border: 0; }
    body.z-druck-blatt::before { display: none; }
    body.z-druck-blatt .z-rad-raster { display: block; }
    body.z-druck-blatt .z-blatt { color: #000; font-size: 14pt; gap: 10pt 24pt; }
    body.z-druck-blatt .z-blatt-kopf { color: #000; margin-bottom: 14pt; }
}
.z-inhalt .t-chip span { font-family: 'Exo 2', system-ui, sans-serif; font-weight: 600; letter-spacing: 0; }
