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

body {
    font-family: 'Courier New', monospace;
    background: #87CEEB;
    min-height: 100vh;
    overflow-x: hidden;
}

.game-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 3px solid #555;
}

.header h1 {
    font-size: 2em;
    text-align: center;
    margin-bottom: 15px;
    color: #FFD700;
    text-shadow: 2px 2px 0 #000;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 10px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 5px;
    border: 2px solid #666;
}

.stat-label {
    font-size: 0.9em;
    color: #AAA;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.3em;
    color: #FFD700;
    font-weight: bold;
}

.xp-bar {
    width: 100%;
    height: 25px;
    background: #555;
    border: 2px solid #333;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    margin-top: 10px;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #7FFF00);
    transition: width 0.5s;
    box-shadow: 0 0 10px rgba(127, 255, 0, 0.8);
}

.xp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

.game-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.main-panel {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #555;
    border-radius: 10px;
    padding: 20px;
    color: white;
}

.biome-display {
    text-align: center;
    margin-bottom: 20px;
}

.biome-name {
    font-size: 1.8em;
    color: #FFD700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0 #000;
}

.world-view {
    width: 100%;
    height: 300px;
    background: #8B4513;
    border: 3px solid #000;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.block {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.block.mining {
    animation: mine-shake 0.1s infinite;
}

@keyframes mine-shake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-2px, -2px); }
    75% { transform: translate(2px, 2px); }
}

.steve {
    position: absolute;
    width: 40px;
    height: 60px;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 48px;
    transition: left 0.5s;
    z-index: 10;
}

.steve.mining {
    animation: steve-mine 0.3s infinite;
}

@keyframes steve-mine {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    50% { transform: translateX(-50%) rotate(-15deg); }
}

.question-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    border: 3px solid #555;
    margin-bottom: 20px;
}

.question {
    font-size: 2.5em;
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-weight: bold;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-btn {
    font-size: 1.6em;
    padding: 15px;
    border: 3px solid #555;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.answer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.answer-btn.option1 { background: #8B4513; color: white; }
.answer-btn.option2 { background: #228B22; color: white; }
.answer-btn.option3 { background: #4169E1; color: white; }

.answer-btn.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.inventory-panel {
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #555;
    border-radius: 10px;
    padding: 15px;
    color: white;
}

.inventory-title {
    font-size: 1.3em;
    color: #FFD700;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 1px 1px 0 #000;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.inventory-slot {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #666;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    position: relative;
    transition: all 0.3s;
}

.inventory-slot.new-item {
    animation: item-get 0.6s ease-out;
}

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

.item-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.5em;
    color: white;
    text-shadow: 1px 1px 0 #000;
    font-weight: bold;
}

.crafting-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 5px;
    border: 2px solid #666;
}

.craft-title {
    font-size: 1.1em;
    color: #FFD700;
    margin-bottom: 10px;
    text-align: center;
}

.craft-recipe {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    margin: 5px 0;
    border-radius: 5px;
    border: 1px solid #555;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.craft-btn {
    background: #228B22;
    color: white;
    border: 2px solid #1a6b1a;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.craft-btn:hover {
    background: #2aa32a;
}

.craft-btn:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.5;
}

.level-complete {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 5px solid #FFD700;
    border-radius: 15px;
    padding: 40px;
    z-index: 1000;
    color: white;
    text-align: center;
    min-width: 400px;
}

.level-complete.show {
    display: block;
    animation: popup 0.5s ease-out;
}

@keyframes popup {
    0% { transform: translate(-50%, -50%) scale(0); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.level-complete h2 {
    font-size: 2.5em;
    color: #FFD700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #000;
}

.level-rewards {
    font-size: 1.5em;
    margin: 20px 0;
}

.next-level-btn {
    font-size: 1.5em;
    padding: 15px 40px;
    background: #228B22;
    color: white;
    border: 3px solid #1a6b1a;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    margin: 10px;
    transition: all 0.3s;
}

.next-level-btn:hover {
    background: #2aa32a;
    transform: scale(1.05);
}

.game-complete {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 5px solid #FFD700;
    border-radius: 15px;
    padding: 40px;
    z-index: 1000;
    color: white;
    text-align: center;
    min-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.game-complete.show {
    display: block;
    animation: popup 0.5s ease-out;
}

.final-inventory {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    font-size: 2em;
}

@media (max-width: 768px) {
    .game-container {
        grid-template-columns: 1fr;
    }

    .level-complete, .game-complete {
        min-width: 90%;
        padding: 20px;
    }
}
