/* stil.css - Schul-Comic-Look: Tafelgruen, Creme-Karten, dicke Konturen. */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0; padding: 0; height: 100%;
    background: #2E5E4E;
    background-image: radial-gradient(#3A6E5C 2px, transparent 2px);
    background-size: 34px 34px;
    font-family: 'Chalkboard SE', 'Comic Sans MS', 'Segoe Print', cursive;
    color: #26202B;
    overflow: hidden;
    touch-action: manipulation;
}

.versteckt { display: none !important; }
.mittig { text-align: center; }
.klein { font-size: 14px; opacity: 0.85; }
.weiss { color: #FFF6E3; }
.pulsieren { animation: pulsieren 1.4s ease-in-out infinite; }
@keyframes pulsieren { 50% { opacity: 0.45; } }

/* --- Startseite (Spieler) ------------------------------------------------ */

#start-schirm {
    position: fixed; inset: 0; z-index: 50;
    display: flex; align-items: center; justify-content: center;
    overflow-y: auto; padding: 16px;
}

.start-karte {
    background: #FFF6E3;
    border: 5px solid #26202B;
    border-radius: 26px;
    box-shadow: 8px 8px 0 rgba(38, 32, 43, 0.55);
    padding: 26px 30px 30px;
    width: min(430px, 94vw);
    text-align: center;
    position: relative;
}

.titel-blob {
    width: 74px; height: 74px; line-height: 70px;
    margin: -64px auto 6px;
    background: #7ED957;
    border: 5px solid #26202B;
    border-radius: 50% 46% 52% 48%;
    font-size: 36px;
    transform: rotate(-6deg);
}

h1 { margin: 4px 0 2px; font-size: 34px; line-height: 1.05; letter-spacing: 0.5px; }
h2 { margin: 8px 0; font-size: 22px; }
.untertitel { margin: 4px 0 18px; font-size: 15px; opacity: 0.8; }

input[type="text"] {
    display: block; width: 100%;
    margin: 10px 0; padding: 13px 14px;
    font: inherit; font-size: 18px;
    border: 4px solid #26202B; border-radius: 14px;
    background: #FFFFFF; outline: none;
}
input[type="text"]:focus { border-color: #7C5CE0; }
#eingabe-code { text-transform: uppercase; letter-spacing: 6px; text-align: center; font-size: 24px; }

input[type="range"] { width: 100%; accent-color: #7C5CE0; margin: 12px 0 18px; }

.knopf {
    font: inherit; font-size: 17px;
    border: 4px solid #26202B; border-radius: 16px;
    padding: 11px 20px; cursor: pointer;
    box-shadow: 4px 4px 0 rgba(38, 32, 43, 0.5);
    transition: transform 0.06s;
}
.knopf:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 rgba(38, 32, 43, 0.5); }
.knopf:disabled { opacity: 0.45; cursor: default; }
.knopf.lila { background: #7C5CE0; color: #FFF6E3; }
.knopf.grau { background: #E9DEC6; color: #26202B; }
.knopf.gross { font-size: 21px; padding: 14px 26px; width: 100%; margin-top: 8px; }

#fehler-text { color: #D63A3A; min-height: 22px; font-size: 15px; margin: 10px 0 0; }

.spieler-chip {
    display: inline-block; margin: 4px;
    background: #FFD34D; border: 3px solid #26202B; border-radius: 999px;
    padding: 6px 13px; font-size: 15px;
    animation: chip-rein 0.25s ease-out;
}
@keyframes chip-rein { from { transform: scale(0.5); opacity: 0; } }

#dreh-hinweis {
    position: fixed; inset: 0; z-index: 200;
    background: #26202B; color: #FFF6E3;
    display: none; align-items: center; justify-content: center;
    text-align: center; font-size: 26px; line-height: 1.5;
}
@media (orientation: portrait) {
    #dreh-hinweis { display: flex; }
}

#spielfeld { position: fixed; inset: 0; }
#spielfeld canvas { display: block; }

/* --- DOM-Overlays (Identifizieren, Buch, Ende) ---------------------------- */

.overlay-dim {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(16, 24, 40, 0.6);
    display: flex; align-items: center; justify-content: center;
    padding: 14px;
}

.overlay-karte {
    background: #FFF6E3;
    border: 5px solid #26202B; border-radius: 24px;
    box-shadow: 8px 8px 0 rgba(38, 32, 43, 0.55);
    padding: 18px 22px;
    width: min(680px, 96vw);
    max-height: 92vh; overflow-y: auto;
    animation: karte-pop 0.18s ease-out;
}
@keyframes karte-pop { from { transform: scale(0.85); opacity: 0; } }

.overlay-karte h2 { margin: 2px 0 8px; color: #7C5CE0; }

.stoff-raster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 9px; margin: 12px 0;
}

.stoff-kachel {
    font: inherit; font-size: 15px;
    border: 3px solid #26202B; border-radius: 13px;
    background: #FFFFFF; padding: 12px 6px; cursor: pointer;
}
.stoff-kachel.gewaehlt {
    background: #7ED957;
    box-shadow: inset 0 0 0 3px #26202B;
    transform: scale(1.04);
}

.overlay-fuss {
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 12px; flex-wrap: wrap;
}

.buch-seite {
    background: #FFFDF4;
    border: 3px dashed #C9B98F; border-radius: 12px;
    padding: 16px 18px; margin: 8px 0;
    font-size: 17px; line-height: 1.55;
    min-height: 170px; white-space: normal;
}

.vorlese-badge {
    display: inline-block;
    background: #FFD34D; border: 3px solid #26202B; border-radius: 999px;
    padding: 5px 13px; font-size: 14px; margin: 0 0 6px;
}

.ende-titel { font-size: 30px; margin: 4px 0; color: #7C5CE0; text-align: center; }

.rangliste { width: 100%; border-collapse: collapse; margin: 12px 0; }
.rangliste th, .rangliste td { padding: 9px 10px; text-align: left; font-size: 17px; }
.rangliste th { border-bottom: 4px solid #26202B; font-size: 14px; }
.rangliste tr:nth-child(even) { background: rgba(124, 92, 224, 0.08); }
.rangliste td:first-child { font-size: 22px; }
.rangliste tr.mein-team { background: #FFE9A8; outline: 3px solid #26202B; }

.kategorien { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.kategorie-karte {
    background: #7ED957; border: 4px solid #26202B; border-radius: 16px;
    padding: 10px 16px; text-align: center; font-size: 15px;
    transform: rotate(-1.5deg);
    box-shadow: 4px 4px 0 rgba(38, 32, 43, 0.4);
}
.kategorie-karte:nth-child(2) { transform: rotate(1.5deg); background: #FFD34D; }
.kategorie-karte:nth-child(3) { transform: rotate(-1deg); background: #6FC3E8; }

/* --- Host-Seite ------------------------------------------------------------ */

.host-seite { overflow-y: auto; }
.host-inhalt { max-width: 1150px; margin: 0 auto; padding: 26px 18px 60px; }
.host-karte { margin: 60px auto 0; }
.host-karte.breit { width: min(760px, 96vw); text-align: left; }

.host-kopf { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }

.code-tafel {
    flex: 1; min-width: 300px;
    background: #26202B; color: #FFF6E3;
    border: 5px solid #FFF6E3; border-radius: 22px;
    padding: 18px 22px; text-align: center;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
}
#riesen-code { font-size: 92px; letter-spacing: 20px; font-weight: bold; color: #FFD34D; margin: 6px 0; }

.story-zettel {
    flex: 1.4; min-width: 320px;
    background: #FFF6E3; border: 5px solid #26202B; border-radius: 6px 26px 6px 26px;
    padding: 14px 22px; transform: rotate(-0.6deg);
    box-shadow: 8px 8px 0 rgba(38, 32, 43, 0.5);
    font-size: 16px; line-height: 1.5;
}
.story-zettel h2 { color: #7C5CE0; }

.team-karten {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px; margin: 18px 0 26px;
}

.team-karte {
    background: #FFF6E3; border: 4px solid #26202B; border-radius: 4px 18px 4px 18px;
    padding: 12px 16px;
    box-shadow: 5px 5px 0 rgba(38, 32, 43, 0.45);
    transform: rotate(-0.8deg);
}
.team-karte:nth-child(even) { transform: rotate(0.8deg); background: #FFF1CE; }
.team-karte h3 { margin: 0 0 6px; font-size: 20px; }
.team-karte p { margin: 4px 0; }

.balken {
    height: 14px; border: 3px solid #26202B; border-radius: 999px;
    background: #FFFFFF; overflow: hidden; margin: 2px 0 8px;
}
.balken-fuellung { height: 100%; border-radius: 999px; transition: width 0.4s; }
.balken-fuellung.lila-f { background: #7C5CE0; }
.balken-fuellung.gruen-f { background: #7ED957; }

.host-timerzeile {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 6px;
}
.host-timer {
    font-size: 74px; font-weight: bold; color: #FFF6E3;
    background: #26202B; border: 5px solid #FFF6E3; border-radius: 20px;
    padding: 4px 30px;
}
.host-timer.rot { color: #FF5252; animation: pulsieren 0.8s infinite; }

/* --- Grafikstufen-Wahl in der Lobby ---------------------------------------- */

.grafik-wahl {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin: 14px 0 8px; flex-wrap: wrap;
}
.grafik-knopf {
    font: inherit; font-size: 14px;
    border: 3px solid #26202B; border-radius: 999px;
    background: #FFFFFF; padding: 7px 14px; cursor: pointer;
}
.grafik-knopf.aktiv {
    background: #7ED957;
    box-shadow: inset 0 0 0 2px #26202B;
}

/* --- Notizbuch ---------------------------------------------------------------- */

.tab-zeile { display: flex; gap: 8px; margin: 4px 0 12px; }
.tab-knopf {
    font: inherit; font-size: 15px; flex: 1;
    border: 3px solid #26202B; border-radius: 12px;
    background: #E9DEC6; padding: 9px 6px; cursor: pointer;
}
.tab-knopf.aktiv { background: #7C5CE0; color: #FFF6E3; }

.notiz-block {
    background: #FFFDF4; border: 3px dashed #C9B98F; border-radius: 12px;
    padding: 8px 14px; margin: 8px 0;
}
.notiz-block h3 { margin: 2px 0 4px; color: #7C5CE0; font-size: 17px; }
.notiz-block ul { margin: 4px 0 6px; padding-left: 20px; }
.notiz-block li { margin: 3px 0; font-size: 15px; }

.merkmal-zeile { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.merkmal-chip {
    font: inherit; font-size: 13px;
    border: 3px solid #26202B; border-radius: 999px;
    background: #FFFFFF; padding: 6px 11px; cursor: pointer;
}
.merkmal-chip.aktiv { background: #7ED957; box-shadow: inset 0 0 0 2px #26202B; }
.merkmal-chip.reset { background: #FFD34D; }

.stoff-check-liste {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 7px; margin-top: 10px;
}
.stoff-check {
    border: 3px solid #26202B; border-radius: 11px;
    background: #FFFFFF; padding: 9px 10px; font-size: 14px;
    transition: opacity 0.15s;
}
.stoff-check.ausgegraut {
    opacity: 0.3; text-decoration: line-through;
    background: #E9DEC6;
}

/* --- Hilfe-Buch ---------------------------------------------------------------- */

.hilfe-karte {
    background: #FFFDF4; border: 3px solid #26202B; border-radius: 14px;
    padding: 10px 14px; margin: 8px 0;
    box-shadow: 3px 3px 0 rgba(38, 32, 43, 0.35);
}
.hilfe-karte .hilfe-titel { font-size: 18px; color: #7C5CE0; margin-bottom: 4px; }
.hilfe-karte p { margin: 4px 0; font-size: 14px; line-height: 1.45; }
.hilfe-karte.gesperrt {
    opacity: 0.45; background: #E9DEC6; border-style: dashed;
    box-shadow: none; font-size: 15px;
}
