/*
 * spiel.css – Kindgerechte Oberfläche im Schul-CI der
 * Linden-Grundschule Velten. Keine externen Bilder, keine CDNs.
 */

/* Resets */
* { box-sizing: border-box; }
body { margin: 0; padding: 0; }

/* Dauerhaft sichtbare farbige Scrollleiste in Schulgrün */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
    scrollbar-color: #43a047 #f1f8e9;
}
html::-webkit-scrollbar { width: 14px; }
html::-webkit-scrollbar-track { background: #f1f8e9; }
html::-webkit-scrollbar-thumb { background: #43a047; border-radius: 7px; }
html::-webkit-scrollbar-thumb:hover { background: #1b5e20; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f1f8e9;
    color: #003300;
}

/* Unsichtbarer Platzhalter am Ende des body */
#platzhalter { height: 5px; }

.seite, #app {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 16px 0 16px;
}

/*
 * Kasten im Schul-Stil: Haarrahmen #006600 mit 5px Ecken und ein
 * flacher, kompakter Kopfbereich (wie beim Quiz-Widget der
 * Schulhomepage). Verwendung: .box > .box-kopf + .box-inhalt
 */
.box {
    max-width: 640px;
    margin: 8px auto 16px auto;
    background: #ffffff;
    border: 1px solid #006600;
    border-radius: 5px;
    box-shadow: 0 4px 14px rgba(27, 94, 32, 0.10);
    overflow: hidden;
}
.box.breit { max-width: 780px; }
.box-kopf { background: #1b5e20; color: #ffffff; padding: 10px 16px; }
.box-kopf h1 { color: #ffffff; font-size: 1.35rem; margin: 0; }
.box-kopf .unterzeile {
    color: #ffca28;
    font-weight: bold;
    font-size: 0.9rem;
    margin: 2px 0 0 0;
}
.box-inhalt { padding: 4px 16px 18px 16px; }
.box-inhalt h2:first-child { margin-top: 0.8em; }

/* Der Spieltisch (#app) ist selbst der Kasten; die Überschrift wird zum Kopfbereich. */
#app {
    padding: 0;
    margin: 8px auto 16px auto;
    background: #ffffff;
    border: 1px solid #006600;
    border-radius: 5px;
    box-shadow: 0 4px 14px rgba(27, 94, 32, 0.10);
    overflow: hidden;
}
#app > h1 {
    background: #1b5e20;
    color: #ffffff;
    font-size: 1.35rem;
    margin: 0 0 6px 0;
    padding: 10px 16px;
}
#app > *:not(h1):not(.overlay) { margin-left: 16px; margin-right: 16px; }
#app > *:last-child:not(h1) { margin-bottom: 16px; }

/* Werkzeugleiste über dem Spieltisch: Zugriff auf die Regeln ohne das Spiel zu verlassen */
.werkzeugleiste {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 16px 0 16px;
    text-align: right;
}

h1 { color: #006600; font-size: 1.8rem; margin: 0.4em 0 0.2em 0; }
h2 { color: #2e7d32; margin-top: 1.4em; }
.unterzeile { color: #2e7d32; margin-top: 0; }

/* Eingabefelder: mindestens 16px (verhindert iOS-Zoom) */
input, textarea, select, button {
    font-family: inherit;
    font-size: 16px;
    color: #1b1b1b;
}
input[type="text"], select {
    width: 100%;
    padding: 12px;
    margin: 6px 0 14px 0;
    border: 2px solid #43a047;
    border-radius: 10px;
    background: #ffffff;
}
.code-feld { letter-spacing: 3px; font-weight: bold; text-transform: uppercase; }
label { font-weight: bold; color: #1b5e20; }

.grosser-knopf {
    display: inline-block;
    background: #43a047;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 16px 28px;
    font-size: 1.15rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 102, 0, 0.25);
}
.grosser-knopf:hover { background: #1b5e20; }
.grosser-knopf.klein { padding: 10px 16px; font-size: 1rem; }
.neben-link { color: #2e7d32; }

.start-knoepfe { display: flex; flex-direction: column; gap: 14px; max-width: 340px; }
.tisch-liste { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.tisch-eintrag { text-align: left; }

/* Honeypot: off-screen, nicht display:none */
.honeypot { position: absolute; left: -9999px; top: 0; height: 1px; width: 1px; overflow: hidden; }

/* Spielregeln-Seite */
.regel-liste { line-height: 1.7; }

.erfolg { color: #1b5e20; font-weight: bold; font-size: 1.1rem; }
.fehler { color: #a30000; font-weight: bold; }
.erklaerung { color: #2e7d32; }

/* Ich-Banner: große Anzeige des eigenen Namens */
.ich-banner {
    background: #ffffff;
    border: 3px solid #006600;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 1.25rem;
    margin: 10px 0;
}
.ich-banner strong { color: #006600; font-size: 1.5rem; }
.chef-marke { color: #2e7d32; font-size: 1rem; }

/* Blinkt kurz auf, wenn diese Person gerade 2 Straf-Karten ziehen musste. */
.ich-banner.straf-blinkt { animation: straf-blitz 0.6s ease-in-out 3; }
@keyframes straf-blitz {
    0%, 100% { background: #ffffff; border-color: #006600; }
    50% { background: #fff3e0; border-color: #e65100; }
}

/* Zug-Banner: unübersehbar, wer dran ist */
.zug-banner {
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: bold;
    margin: 10px 0;
}
.zug-banner.dran {
    background: #43a047;
    color: #ffffff;
    box-shadow: 0 0 0 4px #006600;
    animation: aufblitzen 1.2s ease-out;
}
.zug-banner.warte {
    background: #ffffff;
    color: #2e7d32;
    border: 2px dashed #bdb76b;
}

/* Straf-Banner: sehr auffällig, wenn man selbst gerade 2 Karten ziehen
   musste (7 gelegt bekommen). Eigene, kräftigere Farbe (Orange) statt
   Schulgrün, damit die Meldung sich klar vom normalen Zug-Banner abhebt. */
.straf-banner {
    background: #ffb300;
    color: #4a2c00;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: bold;
    margin: 10px 0;
    box-shadow: 0 0 0 4px #e65100;
    animation: straf-banner-wackeln 0.5s ease-in-out 2;
}
@keyframes straf-banner-wackeln {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Aufblitz-Effekte für neue Meldungen */
@keyframes aufblitzen {
    0% { background-color: #d7ffd9; }
    100% { background-color: #43a047; }
}
.info-zeile {
    font-size: 1.15rem;
    font-weight: bold;
    color: #006600;
    min-height: 1.4em;
}
.info-zeile.aufblitzen { animation: info-puls 1.5s ease-out; }
@keyframes info-puls {
    0% { background-color: #d7ffd9; border-radius: 8px; }
    100% { background-color: transparent; }
}

/* Rückmeldung, wenn eine Aktion nicht erlaubt war (statt stiller Ablehnung) */
.aktion-fehler {
    background: #fff3e0;
    border: 2px solid #a30000;
    border-radius: 10px;
    padding: 10px 14px;
    color: #a30000;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
}

/* Abbruch-Button */
.abbruch-knopf {
    background: #f1f8e9;
    color: #a30000;
    border: 2px solid #a30000;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: block;
    margin: 8px auto 12px auto;
}
.abbruch-knopf:hover { background: #a30000; color: #ffffff; }

.code-anzeige {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 6px;
    color: #ffffff;
    background: #006600;
    display: inline-block;
    padding: 12px 24px;
    border-radius: 12px;
}

/* Dezente Code-Zeile für den Chef */
.code-klein {
    color: #2e7d32;
    font-size: 1rem;
    background: #ffffff;
    border: 1px dashed #bdb76b;
    border-radius: 8px;
    padding: 8px 14px;
    display: inline-block;
}

/* Mitspieler */
.mitspieler-reihe { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.mitspieler {
    background: #ffffff;
    border: 3px solid #bdb76b;
    border-radius: 12px;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    min-width: 130px;
}
.mitspieler.ist-dran { border-color: #43a047; background: #d7ffd9; box-shadow: 0 0 0 3px #43a047; }
.mitspieler.gegangen { opacity: 0.45; }
.mitspieler.straf-blinkt { animation: straf-blitz-mitspieler 0.6s ease-in-out 3; }
@keyframes straf-blitz-mitspieler {
    0%, 100% { border-color: #bdb76b; background: #ffffff; box-shadow: none; }
    50% { border-color: #e65100; background: #fff3e0; box-shadow: 0 0 0 3px #ffb300; }
}
.mitspieler-name { font-weight: bold; font-size: 1.05rem; }
.mitspieler-anzahl { color: #2e7d32; }
.mitspieler-anzahl.mau { color: #e65100; font-weight: bold; }
.mitspieler-siege { color: #006600; font-size: 0.9rem; }

/* Spielkarten */
.karte {
    width: 92px;
    height: 132px;
    border-radius: 10px;
    background: #ffffff;
    border: 2px solid #999;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px;
    margin: 6px;
    position: relative;
    user-select: none;
}
.karte.rot { color: #d40000; }
.karte:not(.rot):not(.rueckseite) { color: #1a1a1a; }
/* Verdeckter Stapel: klares Grün mit gut lesbarer heller Schrift */
.karte.rueckseite {
    background: #2e7d32;
    color: #f1f8e9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
.karten-wert { font-size: 1.7rem; font-weight: bold; }
.karten-symbol { font-size: 1.8rem; align-self: flex-end; }
.karte.aktiv {
    cursor: pointer;
    border-color: #43a047;
    box-shadow: 0 0 0 3px #43a047, 0 6px 12px rgba(0, 102, 0, 0.3);
}
.karte.aktiv:hover { transform: translateY(-6px); }
.stapel-hinweis {
    font-size: 0.8rem;
    letter-spacing: 0;
    text-align: center;
    margin-top: 4px;
}
/* Deutlicher visueller Hinweis zusätzlich zum Text, wichtig für Kinder,
   die noch nicht flüssig lesen. */
.karte.ziehstapel.stapel-blinkt { animation: stapel-pulsen 1.1s ease-in-out infinite; }
@keyframes stapel-pulsen {
    0%, 100% { box-shadow: 0 0 0 3px #43a047, 0 6px 12px rgba(0, 102, 0, 0.3); }
    50% { box-shadow: 0 0 0 7px #fbc02d, 0 6px 16px rgba(0, 102, 0, 0.4); }
}

/* Tischmitte */
.tisch-mitte {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 16px 0;
}
.ablage-bereich { text-align: center; }
.ablage-karte { box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); }
.gewaehlte-farbe { font-weight: bold; color: #006600; margin: 6px 0 0 0; }

/* Eigene Hand: groß und touchfreundlich */
.hand-titel { font-weight: bold; color: #1b5e20; margin: 10px 0 0 0; }
.hand { display: flex; flex-wrap: wrap; justify-content: center; padding: 8px 0 8px 0; }
.hand-hinweis {
    background: #d7ffd9;
    border: 2px solid #43a047;
    border-radius: 10px;
    padding: 12px;
    font-weight: bold;
    color: #006600;
    text-align: center;
    margin: 0 0 12px 0;
}

/* Beitrittswünsche für den Chef */
.anfrage-box { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.anfrage-zeile {
    background: #ffffff;
    border: 3px solid #43a047;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
}

/* Farbwahl-Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 40, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}
.overlay-box { background: #f1f8e9; border-radius: 16px; padding: 24px; text-align: center; max-width: 360px; }
.overlay-titel { font-size: 1.3rem; font-weight: bold; color: #006600; }
.overlay-hinweis { color: #2e7d32; margin: 6px 0 0 0; }
.overlay-knopf-reihe { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.overlay-knopf-reihe .abbruch-knopf,
.overlay-knopf-reihe .grosser-knopf { margin: 0; }
.farb-reihe { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.farb-feld {
    font-size: 1.3rem;
    font-weight: bold;
    padding: 28px 20px;
    min-width: 120px;
    border-radius: 14px;
    border: 3px solid #006600;
    background: #ffffff;
    color: #1a1a1a;
    cursor: pointer;
}
.farb-feld.rot { color: #d40000; }
.farb-feld:hover { background: #43a047; color: #ffffff; }

/* Rundenende */
.runde-ende, .warten-box, .meldung { text-align: center; margin: 12px 0; }
.runde-ende .neben-link { display: block; margin-top: 12px; }
.siege-tabelle {
    margin: 14px auto;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
}
.siege-tabelle td { padding: 8px 18px; border-bottom: 1px solid #f1f8e9; }
.siege-tabelle tr:first-child td { background: #43a047; color: #ffffff; font-weight: bold; }

/* Tablets und kleine Bildschirme */
@media (max-width: 600px) {
    .karte { width: 74px; height: 106px; margin: 4px; }
    .karten-wert { font-size: 1.3rem; }
    .karten-symbol { font-size: 1.4rem; }
    .tisch-mitte { gap: 20px; }
    .farb-feld { min-width: 100px; padding: 20px 10px; }
    .zug-banner { font-size: 1.15rem; }
    .ich-banner strong { font-size: 1.25rem; }
}