/* Fetzerei um Wien – "So geht's"-Tutorial. Pixelschrift nur in 16/32/48/64 px.
   Szenen rechnen in nativen Kartenpixeln: Länge = Npx * var(--k) (Handkarten: var(--kh)). --tr = Ringstärke, --tf = Schildschrift. */

.seite.tutorial { overflow-x: clip; }

/* ---------- Übersicht ---------- */
.t-uebersicht { max-width: 720px; }
.t-intro { color: var(--text-leise); max-width: 40ch; }
.t-kapitelliste { list-style: none; margin: 20px 0 8px; padding: 0; display: grid; gap: 10px; }
.t-kap {
  width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  padding: 8px 14px 10px 10px; min-height: 68px; background: var(--tisch-2); color: var(--papier);
  border: 4px solid transparent; border-image: var(--rahmen-gruen) 2 / 4px stretch; background-clip: padding-box; box-shadow: inset 0 3px 0 var(--tisch-3);
}
.t-kap:hover { background: var(--tisch-3); }
.t-kap:hover .t-nr { background: var(--gold-hell); }
.t-kap > .ico { color: var(--gold); }
.t-nr { display: grid; place-items: center; width: 48px; height: 48px; padding-bottom: 4px; font-family: 'CW Dick', monospace; background: var(--gold); color: var(--tinte);
  box-shadow: inset 0 -4px 0 var(--gold-2), inset 0 3px 0 var(--gold-hell); }
.t-kaptext { display: grid; gap: 2px; min-width: 0; }
.t-kapname { font-family: 'CW Dick', monospace; color: var(--papier); }
.t-kapkurz { font-size: var(--fs-s); color: var(--text-leise); }
.t-unten { margin-top: 16px; }

/* ---------- Lern-Ansicht: Kopf, Bühne, Tafel ---------- */
.seite.t-lernen { max-width: 1200px; height: 100dvh; display: flex; flex-direction: column; padding-top: max(8px, env(safe-area-inset-top));
  padding-bottom: calc(12px + env(safe-area-inset-bottom)); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.t-kopf { padding: 0 0 8px; flex: none; gap: 12px; }
.t-kopftext { flex: 1; min-width: 0; display: grid; }
.t-kaptitel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-zaehler { font-size: var(--fs-s); color: var(--text-leise); }
.t-skip { flex: none; display: inline-flex; align-items: center; gap: 8px; }
/* Handy: Überspringen nur als X (wie Regeln im Spiel), damit der Kapiteltitel ganz bleibt */
.t-skip .t-skip-ico { display: none; }
@media (max-width: 600px) { .t-skip .t-skip-wort { display: none; } .t-skip .t-skip-ico { display: inline-block; } .t-skip { min-width: 48px; min-height: 48px; justify-content: center; } }
.t-ende .t-skip { display: none; }
@media (max-width: 600px) { .t-zaehler { display: none; } }
.t-haupt { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; touch-action: pan-y; }   /* waagrecht wischen = blättern (0.10.15) */
.t-buehne { flex: 1 1 0; min-height: 0; position: relative; display: grid; place-items: center; }
.t-tafel { flex: none; display: grid; gap: 8px; }
.t-text { margin: 0; min-height: calc(3 * 1.25em); color: var(--papier); }
.t-notiz { margin: -4px 0 0; font-size: var(--fs-s); color: var(--text-leise); }
.t-leiste { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.t-punkte { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.t-punkte span { width: 16px; height: 8px; background: #1a2a21; box-shadow: inset 0 0 0 2px #2e4638; }
.t-punkte span.voll { background: var(--gold-2); box-shadow: none; }
.t-punkte span.jetzt { width: 32px; background: var(--gold); box-shadow: inset 0 -2px 0 var(--gold-2); }
.t-nochmal { display: inline-flex; align-items: center; gap: 8px; }
.t-steuer { display: flex; gap: 10px; }
.t-steuer .t-weiter { flex: 1; }
.t-extra { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.t-extra:empty { display: none; }

@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .t-haupt { flex-direction: row; gap: 32px; }
  .t-tafel { width: 420px; align-self: center; padding: 20px 22px 22px; background: var(--tisch-2);
    border: 4px solid transparent; border-image: var(--rahmen-gold2) 2 / 4px stretch; background-clip: padding-box; box-shadow: inset 0 4px 0 var(--tisch-3); }
  .t-text { min-height: calc(5 * 1.25em); }
}

/* ---------- Szenen allgemein ---------- */
.t-szene { position: relative; --kw: 2; --kh: 1.5; --tr: 2px; --tf: 16px; }
.t-szene .karte { width: calc(58px * var(--k)); height: calc(72px * var(--k)); filter: none; }
.t-lage { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.t-weg { visibility: hidden; }
.t-aus { visibility: hidden; }
.t-szene .ansage { z-index: 20; }

/* Markier-Ringe: harte Pixelkante, blinken in Stufen */
.t-ring { position: absolute; pointer-events: none;
  box-shadow: 0 0 0 var(--tr) var(--gold-hell), 0 0 0 calc(var(--tr) * 2) var(--tinte);
  animation: t-auf .2s steps(3) both, t-puls .9s steps(1) .2s infinite; }
.t-ring.minus { box-shadow: 0 0 0 var(--tr) #ffb4b4, 0 0 0 calc(var(--tr) * 2) var(--tinte); animation: t-auf .2s steps(3) both, t-puls-rot .9s steps(1) .2s infinite; }
.t-ring.eigen { box-shadow: 0 0 0 var(--tr) #9cc3ef, 0 0 0 calc(var(--tr) * 2) var(--tinte); animation: t-auf .2s steps(3) both; }
.t-ring.nix { box-shadow: 0 0 0 var(--tr) var(--text-leise), 0 0 0 calc(var(--tr) * 2) var(--tinte); animation: t-auf .2s steps(3) both; }
@keyframes t-auf { 0% { scale: 1.6; opacity: 0; } 34% { opacity: 1; } 100% { scale: 1; opacity: 1; } }
@keyframes t-puls {
  0% { box-shadow: 0 0 0 var(--tr) var(--gold-hell), 0 0 0 calc(var(--tr) * 2) var(--tinte); }
  50% { box-shadow: 0 0 0 var(--tr) #fff8e8, 0 0 0 calc(var(--tr) * 2) var(--tinte), 0 0 0 calc(var(--tr) * 3) var(--gold-2); }
}
@keyframes t-puls-rot {
  0% { box-shadow: 0 0 0 var(--tr) #ffb4b4, 0 0 0 calc(var(--tr) * 2) var(--tinte); }
  50% { box-shadow: 0 0 0 var(--tr) #fff8e8, 0 0 0 calc(var(--tr) * 2) var(--tinte), 0 0 0 calc(var(--tr) * 3) var(--rot-dunkel); }
}
/* Schild mit dem Vergleich ("7>4", "6=6", "3+7=10") */
.t-schild { position: absolute; z-index: 7; font-family: 'CW Dick', monospace; font-size: var(--tf); line-height: 1; white-space: nowrap;
  padding: 2px 6px 4px; background: var(--tinte); color: var(--gold-hell); box-shadow: 0 0 0 2px var(--gold-2);
  animation: t-auf-schild .2s steps(3) both; }
.t-schild.nix { color: var(--text-leise); box-shadow: 0 0 0 2px #50675a; }
.t-schild.eigen { color: #9cc3ef; box-shadow: 0 0 0 2px var(--blau-dunkel); }
@keyframes t-auf-schild { 0% { opacity: 0; } 100% { opacity: 1; } }

/* ---------- Karte (Kapitel 1) ---------- */
.t-kartenszene { --tf: 32px; }
.t-grosskarte { position: relative; width: calc(58px * var(--k)); height: calc(72px * var(--k)); perspective: 900px; }
.t-grosskarte .karte { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 calc(2px * var(--k)) 0 rgba(0, 0, 0, .35)); }

/* ---------- Brett ---------- */
.t-brettszene { display: grid; justify-items: center; gap: 8px; }
.t-brettrahmen { position: relative; }
.t-brett { position: relative; width: calc(190px * var(--k)); height: calc(232px * var(--k));
  background:
    repeating-linear-gradient(180deg, transparent 0 calc(5px * var(--k)), rgba(0, 0, 0, .18) calc(5px * var(--k)) calc(6px * var(--k)), transparent calc(6px * var(--k)) calc(11px * var(--k)), rgba(255, 220, 160, .06) calc(11px * var(--k)) calc(12px * var(--k))),
    var(--holz);
  box-shadow: inset 0 0 0 calc(1px * var(--k)) var(--holz-hell), inset 0 0 0 calc(2px * var(--k)) var(--holz-dunkel), 0 calc(4px * var(--k)) 0 var(--schatten); }
.t-brett::before { content: ''; position: absolute; left: calc(1.5px * var(--k)); top: calc(1.5px * var(--k)); width: calc(2px * var(--k)); height: calc(2px * var(--k));
  background: var(--messing); pointer-events: none;
  box-shadow: calc(185px * var(--k)) 0 0 var(--messing), 0 calc(227px * var(--k)) 0 var(--messing), calc(185px * var(--k)) calc(227px * var(--k)) 0 var(--messing); }
.t-feld { position: absolute; width: calc(58px * var(--k)); height: calc(72px * var(--k)); display: grid; place-items: center; perspective: 600px;
  background-color: #23160e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM4 4h1v1h-1z' fill='%23c99a3b' fill-opacity='.14'/%3E%3C/svg%3E");
  background-size: calc(8px * var(--k)) calc(8px * var(--k));
  box-shadow: inset 0 calc(1px * var(--k)) 0 #120b06, inset 0 0 0 calc(1px * var(--k)) #1a110a; }
.t-feld .karte { position: absolute; inset: 0; width: 100%; height: 100%; }
.t-feld canvas.elsym { width: calc(21px * var(--k)); height: calc(21px * var(--k)); opacity: .55; }
.t-feld canvas.elsym.plakette { width: calc(27px * var(--k)); height: calc(27px * var(--k)); opacity: .7; }
.t-feld.t-glimm { box-shadow: inset 0 0 0 var(--tr) var(--gold), inset 0 0 0 calc(var(--tr) * 2) var(--tinte); animation: t-glimm .36s steps(1) 3; background-color: #35210f; }
@keyframes t-glimm { 50% { box-shadow: inset 0 0 0 var(--tr) var(--gold-hell); } }
.t-bonus { position: absolute; right: 0; bottom: 0; z-index: 3; font-family: 'CW Dick', monospace; font-size: var(--tf); line-height: 1; padding: 2px 4px 4px; background: var(--tinte); }
.t-bonus.plus { color: #ffe28a; }
.t-bonus.minus { color: #ffb4b4; }
.t-zahl { position: absolute; left: 50%; top: calc(30px * var(--k)); translate: -50% -50%; z-index: 6;
  display: grid; place-items: center; min-width: 48px; height: 48px; padding: 0 8px 4px; font-family: 'CW Dick', monospace; font-size: 32px; color: #fff8e8;
  border: 4px solid transparent; border-image: var(--rahmen-tinte) 2 / 4px stretch; background-clip: padding-box; animation: t-auf .2s steps(3) both; }
.t-zahl.p0 { background: var(--blau); box-shadow: inset 0 3px 0 #7fb0e6, inset 0 -4px 0 var(--blau-dunkel); }
.t-zahl.p1 { background: var(--rot); box-shadow: inset 0 3px 0 #ee8a8f, inset 0 -4px 0 var(--rot-dunkel); }
.t-slot { position: relative; display: block; width: calc(58px * var(--kh)); height: calc(72px * var(--kh)); box-shadow: inset 0 0 0 2px var(--linie); background: rgba(0, 0, 0, .18); }
.t-slot .karte { position: absolute; inset: 0; width: 100%; height: 100%; }
.t-slot .t-zahl { top: 50%; }
.t-mitrand { padding-top: 48px; }
.t-handzeile { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: calc(54px * var(--k)); }
.t-handname { font-size: var(--fs-s); color: var(--text-leise); }
.t-hand { display: flex; gap: 4px; perspective: 800px; }
.t-hand .karte, .t-klein .karte { width: calc(58px * var(--kh)); height: calc(72px * var(--kh)); }
.t-stand { display: flex; align-items: center; gap: 6px; font-family: 'CW Dick', monospace; }
.t-stand .dp { color: var(--text-leise); }
.t-ergebnis { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 12; display: none;
  font-family: 'CW Logo', 'CW Dick', monospace; font-size: 48px; line-height: 1; color: var(--gold-hell); white-space: nowrap;
  background: var(--tinte); padding: 14px 26px 18px;
  border: 4px solid transparent; border-image: var(--rahmen-gold) 2 / 4px stretch; background-clip: padding-box;
  box-shadow: inset 0 0 0 4px var(--tinte), inset 0 0 0 6px var(--gold-2); filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .5)); }
.t-ergebnis.zeigen { display: block; animation: t-auf-schild .2s steps(3) both; }

/* ---------- Reihen (Hände, Gewinn, Mischen) ---------- */
.t-reihenszene { display: grid; justify-items: center; gap: 12px; }
.t-reihenbox { display: grid; justify-items: center; gap: 4px; }
.t-reihe { position: relative; width: calc(306px * var(--k)); height: calc(72px * var(--k)); perspective: 800px; }
.t-reihe > * { position: absolute; top: 0; }
.t-klein .t-reihe { width: calc(306px * var(--kh)); height: calc(72px * var(--kh)); }
.t-platz { display: block; width: calc(58px * var(--k)); height: calc(72px * var(--k)); box-shadow: inset 0 0 0 2px var(--linie); background: rgba(0, 0, 0, .18); }
.t-platz .karte { position: absolute; inset: 0; }
.t-gewaehlt { outline: var(--tr) solid var(--gold-hell); outline-offset: var(--tr); animation: t-blink-umriss .5s steps(1) infinite; }
@keyframes t-blink-umriss { 50% { outline-color: #fff8e8; } }
.t-stand-zeile { gap: 8px; }
.t-standtext { font-family: 'CW Block', monospace; color: var(--gold-hell); margin-left: 8px; }
.t-nachspielszene { display: grid; justify-items: center; gap: 8px; }
.t-stand-mitte { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 8; background: var(--tinte); padding: 8px 12px;
  box-shadow: 0 0 0 4px var(--gold-2); }

/* ---------- Elemente ---------- */
.t-elementszene { width: 100%; max-width: 720px; }
.t-elgitter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
@media (min-width: 640px) { .t-elgitter { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.t-el { display: flex; align-items: center; gap: 12px; }
.t-elfeld { flex: none; display: grid; place-items: center; width: 58px; height: 72px; background-color: #23160e; box-shadow: inset 0 0 0 2px #1a110a, inset 0 0 0 4px var(--holz-hell); }
.t-elfeld canvas.elsym { width: 42px; height: 42px; }
.t-elfeld canvas.elsym.plakette { width: 45px; height: 45px; opacity: .85; }

/* ---------- Wien-Tour ---------- */
.t-tourszene { display: grid; justify-items: center; gap: 14px; }
.t-tourkopf { display: flex; align-items: center; gap: 12px; color: var(--papier); }
.t-tourreihe { display: flex; gap: calc(8px * var(--k)); align-items: flex-end; perspective: 800px; }
.t-tourplatz { position: relative; display: grid; justify-items: center; gap: 4px; }
.t-tourname { font-size: var(--fs-s); color: var(--text-leise); }
.t-boss .t-tourname { color: var(--gold); }
.t-krone { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); color: var(--gold); z-index: 2; filter: drop-shadow(0 2px 0 var(--tinte)); }
.t-haken { position: absolute; top: -8px; right: -8px; z-index: 3; width: 32px; height: 32px; display: grid; place-items: center; background: var(--gold); color: var(--tinte);
  box-shadow: 0 0 0 2px var(--tinte), inset 0 -3px 0 var(--gold-2); animation: t-auf .2s steps(3) both; }
.t-bezirk { position: relative; display: inline-grid; place-items: center; width: 48px; height: 48px; padding-bottom: 4px; font-family: 'CW Dick', monospace; font-size: 32px; line-height: 1;
  background: var(--papier); color: var(--tinte); border: 4px solid transparent; border-image: var(--rahmen-tinte) 2 / 4px stretch; background-clip: padding-box;
  box-shadow: inset 0 -4px 0 var(--papier-2); }
.t-bezirk.zu { background: #24352b; color: #6d8577; border-image-source: var(--rahmen-gruen); box-shadow: none; }
.t-bezirk.frei { background: var(--gold); box-shadow: inset 0 -4px 0 var(--gold-2), inset 0 3px 0 var(--gold-hell); }
.t-schloss { position: absolute; top: -10px; right: -10px; color: #8a9c90; background: var(--tinte); padding: 2px; box-sizing: content-box; }
.t-tourunten { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 24px; }
.t-tokens { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 300px; }
.t-sammelplatz { display: grid; justify-items: center; gap: 4px; }
.t-sammelfach { position: relative; width: calc(58px * var(--kh)); height: calc(72px * var(--kh)); box-shadow: inset 0 0 0 2px var(--linie); background: rgba(0, 0, 0, .18); perspective: 600px; }
.t-sammelfach .karte { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Trafik ---------- */
.t-trafikszene { display: grid; justify-items: center; gap: 16px; }
.t-trafikoben { display: flex; align-items: center; gap: 20px; }
.t-packplatz { width: calc(66px * var(--k)); height: calc(90px * var(--k)); display: grid; place-items: center; }
.t-packerl { width: 100%; height: 100%; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .45)); }
.t-packerl.t-offen { opacity: .35; }
.t-preise { display: grid; gap: 10px; justify-items: start; }
.t-gratis { font-size: var(--fs-s); background: var(--rot); color: var(--papier); padding: 2px 8px 4px; box-shadow: 0 0 0 2px var(--tinte); }

/* ---------- Grätzlkönig ---------- */
.t-koenigszene { display: grid; justify-items: center; gap: 16px; }
.t-koenigplatz { position: relative; display: grid; justify-items: center; gap: 4px; }
.t-grosskrone { color: var(--gold); filter: drop-shadow(0 4px 0 var(--tinte)); }
.t-koenigschild { font-family: 'CW Logo', 'CW Dick', monospace; font-size: 32px; color: var(--gold-hell); background: var(--tinte); padding: 8px 18px 12px;
  border: 4px solid transparent; border-image: var(--rahmen-gold) 2 / 4px stretch; background-clip: padding-box; }

/* ---------- Schluss ---------- */
.t-faecher { position: relative; width: calc(58px * var(--k) * 3); height: calc(72px * var(--k) + 48px); }
.t-faecher .karte { position: absolute; top: 12px; left: 50%; margin-left: calc(58px * var(--k) / -2);
  transform: translateX(calc(var(--i) * 46%)) rotate(calc(var(--i) * 7deg)) translateY(calc(var(--i) * var(--i) * 5px)); transform-origin: 50% 120%;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .45)); }

@media (prefers-reduced-motion: reduce) {
  .t-ring, .t-ring.minus, .t-schild, .t-zahl, .t-haken, .t-gewaehlt, .t-feld.t-glimm, .t-ergebnis.zeigen { animation: none; }
}
