/* Tokens, Schriften (inkl. Marydale) und Bausteine (Zettel, Tape, Sticker): theme.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--table-bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Override body styles for start page */
body.start-page-body {
    overflow: auto !important;
    display: block !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
}

.screen {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
}

/* Hide screens by default - only show when explicitly made visible by JavaScript */
.screen[style*="display: none"] {
    display: none !important;
}

#splash-screen {
    background: #000;
    z-index: 30; /* Highest z-index - shown first */
    overflow: hidden;
}

.splash-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Use dynamic viewport height for mobile browsers */
    overflow: hidden;
}

.splash-image {
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Use dynamic viewport height for mobile browsers */
    object-fit: cover; /* Fills height, crops left/right if needed */
    object-position: center;
    display: block;
}

/* Optik: .comic-btn (buttons.css); Zentrierung per translate, damit Hover/Active-transform frei bleibt */
.splash-button {
    position: absolute;
    left: 50%;
    translate: -50% 0;
    top: 45%; /* Knapp unter der Mitte, etwas höher */
    z-index: 31;
    white-space: nowrap;
}

/* Spezifischer als .comic-btn, da buttons.css spaeter geladen wird */
.comic-btn.splash-button {
    padding: 16px 40px;
    font-size: clamp(20px, 1.6vw + 10px, 30px);
}

#intro-screen {
    background: var(--table-bg);
    z-index: 10;
}

#portrait-screen {
    background: var(--table-bg);
    z-index: 20; /* Higher than intro-screen to ensure it's on top */
}

/* Zettel auf dem Tisch (Optik: .k-paper, theme.css) */
.portrait-content {
    text-align: center;
    max-width: 600px;
    padding: 32px 24px;
    width: calc(100% - 40px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.portrait-icon {
    font-size: 5em;
    margin-bottom: 30px;
    animation: rotate 2s ease-in-out infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.portrait-content h1,
.intro-content h1 {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.05;
    color: var(--ink);
}

.portrait-content h1 {
    font-size: 2.4em;
    margin-bottom: 20px;
}

.portrait-content p {
    font-size: 1.3em;
    margin-bottom: 15px;
}

/* Zettel auf dem Tisch (Optik: .k-paper, theme.css) */
.intro-content {
    text-align: center;
    max-width: 600px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.intro-content h1 {
    font-size: 2.6em;
    margin-bottom: 20px;
}

.intro-content p {
    font-size: 1.2em;
    margin-bottom: 15px;
}

#intro-character {
    width: 100px;
    height: 100px;
    margin: 30px auto;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: characterEnter 1s ease-out;
}

@keyframes characterEnter {
    from {
        transform: translateX(-200px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Steuerung handschriftlich auf dem Zettel */
#intro-controls {
    margin: 30px 0;
    font-family: var(--font-hand);
    font-size: 1.5em;
}

#intro-controls p {
    margin: 10px 0;
}

/* .start-btn: Optik via buttons.css; hier nur Layout-Abstand */
.start-btn {
    margin: 20px 10px;
    white-space: nowrap;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-in forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

#game-screen {
    background: var(--table-bg);
    z-index: 5;
    padding: 40px;
    align-items: flex-start; /* Align container to top instead of center */
    padding-top: 80px; /* Space for header (20px top + ~60px header height) */
}

/* Handy-Huelle: nur auf dem Desktop sichtbar (desktop-phone.css), sonst layout-neutral */
.phone,
.phone-screen,
.phone-hud {
    display: contents;
}

.phone-statusbar,
.phone-hint,
.phone-deco {
    display: none;
}

.game-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    flex-direction: row;
    justify-content: flex-end; /* Nur noch .target, rechts ausrichten */
    font-size: 1.2em;
    font-weight: 600;
    color: white;
    z-index: 6;
    gap: 20px;
}

/* Ziel: handschriftliches Label + Gaffa-Tape-Streifen mit gelbem Edding (Tokens: theme.css) */
.target {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.target > span:first-child,
.progress-text {
    font-family: var(--font-hand);
    font-weight: normal;
    color: var(--cream);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
}

.target > span:first-child {
    rotate: -5deg;
}

/* Score Display mit Cap-Hintergrund */
.score-display {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    width: 80px;
    height: 80px;
    background-image: url('/assets/static/cap_points.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.score-display span {
    font-size: 1.8em;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

.target {
    flex: 1;
    max-width: 400px;
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 20px;
    position: relative;
    overflow: hidden;
    background: var(--tape);
    rotate: -1.2deg;
    clip-path: polygon(0 8%, 1.5% 0, 98.5% 5%, 100% 20%, 98.9% 42%, 100% 64%, 98.6% 86%, 100% 100%, 1.2% 95%, 0 76%, 1.1% 54%, 0 32%);
}

/* Breite setzt die Engine inline (Prozent) */
.progress-fill {
    position: absolute;
    top: 20%;
    bottom: 20%;
    left: 1.5%;
    max-width: 97%;
    border-radius: 2px 6px 4px 2px;
    background: var(--marker);
    transition: width 0.3s ease;
}

.progress-text {
    white-space: nowrap;
    min-width: 30px;
    text-align: right;
}

#game-canvas-container {
    position: relative;
    display: block;
    box-sizing: border-box;
}

#game-canvas {
    display: block;
    background: linear-gradient(to bottom, #e8f4f8 0%, #e8f4f8 60%, #b8b8b8 85%, #a0a0a0 100%); /* Sky to concrete */
    border: none;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    max-width: 100vw;
    max-height: 85vh;
    width: auto;
    height: auto;
}

/* Desktop-Layout (Handy auf dem Tisch): assets/css/desktop-phone.css */

/* Sound Controls: fest unten rechts auf allen Screens (Desktop-Optik in desktop-phone.css) */
.sound-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.sound-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sound-btn:hover {
    transform: scale(1.1);
}

.sound-btn:active {
    transform: scale(0.95);
}

/* Overlay-Screens: immer viewport-füllend (fixed), sonst peekt mobil Body/#e8f4f8 oben durch */
#game-over-screen,
#win-screen,
#thanks-screen,
#highscore-screen {
    background: var(--table-bg);
    z-index: 20;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: center;
    justify-content: center;
}

#highscore-screen {
    background: url('/assets/static/table.jpg') center center / cover no-repeat #2b1a0d;
}

#game-over-screen {
    display: flex;
}

/* Zettel auf dem Tisch (Optik: .k-paper + .k-taped, theme.css) */
.win-content,
.thanks-content {
    padding: 40px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    rotate: -1deg;
}

.highscore-content {
    background: url('/assets/static/notebook.png') center center / cover no-repeat;
    padding: 40px;
    border-radius: 0;
    text-align: center;
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.4);
    border: none;
    position: relative;
    color: white;
    overflow: visible;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Fail screen background - fullscreen */
.fail-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    display: none;
}

.fail-background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Fail image container - individual fail pic */
.fail-image-container {
    position: absolute;
    inset: 0 0 88px 0; /* unten Platz für Continue-Button */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.fail-image {
    max-height: 100%;
    max-width: min(92vw, 100%);
    width: auto;
    height: auto;
    object-fit: contain;
    transform: rotate(-8deg);
}

/* Fail continue button (Optik: .comic-btn, buttons.css) */
.fail-continue-btn {
    position: absolute;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    left: 50%;
    translate: -50% 0;
    z-index: 10;
    white-space: nowrap;
}

/* Mobile adjustments for fail images */
@media (max-width: 920px) {
    .fail-background {
        inset: 0;
        width: 100%;
        height: 100%;
    }
    
    .fail-image-container {
        inset: 0 0 76px 0;
    }
    
    .fail-continue-btn {
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
        padding: 12px 28px;
        font-size: clamp(16px, 3.5vh, 22px);
    }
}

.win-content h2 {
    font-family: var(--font-display);
    font-size: 2.5em;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.05;
    margin-bottom: 20px;
    color: var(--brick);
}

.highscore-headline {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
    display: block;
}

.win-content p,
.highscore-content p {
    font-size: 1.3em;
    margin-bottom: 30px;
    color: var(--ink-blue);
    text-shadow: none;
}

/* Highscore Screen Styles */
.highscore-content {
    font-family: 'Marydale', sans-serif;
    font-size: 25px;
}

.highscore-content *:not(.highscore-entry-rank):not(.highscore-entry-name):not(.highscore-entry-score) {
    font-family: 'Marydale', sans-serif;
}

.highscore-entry-rank,
.highscore-entry-name,
.highscore-entry-score {
    font-size: 25px !important;
}

.highscore-entry-text {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: #1a237e; /* Tintenblau */
    font-weight: 600;
}

.highscore-entry-subtext {
    font-size: 1.1em;
    margin-bottom: 20px;
    color: #1a237e; /* Tintenblau */
}

.highscore-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin: 20px 0;
}

.highscore-name-input {
    background: transparent;
    border: none;
    border-bottom: 2px dashed #1a237e;
    padding: 0px 20px;
    font-size: 1.2em;
    color: #1a237e; /* Tintenblau */
    text-align: center;
    width: 100%;
    max-width: 300px;
    box-shadow: none;
    transition: all 0.2s;
}

.highscore-name-input::placeholder {
    color: rgba(26, 35, 126, 0.6); /* Tintenblau mit Transparenz */
}

.highscore-name-input:focus {
    outline: none;
    background: transparent;
    box-shadow: none;
    border-bottom-color: #0d47a1;
}



/* .highscore-submit-btn: Optik vollständig via buttons.css */

/* .highscore-back-btn: Optik via buttons.css; Layout + Default-Hidden bleiben */
.highscore-back-btn {
    margin: 20px auto;
    display: none;
    white-space: nowrap;
}

.highscore-back-link {
    display: none;
    font-family: 'Marydale', sans-serif;
    font-size: 25px;
    color: #1a237e;
    text-decoration: underline;
    cursor: pointer;
    text-align: center;
    margin-top: 15px;
    text-transform: lowercase;
    width: 100%;
}

.highscore-back-link:hover {
    color: #0d47a1;
}

.highscore-skip-link {
    display: none;
    font-family: 'Marydale', sans-serif;
    font-size: 20px;
    color: #1a237e;
    text-decoration: underline;
    cursor: pointer;
    text-align: center;
    margin-top: 15px;
    text-transform: lowercase;
    width: 100%;
}

.highscore-skip-link:hover {
    color: #0d47a1;
}

.highscore-list-container {
    margin: 30px 0;
    max-height: 400px;
    overflow-y: auto;
}

.highscore-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
}

.highscore-entry {
    background: transparent;
    border: none;
    padding: 2px 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    transition: all 0.2s;
    line-height: 1.2;
}

.highscore-entry:hover {
    background: transparent;
    transform: translateX(5px);
}

#highscore-screen .highscore-entry-rank,
.highscore-entry-rank {
    font-weight: 700;
    color: #1a237e; /* Tintenblau */
    min-width: 50px;
    text-align: center;
}

#highscore-screen .highscore-entry-name,
.highscore-entry-name {
    font-weight: 600;
    color: #1a237e; /* Tintenblau */
    flex: 0 1 auto;
    margin-left: 10px;
}

#highscore-screen .highscore-entry-score,
.highscore-entry-score {
    font-weight: 700;
    color: #1a237e; /* Tintenblau */
    flex: 0 0 auto;
    text-align: right;
    margin-left: auto;
}

/* Mobile adjustments for highscore screen */
@media (max-width: 920px) {
    .highscore-content {
        padding: 12px 16px 16px;
        max-width: 95%;
        width: min(95%, 560px);
        max-height: calc(100dvh - 16px);
        margin: 8px auto;
        box-sizing: border-box;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .highscore-headline {
        max-width: 60%;
        max-height: 48px;
        margin-bottom: 8px;
        object-fit: contain;
    }
    
    .highscore-entry-text {
        font-size: clamp(0.95em, 3.8vh, 1.15em);
        margin-bottom: 4px;
        line-height: 1.2;
    }
    
    .highscore-entry-subtext {
        font-size: clamp(0.85em, 3.2vh, 1em);
        margin-bottom: 8px;
    }
    
    .highscore-form {
        margin: 8px 0;
        gap: 10px;
    }
    
    .highscore-name-input {
        font-size: 1em;
        padding: 6px 12px;
    }
    
    .highscore-back-link {
        font-size: clamp(18px, 3.5vh, 22px);
    }
    
    .highscore-skip-link {
        font-size: clamp(16px, 3.2vh, 20px);
        margin-top: 8px;
        margin-bottom: 4px;
        padding-bottom: 4px;
    }
    
    .highscore-list-container {
        max-height: min(300px, 45dvh);
        margin: 12px 0;
    }

    /* Flaches Landscape: alles enger, damit „Nö, kein Bock“ sichtbar bleibt */
    @media (max-height: 430px) {
        .highscore-content {
            padding: 8px 12px 10px;
            max-height: calc(100dvh - 8px);
            margin: 4px auto;
        }

        .highscore-entry-text {
            font-size: 0.95em;
        }

        .highscore-form {
            margin: 4px 0;
            gap: 6px;
        }

        .highscore-skip-link {
            margin-top: 4px;
            font-size: 16px;
        }
    }
    
    .highscore-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(5, auto);
        grid-auto-flow: column;
        gap: 2px 20px;
        column-gap: 20px;
    }
    
    .highscore-entry {
        padding: 2px 10px;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
    }
    
    .highscore-entry-rank {
        min-width: auto;
        text-align: left;
    }
    
    .highscore-entry-name {
        margin-left: 0;
        flex: 0 1 auto;
    }
    
    .highscore-entry-score {
        flex: 0 0 auto;
        text-align: right;
        margin-left: auto;
    }
}

/* Thanks Screen Styles */
#thanks-character-container {
    position: relative;
    width: 300px;
    height: 200px;
    margin: 20px auto;
    overflow: hidden;
}

.character-running {
    position: absolute;
    width: 100px;
    height: 120px;
    background-size: 200px 120px;
    background-repeat: no-repeat;
    background-position: 0 0;
    animation: characterRunIn 1.5s ease-out forwards, characterFadeOut 0.3s ease-in 1.5s forwards;
    left: -150px;
}

@keyframes characterRunIn {
    from {
        left: -150px;
    }
    to {
        left: 100px;
    }
}

@keyframes characterFadeOut {
    to {
        opacity: 0;
    }
}

.character-end {
    position: absolute;
    width: 200px;
    height: 200px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    animation: characterEndFadeIn 0.5s ease-in 1.5s forwards;
    left: 50px;
    top: 0;
}

@keyframes characterEndFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#thanks-message {
    font-family: var(--font-hand);
    font-size: 2.5em;
    margin: 30px 0;
    color: var(--ink-blue);
}

/* .reward-btn: Optik via buttons.css; hier nur Layout-Abstand */
.reward-btn {
    margin-top: 20px;
}

/* Optik: .k-paper (theme.css) */
.error {
    text-align: center;
    font-size: 1.5em;
    padding: 40px;
    max-width: 600px;
    width: 90%;
}

@media (max-width: 920px) {
    body {
        background: #e8f4f8 !important; /* Match canvas background - no brown visible */
        overflow: hidden;
    }
    
    #game-screen {
        padding: 0;
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height for mobile browsers */
        overflow: hidden;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        width: 100dvw; /* Use dynamic viewport width for mobile browsers */
        background: #e8f4f8 !important; /* Match canvas background - fills grey areas */
    }
    
    #game-canvas-container {
        width: 100vw;
        width: 100dvw; /* Use dynamic viewport width */
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height */
        padding: 0;
        border: none;
        box-shadow: none;
        background: transparent; /* Remove brown background in mobile view */
        position: fixed;
        top: 0;
        left: 0;
        margin: 0;
        overflow: hidden;
        /* Remove flexbox centering - canvas should be positioned absolutely */
    }
    
    #game-canvas {
        /* Dimensions set by JavaScript resizeCanvas() - maximally fills viewport */
        display: block;
        margin: 0;
        padding: 0;
        position: absolute;
        top: 0;
        left: 0;
        /* Position at top-left so character (at x=50) is visible */
        /* Canvas height fills viewport, width may exceed (will be cropped on right) */
        /* JavaScript sets explicit width/height via inline styles - no CSS should override */
        max-width: none !important;
        max-height: none !important;
        min-width: 0 !important;
        min-height: 0 !important;
        /* Ensure canvas can extend beyond viewport width */
        box-sizing: content-box;
    }
    
    /* Mobile: Score Display links oben */
    .score-display {
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 100;
        width: 60px;
        height: 60px;
    }
    
    .game-header {
        position: fixed !important;
        top: 10px !important;
        left: 85px !important; /* Beginnt rechts von Score-Display (60px + 25px Abstand) */
        right: 10px !important;
        z-index: 10;
        font-size: 0.75em;
        gap: 6px;
        flex-direction: row !important;
        justify-content: flex-start !important; /* Links ausrichten */
        flex-wrap: nowrap !important;
        align-items: center;
    }
    
    .target {
        padding: 6px 10px;
        font-size: 0.9em;
        flex: 1; /* Nimmt verfügbaren Platz ein */
        min-width: 0;
        max-width: none;
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        gap: 6px;
    }
    
    .target > span:first-child {
        display: none !important; /* "Ziel:" Label ausblenden */
    }
    
    .target > .progress-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        gap: 6px;
        flex: 1;
        min-width: 0;
    }
    
    /* Score Display Mobile */
    .score-display {
        top: 10px;
        left: 10px;
        width: 60px;
        height: 60px;
    }
    
    .score-display span {
        font-size: 1.4em;
    }
    
    .progress-container {
        gap: 6px;
        min-width: 0;
        display: flex !important;
        flex-direction: row !important;
    }
    
    .progress-bar {
        height: 16px;
        flex: 1;
        min-width: 0;
    }
    
    .progress-text {
        font-size: 1.25em;
        min-width: 35px;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .screen {
        width: 100%;
        width: 100dvw;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        position: fixed;
        inset: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        align-items: center;
        justify-content: center;
        padding: 0;
        box-sizing: border-box;
    }

    /* Intro behält oben Ausrichtung (kein Abschneiden durch Zentrierung) */
    #intro-screen {
        align-items: flex-start;
        padding-top: 2px;
        padding-bottom: 2px;
    }
    
    /* Zettel fuellt den Bildschirm: kein Tape (wuerde oben abgeschnitten), keine Drehung */
    .intro-content {
        padding: 2vh 15px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: calc(100dvh - 4px);
        margin: 0 auto;
        gap: 1vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: none;
    }

    .intro-content.k-taped::before {
        display: none;
    }

    /* Platz fuer das Tape: .screen richtet mobil oben aus */
    .win-content,
    .thanks-content,
    .portrait-content {
        margin: 24px auto 12px;
    }

    #portrait-screen {
        align-items: center;
    }
    
    .intro-content h1 {
        font-size: clamp(0.9em, 4vh, 1.5em); /* Aggressiv klein für Querformat */
        margin-bottom: 1vh;
        line-height: 1.05;
        padding: 0 10px;
        word-wrap: break-word;
    }
    
    .intro-content p {
        font-size: clamp(0.65em, 3vh, 1em);
        margin-bottom: 0.5vh;
        line-height: 1.15;
        padding: 0 10px;
    }
    
    #intro-character {
        width: clamp(30px, 10vh, 60px);
        height: clamp(30px, 10vh, 60px);
        margin: 1vh auto;
        flex-shrink: 0;
    }
    
    /* Sound Controls (Grundregeln global, siehe oben) */
    .sound-controls {
        bottom: 15px;
        right: 15px;
        gap: 8px;
    }
    
    #intro-controls {
        font-size: clamp(0.9em, 4.5vh, 1.3em);
        margin: 1vh 0;
        padding: 0 10px;
    }
    
    #intro-controls p {
        margin-bottom: 0.5vh;
        line-height: 1.2;
    }
    
    .start-btn {
        /* Optik via buttons.css; Mobile-Layout bleibt */
        margin-top: 1vh;
        flex-shrink: 0;
    }
}

@media (max-width: 920px) and (min-width: 769px) {
    #game-screen {
        padding: 0;
        height: 100vh;
        overflow: hidden;
    }
    
    #game-canvas-container {
        width: 100vw;
        height: 100vh;
        padding: 0;
        border: none;
        box-shadow: none;
        position: fixed;
        top: 0;
        left: 0;
        margin: 0;
    }
    
    #game-canvas {
        width: 100vw;
        height: 100vh;
        display: block;
        margin: 0;
        padding: 0;
    }
    
    .intro-content h1 {
        font-size: 2em;
    }
    
    .game-header {
        font-size: 1em;
        top: 10px;
        left: 10px;
        right: 10px;
        flex-direction: row;
        gap: 10px;
        position: fixed;
        z-index: 10;
    }
    
    .target {
        max-width: 100%;
    }
}

/* ===== Gameplay-Juice (Prototyp: Tempo / Near-Miss-Multiplier / Meilensteine) ===== */

/* Callouts, fliegende Punkte, HUD-Chips, Meilenstein-Flash: im Canvas gezeichnet (assets/js/game-overlay.js) */

/* Screenreader-Ansage der Callouts */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Rausch: leichter Farbtrip der Szene (Screen-Shake laeuft per Web Animations API und ueberlagert sich) */
#game-canvas.tripping {
    animation: tripHue 3s linear infinite;
}
@keyframes tripHue {
    0%   { filter: hue-rotate(0deg) saturate(1.3); }
    50%  { filter: hue-rotate(45deg) saturate(1.6); }
    100% { filter: hue-rotate(0deg) saturate(1.3); }
}

/* Game-Over-Grund (z. B. Ueberdosis) */
.fail-reason {
    position: absolute;
    top: 14%;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    z-index: 5;
    margin: 0;
    width: 90%;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(24px, 5vw, 56px);
    color: var(--yellow);
    text-shadow: 3px 3px 0 var(--ink);
    pointer-events: none;
    animation: tripHue 2s linear infinite;
}

/* Reduced Motion respektieren */
@media (prefers-reduced-motion: reduce) {
    #game-canvas.tripping,
    .fail-reason {
        animation: none !important;
        transition: none !important;
    }
}
