@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Press Start 2P', cursive;
    overflow: hidden;
}

#game-container {
    position: relative;
    touch-action: none;
    width: 800px;
    height: 600px;
    border: 4px solid #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background-color: #000;
}

canvas {
    display: block;
    image-rendering: pixelated;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

#coin-container {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border: 2px solid #ffde00;
    border-radius: 10px;
    color: #ffde00;
    font-size: 18px;
}

.boss-bar-wrapper {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
    max-width: 500px;
}

#start-menu-btns {
    margin-top: auto;
    margin-bottom: 60px;
    display: flex;
    gap: 20px;
    pointer-events: auto;
}

button {
    font-family: 'Press Start 2P', cursive;
    padding: 15px 25px;
    font-size: 12px;
    background: #5c4d7d;
    color: #fff;
    border: 3px solid #fff;
    cursor: pointer;
    box-shadow: 4px 4px 0px #000;
    transition: 0.1s;
}

button:hover {
    background: #7d6ba1;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #000;
}

button:active {
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px #000;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.hidden {
    display: none !important;
}

.panel {
    background: #ded895;
    border: 6px solid #543847;
    padding: 30px;
    width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 10px 10px 0px rgba(0,0,0,0.4);
}

.panel h2 {
    color: #543847;
    margin-bottom: 25px;
    font-size: 24px;
}

#shop-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.shop-item {
    background: #fff;
    border: 3px solid #543847;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.shop-item img {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
    object-fit: contain;
}

.shop-item.purchased { background: #d4ffd4; }
.shop-item.equipped { border-color: #ff0000; outline: 3px solid #ff0000; }

#wheel-container {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto 30px;
}

#wheel-img {
    width: 100%;
    height: 100%;
    transition: transform 4s cubic-bezier(0.15, 0, 0.15, 1);
}

#wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    color: #ff0000;
    z-index: 10;
}

.boss-name {
    color: #ffde00;
    font-size: 12px;
    margin-bottom: 6px;
    text-shadow: 2px 2px 0px #000;
    letter-spacing: 2px;
}

#boss-bar-container {
    width: 100%;
    height: 18px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid #fff;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

#boss-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8b0000 0%, #ff0000 50%, #8b0000 100%);
    background-size: 200% 100%;
    animation: barShine 2s linear infinite;
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: inset 0 0 8px rgba(0,0,0,0.6);
}

@keyframes barShine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.point-gain {
    animation: pointGainFlash 0.3s ease-out;
}

@keyframes pointGainFlash {
    0% { filter: brightness(2) contrast(1.5); transform: scaleY(1.2); }
    100% { filter: brightness(1) contrast(1); transform: scaleY(1); }
}

#score-display {
    color: #fff;
    font-size: 24px;
    margin-top: 8px;
    text-shadow: 3px 3px 0px #000;
    font-weight: bold;
}
