@font-face {
    font-family: 'Play';
    src: url('fonts/Play/Play-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Play';
    src: url('fonts/Play/Play-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Raleway';
    src: url('fonts/Raleway/Raleway-VariableFont_wght.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Raleway';
    src: url('fonts/Raleway/Raleway-Italic-VariableFont_wght.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter/Inter-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter/Inter-Italic-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

html, body {
    overflow: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Play', Arial, sans-serif;
    padding: 20px;
    background-image: url('img/background_img/9800071_4252907.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}



canvas {
    display: block;
    background-color: black;
    outline: none;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    aspect-ratio: 3/2;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.game-container {
    width: 100%;
    max-width: 740px;
    padding: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border-radius: 12px;
}

@media only screen and (max-width: 325px) {
    .game-container {
        padding: 0;
    }
}

/* Mobile Controls (DOM unter dem Canvas) */
.mobile-controls {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    display: none;
    gap: 10px;
    justify-content: space-evenly;
    flex-wrap: nowrap;
}

.mobile-controls .mc-btn {
    width: clamp(36px, 10vw, 56px);
    aspect-ratio: 1 / 1;
    font-size: clamp(10px, 3vw, 18px);
    border-radius: clamp(6px, 1vw, 10px);
    border: 2px solid #2E5A8A;
    background: linear-gradient(180deg, #FFD700, #FFA500);
    color: #222;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

@media (max-width: 1024px) {
    body { padding: 0; }
    .mobile-controls { justify-content: space-evenly; flex-wrap: nowrap; gap: 8px; }
    .mobile-controls .mc-btn { font-size: clamp(10px, 2.4vw, 18px); }
}

@media (max-width: 600px) {
    .mobile-controls { gap: 6px; }
    .mobile-controls .mc-btn { font-size: clamp(10px, 2vw, 16px); }
}

/* Höhenbasierte Skalierung für sehr kleine Bildschirme */
@media (max-height: 700px) {
    /* Buttons skalieren bereits prozentual; keine Mindestgrößen nötig */
}

@media (max-height: 600px) {
    .mobile-controls { gap: 8px; }
}

@media (max-height: 500px) {
    .mobile-controls { gap: 6px; }
    canvas { max-height: 65vh; }
}

@media (max-height: 420px) {
    .mobile-controls { gap: 6px; }
    canvas { max-height: 58vh; }
}

@media (max-height: 360px) {
    canvas { max-height: 55vh; }
}





.start-button, .restart-button, .home-button, .fullscreen-button {
    font-family: 'Play', Arial, sans-serif;
    font-weight: bold;
}

.start-button {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: 3px solid #FF8C00;
    border-radius: 15px;
    color: #8B4513;
    font-size: 20px;
    font-weight: bold;
    padding: 12px 30px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.start-button:hover {
    background: linear-gradient(45deg, #FFA500, #FFD700);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.start-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Game Over Bildschirm Styles */
.game-over-screen {
    position: relative;
    bottom: 230px;
    left: 200px;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    aspect-ratio: 3/2;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-content {
    text-align: center;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.restart-button, .home-button {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    margin: 0 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.restart-button:hover, .home-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: linear-gradient(45deg, #ee5a24, #ff6b6b);
}

.home-button {
    background: linear-gradient(45deg, #4834d4, #686de0);
}

.home-button:hover {
    background: linear-gradient(45deg, #686de0, #4834d4);
}

/* Info Modal Styles */
.info-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
}

.info-content {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

/* Impressum Modal Styles */
.impressum-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1200;
}

.impressum-content {
    background: rgba(0, 0, 0, 0.95);
    color: white;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 15px;
    border: 3px solid #FFD700;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.impressum-content::-webkit-scrollbar {
    display: none;
}

.impressum-header {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    padding: 20px 30px;
    border-bottom: 3px solid #FF8C00;
    position: relative;
    border-radius: 12px 12px 0 0;
}

.impressum-header h1 {
    font-family: 'Play', Arial, sans-serif;
    font-size: 28px;
    font-weight: bold;
    color: #8B4513;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.impressum-subtitle {
    font-size: 16px;
    color: #8B4513;
    text-align: center;
    font-style: italic;
}

.impressum-header .close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, #FF6B6B, #ee5a24);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.impressum-header .close-button:hover {
    background: linear-gradient(45deg, #ee5a24, #FF6B6B);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.impressum-body {
    padding: 30px;
    line-height: 1.6;
}

.impressum-section {
    margin-bottom: 25px;
}

.impressum-section h2 {
    font-family: 'Play', Arial, sans-serif;
    font-size: 20px;
    color: #FFD700;
    margin-bottom: 12px;
    border-bottom: 2px solid #FFA500;
    padding-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.impressum-section h3 {
    font-family: 'Play', Arial, sans-serif;
    font-size: 16px;
    color: #FFA500;
    margin: 15px 0 8px 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.impressum-section p {
    margin-bottom: 12px;
    text-align: justify;
}

.impressum-highlight {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

.impressum-highlight h4 {
    color: #FFD700;
    margin-bottom: 10px;
    font-family: 'Play', Arial, sans-serif;
}

.impressum-contact {
    background: rgba(74, 144, 226, 0.1);
    border: 2px solid #4A90E2;
    border-radius: 10px;
    padding: 20px;
    margin-top: 25px;
}

.impressum-contact h3 {
    color: #4A90E2;
    margin-bottom: 10px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.info-content h2 {
    text-align: center;
    color: #f39c12;
    margin-bottom: 20px;
    font-family: 'Play', Arial, sans-serif;
    font-size: 28px;
}

.info-content h3 {
    color: #e74c3c;
    margin: 20px 0 10px 0;
    font-family: 'Play', Arial, sans-serif;
    font-size: 20px;
}

.info-content ul {
    list-style: none;
    padding: 0;
}

.info-content li {
    margin: 8px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Inter', Arial, sans-serif;
}

.info-content strong {
    color: #FFD700;
}

.privacy-info {
    margin-top: 20px;
    text-align: center;
}

.privacy-info .privacy-link {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: 3px solid #FF8C00;
    border-radius: 15px;
    color: #8B4513;
    font-size: 16px;
    font-weight: bold;
    padding: 8px 20px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    font-family: 'Play', Arial, sans-serif;
    text-decoration: none;
    display: inline-block;
}

.privacy-info .privacy-link:hover {
    background: linear-gradient(45deg, #FFA500, #FFD700);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    text-decoration: none;
}

.privacy-info .privacy-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.close-button {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    font-family: 'Play', Arial, sans-serif;
}

.close-button:hover {
    background: linear-gradient(45deg, #c0392b, #e74c3c);
    transform: translateY(-2px);
}

/* Datenschutzlink Styles */
.privacy-link-container {
    text-align: center;
    margin-top: 15px;
}

.privacy-link {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: 3px solid #FF8C00;
    border-radius: 15px;
    color: #8B4513;
    font-size: 16px;
    font-weight: bold;
    padding: 8px 20px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    font-family: 'Play', Arial, sans-serif;
    text-decoration: none;
    display: inline-block;
}

.privacy-link:hover {
    background: linear-gradient(45deg, #FFA500, #FFD700);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    text-decoration: none;
}

.privacy-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Impressum as link style */
.impressum-link {
    color: #4A90E2;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Play', Arial, sans-serif;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    transition: color 0.3s ease;
}

.impressum-link:hover {
    color: #357ABD;
    text-decoration: underline;
    background: none;
    transform: none;
    box-shadow: none;
}

.impressum-link:active {
    color: #2E5A8A;
    transform: none;
    box-shadow: none;
}

/* Verstecke Bildschirme wenn nicht benötigt */
.start-screen.hidden,
.game-over-screen.hidden,
.info-modal.hidden,
.impressum-modal.hidden {
    display: none !important;
}

.landscape-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landscape-warning-content {
    background: #222;
    color: #fff;
    padding: 32px 24px;
    border-radius: 18px;
    box-shadow: 0 6px 32px rgba(0,0,0,0.7);
    text-align: center;
    max-width: 90vw;
    font-family: 'Play', Arial, sans-serif;
}

.landscape-warning h2 {
    color: #FFD700;
    margin-bottom: 16px;
    font-size: 2rem;
}

.landscape-warning p {
    font-size: 1.2rem;
    margin: 0;
}

@media only screen and (max-width: 666px) {
    body {
        min-height: 0;
    }
    body.mobile-controls-active h1 {
        display: none;
    }
    canvas {
        max-width: 100%;
        max-height: 70vh;
        width: auto;
        height: auto;
        aspect-ratio: 3/2;
    }
    
    .game-over-screen {
        max-width: 100%;
        max-height: 70vh;
        width: auto;
        height: auto;
        aspect-ratio: 3/2;
    }

    h1 {
        display: none;
    }

    .privacy-link-container {
        display: none;
    }
}

@media only screen and (max-width: 480px) {
    body {
        background-size: cover;
        background-position: center;
    }
}

@media only screen and (max-width: 480px) {
    canvas {
        max-width: 95vw;
        max-height: 60vh;
        width: auto;
        height: auto;
        aspect-ratio: 3/2;
    }
    
    .game-over-screen {
        max-width: 95vw;
        max-height: 60vh;
        width: auto;
        height: auto;
        aspect-ratio: 3/2;
    }
}

@media only screen and (max-height: 500px) {
    canvas {
        max-height: 70vh;
    }
    
    .game-over-screen {
        max-height: 70vh;
    }
}

@media only screen and (orientation: landscape) and (max-width: 760px) {
    canvas {
        max-width: 90vw;
        max-height: 80vh;
        width: auto;
        height: auto;
        aspect-ratio: 3/2;
    }
    
    .game-over-screen {
        max-width: 90vw;
        max-height: 80vh;
        width: auto;
        height: auto;
        aspect-ratio: 3/2;
    }
}

@media (max-width: 768px) {
    .impressum-content {
        width: 95%;
        max-height: 85vh;
        margin: 10px;
    }
    
    .impressum-body {
        padding: 20px;
    }
    
    .impressum-header {
        padding: 15px 20px;
    }
    
    .impressum-header h1 {
        font-size: 24px;
    }
}

@media (min-width: 667px) {
    .game-container {
        max-width: none;
        width: calc(100% - 40px);
        margin: 0 20px;
    }
    canvas {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 1024px) {
    h1 {
        display: none;
    }
    .privacy-link-container {
        display: none;
    }
}