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

body {
    background-color: #f4e8d1; /* Цвет старой комиксной бумаги */
    /* Эффект растра (halftone) */
    background-image: radial-gradient(#d3c5a3 2px, transparent 2px);
    background-size: 10px 10px;
    font-family: 'Bangers', cursive; /* Комиксный шрифт */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    user-select: none;
    overflow: hidden;
}

.comic-page {
    background: #fff;
    padding: 30px;
    border: 5px solid #000;
    box-shadow: 15px 15px 0px rgba(0,0,0,0.9);
    position: relative;
    max-width: 800px;
    transform: rotate(-1deg); /* Легкий наклон "страницы" */
}

#score {
    background: #ffcc00;
    border: 4px solid #000;
    padding: 5px 20px;
    display: inline-block;
    box-shadow: 6px 6px 0 #000;
    font-size: 32px;
    margin-bottom: 20px;
    letter-spacing: 2px;
    transform: rotate(-2deg);
}

.comic-panel {
    width: 650px;
    height: 280px;
    border: 6px solid #000;
    background-color: #f7a040; 
    position: relative;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 10px 10px 0px #000;
}

/* Фон внутри панели (динамичные линии) */
.sky {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(
      45deg,
      #f7a040,
      #f7a040 10px,
      #eb8a2a 10px,
      #eb8a2a 20px
    );
}

/* Силуэты города */
.buildings {
    position: absolute;
    bottom: 25px;
    width: 100%;
    height: 120px;
    background-image: linear-gradient(to right, 
        #000 0%, #000 15%, transparent 15%, transparent 25%,
        #000 25%, #000 45%, transparent 45%, transparent 55%,
        #000 55%, #000 80%, transparent 80%, transparent 100%);
    background-size: 300px 120px;
    opacity: 0.3;
}

.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25px;
    background: #000;
    border-top: 4px solid #fff;
}

/* Персонаж (Стиль: Скетч Тернер) */
#player {
    width: 45px;
    height: 70px;
    background-color: transparent;
    position: absolute;
    bottom: 25px;
    left: 60px;
    z-index: 5;
}

/* Препятствие (Стиль: Зеленый мутант) */
#obstacle {
    width: 50px;
    height: 50px;
    background-color: transparent;
    position: absolute;
    bottom: 25px;
    right: -60px;
    z-index: 5;
}

/* Всплывающие надписи как в комиксах */
#action-text {
    position: absolute;
    bottom: 110px;
    left: 20px;
    font-size: 40px;
    color: #fff;
    text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000, 5px 5px 0 #e74c3c;
    transform: rotate(-15deg);
    z-index: 10;
    letter-spacing: 2px;
}

#game-over-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(5deg);
    font-size: 65px;
    color: #ffcc00;
    text-shadow: 3px 0 0 #000, -3px 0 0 #000, 0 3px 0 #000, 0 -3px 0 #000, 8px 8px 0 #e74c3c;
    text-align: center;
    line-height: 1.1;
    z-index: 20;
    background: rgba(0,0,0,0.85);
    padding: 15px 30px;
    border: 6px solid #fff;
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

/* Анимации */
.jump {
    animation: jump-anim 0.6s ease-out;
}

@keyframes jump-anim {
    0% { bottom: 25px; }
    40% { bottom: 160px; }
    50% { bottom: 170px; }
    60% { bottom: 160px; }
    100% { bottom: 25px; }
}

.obstacle-move {
    animation: move-anim 1.5s infinite linear;
}

@keyframes move-anim {
    0% { right: -60px; }
    100% { right: 700px; }
}

/* Подпись под фреймом */
.caption {
    background: #fff;
    border: 4px solid #000;
    padding: 10px 15px;
    box-shadow: 5px 5px 0 #000;
    font-size: 22px;
    max-width: 450px;
    margin: 0 auto;
    text-align: center;
    letter-spacing: 1px;
}

@media (max-width: 700px) {
    .comic-panel {
        width: 90vw;
        height: 220px;
    }
    @keyframes move-anim {
        0% { right: -60px; }
        100% { right: 100vw; }
    }
    #game-over-text {
        font-size: 40px;
    }
}
