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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #87CEEB;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Playmat Wrapper - Basis (für Mobile) */
#playmat-wrapper {
    position: relative;
    width: 1512px;
    height: 945px;
}

/* Desktop (>= 1512x945): Dynamisch - füllt Viewport */
@media (min-width: 1512px) and (min-height: 945px) {
    body {
        overflow: hidden;
    }

    #playmat-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
    }
}

/* Tablet: Scrollbar (768px - 1511px) */
@media (min-width: 768px) and (max-width: 1511px) {
    html, body {
        overflow: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    body {
        width: 1512px;
        height: 945px;
        cursor: grab;
    }

    body:active {
        cursor: grabbing;
    }

    #playmat-wrapper {
        position: absolute;
        top: 0;
        left: 0;
    }

    .container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
    }

    .info-btn {
        position: fixed !important;
    }

    .playmat-footer {
        position: fixed !important;
    }
}

/* Smartphone: Skaliert + Touch-Drag (< 768px) */
@media (max-width: 767px) {
    html, body {
        overflow: hidden;
        width: 100vw;
        height: 100vh;
        touch-action: none;
        cursor: grab;
    }

    body:active {
        cursor: grabbing;
    }

    #playmat-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        transform-origin: top left;
        /* Scale + Translate wird per JavaScript gesetzt */
    }

    .container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
    }

    .info-btn {
        position: fixed !important;
    }

    .playmat-footer {
        position: fixed !important;
    }
}

#playmat {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#helicopter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.vehicles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.vehicle {
    position: absolute;
    font-size: 2.4rem;
    filter: drop-shadow(3px 3px 5px rgba(0,0,0,0.4));
    cursor: pointer;
    pointer-events: all;
    transition: filter 0.2s ease;
    will-change: transform;
}

.vehicle:hover {
    filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.6)) brightness(1.1);
}

#tram {
    font-size: 2.8rem;
}

.container {
    position: fixed;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    padding: 20px;
    overflow-y: auto;
}

.content-card {
    background: rgba(108, 108, 108, 0.454);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 25px;
    padding: 40px;
    padding-top: 60px;
    padding-right: 10px;
    max-width: 700px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid rgba(255, 255, 255, 0.5);
    border-left: 2px solid rgba(255, 255, 255, 0.5);
    max-height: 90vh;
    overflow: hidden;
    transform-style: preserve-3d;
}

.card-inner {
    overflow-y: auto;
    max-height: calc(90vh - 104px);
    padding-top: 25px;
    padding-right: 30px;
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(60, 60, 60, 0.5) transparent;
}

.card-inner::-webkit-scrollbar {
    width: 4px;
}

.card-inner::-webkit-scrollbar-track {
    background: transparent;
    margin: 80px 0;
}

.card-inner::-webkit-scrollbar-button {
    display: none;
    height: 0;
}

.card-inner::-webkit-scrollbar-thumb {
    background: rgba(60, 60, 60, 0.5);
    border-radius: 25px;
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.badge {
    position: relative;
    width: 100px;
    height: 100px;
    background: linear-gradient(145deg, #FF4444, #CC0000);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 4px solid #FFD700;
}

.badge-text {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.blue-light {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 40px;
    height: 20px;
    background: linear-gradient(to right,
        #0066FF 0%, #0066FF 48%,
        #333 48%, #333 52%,
        #FF0000 52%, #FF0000 100%);
    border-radius: 5px;
    border: 2px solid #222;
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.6);
}

.light-dome {
    position: absolute;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
}

.light-dome.left {
    left: 4px;
    animation: blink-blue 1s ease-in-out infinite;
}

.light-dome.right {
    right: 4px;
    animation: blink-red 1s ease-in-out infinite;
}

@keyframes blink-blue {
    0%, 49% {
        opacity: 1;
        box-shadow: 0 0 10px #0066FF, 0 0 20px #0066FF;
    }
    50%, 100% {
        opacity: 0.3;
        box-shadow: none;
    }
}

@keyframes blink-red {
    0%, 49% {
        opacity: 0.3;
        box-shadow: none;
    }
    50%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px #FF0000, 0 0 20px #FF0000;
    }
}

h1 {
    color: white;
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.story p {
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.8;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: justify;
}

.highlight {
    background: rgba(255, 215, 0, 0.3);
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 600;
    color: #FFD700;
}

.signature {
    text-align: center;
    font-size: 1.2rem;
    margin-top: 20px;
    color: #FFD700;
}

.age-display {
    margin: 30px 0;
    display: flex;
    justify-content: center;
}

.age-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    animation: gentle-move 3s ease-in-out infinite;
}

@keyframes gentle-move {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.age-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
    }
}

#age-counter {
    display: inline-block;
    animation: count-glow 2s ease-in-out infinite;
}

@keyframes count-glow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.9), 0 0 25px rgba(255, 255, 255, 0.6);
    }
}

.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.footer p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 600;
}

@keyframes vehicle-click {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.4) rotate(15deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.vehicle.clicked {
    animation: vehicle-click 0.4s ease-out;
}

@media (max-width: 768px) {
    /* Info-Box responsive */
    .content-card {
        padding: 25px 18px;
        padding-top: 50px;
        margin-bottom: 60px;
        max-height: 90vh;
    }

    .content-card h1 {
        font-size: 1.6rem;
        margin-bottom: 15px;
    }

    .story p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 12px;
    }

    .content-card .badge {
        width: 70px;
        height: 70px;
    }

    .content-card .badge-text {
        font-size: 2rem;
    }

    .content-card .logo {
        margin-bottom: 15px;
    }

    .content-card .footer {
        margin-top: 15px;
    }

    .content-card .footer p {
        font-size: 0.85rem;
    }

    .close-info-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* Footer kleiner */
    .playmat-footer {
        padding: 5px 10px !important;
        font-size: 10px !important;
        gap: 10px !important;
    }

    .playmat-footer .version {
        font-size: 9px !important;
    }

    /* Fahrzeuge behalten Desktop-Größe */

    .card-inner {
        max-height: calc(90vh - 79px);
        padding-top: 25px;
        padding-right: 15px;
    }
}

@media (max-width: 480px) {
    .content-card {
        padding: 20px 15px;
        padding-top: 45px;
        margin-bottom: 50px;
        max-height: 90vh;
        border-radius: 18px;
    }

    .content-card h1 {
        font-size: 1.3rem;
    }

    .story p {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 10px;
    }

    .content-card .badge {
        width: 60px;
        height: 60px;
    }

    .content-card .badge-text {
        font-size: 1.7rem;
    }

    .close-info-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .playmat-footer {
        padding: 5px 10px !important;
        font-size: 10px !important;
        gap: 8px !important;
    }

    .playmat-footer .version {
        font-size: 9px !important;
    }

    /* Fahrzeuge behalten Desktop-Größe */

    .card-inner {
        max-height: calc(90vh - 69px);
        padding-top: 25px;
        padding-right: 10px;
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.info-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.info-btn:hover {
    transform: scale(1.25) rotate(5deg) !important;
    box-shadow: 0 12px 35px rgba(74, 144, 226, 0.6);
}

.info-btn.hiding {
    animation: zoomFadeOut 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes zoomFadeOut {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
        pointer-events: none;
    }
}


.info-icon {
    font-size: 32px;
    font-weight: bold;
    color: white;
    font-family: Georgia, serif;
    font-style: italic;
}

.info-btn.hidden {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    pointer-events: none;
}

.content-card.closing {
    animation: zoomToInfoButton 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.content-card.opening {
    animation: zoomFromInfoButton 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes zoomToInfoButton {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(calc(50vw - 50%), calc(-50vh + 50px)) scale(0.1);
        pointer-events: none;
    }
}

@keyframes zoomFromInfoButton {
    0% {
        opacity: 0;
        transform: translate(calc(50vw - 50%), calc(-50vh + 50px)) scale(0.1);
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
}

.info-btn.show {
    animation: blopIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0s;
}

@keyframes blopIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}


.close-info-btn {
    display: block;
    margin: 30px auto 20px;
    padding: 12px 35px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.close-info-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.close-info-btn:active {
    transform: scale(0.98);
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #3071bb 0%, #5B9BD5 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 1.5s ease, visibility 1.5s ease;
}


#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
}

.logo-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-container .badge {
    position: relative;
    width: 100px;
    height: 100px;
    background: linear-gradient(145deg, #FF4444, #CC0000);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 4px solid #FFD700;
    z-index: 2;
}

.logo-container .badge-text {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.logo-container .blue-light {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 40px;
    height: 20px;
    background: linear-gradient(to right,
        #0066FF 0%, #0066FF 48%,
        #333 48%, #333 52%,
        #FF0000 52%, #FF0000 100%);
    border-radius: 5px;
    border: 2px solid #222;
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.6);
}

.logo-container .light-dome {
    position: absolute;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
}

.logo-container .light-dome.left {
    left: 4px;
    animation: blink-blue 1s ease-in-out infinite;
}

.logo-container .light-dome.right {
    right: 4px;
    animation: blink-red 1s ease-in-out infinite;
}

.loading-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: rotate-circle 2s linear infinite;
}

.loading-circle circle {
    fill: none;
    stroke: white;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 70, 283;
    stroke-dashoffset: 0;
    transform-origin: center;
}

@keyframes rotate-circle {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


.loading-text {
    color: white;
    font-size: 24px;
    font-weight: 500;
    margin: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.badge.badge-complete {
    animation: badge-glow 0.6s ease-out;
}

@keyframes badge-glow {
    0% {
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.6);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
        transform: scale(1);
    }
}

.playmat-footer {
    position: fixed;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 15px;
    font-size: 12px;
    z-index: 100;
    display: flex;
    gap: 20px;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.playmat-footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
}

.playmat-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.playmat-footer .version {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}

/* ==========================================
   SCROLL-HINWEIS FÜR MOBILE
   ========================================== */
.scroll-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.scroll-hint.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.scroll-hint.hidden {
    display: none;
}

.scroll-hint.fade-out {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.scroll-hint-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scroll-hint-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-hint-icon .hand {
    font-size: 20px;
    animation: hand-move 2s ease-in-out infinite;
}

@keyframes hand-move {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(4px, 0); }
    50% { transform: translate(0, -4px); }
    75% { transform: translate(-4px, 0); }
}

.direction-arrows {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.direction-arrows .arrow {
    position: absolute;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    animation: arrow-pulse 2s ease-in-out infinite;
}

.arrow.up { top: 0; left: 50%; transform: translateX(-50%); animation-delay: 0s; }
.arrow.right { right: 0; top: 50%; transform: translateY(-50%); animation-delay: 0.25s; }
.arrow.down { bottom: 0; left: 50%; transform: translateX(-50%); animation-delay: 0.5s; }
.arrow.left { left: 0; top: 50%; transform: translateY(-50%); animation-delay: 0.75s; }

@keyframes arrow-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.scroll-hint-text {
    color: white;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
