/* ── Tierlist-Maker /tierlist — Block WZ3 (BAUPLAN-WERKZEUGE, Figma WZ0 Final 887:2414 T-1…T-6 + T-2b) ── Praefix wzt-
   Werkzeug, kein Schaufenster (Entscheid 8): dunkler Grund, Reihen mit Haarlinien, Etikett in Palettenfarbe (teams.FARBEN), Kacheln
   als Icons. Klappblaetter (.tw-tk-ks, Barlow = BRAND-Ausnahme) NUR fuer die Partienzahl der Meta. ECKIG: Radius 0 ueberall
   (Betreiber 08.11. „keine runden Kanten“). ≤ 760: Reihen-Leiste unten zum Tippen. */
.wzt { max-width: 1440px; margin: 0 auto;
    padding: 0 0 40px; box-sizing: border-box; color: var(--tw-text); }   /* neuer Rahmen: Kante setzt .tw-main */
.wzt *, .wzt *::before, .wzt *::after { box-sizing: border-box; }
.wzt, .wzt *, .wzt *::before, .wzt *::after, .wzt-dlg, .wzt-dlg *, .wzt-zieh, .wzt-leiste, .wzt-leiste * { border-radius: 0 !important; }
.wzt-h1 { font: var(--tw-h1-seite); letter-spacing: -.01em; margin: 0; color: var(--tw-text); }   /* Stufe Seite (W3-B2) */
.wzt-ml { font: 700 11.2px/14px var(--tw-f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--tw-text-3); margin: 0; }
.wzt-sp { flex: 1; }
.wzt .tw-seg { padding: 0; gap: 0; border-color: color-mix(in srgb, var(--tw-text) 10%, transparent); }
.wzt .tw-seg button { height: 34px; }
.wzt-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--tw-akzent); font: 600 13px var(--tw-f-mono); text-decoration: none; }
.wzt-link:disabled { color: var(--tw-text-4); cursor: default; }
.wzt-link:hover:not(:disabled) { color: var(--tw-akzent); }

/* Werkzeugleiste */
.wzt-werk { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--tw-linie); border-bottom: 1px solid var(--tw-linie); flex-wrap: wrap; min-height: 64px; }
.wzt-werk .tw-btn.prim { gap: 8px; }

/* Titel (inline bearbeitbar) */
.wzt-titel { margin-top: 20px; }
.wzt-titel-in { width: 100%; max-width: 640px; background: transparent; border: 0; border-bottom: 1px dashed transparent; padding: 2px 0; color: var(--tw-text);
    font: 800 22px/1.25 var(--tw-f-mono); }
.wzt-titel-in::placeholder { color: var(--tw-text); opacity: 1; }
.wzt-titel-in:hover:not([readonly]) { border-bottom-color: var(--tw-text-4); }
.wzt-titel-in:focus { outline: none; border-bottom: 1px solid var(--tw-akzent); }
.wzt-titel-in:focus::placeholder { color: var(--tw-text-4); }

/* Bänder: Meta-Kennzeichnung (T-2), zu wenige Partien (T-2b), geteilt (T-6/S-3) */
.wzt-hinweis:empty { display: none; }
.wzt-band { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 12px 16px; flex-wrap: wrap; }
.wzt-band p { margin: 0; font: 500 13px/18px var(--tw-f-mono); color: var(--tw-text-2); flex: 1; min-width: 240px; }
.wzt-band p b { color: var(--tw-text); }
.wzt-band.geteilt { border: 1px solid var(--tw-linie); background: var(--tw-grund-2); }

/* Reihen */
.wzt-reihen { margin-top: 20px; border-top: 1px solid var(--tw-linie); }
.wzt-status { padding: 16px 0; }
.wzt-reihe { --rf: var(--tw-text); position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr) 44px; min-height: 76px; border-bottom: 1px solid var(--tw-linie); }
.wzt-lab { display: flex; align-items: center; justify-content: center; background: var(--rf); padding: 6px; }
.wzt-lab input { width: 100%; background: transparent; border: 0; padding: 4px 2px; text-align: center; color: var(--tw-grund);
    font: 900 30px/1 var(--tw-f-mono); text-overflow: ellipsis; }
.wzt-lab.lang input { font-size: 13px; line-height: 1.15; font-weight: 800; letter-spacing: .02em; }
.wzt-lab input:focus { outline: 2px solid var(--tw-grund); outline-offset: -2px; background: color-mix(in srgb, var(--tw-text) 35%, transparent); }
.wzt-lab input[readonly] { cursor: default; }
.wzt-bahn { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px 12px; align-items: center; align-content: center; background: color-mix(in srgb, var(--tw-text) 1.5%, transparent); min-width: 0; }
.wzt-leer { font: 400 13px/18px var(--tw-f-mono); color: var(--tw-text-4); }
.wzt-mehr, .wzt-mehr-p { display: flex; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--tw-text-3); cursor: pointer; }
.wzt-mehr:hover, .wzt-mehr[aria-expanded="true"] { color: var(--tw-text); background: color-mix(in srgb, var(--tw-text) 4%, transparent); }
.wzt-reihe.ziel .wzt-bahn { background: color-mix(in srgb, var(--tw-akzent) 8%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tw-akzent) 50%, transparent); }
.wzt-einfueg { width: 3px; height: 58px; background: var(--tw-akzent); box-shadow: 0 0 10px color-mix(in srgb, var(--tw-akzent) 70%, transparent); flex: none; }

/* Reihen-Menü (T-5) */
.wzt-menu { position: absolute; z-index: 20; right: 8px; top: calc(100% - 6px); width: 300px; padding: 16px; background: var(--tw-grund-2);
    border: 1px solid color-mix(in srgb, var(--tw-text) 12%, transparent); box-shadow: 0 20px 50px color-mix(in srgb, var(--tw-grund) 60%, transparent); display: flex; flex-direction: column; gap: 12px; }
.wzt-farben { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.wzt-farben button { aspect-ratio: 1; background: var(--f); border: 0; cursor: pointer; padding: 0; }
.wzt-farben button.an { box-shadow: 0 0 0 2px var(--tw-grund-2), 0 0 0 4px var(--tw-text); }
.wzt-farben button:focus-visible { outline: 2px solid var(--tw-text); outline-offset: 2px; }
.wzt-zl { display: flex; flex-direction: column; border-top: 1px solid var(--tw-linie); }
.wzt-zl button { display: flex; align-items: center; gap: 10px; height: 38px; border: 0; background: transparent; color: var(--tw-text-2); font: 500 14px var(--tw-f-mono); padding: 0 4px; cursor: pointer; text-align: left; }
.wzt-zl button:hover:not(:disabled) { color: var(--tw-text); background: color-mix(in srgb, var(--tw-text) 4%, transparent); }
.wzt-zl button:disabled { color: var(--tw-text-4); cursor: default; }
.wzt-zl button svg { transform: rotate(180deg); flex: none; }
.wzt-zl button.runter svg { transform: none; }
.wzt-zl button[data-wzt-dazu] svg, .wzt-zl button.gefahr svg { transform: none; }
.wzt-zl button.gefahr { color: var(--tw-text); }

/* Unter den Reihen */
.wzt-unter { margin-top: 14px; }
.wzt-unter-z { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.wzt-hw { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; font: 400 13px/17px var(--tw-f-mono); color: var(--tw-text-3); }
.wzt-hw b { color: var(--tw-text); }
.wzt-hw kbd { font: 600 11px/1 var(--tw-f-mono); padding: 3px 6px; border: 1px solid color-mix(in srgb, var(--tw-text) 15%, transparent); border-bottom-width: 2px; color: var(--tw-text-2); }

/* Champion-Kachel: in Reihen nur das Icon, im Pool mit Namen */
.wzt-c { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; padding: 0; border: 0; background: none;
    color: var(--tw-text-2); cursor: grab; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.wzt-c img { width: 58px; height: 58px; display: block; border: 1px solid var(--tw-linie); background: var(--tw-grund-2); pointer-events: none; }
.wzt-c span { font: 500 11px/13px var(--tw-f-mono); max-width: 66px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wzt-bahn .wzt-c span { display: none; }
.wzt-c:hover img { border-color: color-mix(in srgb, var(--tw-text) 35%, transparent); }
.wzt-c:focus-visible { outline: none; }
.wzt-c:focus-visible img { outline: 2px solid var(--tw-akzent); outline-offset: 2px; }
.wzt-c.wahl img { border: 2px solid var(--tw-akzent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tw-akzent) 25%, transparent); }
.wzt-c.wahl span { color: var(--tw-text); font-weight: 700; }
.wzt-c.geist { opacity: .25; }
.wzt-c[aria-disabled="true"] { cursor: default; }
body.wzt-zieht, body.wzt-zieht * { cursor: grabbing !important; user-select: none; }
.wzt-zieh { position: absolute; left: 0; top: 0; z-index: 9000; width: 66px; height: 66px; pointer-events: none;
    box-shadow: 0 16px 34px color-mix(in srgb, var(--tw-grund) 65%, transparent), 0 0 0 2px var(--tw-akzent); will-change: transform; }

/* Pool */
.wzt-pool { margin-top: 32px; padding: 4px; margin-left: -4px; margin-right: -4px; }
.wzt-pool.ziel { background: color-mix(in srgb, var(--tw-akzent) 5%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tw-akzent) 40%, transparent); }
.wzt-pool-kopf { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.wzt-pool-kopf h2 { flex: none; }
.wzt-such { position: relative; flex: 1; min-width: 200px; }
.wzt-such input { width: 100%; height: 38px; padding: 0 12px 0 36px; background: color-mix(in srgb, var(--tw-text) 3%, transparent); border: 1px solid var(--tw-linie); color: var(--tw-text);
    font: 500 14px var(--tw-f-mono); }
.wzt-such input:focus { outline: none; border-color: var(--tw-akzent); }
.wzt-such svg { position: absolute; left: 12px; top: 11px; color: var(--tw-text-3); }
.wzt-gitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 12px 8px; min-height: 76px; }
.wzt-pool-leer { margin: 8px 0 0; font: 500 13px var(--tw-f-mono); color: var(--tw-text-3); }
.wzt-tl-ablauf { margin: 4px 0 0; font: 500 12px var(--tw-f-mono); color: var(--tw-text-3); }
.wzt-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: -1px; }

/* Geteilt: nur lesen */
body.wzt-geteilt .wzt-c { cursor: default; }

/* Reihen-Leiste (T-4, Tippen) — fest unten, nur ≤ 760 */
.wzt-leiste { display: none; }

@media (max-width: 760px) {
    .wzt { padding-bottom: 120px; }   /* unten Platz fuer die feste Teilen-Leiste; oben setzt der Rahmen die Kante */
    .wzt-werk { gap: 10px; }
    .wzt-reihe { grid-template-columns: 64px minmax(0, 1fr) 36px; min-height: 60px; }
    .wzt-lab input { font-size: 24px; }
    .wzt-bahn { padding: 6px 8px; gap: 4px; }
    .wzt-c img { width: 44px; height: 44px; }
    .wzt-einfueg { height: 44px; }
    .wzt-gitter { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 10px 6px; }
    .wzt-c span { max-width: 56px; font-size: 10px; }
    .wzt-menu { right: 0; left: 0; width: auto; }
    .wzt-hw { display: none; }
    .wzt-leiste:not([hidden]) { display: flex; flex-direction: column; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--tw-grund-2); border-top: 1px solid color-mix(in srgb, var(--tw-text) 12%, transparent);
        box-shadow: 0 -16px 40px color-mix(in srgb, var(--tw-grund) 55%, transparent); }
    .wzt-leiste .k { display: flex; align-items: center; gap: 10px; }
    .wzt-leiste .k img { width: 40px; height: 40px; border: 1px solid var(--tw-linie); }
    .wzt-leiste .k div { flex: 1; display: flex; flex-direction: column; font: 500 12px var(--tw-f-mono); color: var(--tw-text-3); }
    .wzt-leiste .k b { font: 700 15px var(--tw-f-mono); color: var(--tw-text); }
    .wzt-leiste-zu { width: 36px; height: 36px; border: 1px solid var(--tw-linie); background: transparent; color: var(--tw-text-2); display: flex; align-items: center; justify-content: center; }
    .wzt-leiste .z { display: flex; gap: 6px; overflow-x: auto; }
    .wzt-leiste .z button { flex: 1 0 44px; min-width: 44px; height: 44px; padding: 0 8px; border: 0; background: var(--rf); color: var(--tw-grund);
        font: 800 15px var(--tw-f-mono); white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
    .wzt-leiste .z button.pool { background: transparent; color: var(--tw-text-2); border: 1px solid color-mix(in srgb, var(--tw-text) 18%, transparent); flex: 0 0 auto; }
    .wzt-leiste .z button.pool:disabled { color: var(--tw-text-4); }
}

/* Dialoge dieser Seite (Rueckfrage, „Wie gerechnet?“, Teilen aus tw-kern) ebenfalls eckig */
body.page-wzt #tw-ov .tw-dlg, body.page-wzt #tw-ov .tw-dlg * { border-radius: 0 !important; }
body.wzt-geteilt .wzt-pool { opacity: .45; }
/* neuer Rahmen: auf der geteilten Liste (Seite) bleiben Werkzeugleiste und Hinweis leer — dann ohne Linien */
.wzt-werk:empty, .wzt-hinweis:empty { display: none; }
