body {
    margin: 0;
    padding: 0;
    background: #1e1e1e;
    overflow: hidden;
    font-family: 'Minecraft Seven', monospace, system-ui, -apple-system, sans-serif;
    touch-action: none; /* Prevents default touch behaviors like pinch-zoom */
}

@font-face {
    font-family: 'Minecraft Seven';
    src: url('/Minecraft Seven_2.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

canvas {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#gameCanvas {
    display: block;
    position: relative;
    width: 100vw;
    height: 100vh;
    background: transparent;
}

#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

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

#loadingText {
    font-family: 'Minecraft Seven', monospace, system-ui, -apple-system, sans-serif;
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

.progress-bar {
    width: 300px;
    height: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    width: 0%;
    transition: width 0.3s ease;
}

#collectible-effects-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2001; /* Above sparkles */
    overflow: hidden;
}

.experience-bottle-effect {
    position: absolute;
    width: 32px;
    height: 32px;
    background-image: url('/experience_bottle.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 1;
    animation: collect-bottle-anim 1s ease-out forwards;
}

@keyframes collect-bottle-anim {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(0.2) translateY(-100px);
        opacity: 0;
    }
}

#enchantment-sparkle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2000;
    overflow: hidden;
}

.enchantment-sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ff00ff;
    border-radius: 50%;
    opacity: 0;
    animation: sparkle-anim 0.7s ease-out forwards;
}

@keyframes sparkle-anim {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(1.5) translate(var(--tx, 0), var(--ty, 0));
        opacity: 0;
    }
}

#titleScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #333;
    background-image: url('/c9ab83fe-1f29-442e-af51-f77a4d7c36fa.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    cursor: pointer;
    flex-direction: column;
}

#title-start-prompt {
    font-family: 'Minecraft Seven', monospace, system-ui, -apple-system, sans-serif;
    font-size: 24px;
    color: white;
    text-shadow: 3px 3px 0 #333;
    margin-top: 20px;
    animation: blink-animation 1.5s steps(2, start) infinite;
}

@keyframes blink-animation {
    to {
        visibility: hidden;
    }
}

#stats-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    backdrop-filter: blur(5px);
}

#stats-content {
    background-color: #C6C6C6;
    border: 3px solid #555555;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    font-family: 'Minecraft Seven', monospace, system-ui, -apple-system, sans-serif;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    text-align: center;
}

#stats-content h2 {
    font-size: 24px;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    text-shadow: 2px 2px #FFF;
}

#stats-grid {
    display: grid;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #8B8B8B;
    border: 2px solid #555;
}

.stat-label {
    font-size: 16px;
    color: #FFFFFF;
    text-shadow: 1px 1px #333;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: #FFFF00;
    text-shadow: 1px 1px #333;
}

#stats-close-button {
    margin-top: 20px;
    padding: 10px 20px;
    font-family: 'Minecraft Seven', monospace, system-ui, -apple-system, sans-serif;
    font-size: 16px;
    color: white;
    background-color: #D32F2F;
    border: 2px solid #555;
    cursor: pointer;
    box-shadow: inset -2px -2px 0px 0px #8f1f1f;
}

#stats-close-button:hover {
    background-color: #E53935;
}

#stats-close-button:active {
    box-shadow: inset 2px 2px 0px 0px #8f1f1f;
}

#settings-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    backdrop-filter: blur(5px);
}

#settings-content {
    background-color: #C6C6C6;
    border: 3px solid #555555;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    font-family: 'Minecraft Seven', monospace, system-ui, -apple-system, sans-serif;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    text-align: center;
}

#settings-content h2 {
    font-size: 24px;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    text-shadow: 2px 2px #FFF;
}

#settings-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #8B8B8B;
    border: 2px solid #555;
}

.setting-item label {
    font-size: 16px;
    color: #FFFFFF;
    text-shadow: 1px 1px #333;
}

.setting-item input[type="range"] {
    width: 50%;
}

.setting-item select {
    font-family: 'Minecraft Seven', monospace, system-ui, -apple-system, sans-serif;
    background: #c6c6c6;
    border: 2px solid #555;
    padding: 5px;
}

#reset-progress-button,
#settings-close-button {
    margin-top: 20px;
    padding: 10px 20px;
    font-family: 'Minecraft Seven', monospace, system-ui, -apple-system, sans-serif;
    font-size: 16px;
    color: white;
    background-color: #D32F2F;
    border: 2px solid #555;
    cursor: pointer;
    box-shadow: inset -2px -2px 0px 0px #8f1f1f;
    margin-left: 10px;
    margin-right: 10px;
}

#reset-progress-button:hover,
#settings-close-button:hover {
    background-color: #E53935;
}

#reset-progress-button:active,
#settings-close-button:active {
    box-shadow: inset 2px 2px 0px 0px #8f1f1f;
}

#settings-close-button {
    background-color: #1976D2;
    box-shadow: inset -2px -2px 0px 0px #0f4a83;
}

#settings-close-button:hover {
    background-color: #2196F3;
}

#settings-close-button:active {
    box-shadow: inset 2px 2px 0px 0px #0f4a83;
}

#background-music {
    display: none;
}