html, body {
    height: 100%;
    overscroll-behavior: none;
}

body {
    touch-action: manipulation;
}

#app {
    position: relative;
    z-index: 1;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: var(--weiss);
    border-bottom: var(--rand);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 3;
}

.kopf-ich {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.kopf-ich .avatar-figur {
    width: 42px;
    flex: 0 0 auto;
}

.kopf-ich .name {
    font-weight: 700;
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kopf-ich .unter {
    font-size: 13px;
    opacity: 0.75;
}

.kopf-knoepfe {
    display: flex;
    gap: 8px;
}

.kopf-knoepfe .comic-knopf {
    font-size: 20px;
    padding: 6px 12px;
}

.inhalt {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.seite {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 20px 16px 28px;
    text-align: center;
    animation: ansichtRein 0.45s cubic-bezier(.2, 1.4, .4, 1) both;
}

.seite.oben {
    justify-content: flex-start;
}

.seite .comic-titel {
    font-size: 44px;
}

.seite .comic-titel.mittel {
    font-size: 34px;
}

.seite .text {
    font-size: 18px;
    font-weight: 600;
    max-width: 360px;
}

.seite .comic-knopf {
    width: 100%;
    max-width: 380px;
}

.beitritt-form {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.feld label {
    display: block;
    font-family: var(--schrift-titel);
    font-size: 22px;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.feld input {
    width: 100%;
    font-family: var(--schrift-text);
    font-size: 22px;
    font-weight: 700;
    padding: 12px 14px;
    border: var(--rand);
    border-radius: 14px;
    box-shadow: var(--schatten-klein);
    background: var(--weiss);
    outline: none;
}

.feld input:focus {
    background: #fffbe8;
    box-shadow: 4px 4px 0 var(--blau);
}

.feld input.code {
    font-family: var(--schrift-titel);
    font-size: 40px;
    letter-spacing: 12px;
    text-align: center;
    text-transform: uppercase;
}

.fehler-text {
    color: var(--rot);
    font-weight: 700;
    min-height: 22px;
    text-align: center;
}

.avatar-editor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px;
}

.avatar-editor .vorschau {
    width: 150px;
    cursor: pointer;
}

.editor-zeile {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.editor-zeile .comic-knopf {
    width: auto;
    padding: 4px 0;
    font-size: 22px;
}

.editor-zeile .beschriftung {
    text-align: center;
    font-weight: 700;
    font-size: 15px;
}

.editor-zeile .beschriftung small {
    display: block;
    font-weight: 500;
    opacity: 0.7;
    font-size: 12px;
}

.farb-reihe {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.farb-punkt {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid var(--schwarz);
    cursor: pointer;
}

.farb-punkt.aktiv {
    transform: scale(1.25);
    box-shadow: 0 0 0 3px var(--weiss), 0 0 0 6px var(--schwarz);
}

.stups-figur {
    width: min(60vw, 230px);
    cursor: pointer;
}

.stups-hinweis {
    font-size: 14px;
    opacity: 0.75;
    margin-top: -10px;
}

.admin-box {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.admin-box .admin-titel {
    font-family: var(--schrift-titel);
    font-size: 24px;
    letter-spacing: 1px;
}

.admin-box .comic-knopf {
    max-width: none;
}

.spiel-liste {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spiel-eintrag {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--weiss);
    border: var(--rand);
    border-radius: 16px;
    box-shadow: var(--schatten-klein);
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    animation: reinRutschen 0.3s ease-out both;
}

.spiel-eintrag:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--schwarz);
}

.spiel-eintrag .symbol {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    border: 3px solid var(--schwarz);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.spiel-eintrag .name {
    font-family: var(--schrift-titel);
    font-size: 24px;
    letter-spacing: 1px;
    line-height: 1;
}

.spiel-eintrag .kurz {
    font-size: 13px;
}

.spiel-eintrag .rechts {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.spiel-eintrag.gesperrt {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.bereit-knoepfe {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bereit-knoepfe .comic-knopf {
    font-size: 40px;
    padding: 26px 10px;
}

.bereit-knoepfe .comic-knopf.gewaehlt {
    outline: 5px solid var(--schwarz);
    outline-offset: 4px;
    animation: pulsieren 1s ease-in-out infinite;
}

.bereit-knoepfe .comic-knopf.nicht-gewaehlt {
    opacity: 0.45;
}

.zeit-balken {
    width: 100%;
    max-width: 400px;
    height: 22px;
    border: var(--rand);
    border-radius: 999px;
    overflow: hidden;
    background: var(--weiss);
}

.zeit-balken div {
    height: 100%;
    background: var(--rot);
    width: 100%;
}

.spiel-symbol-gross {
    font-size: 84px;
    filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.6));
    animation: reinploppen 0.6s cubic-bezier(.2, 1.6, .4, 1) both;
}

.riesen-zahl {
    font-family: var(--schrift-titel);
    font-size: 160px;
    line-height: 1;
    color: var(--rot);
    -webkit-text-stroke: 4px var(--schwarz);
    paint-order: stroke fill;
    text-shadow: 6px 6px 0 var(--schwarz);
    animation: reinploppen 0.5s cubic-bezier(.2, 1.6, .4, 1) both;
}

.spiel-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.platz-anzeige {
    font-family: var(--schrift-titel);
    font-size: 110px;
    line-height: 1;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(22, 22, 22, 0.6);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.overlay-panel {
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    animation: ansichtRein 0.4s cubic-bezier(.2, 1.4, .4, 1) both;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.overlay-panel .comic-titel {
    font-size: 34px;
    text-align: center;
}

.overlay-panel .comic-knopf {
    width: 100%;
}

.overlay-panel .einstellungs-zeile {
    flex-wrap: wrap;
}

.overlay-panel .einstellungs-zeile .beschriftung {
    text-align: left;
}

.pause-titel {
    font-size: 90px !important;
    color: var(--gelb);
    animation: pulsieren 1.6s ease-in-out infinite;
}

.verwaltungs-zeile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 3px solid var(--schwarz);
    border-radius: 12px;
    background: var(--papier);
    flex-wrap: wrap;
}

.verwaltungs-zeile .avatar-figur {
    width: 36px;
}

.verwaltungs-zeile .name {
    font-weight: 700;
    flex: 1;
    text-align: left;
}

.verwaltungs-zeile .comic-knopf {
    width: auto !important;
    font-size: 15px;
    padding: 5px 10px;
}

.playlist-mini {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.playlist-mini .eintrag {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 3px solid var(--schwarz);
    border-radius: 10px;
    background: var(--weiss);
    padding: 4px 10px;
    font-weight: 700;
}

.playlist-mini .eintrag span:last-child {
    margin-left: auto;
}

.verbindungs-hinweis {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background: var(--weiss);
    border: var(--rand);
    border-radius: 14px;
    padding: 8px 16px;
    font-weight: 700;
    box-shadow: var(--schatten-klein);
}

.zuschauer-figur {
    width: 140px;
}

.overlay-panel .umschalter .comic-knopf {
    width: auto;
    flex: 1;
}

.spiel-container .comic-titel {
    font-size: 40px;
}

.spiel-container .comic-titel.mittel {
    font-size: 30px;
}

.spiel-container .text {
    font-size: 18px;
    font-weight: 600;
    max-width: 360px;
}

.ausgeblendet-hinweis {
    margin: 6px 0;
    font-weight: 700;
    font-size: 13px;
    opacity: 0.75;
    text-align: center;
}

.playlist-mini .eintrag .entfernen {
    margin-left: auto;
}

.modus-chip {
    font-size: 12px;
    font-weight: 700;
    background: #e0d7ff;
    border: 2px solid var(--schwarz);
    border-radius: 999px;
    padding: 1px 8px;
    white-space: nowrap;
}

.modus-chip.fest {
    background: #b9fbc0;
}

.mw-liste {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mw-knopf {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: var(--weiss);
    border: 4px solid var(--schwarz);
    border-radius: 16px;
    box-shadow: 3px 3px 0 var(--schwarz);
    padding: 10px 12px;
    font-family: var(--schrift-text);
    color: var(--schwarz);
    cursor: pointer;
    animation: reinRutschen 0.3s ease-out both;
}

.mw-knopf .symbol {
    font-size: 34px;
}

.mw-knopf .texte {
    display: flex;
    flex-direction: column;
}

.mw-knopf .name {
    font-family: var(--schrift-titel);
    font-size: 24px;
    letter-spacing: 1px;
}

.mw-knopf .beschreibung {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.8;
}

.mw-knopf.gewaehlt {
    background: var(--gelb);
    outline: 4px solid var(--schwarz);
    outline-offset: 2px;
}

/* Verbindungsanzeige oben rechts: drei Balken */
.netz-anzeige {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 22px;
    padding: 0 4px;
    align-self: center;
}

.netz-anzeige i {
    display: block;
    width: 5px;
    border: 2px solid #161616;
    border-radius: 2px;
    background: #2b9348;
}

.netz-anzeige i:nth-child(1) { height: 8px; }
.netz-anzeige i:nth-child(2) { height: 13px; }
.netz-anzeige i:nth-child(3) { height: 18px; }
.netz-anzeige.mittel i { background: #ffd23f; }
.netz-anzeige.mittel i:nth-child(3) { background: #fff; }
.netz-anzeige.schlecht i { background: #f77f00; }
.netz-anzeige.schlecht i:nth-child(2), .netz-anzeige.schlecht i:nth-child(3) { background: #fff; }
.netz-anzeige.weg i { background: #fff; }

/* Teams */
.team-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
}

.team-box .team-name {
    font-family: var(--schrift-titel);
    font-size: 28px;
    color: #fff;
    text-shadow: 2px 2px 0 #161616;
}

.team-box .team-name.klein {
    font-size: 20px;
}

.team-box .team-figuren {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.team-mitglied {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: 700;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid #161616;
    border-radius: 10px;
    padding: 4px 6px;
}

.team-mitglied .avatar-figur {
    width: 38px;
}
