/* Player sprite */
#playerSprite{
    position: absolute;
    width: 50px;
    height: 50px;
    background-image: url('assets/sloth.svg');
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    box-shadow: 0 2px 0 rgba(0,0,0,0.6);
    transition: left 0.12s linear, top 0.12s linear, transform 160ms ease;
}
#arm{
    position: absolute;
    left: 320px;
    top: 220px;
    width: 10px;
    height: 30px;
    background: brown;
    transform-origin: top center;
}
@keyframes swingArm {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(45deg); }
    100% { transform: rotate(0deg); }
}
body{
    background: black;
}
h1{
    color: white;
    font-size: 90px;
    text-align: center;
}

/* Game layout */
#game{
    position: relative;
    width: 640px; /* 10 cols * 64px */
    height: 480px; /* canvas area with header */
    margin: 20px auto;
    background: #111;
    border: 4px solid #333;
    overflow: hidden;
}

#grid{
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    grid-template-columns: repeat(10, 64px);
    grid-template-rows: repeat(6, 64px);
    gap: 0;
}

.block{
    width: 64px;
    height: 64px;
}
.block.dirt{ background: #6b4423 }
.block.stone{ background: #777 }
.block.ore{ background: #b58900 }
.block.empty{ background: transparent; }
.block.city{ 
    background: radial-gradient(circle at 30% 30%, #ffe082 0%, #ffab00 30%, #ff6f00 60%);
    box-shadow: 0 0 18px rgba(255,160,0,0.9), inset 0 -6px 12px rgba(0,0,0,0.35);
    border: 2px solid #fff3e0;
    color: #3e2723;
    font-size: 28px;
    display:flex;align-items:center;justify-content:center;
    transform-origin:center;
    animation: cityPulse 1200ms ease-in-out infinite;
}

@keyframes cityPulse {
    0% { transform: scale(1); box-shadow: 0 0 12px rgba(255,160,0,0.6) }
    50% { transform: scale(1.08); box-shadow: 0 0 26px rgba(255,180,0,0.95) }
    100% { transform: scale(1); box-shadow: 0 0 12px rgba(255,160,0,0.6) }
}

/* Overlay / city interior */
#overlay{ position: fixed; left:0; top:0; right:0; bottom:0; display:flex; align-items:center; justify-content:center; pointer-events:none }
#overlay.visible{ pointer-events:auto }
#cityInterior{ background: #0b3d2e; color: #fff; padding: 20px; border-radius: 10px; min-width: 480px; max-width: 90%; box-shadow: 0 10px 40px rgba(0,0,0,0.7); text-align:center }
#cityNPCs{ display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin:12px 0 }
.npc{ width:56px; height:56px; background: peru; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; color:#fff; box-shadow:0 3px 0 rgba(0,0,0,0.4) }

@keyframes dance {
    0%{ transform: translateY(0) rotate(0) }
    50%{ transform: translateY(-8px) rotate(-6deg) }
    100%{ transform: translateY(0) rotate(0) }
}
.npc.dance{ animation: dance 800ms ease-in-out infinite }

#citySummary{ margin-top:8px; font-weight:700 }
#exitCity, #restartBtn{ margin-top:12px; padding:8px 14px; background:#ffcc80; border:none; border-radius:6px; cursor:pointer }

/* Cutscene */
#cutscene{ background: rgba(0,0,0,0.85); color:#fff; padding:30px; border-radius:10px; text-align:center }
#cutsceneContent{ font-size:20px; margin-bottom:12px }

.hidden{ display:none }

#hud{
    width: 640px;
    margin: 10px auto;
    color: white;
    text-align: center;
}

#inventory{
    font-family: sans-serif;
}

/* mining animation */
.swing {
    transform: translateY(-4px) rotate(-10deg);
}

#playerSprite{ z-index: 10 }