/* AssistUK Dominosteine — nur was über kern/css/spiel.css hinausgeht (Muster: Builder) */
html, body { background: radial-gradient(ellipse at 50% 30%, #3a3a2a 0%, var(--grund) 70%); }
#buehne { position: fixed; inset: 0; }
#bau { position: fixed; inset: 0; z-index: 1; }
#bau[hidden] { display: none; }
/* Bau-Felder: Zeigen, Tippen, Verweilen und Scannen laufen über die Spiel-Methoden (app.js), nicht über den Rahmen */
#bau .bau-feld { pointer-events: none; min-width: 128px; min-height: 96px; }
#bau .bau-links, #bau .bau-rechts { top: calc(50% + 48px); max-height: calc(100% - 128px); flex-wrap: wrap; align-content: flex-start; }
#bau .bau-rechts { align-content: flex-end; }
#bau .bau-unten { flex-wrap: wrap; justify-content: center; max-width: calc(100% - 2 * 128px - 56px); }
@media (max-height: 500px) {
  #bau .bau-feld { min-width: 120px; min-height: 96px; }
  #bau .bau-rechts { top: 50%; transform: translateY(-50%); max-height: calc(100% - 16px); gap: 8px; }
  #bau .bau-unten { bottom: 8px; gap: 8px; max-width: calc(100% - 2 * 128px - 40px); }
  .bau-anzeige { right: auto; left: max(12px, env(safe-area-inset-left)); top: 120px; }
}
@media (max-height: 420px) {
  /* Ausnahme 4 (kern/LAYOUT.md): ≥ 96 × 72 unter 420 px Höhe */
  #bau .bau-feld { min-width: 104px; min-height: 76px; padding: 4px; }
  #bau .bau-feld svg { width: 30px; height: 30px; }
}
/* Vorlagen-Seite: Gitter wie die Level, Blättern über die Leiste */
.vorlagen-schirm .vorlagen-gitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--luecke); align-content: start; padding: 0 var(--rand-aussen); }
.vorlagen-schirm .vorlagen-gitter .knopf { min-height: 120px; }
.vorlagen-schirm .titel { text-align: center; }
.modus-text { font-size: var(--s-klein); }

/* ---- aus builder.css übernommen (Zähler, Startbild, Feld-Stil), 23.11.2026 ---- */
#bau .bau-raster { top: calc(50% + 48px); }
.bau-anzeige { position: absolute; right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top));
  display: flex; gap: 6px; padding: 6px; border-radius: 20px; background: var(--flaeche-glas, #0b1622d8); border: 3px solid var(--rand, #ffffff40);
  box-shadow: var(--schatten-weich, 0 10px 28px #000b); color: #fff; font-family: var(--schrift, "DM Sans", system-ui, sans-serif);
  pointer-events: none !important; }
.bau-anzeige[hidden] { display: none; }
/* Darstellung 11.11.2026: je Wert ein Feld — kleine Überschrift, große Zahl (wie die Anzeigen der Sport-Spiele) */
.bau-anzeige span { display: flex; flex-direction: column; justify-content: center; min-width: 92px; padding: 4px 14px 6px; border-radius: 14px;
  background: linear-gradient(180deg, #ffffff14, #ffffff05); font: 700 22px/1.1 var(--schrift, "DM Sans", system-ui, sans-serif); }
.bau-anzeige span:first-child { background: linear-gradient(180deg, color-mix(in srgb, var(--akzent) 34%, transparent), color-mix(in srgb, var(--akzent) 14%, transparent)); }
.bau-anzeige small { font-size: 14px; font-weight: 600; color: var(--leise, #cfdbe6); letter-spacing: .3px; }
.bau-anzeige b { font-size: 28px; font-weight: 800; color: #fff; white-space: nowrap; }
@media (max-height: 500px), (max-width: 600px) {
  .bau-anzeige { gap: 4px; padding: 4px; border-width: 2px; border-radius: 16px; }
  .bau-anzeige span { min-width: 0; padding: 3px 9px 4px; border-radius: 12px; }
  .bau-anzeige b { font-size: 20px; } .bau-anzeige small { font-size: 12px; }
}
/* Hochformat schmal: neben „Pause“ (151 px) bleibt rechts wenig Platz — Anzeige darf nicht unter den Knopf ragen */
@media (max-width: 600px) { .bau-anzeige { max-width: calc(100vw - 190px); flex-wrap: wrap; justify-content: flex-end; } }
.blickpunkt-bau { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; pointer-events: none !important;
  border: 4px solid #ffd23f; box-shadow: 0 0 0 3px #000; }
.blickpunkt-bau[hidden] { display: none; }
body.bf-cvi .bau-anzeige { background: #000; color: #ffd23f; border: 3px solid #fff; box-shadow: none; }
body.bf-cvi .bau-anzeige span { background: #000; }
body.bf-cvi .bau-anzeige small, body.bf-cvi .bau-anzeige b { color: #ffd23f; }
/* Startseite: Bild aus dem Spiel (assets/bild/start.webp), oben und unten abgedunkelt; CVI und „Ruhiger Hintergrund“: schwarz */
.bildschirm.domino-start { isolation: isolate; }
body:not(.bf-cvi) .bildschirm.domino-start { background: url("../assets/bild/start.webp") center 62% / cover no-repeat, var(--grund); }
body:not(.bf-cvi) .bildschirm.domino-start::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, #1b2433e6 0%, #1b243380 22%, #1b243326 42%, #1b2433b3 64%, #1b2433f2 100%); }
body.bf-ruhig .bildschirm.domino-start, body.bf-ruhig .bildschirm.domino-start::before { background: #000; }
/* Felder des Bau-Kerns im Stil der Arcade-Knöpfe (Glas, heller Rand, Schatten); Fokus/Scan-Rahmen kommen weiter aus
   _shared_bau (gelb-schwarz). CVI behält die Felder des Bau-Kerns (schwarz, gelb). */
#bau:not(.bau-cvi) .bau-feld:not(.bau-unsichtbar):not(.bau-rahmen) { border: 3px solid var(--rand, #ffffff40); border-radius: var(--r-gross, 22px);
  background: linear-gradient(180deg, #ffffff12, #ffffff00 45%), var(--flaeche-glas, #0b1622d8); box-shadow: var(--schatten, 0 5px 0 #0009); }
#bau:not(.bau-cvi) .bau-feld:not(.bau-unsichtbar):not(.bau-rahmen).bau-gewaehlt { border-color: var(--akzent); background: color-mix(in srgb, var(--akzent) 34%, var(--flaeche, #0b1622)); }
#bau:not(.bau-cvi) .bau-feld:not(.bau-unsichtbar):not(.bau-rahmen).bau-fokus,
#bau:not(.bau-cvi) .bau-feld:not(.bau-unsichtbar):not(.bau-rahmen).scan-focus { border-color: #ffd23f; box-shadow: 0 0 0 5px #000, 0 0 0 9px #ffd23f; }
/* Hinweise des Spiels (Aufgabe, „Perfekt gesetzt!“) als Karte in der Akzentfarbe */
#bau:not(.bau-cvi) .bau-hinweis { top: max(16px, env(safe-area-inset-top)); padding: 12px 26px; border-radius: 20px; border: 3px solid var(--akzent);
  background: #0b1622ee; box-shadow: var(--schatten-weich, 0 10px 28px #000b); font-size: clamp(18px, .8vw + 1.2vh, 28px); max-width: min(70%, 900px); }
@media (max-width: 600px) { #bau .bau-hinweis { top: 128px; max-width: calc(100% - 24px); } }
/* Kacheln Vorlagen und Freies Legen im Level-Gitter */
.level-knopf.modus { flex-direction: column; gap: 4px; }
.level-knopf.modus .modus-text { font-size: clamp(15px, .6vw + .9vh, 22px); line-height: 1.1; text-align: center; }
.level-knopf.modus svg { width: 40px; height: 40px; }
.gross-sterne i { width: 64px; height: 64px; }
/* Handy quer (Höhe ≤ 500): Zähler unter „Pause“, Felder untereinander (die rechte Spalte reicht dort über die ganze
   Höhe). Steht am Ende, damit die Grundregel oben (rechts oben) hier nicht gewinnt. */
@media (max-height: 500px) {
  .bau-anzeige { left: max(12px, env(safe-area-inset-left)); right: auto; top: 120px; flex-direction: column; max-width: none; }
}
/* Handy hoch (≤ 600 breit): beide Leisten als Raster unten, je Reihe 3 Felder ≥ 120 breit (Messung 23.11.: vorher wurde
   die Leiste unten auf 78 px gequetscht und lag über „Los!“) */
@media (max-width: 600px) and (orientation: portrait) {
  #bau .bau-unten, #bau .bau-rechts { position: absolute; left: 4px; right: 4px; transform: none; top: auto; max-width: none; max-height: none; width: auto;
    display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 8px; justify-content: center; }
  #bau .bau-unten { bottom: max(8px, env(safe-area-inset-bottom)); }
  #bau .bau-rechts { bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--domino-unten-h, 208px)); }
  #bau .bau-unten:has(> .bau-feld:nth-child(4)) ~ .bau-rechts, #bau .bau-rechts:has(~ .bau-unten > .bau-feld:nth-child(4)) { --domino-unten-h: 208px; }
  #bau .bau-feld { min-width: 120px; min-height: 96px; }
}
