/* Boulevard — spielspezifische Styles (Chrome aus ../style.css).
   Eigene Optik: dunkles Brett, Farbleisten, KEINE fremde Gestaltung. */

.hero-blvd { font-size: 44px; letter-spacing: 8px; margin-bottom: 8px; }

/* Spieler-Leiste */
.pl-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.pl {
    display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 12px;
    background: var(--panel); border: 1px solid var(--panel-border); font-size: 14px;
}
.pl.turn { border-color: var(--gold); box-shadow: 0 0 18px rgba(242, 193, 78, .25); animation: focus-pulse 1.6s infinite; }
.pl.dead { opacity: .45; filter: grayscale(.8); }
/* E59B (S21): Bargeld ist in Boulevard die eine Zahl. */
.pl .cash { font-weight: 800; color: var(--gold); font-size: 17px; font-variant-numeric: tabular-nums; }
.pl .dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.35); }

/* ── Brett: 11×11-Grid ────────────────────────────── */
.board {
    display: grid; grid-template-columns: repeat(11, 1fr); grid-template-rows: repeat(11, 1fr);
    /* S15: zusätzlich an die Viewport-HÖHE gedeckelt, Untergrenze 300px */
    gap: 2px;
    /* 100% statt 96vw: 96vw ignorierte das Screen-Padding → 2px Quer-Scroll */
    /* E84: Die Kantenlänge steht EINMAL da und gilt für Breite UND Höhe.
       Vorher stand nur `width` + `aspect-ratio: 1` — und das reicht hier
       nicht: `.board` ist Flex-Item in einer Spalten-Flexbox, die Höhe kam
       also aus dem Inhalt (die `1fr`-Zeilen haben ein automatisches Minimum),
       und das Seitenverhältnis verlor. Gemessen am Rechner: 720×1213 statt
       720×720, Felder 63×108 statt 63×63, oberer Rand 464 px ÜBER dem Bild.
       Am Handy stimmte es, deshalb ist es lange niemandem aufgefallen. */
    --kante: min(100%, 720px);   /* Fallback ohne dvh (Safari < 15.4) */
    --kante: clamp(280px, min(100%, calc(100dvh - 350px)), 720px);
    width: var(--kante); height: var(--kante);
    flex: 0 0 auto;              /* nicht vom Flex-Container gestreckt/gestaucht */
    max-width: 100%; aspect-ratio: 1; margin: 0 auto 12px;
    background: rgba(63, 191, 111, .05); border: 1px solid var(--panel-border);
    border-radius: 12px; padding: 4px;
}
.tile {
    position: relative; border-radius: 4px; background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .07); overflow: hidden;
    display: flex; flex-direction: column; min-width: 0; min-height: 0;
    font-size: clamp(5.5px, 1.35vw, 9.5px); line-height: 1.15; padding: 1px 2px;
}
.tile .strip { height: 18%; min-height: 4px; border-radius: 2px; margin-bottom: 1px; }
.tile .nm { font-weight: 700; overflow: hidden; word-break: break-word; }
.tile .pr { color: var(--muted); margin-top: auto; }
.tile.special { align-items: center; justify-content: center; text-align: center; font-size: clamp(8px, 2vw, 15px); }
.tile.owned { box-shadow: inset 0 0 0 2px var(--ownc, transparent); }
.tile.here { background: rgba(242, 193, 78, .16); }
.tile .hs { position: absolute; top: 1px; right: 2px; font-size: clamp(6px, 1.5vw, 10px); }
.tile .chips { position: absolute; bottom: 1px; right: 2px; display: flex; gap: 1px; }
.tile .chips i {
    width: clamp(6px, 1.6vw, 11px); height: clamp(6px, 1.6vw, 11px);
    border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .5);
}

/* Brettmitte: Würfel + Karte + Log + Pott */
.mid {
    grid-row: 2 / 11; grid-column: 2 / 11;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; padding: 4%; min-height: 0; overflow: hidden;
}
.mid .dice { font-size: clamp(30px, 7vw, 54px); line-height: 1; }
.mid .dice span { animation: die-in .3s cubic-bezier(.2, 1.6, .4, 1); display: inline-block; }
@keyframes die-in { from { transform: scale(.4) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }
.mid .pot { font-size: clamp(10px, 2vw, 14px); color: var(--gold); font-weight: 700; }
.mid .cardbox {
    font-size: clamp(8px, 1.8vw, 13px); text-align: center; color: var(--text);
    background: rgba(242, 193, 78, .1); border: 1px solid rgba(242, 193, 78, .45);
    border-radius: 10px; padding: 6px 10px; max-width: 100%;
}
.mid .log {
    font-size: clamp(7px, 1.6vw, 11.5px); color: var(--muted); text-align: center;
    overflow: hidden; max-width: 100%; display: grid; gap: 2px;
}
.mid .log .lg { justify-content: center; gap: 5px; }
.mid .log .lg:last-child .lg-t { color: var(--text); font-weight: 600; }

/* Aktions-Box */
.action-box { width: min(640px, 100%); margin: 0 auto 12px; }
.action-title { font-size: 15px; color: var(--muted); margin-bottom: 10px; }
.action-box.focus .action-title { font-size: 18px; font-weight: 800; color: var(--text); }
.act-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.act-btns .btn { min-height: 50px; min-width: 130px; font-size: 15.5px; }
.btn.danger { border-color: rgba(229, 72, 77, .55); color: var(--red); }
.build-row { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.build-row[hidden] { display: none; }
.build-row .btn { font-size: 12.5px; padding: 8px 10px; }
.finish-btn { display: block; margin: 0 auto; font-size: 13.5px; padding: 9px 16px; color: var(--muted); }
/* E78: Aufgeben ist endgültig — also zurückhaltend, aber nicht versteckt.
   `[hidden]` braucht die eigene Zeile, weil `display: block` sonst gewinnt
   (die Falle aus E75). */
.giveup-btn { display: block; margin: 8px auto 0; font-size: 13px; padding: 8px 14px; color: var(--muted); min-height: 44px; }
.giveup-btn[hidden], .finish-btn[hidden] { display: none; }

/* §4.16 Desktop-Fill */
@media (min-width: 1100px) {
    .board { --kante: min(80vh, 860px); }
    .tile { font-size: 11px; }
}

/* Etappe 21 (A4): Lande-Puls auf dem Zielfeld */
.tile.landed { animation: tile-land .6s ease-out; }
@keyframes tile-land {
    0% { box-shadow: 0 0 0 0 rgba(242, 193, 78, .8); }
    100% { box-shadow: 0 0 0 14px rgba(242, 193, 78, 0); }
}

/* ── Etappe 23 (Feedback-Runde 6) ── */
/* F7: Avatar-Spielfiguren statt Punkte */
.tile .chips i {
    width: clamp(10px, 2.4vw, 17px); height: clamp(10px, 2.4vw, 17px);
    border-radius: 50%; display: grid; place-items: center;
    font-size: clamp(7px, 1.7vw, 12px); line-height: 1;
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .5);
}
.pl.off { opacity: .6; }
.pl .offtag { font-size: 11px; color: var(--muted); border: 1px solid var(--panel-border); border-radius: 999px; padding: 1px 7px; }

/* F9: Häuser-Badge lesbar */
.tile .hs {
    top: auto; bottom: 1px; left: 2px; right: auto;
    font-size: clamp(7px, 1.7vw, 11px); font-weight: 800;
    background: rgba(0, 0, 0, .55); border-radius: 5px; padding: 0 3px;
}

/* F10: Bau-Menü */
.build-btn { text-align: left; line-height: 1.25; }
.build-btn small { color: var(--muted); font-weight: 600; }

/* F11: Log-Box */
.log-box {
    width: min(640px, 100%); margin: 0 auto 10px; padding: 10px 14px;
    background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
    font-size: 13px; color: var(--muted); display: grid; gap: 3px;
}
.log-box:empty { display: none; }
.log-box .lg { padding: 2px 8px; border-left: 2px solid transparent; border-radius: 3px; }
.log-box .lg.new { color: var(--text); font-weight: 700; font-size: 14.5px; background: rgba(255, 255, 255, .04); }

/* Etappe 46C: Log-Zeile = Text (+ „→ Name") links, farbiger Betrag rechts */
.lg { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lg-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-to { color: var(--muted); font-weight: 400; }
.lg-d { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.lg.pos .lg-d { color: var(--green); }
.lg.neg .lg-d { color: var(--red); }
.log-box .lg.pos { border-left-color: rgba(63, 191, 111, .55); }
.log-box .lg.neg { border-left-color: rgba(229, 72, 77, .55); }

/* F12: Spielstand-Hinweis */
.save-hint { text-align: center; font-size: 12px; color: var(--muted); margin: 0 auto 10px; max-width: 560px; }

/* F8: Feld-Karte */
.tile-card { width: min(400px, 92vw); }
.ti-strip { height: 14px; border-radius: 8px; margin-bottom: 10px; }
.tile-card .scores td { padding: 3px 6px; font-size: 13.5px; }
.tile { cursor: pointer; }

/* Etappe 35 (#6): Discord-Bild als Boulevard-Figur */
.chips i img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }

/* ── E84: Das Brett schräg (umschaltbar, Vorgabe bleibt flach) ──────────
   Kein WebGL, keine Bibliothek: Das Brett IST ein DOM-Raster, also kippt
   es der Compositor. Damit bleiben Klicks, Tippziele, das Mobile-Gate, der
   Lande-Puls und die Vorlesbarkeit unverändert — mit einer Leinwand müsste
   das alles neu gebaut werden.

   Der Preis ist ehrlich benannt: ein GEKIPPTES Brett mit erhabenen Figuren,
   keine drehbare Kamera und keine modellierten Häuser. */

.schraeg-chip {
    display: none;                 /* nur im Spiel, s. .view-game-Regel unten */
    margin: 0 auto 8px; padding: 8px 14px; min-height: 44px;
    border-radius: 999px; border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, .05); color: var(--muted);
    font-size: 13px; cursor: pointer;
}
#view-game.active .schraeg-chip { display: block; }
#view-game.active .schraeg-chip[hidden] { display: none; }
.schraeg-chip[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }

/* Die Perspektive steht IM Transform des Bretts, nicht als feste Zahl auf
   einem Eltern-Element — denn sie muss mit der Brettgröße wachsen. Mit
   festen 1400 px staucht ein 720-px-Brett viel stärker als ein 358-px-Brett:
   gemessen 63 % der Feldhöhe am Rechner gegen 83 % am Handy, bei gleichem
   Winkel. `--kante` (dieselbe Kantenlänge, die Breite und Höhe setzt) hält
   das Verhältnis über alle Größen konstant. */
.board-buehne { transform-style: preserve-3d; }

.board.schraeg {
    /* 34° statt der zuerst gewählten 46°: Bei 46° schrumpfte die hinterste
       Reihe am Rechner auf 55 % (34 px von 63) — das ist Dekoration, kein
       Spielbrett. Der Test misst das jetzt, statt es dem Auge zu überlassen. */
    /* `--tiefe` statt `calc(var(--kante) * 4)`: `--kante` enthält
       `min(100%, …)`, und `perspective()` verträgt KEINE Prozentwerte — der
       ganze Transform war damit ungültig und auf dem Handy kippte gar nichts.
       Aufgefallen ist das nur, weil der Test seitdem auch eine OBERGRENZE
       prüft; mit „mindestens 66 % der flachen Höhe" ging „0 % Neigung" als
       grün durch (S34: eine Prüfung, die nicht scheitern kann). */
    transform: perspective(var(--tiefe, 2800px)) rotateX(var(--neigung, 34deg)) translateY(-3%) scale(.95);
    transform-style: preserve-3d;
    transition: transform .35s ease;
    box-shadow: 0 40px 60px -30px rgba(0, 0, 0, .75);
}

/* Feldinhalte zurückdrehen: Sonst fliehen Namen und Preise in die Tiefe und
   die hinterste Reihe ist auf 390 px nur noch ~3 px hoch. Gemessen wird im
   Test die PROJIZIERTE Größe, nicht die im Layout.

   `preserve-3d` MUSS auch auf dem Feld stehen. Ohne das flacht `.tile` seine
   Kinder ein, die Gegendrehung wird in eine flache Ebene gerechnet und dann
   mitgekippt — der Inhalt schrumpfte trotz Gegendrehung auf 86 % (gemessen
   7,9 statt 9,2 px). Genau daran ist die erste Fassung gescheitert. */
.board.schraeg .tile,
.board.schraeg .mid {
    transform-style: preserve-3d;
    /* `overflow: hidden` (Grundregel, damit lange Namen nicht auslaufen)
       erzwingt eine flache Ebene — damit wäre `preserve-3d` wirkungslos und
       die Gegendrehung liefe ins Leere. Im Schrägmodus also aufheben; die
       Namen brechen ohnehin um, statt zu überlaufen. */
    overflow: visible;
}
.board.schraeg .tile > *,
.board.schraeg .mid > * {
    transform: rotateX(calc(-1 * var(--neigung, 34deg)));
    transform-origin: center bottom;
}
/* Figuren stehen auf dem Brett statt darauf zu liegen. */
.board.schraeg .chips i {
    transform: rotateX(calc(-1 * var(--neigung, 34deg))) translateZ(6px);
    transform-origin: center bottom;
}
/* Häuser bekommen Höhe — das ist der eigentliche „altes Monopoly"-Moment. */
.board.schraeg .hs { transform: rotateX(calc(-1 * var(--neigung, 34deg))) translateZ(10px); }

/* Auf dem Handy flacher: 29,8-px-Felder vertragen keine 46°. */
@media (max-width: 700px) { .board.schraeg { --neigung: 26deg; --tiefe: 1400px; } }
@media (max-width: 420px) { .board.schraeg { --neigung: 20deg; --tiefe: 1250px; } }

/* Wer Bewegung reduziert haben will, bekommt kein gekipptes Brett — und
   auch keinen Übergang. */
@media (prefers-reduced-motion: reduce) {
    .board.schraeg { transform: none; transition: none; box-shadow: none; }
    .board.schraeg .tile > *, .board.schraeg .mid > *,
    .board.schraeg .chips i, .board.schraeg .hs { transform: none; }
}

/* ── E85: echtes 3D — die Leinwand tritt an die Stelle des Rasters ────── */
.board-buehne.dreid { position: relative; }
/* Das DOM-Brett bleibt im Dokument (Vorlesbarkeit, Tests, sofortiger
   Rückfall), wird aber nicht angezeigt, solange die Leinwand steht. */
.board-buehne.dreid > .board { display: none; }
.board3d {
    display: block; width: 100%; margin: 0 auto 12px;
    height: var(--kante3d, min(78vh, 560px));
    max-width: 100%; touch-action: none; cursor: grab;
    border-radius: 14px; background: transparent;
}
.board3d:active { cursor: grabbing; }
@media (max-width: 700px) { .board3d { --kante3d: min(58vh, 420px); } }

/* Die Brettmitte neben der Leinwand: In 3D ist das Raster versteckt, also
   müssen Würfel, Pott und gezogene Karte woanders stehen — sonst spielt man
   blind. Das Log darin entfällt, weil `#log-box` darunter ohnehin acht
   Zeilen zeigt. */
.mid-3d {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center;
    /* `.mid` bringt `min-height: 0` und `overflow: hidden` aus dem Raster mit —
       außerhalb des Grids fällt die Mitte damit auf null zusammen und klippt
       ihren Inhalt weg. Beides muss hier zurückgenommen werden. */
    min-height: auto; overflow: visible;
    max-width: 520px; margin: -4px auto 10px; padding: 8px 12px;
    border-radius: 12px; background: rgba(255, 255, 255, .05);
}
.mid-3d .log { display: none; }
.mid-3d:empty { display: none; }
