/* Wordle polarhub.de/wordle/ (ergänzt /shared/polar.css) */
[hidden] { display: none !important; }
.hero { padding-bottom: 24px; }
.reihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.reihe.mitte { justify-content: center; }
.klein { font-size: .88rem; margin-top: 12px; }
.btn.klein { margin: 0; padding: 6px 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }

:root { --richtig: #2e8b4a; --anders: #c99a14; --leer: #6b7380; --feld: #ffffff; }
@media (prefers-color-scheme: dark) { :root { --richtig: #3f9d5b; --anders: #b58a14; --leer: #3b424d; --feld: #171b21; } }
/* Farben für Farbenblinde: Blau und Orange sind auch bei Rot-Grün-Schwäche gut zu unterscheiden */
:root.kontrast { --richtig: #1f6fd1; --anders: #e8710a; }

.spiel { text-align: center; }
.spiel > .klein:first-child { margin-top: 0; }

/* Spielfeld: 6 Zeilen mit je 5 Feldern, Größe folgt der Breite */
.brett { display: grid; grid-template-rows: repeat(6, 1fr); gap: 6px; width: min(100%, 330px); margin: 16px auto; }
.zeile { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.feld { aspect-ratio: 1; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 8px; background: var(--feld); font-size: clamp(1.5rem, 8vw, 2rem); font-weight: 800; text-transform: uppercase; line-height: 1; }
.feld.voll { border-color: var(--muted); animation: tipp .1s ease-out; }
.feld.m2, .feld.m1, .feld.m0 { color: #fff; border-color: transparent; }
.feld.m2 { background: var(--richtig); }
.feld.m1 { background: var(--anders); }
.feld.m0 { background: var(--leer); }
.zeile.neu .feld { animation: dreh .5s ease both; }
.zeile.neu .feld:nth-child(2) { animation-delay: .25s; }
.zeile.neu .feld:nth-child(3) { animation-delay: .5s; }
.zeile.neu .feld:nth-child(4) { animation-delay: .75s; }
.zeile.neu .feld:nth-child(5) { animation-delay: 1s; }
.zeile.falsch { animation: wackel .4s; }
@keyframes tipp { 50% { transform: scale(1.08); } }
@keyframes dreh { 0% { transform: rotateX(0); } 49% { transform: rotateX(90deg); } 51% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes wackel { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .feld, .zeile { animation: none !important; } }

.meldung { min-height: 1.6em; font-weight: 600; }
.meldung.fehler { color: var(--err); }

/* Tastatur */
.tasten { display: grid; gap: 6px; width: min(100%, 520px); margin: 8px auto 0; }
.tr { display: flex; gap: 5px; justify-content: center; }
.taste { flex: 1 1 0; min-width: 0; max-width: 46px; height: 52px; padding: 0; border: 0; border-radius: 8px; background: var(--accent-soft); color: var(--text); font: inherit; font-weight: 700; font-size: 1.05rem; text-transform: uppercase; cursor: pointer; }
.taste.breit { flex-grow: 1.6; max-width: 70px; font-size: 1.2rem; }
.taste:hover { filter: brightness(.95); }
.taste.m2, .taste.m1, .taste.m0 { color: #fff; }
.taste.m2 { background: var(--richtig); }
.taste.m1 { background: var(--anders); }
.taste.m0 { background: var(--leer); }
.ende { margin-top: 18px; }

/* Bestenliste und Statistik */
.kopfzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.liste { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-variant-numeric: tabular-nums; }
.liste th, .liste td { padding: 10px 16px; text-align: right; overflow-wrap: anywhere; }
.liste th:nth-child(-n+2), .liste td:nth-child(-n+2) { text-align: left; }
.liste th:first-child, .liste td:first-child { width: 1%; padding-right: 0; color: var(--muted); }
.liste th { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.liste tr + tr td { border-top: 1px solid var(--line); }
.liste tr.ich td { background: var(--accent-soft); font-weight: 700; }

.zwei { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.zwei > .card { align-self: start; }
.zahlen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; text-align: center; }
.zahlen strong { display: block; font-size: 1.6rem; line-height: 1.2; }
.zahlen span { font-size: .78rem; color: var(--muted); }
.verteilung { display: grid; gap: 4px; margin-top: 16px; }
.verteilung div { display: grid; grid-template-columns: 1em 1fr 2em; align-items: center; gap: 8px; font-size: .88rem; font-variant-numeric: tabular-nums; }
.verteilung progress { width: 100%; height: 14px; border: 0; border-radius: 4px; background: var(--accent-soft); accent-color: var(--richtig); }
.verteilung progress::-webkit-progress-bar { background: var(--accent-soft); border-radius: 4px; }
.verteilung progress::-webkit-progress-value { background: var(--richtig); border-radius: 4px; }
.verteilung progress::-moz-progress-bar { background: var(--richtig); border-radius: 4px; }

#profil form { display: grid; gap: 14px; margin-top: 16px; }
#profil label { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--muted); }
#profil label.haken { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; color: var(--text); }
#profil .haken input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
#profil input[type=text] { width: 100%; padding: 10px 12px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
#profil .reihe { margin-top: 0; }

/* 10-Wörter-Modus: zehn kleine Spielfelder, die gelöste schrumpfen; die Tastatur bleibt unten am Bildschirm */
.bretter { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 12px; margin: 16px 0; text-align: left; }
.mini { display: grid; gap: 2px; align-content: start; padding: 6px; border: 2px solid transparent; border-radius: 8px; }
.mini.fertig { border-color: var(--richtig); }
.mini .zeile { gap: 2px; }
.mini .feld { border-width: 1px; border-radius: 3px; font-size: clamp(.7rem, 2.8vw, .95rem); }
.mini .titel { margin: 0 0 2px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.mini.fertig .titel { color: var(--richtig); }
.mini .loesung { margin: 2px 0 0; font-size: .78rem; font-weight: 700; color: var(--err); text-transform: uppercase; }
.spiel.zehn .tasten { position: sticky; bottom: 0; z-index: 5; padding: 8px 0; background: var(--surface); box-shadow: 0 -8px 12px -8px rgba(0, 0, 0, .15); }
.spiel.zehn .meldung { position: sticky; top: 0; z-index: 5; background: var(--surface); }
h2 small { font-size: .8rem; font-weight: 500; }
.bretter { align-items: start; }

.hinweiszeile { margin-top: 4px; min-height: 0; }
.hinweiszeile .klein { margin-top: 0; }
.optionen { display: flex; gap: 8px 20px; flex-wrap: wrap; justify-content: center; margin-top: 16px; font-size: .88rem; text-align: left; }
.optionen label { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; max-width: 250px; }
.optionen input { width: 17px; height: 17px; accent-color: var(--accent); }
.optionen small { flex-basis: 100%; padding-left: 25px; color: var(--muted); font-size: .8rem; }
.btn .ic { margin-right: 4px; }
.taste .ic { width: 1.6rem; height: 1.6rem; vertical-align: middle; }

/* Breite Bildschirme: Spielfeld links, Bestenliste und Statistik rechts (Mehr-Wörter-Spiele brauchen die volle Breite) */
@media (min-width: 1000px) {
    main.wrap:not(:has(.spiel.zehn)) { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 0 32px; grid-template-rows: auto auto min-content 1fr auto; align-items: start; }
    main.wrap:not(:has(.spiel.zehn)) > .hero { grid-column: 1 / -1; grid-row: 1; }
    main.wrap:not(:has(.spiel.zehn)) > noscript { grid-column: 1 / -1; grid-row: 2; }
    main.wrap:not(:has(.spiel.zehn)) > .wissen { grid-column: 1 / -1; grid-row: 5; }
    main.wrap:not(:has(.spiel.zehn)) > .spiel { grid-column: 1; grid-row: 3 / span 2; }
    main.wrap:not(:has(.spiel.zehn)) > .best { grid-column: 2; grid-row: 3; margin-top: 0; }
    main.wrap:not(:has(.spiel.zehn)) > .stat { grid-column: 2; grid-row: 4; }
}

/* Spielart und Bestenliste: gruppierte Umschalter statt einer langen Reihe gleicher Knöpfe */
.modi { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 12px 26px; margin-bottom: 12px; }
.modi.links { justify-content: flex-start; }
.seg-gruppe { display: grid; gap: 5px; justify-items: center; }
.modi.links .seg-gruppe { justify-items: start; }
.kap { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent); }
.seg button { min-width: 42px; padding: 6px 15px; border: 0; border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s; }
.seg button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.seg button[aria-selected=true] { background: var(--accent); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 45%, transparent); }
.seg button .ic { width: 1.1em; height: 1.1em; margin-right: 3px; vertical-align: -.2em; }
@media (max-width: 520px) { .seg button { min-width: 36px; padding: 6px 11px; font-size: .86rem; } .modi { gap: 10px 14px; } }
.kopfzeile { flex-direction: column; align-items: flex-start; gap: 10px; }
.seg { flex-wrap: wrap; max-width: 100%; } .modi { max-width: 100%; }

/* Mehr-Wörter-Spiele: Spaltenzahl nach Anzahl und Breite, damit die Zeilen gleichmäßig sind (unvollständige letzte Zeile steht mittig) */
.spiel { container-type: inline-size; }
.bretter { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 12px; --sp: 4; }
.bretter .mini { flex: 0 0 calc((100% - (var(--sp) - 1) * 12px) / var(--sp)); min-width: 0; }
.bretter[data-n="4"] { --sp: 4; } .bretter[data-n="7"] { --sp: 4; } .bretter[data-n="10"] { --sp: 5; }
@container (min-width: 1020px) { .bretter[data-n="7"] { --sp: 7; } }
@container (max-width: 640px) { .bretter[data-n="4"], .bretter[data-n="7"] { --sp: 3; } .bretter[data-n="10"] { --sp: 5; } }
@container (max-width: 420px) { .bretter[data-n="4"], .bretter[data-n="7"] { --sp: 2; } .bretter[data-n="10"] { --sp: 2; } }
