:root {
    --primary: #ff9f43;
    --secondary: #10ac84;
    --dark-bg: #1e272e;
    --panel-bg: rgba(47, 53, 66, 0.95);
    --text: #ffffff;
    --accent: #ee5253;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: var(--text);
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #74b9ff, #a29bfe);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.panel {
    background: var(--panel-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 90%;
    max-width: 450px;
    text-align: center;
    border: 2px solid var(--primary);
}

h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

button {
    background: linear-gradient(135deg, var(--primary), #f39c12);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    box-shadow: 0 4px 10px rgba(243, 156, 18, 0.4);
    transition: transform 0.1s, filter 0.2s;
}

button:active {
    transform: scale(0.98);
}

button.secondary {
    background: linear-gradient(135deg, #718093, #2f3640);
    box-shadow: none;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;
    font-weight: bold;
    text-shadow: 2px 2px 2px #000;
    font-size: 1.2rem;
    z-index: 5;
}

.hud-item {
    background: rgba(0,0,0,0.4);
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    display: flex;
    justify-content: space-between;
    padding: 20px;
    pointer-events: none;
    box-sizing: border-box;
    z-index: 5;
}

.ctrl-btn {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    pointer-events: auto;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.grid-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
}

.card {
    background: #2f3640;
    border: 1px solid #718093;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.card.selected {
    border-color: var(--primary);
    background: #34495e;
    box-shadow: 0 0 10px var(--primary);
}

#wheel-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 15px auto;
}

#wheel-pointer {
    position: absolute;
    top: -10px;
    left: calc(50% - 10px);
    width: 20px;
    height: 20px;
    background: var(--accent);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    z-index: 12;
}

#wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid var(--primary);
    transition: transform 4s cubic-bezier(0.1, 0.8, 0.1, 1);
    background: conic-gradient(
        #ee5253 0deg 60deg, #f39c12 60deg 120deg, 
        #10ac84 120deg 180deg, #0abde3 180deg 240deg, 
        #5f27cd 240deg 300deg, #ff9f43 300deg 360deg
    );
}

.bar-container {
    width: 120px;
    height: 14px;
    background: #57606f;
    border-radius: 7px;
    display: inline-block;
    overflow: hidden;
    border: 1px solid #fff;
}

.bar-fill {
    height: 100%;
    background: var(--secondary);
    width: 100%;
    transition: width 0.1s linear;
}
