/* Karate Font */
@font-face {
    font-family: 'Karate';
    src: url('../fonts/Karate.woff2') format('woff2'),
         url('../fonts/Karate.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

/* Loading Animation Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.loading-screen.fade-out {
    opacity: 0;
}

.loading-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/karate-jump.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: continuousZoom 2s ease-in-out infinite;
    z-index: -1;
}

.loading-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.loading-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-content #main-title {
    font-family: 'Karate', sans-serif;
    font-size: clamp(4rem, 15vw, 12rem);
    line-height: 1.2;
    margin: 0;
    color: #039;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.5),
        0 0 40px rgba(255, 255, 255, 0.3),
        0 0 60px rgba(255, 255, 255, 0.1),
        2px 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.loading-content #main-title span {
    color: #d00;
}

.loading-content .dojo-name {
    font-family: Arial, sans-serif;
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4),
                 0 0 20px rgba(255, 255, 255, 0.2),
                 2px 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
    opacity: 0.9;
    animation: dojoNameFade 2s ease-in-out infinite alternate;
}

@keyframes dojoNameFade {
    0% {
        opacity: 0.7;
        transform: translateY(0px);
    }
    100% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

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

/* Loading dots animation */
.loading-dots {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Hide district selection when loading screen is shown */
body.game-loading #district-selection {
    display: none;
}

/* Show district selection after loading */
body:not(.game-loading) #district-selection {
    display: block;
}



body {
    margin: 0;
    padding: 0;
    background: #ffffff;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    overflow: auto;
}

/* Only hide overflow when game is active */
body.game-active {
    overflow: hidden;
}


#game-container {
    position: relative;
    max-width: 100vw;
    max-height: 100vh;
}

canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 100vh;
    touch-action: none;
}

#ui {
    position: absolute;
    font-family:'Courier New', Courier, monospace;
    top: 0;
    left: 20px;
    color: #ffffff;
    font-size: 14px;
    font-weight: normal;
    z-index: 100;
    text-shadow: none;
    opacity: 0.5;
}



/* Modern Glassy Modal Styles */

/* Game Over Modal - Complete Glassy Design */
.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-over-modal.show {
    display: flex;
    opacity: 1;
}

.game-over-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: fadeIn 0.3s ease;
}

.game-over-modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.2),
        0 15px 30px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalGlassySlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
}

.game-over-modal-close {
    position: absolute;
    top: 18px;
    right: 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 24px;
    cursor: pointer;
    color: #ccc;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10002;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.game-over-modal-close span {
    margin-top: -2px;
}

.game-over-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    transform: scale(1.1);
}

.game-over-modal-header {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, 
        rgba(220, 0, 0, 0.8) 0%, 
        rgba(139, 0, 0, 0.8) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.game-over-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.game-over-modal-header h2 {
    font-family: 'Karate', sans-serif;
    font-size: 32px;
    color: #ffffff;
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-over-modal-body {
    padding: 32px 24px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.game-over-modal-footer {
    padding: 0 24px 32px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Game Paused Modal - Complete Glassy Design */
.game-paused-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-paused-modal.show {
    display: flex;
    opacity: 1;
}

.game-paused-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: fadeIn 0.3s ease;
}

.game-paused-modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.2),
        0 15px 30px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalGlassySlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
}

.game-paused-modal-close {
    position: absolute;
    top: 18px;
    right: 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 24px;
    cursor: pointer;
    color: #ccc;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10002;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.game-paused-modal-close span {
    margin-top: -2px;
}

.game-paused-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    transform: scale(1.1);
}

.game-paused-modal-header {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, 
        rgba(255, 149, 0, 0.8) 0%, 
        rgba(255, 140, 0, 0.8) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.game-paused-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.game-paused-modal-header h2 {
    font-family: 'Karate', sans-serif;
    font-size: 32px;
    color: #ffffff;
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-paused-modal-header .emoji {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
    animation: emojiFloat 3s ease-in-out infinite;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.game-paused-modal-body {
    padding: 32px 24px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.game-paused-modal-body p {
    margin: 0;
    font-size: 18px;
    color: #555;
    font-weight: 500;
    text-align: center;
    line-height: 1.6;
}

/* Shared Modal Animations */
@keyframes emojiFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

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

@keyframes modalGlassySlideIn {
    from { 
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Stats Grid - Enhanced Glassy Cards */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 24px 0;
}

.stat-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 24px;
    border-radius: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #039;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modal Button Styles - Glassy Design */
#restart-btn {
    background: linear-gradient(135deg, 
        rgba(0, 51, 153, 0.9) 0%, 
        rgba(220, 0, 0, 0.9) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: none;
    color: white;
    padding: 16px 32px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 200px;
}

#restart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

#restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#restart-btn:hover::before {
    left: 100%;
}

#restart-btn:active {
    transform: translateY(0);
}

/* Location Modal - Complete Glassy Redesign */
.location-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.location-modal.show {
    display: flex;
    opacity: 1;
}

.location-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: fadeIn 0.3s ease;
}

.location-modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.2),
        0 15px 30px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalGlassySlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    }
    
.location-modal-close {
    position: absolute;
    top: 18px;
    right: 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10002;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.location-modal-close span {
    margin-top: -2px;
}

.location-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    color: #333;
    transform: scale(1.1);
    }
    
.location-modal-header {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, 
        rgba(0, 51, 153, 0.1) 0%, 
        rgba(220, 0, 0, 0.1) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.location-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    }
    
.location-modal-header h2 {
    font-family: 'Karate', sans-serif;
    font-size: 32px;
    color: #ffffff;
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
.location-modal-body {
    padding: 32px 24px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
    
.location-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    }
    
.location-info > div {
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 20px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }

.location-info > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.location-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: #039;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.location-info p {
    margin: 8px 0 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    position: relative;
    z-index: 1;
    }
    
.difficulty-info .difficulty-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: none;
    position: relative;
    z-index: 2;
    margin-left: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
    
.difficulty-badge.easy {
    background: rgba(40, 167, 69, 0.9);
    color: white;
}

.difficulty-badge.easy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 1;
}

.difficulty-badge.medium {
    background: rgba(255, 193, 7, 0.9);
    color: #333;
}

.difficulty-badge.medium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 1;
}
    
.difficulty-badge.hard {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.difficulty-badge.hard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 1;
}

.location-modal-footer {
    padding: 0 24px 32px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
    
.visit-dojo-btn,
.back-btn {
    background: linear-gradient(135deg, 
        rgba(40, 167, 69, 0.9) 0%, 
        rgba(76, 175, 80, 0.9) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: none;
    color: white;
    padding: 16px 32px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visit-dojo-btn::before,
.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.visit-dojo-btn:hover,
.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.visit-dojo-btn:hover::before,
.back-btn:hover::before {
    left: 100%;
}

.visit-dojo-btn:active,
.back-btn:active {
    transform: translateY(0);
}

.launch-game-btn {
    background: linear-gradient(135deg, 
        rgba(0, 51, 153, 0.9) 0%, 
        rgba(220, 0, 0, 0.9) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: none;
    color: white;
    padding: 16px 32px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.launch-game-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.launch-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.launch-game-btn:hover::before {
    left: 100%;
}

.launch-game-btn:active {
    transform: translateY(0);
}

/* Enhanced Animations */
@keyframes modalGlassyFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
}
}

@keyframes modalGlassySlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
}
}

/* Mobile Responsive Enhancements */
@media (max-width: 480px) {
    .location-modal-content,
    .game-over-modal-content,
    .game-paused-modal-content {
        width: 95%;
        border-radius: 24px;
    }
    
    .location-modal-header,
    .game-over-modal-header,
    .game-paused-modal-header {
        padding: 20px;
    }
    
    .location-modal-header h2,
    .game-over-modal-header h2,
    .game-paused-modal-header h2 {
        font-size: 28px;
    }
    
    .location-modal-body,
    .game-over-modal-body,
    .game-paused-modal-body {
        padding: 24px 20px;
    }
    
    .location-modal-footer,
    .game-over-modal-footer {
        padding: 0 20px 24px;
        flex-direction: column;
        gap: 12px;
    }
    
    .visit-dojo-btn,
    .launch-game-btn,
    #restart-btn {
        width: 100%;
        padding: 18px 32px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .location-modal-close,
    .game-over-modal-close,
    .game-paused-modal-close {
        top: 12px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

/* District Selection Styles */
#district-selection {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background-image: url('../assets/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #ffffff;
    padding: 0;
    padding-bottom: 120px; /* Add space for footer */
    box-sizing: border-box;
    overflow: visible;
    z-index: 300;
}

#district-selection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

#district-selection::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

.district-header {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 50;
    padding: 15px 30px;
}

.district-header h1 {
    font-family: 'Karate', sans-serif;
    font-size: 48px;
    line-height: 1.2;
    margin: 0 0 5px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    color: #fff;
}

.district-header p {
    font-size: 14px;
    margin: 0;
    opacity: 1;
    color: #fff;
    font-weight: 500;
}

.district-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    backdrop-filter: none;
    box-shadow: none;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    /*background: #f8f9fa;*/
    display: flex;
    align-items: center;
    justify-content: center;
}

.district-grid:active {
    cursor: grabbing;
}

.map-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100vh;
    max-height: 100vh;
    aspect-ratio: 6/7;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

/* Responsive sizing for different viewport orientations */
@media (max-aspect-ratio: 6/7) {
    .map-container {
        width: 100vw;
        height: calc(100vw * 7/6);
        max-width: 100vw;
        max-height: calc(100vh - 80px);
    }
}

@media (min-aspect-ratio: 6/7) {
    .map-container {
        width: calc((100vh - 80px) * 6/7);
        height: calc(100vh - 80px);
        max-width: 100vw;
        max-height: calc(100vh - 80px);
    }
}

.map-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    object-fit: contain;
    object-position: center;
}

.map-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02));
    z-index: 1;
}

/* Map overlay contains all dojo positions */
.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

/* Map content container for dojo positioning */
.map-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.district-grid:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0;
    pointer-events: none;
}

.district-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #039;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.district-card:hover,
.district-card:active {
    transform: translate(-50%, -50%) scale(1.1);
    background: #039;
    border-color: #039;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    z-index: 10;
}

.district-icon {
    font-size: 20px;
}

.district-card h3,
.district-card .dojo-name,
.district-card .environment {
    display: none;
}

/* Tooltip styles */
.district-tooltip {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #333;
    padding: 16px;
    border-radius: 16px;
    font-size: 12px;
    line-height: 1.4;
    max-width: 220px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 8px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.district-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.district-tooltip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 1;
}

.district-tooltip h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #d00;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.district-tooltip .dojo-name {
    font-size: 12px;
    margin: 0 0 6px 0;
    color: #222;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.district-tooltip .environment {
    font-size: 11px;
    margin: 0 0 10px 0;
    color: #555;
    opacity: 0.9;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

.difficulty-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 8px;
    position: relative;
    z-index: 2;
}

.difficulty-info .label {
    font-size: 11px;
    color: #555;
    font-weight: 500;
}



.tooltip-arrow {
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 2;
}

.tooltip-arrow::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -7px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid rgba(255, 255, 255, 0.2);
    z-index: 1;
}

/* Geographic positioning for Berlin districts */
[data-district="frohnau"] { top: 24%; left: 29%; }
[data-district="pankow"] { top: 32%; left: 50%; }
[data-district="prenzlauer"] { top: 42%; left: 48%; }
[data-district="prenzlauer2"] { top: 44%; left: 52%; }
[data-district="prenzlauer3"] { top: 47%; left: 54%; }
[data-district="prenzlauer4"] { top: 40%; left: 50%; }
[data-district="mitte"] { top: 47%; left: 44%; }
[data-district="kreuzberg"] { top: 55%; left: 45%; }
[data-district="schoeneberg"] { top: 58%; left: 44%; }
[data-district="zehlendorf"] { top: 69%; left: 29%; }
[data-district="zehlendorf2"] { top: 67%; left: 25%; } 
[data-district="zehlendorf3"] { top: 64%; left: 23%; }
[data-district="zehlendorf4"] { top: 66%; left: 24%; }

.skip-selection {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 50;
}

#skip-selection-btn {
    background: linear-gradient(135deg, 
        rgba(0, 51, 153, 0.9) 0%, 
        rgba(220, 0, 0, 0.9) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: white;
    padding: 16px 48px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#skip-selection-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

#skip-selection-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#skip-selection-btn:hover::before {
    left: 100%;
}

#skip-selection-btn:active {
    transform: translateY(0);
}

/* Mobile devices - 80% width for district header and skip selection */
@media (max-width: 800px) {
    .district-header {
        width: 80%;
        left: 50%;
        transform: translateX(-50%);
        padding: 15px 20px;
    }
    
    .skip-selection {
        width: 80%;
        left: 50%;
        transform: translateX(-50%);
    }
    
    #skip-selection-btn {
        width: 100%;
        padding: 16px 32px;
    }
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    .district-header h1 {
        font-family: 'Karate', sans-serif;
        font-size: 56px;
    }
    
    .district-header p {
        font-size: 16px;
    }
    
    .district-card {
        width: 45px;
        height: 45px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    }
    
    .district-icon {
        font-size: 22px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .district-header h1 {
        font-family: 'Karate', sans-serif;
        font-size: 72px;
    }
    
    .district-header p {
        font-size: 18px;
    }
    
    .district-card {
        width: 50px;
        height: 50px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
    
    .district-icon {
        font-size: 24px;
    }
}

/* Zoom controls */
.zoom-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 50;
}

.zoom-btn {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #039;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #039;
    transition: all 0.3s ease;
    user-select: none;
    opacity: 1;
    transform: scale(1);
}

.zoom-btn:hover,
.zoom-btn:active {
    background: #039;
    color: white;
    transform: scale(0.95);
}

.zoom-btn.disabled {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.zoom-indicator {
    position: absolute;
    bottom: 100px;
    right: 5px;
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.9);
    color: #039;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 50;
}

.zoom-indicator.show {
    opacity: 1;
    transform: scale(1);
}
/* Footer */
.footer {
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(30, 61, 136, 0.1);
    padding: 15px 0;
    height: 70px;
    box-sizing: border-box;
}

/* Hide footer when game is active */
body:has(#game-container:not([style*="display: none"])) .footer,
body.game-active .footer {
    display: none;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.legal-links {
    text-align: center;
    font-size: 14px;
}

.legal-link {
    color: #039;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 5px;
}

.legal-link:hover,
.legal-link:active {
    color: #d00;
    background: rgba(30, 61, 136, 0.1);
    text-decoration: underline;
}

.separator {
    margin: 0 10px;
    color: #666666;
    font-weight: normal;
} 

/* Legal pages (Datenschutz and Impressum) styles */
body.legal-page {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    font-family: Arial, sans-serif;
    color: #000000;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.legal-page .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.legal-page .header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.legal-page .header h1 {
    font-size: 32px;
    margin: 0 0 10px 0;
    color: #039;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.legal-page .header p {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
}

.legal-page .content {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(30, 61, 136, 0.1);
    margin-bottom: 100px;
}

.legal-page .content h2 {
    color: #039;
    font-size: 24px;
    margin-bottom: 20px;
    border-bottom: 2px solid #039;
    padding-bottom: 10px;
}

.legal-page .content h3 {
    color: #d00;
    font-size: 18px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.legal-page .content h4 {
    color: #039;
    font-size: 16px;
    margin-top: 25px;
    margin-bottom: 10px;
}

.legal-page .content p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.legal-page .content ul {
    margin: 15px 0;
    padding-left: 20px;
}

.legal-page .content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.legal-page .highlight-box {
    background: rgba(30, 61, 136, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #039;
}

.legal-page .contact-info {
    background: rgba(30, 61, 136, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #039;
}

.legal-page .back-button {
    display: inline-block;
    background: #039;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(30, 61, 136, 0.3);
}

.legal-page .back-button:hover {
    background: #d00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.legal-page .legal-note {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #d00;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    font-size: 14px;
}

.legal-page .legal-note h4 {
    color: #d00;
    margin-top: 0;
    font-size: 16px;
}

/* Mobile responsive styles for legal pages */
@media (max-width: 768px) {
    .legal-page .container {
        padding: 10px;
    }
    
    .legal-page .content {
        padding: 20px;
    }
    
    .legal-page .header h1 {
        font-size: 24px;
    }
    
    .legal-page .content h2 {
        font-size: 20px;
    }
} 

