/* Blitz-Lesen - Mobile-First Styles */

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

:root {
    --primary-color: #1a4b8c;
    --secondary-color: #2d6bb5;
    --accent-color: #f5a623;
    --success-color: #4CAF50;
    --error-color: #f44336;
    --text-color: #333;
    --bg-color: #1a1a2e;
    --header-height: 50px;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Website Header */
.game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(26, 26, 46, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.game-header .back-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.game-header .back-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.game-header .logo-link {
    display: flex;
    align-items: center;
}

.game-header .logo-img {
    height: 24px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.game-header .logo-link:hover .logo-img {
    opacity: 1;
}

.game-header .header-spacer {
    width: 70px; /* Balance für zentriertes Logo */
}

#game-container {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Phaser canvas wrapper - zentrieren */
#game-container > div,
#game-container > canvas {
    margin: 0 auto !important;
}

#game-container canvas {
    max-width: 100%;
    max-height: 100%;
    touch-action: manipulation;
}

/* PWA-safe area für Notch etc. */
@supports (padding: env(safe-area-inset-top)) {
    .game-header {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--header-height) + env(safe-area-inset-top));
    }

    #game-container {
        top: calc(var(--header-height) + env(safe-area-inset-top));
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Landscape-Warnung - nur auf Mobile im Querformat */
#landscape-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.98);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.landscape-content {
    text-align: center;
    color: white;
    padding: 2rem;
}

.rotate-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    animation: rotate-hint 1.5s ease-in-out infinite;
}

@keyframes rotate-hint {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.landscape-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Zeige Warnung nur auf kleinen Touch-Geräten im Landscape */
@media (max-height: 500px) and (orientation: landscape) and (hover: none) and (pointer: coarse) {
    #landscape-warning {
        display: flex;
    }
    #game-container,
    .game-header {
        display: none;
    }
}

/* Fullscreen-Button */
.fullscreen-btn {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 500;
    display: none; /* Nur auf Touch-Geräten anzeigen */
    justify-content: center;
    align-items: center;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fullscreen-btn:hover,
.fullscreen-btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.fullscreen-btn.is-fullscreen {
    background: var(--success-color);
}

/* Nur auf Touch-Geräten anzeigen die Fullscreen unterstützen */
@media (hover: none) and (pointer: coarse) {
    .fullscreen-btn {
        display: flex;
    }
}

/* Verstecke auf iOS da Fullscreen API nicht unterstützt */
@supports (-webkit-touch-callout: none) {
    .fullscreen-btn {
        display: none;
    }
}
