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

:root {
    /* Mayks Fahrschule Corporate Identity */
    --mayks-red: #e63946;
    --mayks-dark: #1d3557;
    --mayks-light: #f1faee;
    --mayks-accent: #457b9d;
    --mayks-gold: #FFD700;
    
    /* Legacy aliases */
    --primary-color: var(--mayks-red);
    --secondary-color: var(--mayks-dark);
    --accent-color: var(--mayks-light);
    --success-color: #06d6a0;
    --warning-color: #ffd60a;
    --gold: var(--mayks-gold);
    --silver: #C0C0C0;
    --bronze: #CD7F32;
    
    /* Hamburg theme colors */
    --hamburg-blue: #1a2a6c;
    --hamburg-sunset: #b21f1f;
    --hamburg-gold: #fdbb2d;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap');

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--hamburg-blue) 0%, var(--hamburg-sunset) 50%, var(--hamburg-gold) 100%);
    color: #333;
    overflow: hidden;
}

#app {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: flex;
}

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

.container {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Mayks Logo */
.mayks-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--mayks-red) 0%, #d62839 100%);
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(230, 57, 70, 0.3);
}

.logo-text {
    font-size: 3rem;
    font-weight: 900;
    color: white;
    letter-spacing: 8px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    font-family: 'Poppins', sans-serif;
}

.logo-sub {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 0.3rem;
}

/* Welcome Screen */
.title {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--mayks-red) 0%, #d62839 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--mayks-dark);
    text-align: center;
    margin-bottom: 1rem;
}

.celebration {
    text-align: center;
    font-size: 1.3rem;
    color: var(--warning-color);
    margin-bottom: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.rewards-preview {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    color: white;
}

.rewards-preview h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.rewards-preview ul {
    list-style: none;
    padding: 0;
}

.rewards-preview li {
    margin: 0.7rem 0;
    font-size: 1rem;
    padding-left: 0.5rem;
}

.prizes-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    color: white;
}

.prizes-info h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.prizes-grid {
    display: grid;
    gap: 0.5rem;
}

.prize {
    background: rgba(255,255,255,0.2);
    padding: 0.7rem;
    border-radius: 10px;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.prize.gold {
    background: linear-gradient(135deg, var(--gold) 0%, #FFA500 100%);
    color: #333;
    font-weight: bold;
}

.prize.silver {
    background: linear-gradient(135deg, var(--silver) 0%, #A9A9A9 100%);
    color: #333;
}

.prize.bronze {
    background: linear-gradient(135deg, var(--bronze) 0%, #8B4513 100%);
    color: white;
}

.registration-form {
    margin-bottom: 1rem;
}

.registration-form h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.registration-form input[type="text"],
.registration-form input[type="email"],
.registration-form input[type="tel"] {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.registration-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.consent {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    cursor: pointer;
}

.consent input {
    margin-right: 0.5rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.consent a {
    color: var(--primary-color);
    text-decoration: none;
}

.consent a:hover {
    text-decoration: underline;
}

.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #d62839 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #457b9d 100%);
    color: white;
    margin-top: 0.5rem;
}

/* Countdown Screen */
.countdown-container {
    text-align: center;
}

.countdown-number {
    font-size: 15rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 30px rgba(255,255,255,0.5);
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Game Screen */
#gameCanvas {
    display: block;
    background: #2d2d2d;
    width: 100%;
    height: 100vh;
}

.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);  /* Transparenter */
    padding: 0.5rem;  /* Weniger Padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    z-index: 100;
    flex-wrap: wrap;
    font-size: 0.9rem;  /* Kleinere Schrift */
}

.hud-left, .hud-center, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.score-display, .rank-display, .distance-display {
    font-size: 0.9rem;  /* Kleiner */
}

.label {
    font-size: 0.75rem;  /* Kleiner */
    opacity: 0.8;
    margin-right: 0.3rem;
}

#scoreValue, #rankValue, #distanceValue {
    font-weight: bold;
    font-size: 1.1rem;  /* Kleiner */
    color: var(--warning-color);
}

.instructors-collected {
    text-align: center;
}

.instructor-slots {
    display: flex;
    gap: 0.3rem;
    margin: 0.3rem 0;
}

.slot {
    font-size: 2rem;
    filter: grayscale(100%);
    opacity: 0.3;
    transition: all 0.3s;
}

.slot.filled {
    filter: grayscale(0%);
    opacity: 1;
    animation: slotFill 0.5s ease-in-out;
}

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

#instructorCount {
    font-weight: bold;
    font-size: 1.2rem;
}

.combo-display {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    border-radius: 20px;
    animation: comboPulse 0.5s ease-in-out infinite alternate;
}

.combo-text {
    font-weight: 800;
    font-size: 1.3rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

@keyframes comboPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.touch-controls {
    position: absolute;
    bottom: 3rem;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
    pointer-events: none;
}

.touch-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(230, 57, 70, 0.8);
    border: 4px solid white;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    user-select: none;
    backdrop-filter: blur(10px);
    transition: transform 0.1s, background 0.2s;
    pointer-events: auto;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.touch-btn:active {
    transform: scale(0.85);
    background: rgba(230, 57, 70, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

.touch-btn.left {
    margin-right: auto;
}

.touch-btn.right {
    margin-left: auto;
}

@media (max-width: 768px) {
    .touch-controls {
        display: flex;
    }
}

.reward-notification {
    position: absolute;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, var(--success-color) 0%, #05b892 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 200;
    max-width: 350px;
    animation: toastSlideIn 0.4s ease-out;
    pointer-events: none;
}

.reward-notification.hidden {
    animation: toastSlideOut 0.3s ease-in;
    opacity: 0;
    transform: translateX(400px);
}

@keyframes toastSlideIn {
    0% { 
        opacity: 0;
        transform: translateX(400px);
    }
    100% { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    0% { 
        opacity: 1;
        transform: translateX(0);
    }
    100% { 
        opacity: 0;
        transform: translateX(400px);
    }
}

/* Game Over Screen */
.game-over-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.final-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    border-radius: 15px;
    color: white;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-value {
    font-weight: bold;
    font-size: 1.2rem;
}

.stat-value.rank {
    color: var(--gold);
    font-size: 1.5rem;
}

.rewards-earned {
    background: linear-gradient(135deg, var(--success-color) 0%, #05b892 100%);
    padding: 1.5rem;
    border-radius: 15px;
    color: white;
    margin-bottom: 1.5rem;
}

.rewards-earned h3 {
    margin-bottom: 1rem;
}

.rewards-earned ul {
    list-style: none;
    padding: 0;
}

.rewards-earned li {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.rewards-earned li::before {
    content: "✓";
    position: absolute;
    left: 0;
    font-weight: bold;
}

.leaderboard-container {
    margin-bottom: 1.5rem;
}

.leaderboard-container h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.leaderboard-list {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.leaderboard-item.top1 {
    background: linear-gradient(135deg, var(--gold) 0%, #FFA500 100%);
    color: #333;
    font-weight: bold;
}

.leaderboard-item.top2, .leaderboard-item.top3 {
    background: linear-gradient(135deg, var(--silver) 0%, #D3D3D3 100%);
    color: #333;
}

.leaderboard-item.top4, .leaderboard-item.top5 {
    background: linear-gradient(135deg, var(--bronze) 0%, #A0522D 100%);
    color: white;
}

.leaderboard-rank {
    font-weight: bold;
    font-size: 1.2rem;
    min-width: 40px;
}

.leaderboard-name {
    flex: 1;
    padding: 0 1rem;
}

.leaderboard-score {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.leaderboard-item.top1 .leaderboard-score,
.leaderboard-item.top2 .leaderboard-score,
.leaderboard-item.top3 .leaderboard-score,
.leaderboard-item.top4 .leaderboard-score,
.leaderboard-item.top5 .leaderboard-score {
    color: inherit;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .container {
        padding: 1.5rem;
        max-height: 85vh;
    }
    
    .game-hud {
        font-size: 0.65rem;  /* Noch kleiner auf Mobile */
        padding: 0.25rem;  /* Minimal Padding */
        flex-wrap: wrap;
        background: rgba(0,0,0,0.4);  /* Noch transparenter */
    }
    
    .hud-left, .hud-center, .hud-right {
        font-size: 0.7rem;  /* Kompakter */
        flex: 1 1 auto;  /* Nebeneinander statt untereinander */
        gap: 0.2rem;
    }
    
    .hud-center {
        order: -1;
        margin-bottom: 0.5rem;
    }
    
    .instructor-slots .slot {
        font-size: 1.3rem;
    }
    
    .combo-display {
        margin-top: 0.3rem;
    }
    
    .combo-text {
        font-size: 1rem;
    }
    
    .reward-notification {
        top: 80px;
        right: 10px;
        max-width: 280px;
        font-size: 0.95rem;
        padding: 0.8rem 1.2rem;
    }
    
    .rewards-preview, .prizes-info {
        padding: 1rem;
    }
    
    .rewards-preview h3, .prizes-info h3 {
        font-size: 1.1rem;
    }
    
    .registration-form input {
        padding: 0.7rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .touch-btn {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .container {
        padding: 1rem;
    }
}
