:root {
    --gold: #d4af37;
    --dark-gold: #996515;
    --deep-red: #8b0000;
    --stone: #4a4a4a;
    --bg-dark: #0a0a0a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
}

#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

canvas {
    display: block;
    touch-action: none;
}

/* HUD Styling */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.label {
    font-size: 12px;
    color: var(--gold);
    display: block;
    letter-spacing: 2px;
}

#score-value,
#high-score-value {
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Overlay & Screens */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: opacity 0.5s ease;
}

#overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.screen {
    text-align: center;
    padding: 40px;
    border: 2px solid var(--gold);
    background: rgba(10, 10, 10, 0.9);
    border-radius: 4px;
    box-shadow: 0 0 30px var(--dark-gold);
}

.screen.hidden {
    display: none;
}

.thai-style {
    font-size: 48px;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    margin-bottom: 5px;
    letter-spacing: 4px;
}

.subtitle {
    color: var(--dark-gold);
    font-style: italic;
    margin-bottom: 30px;
}

button {
    background: var(--gold);
    color: black;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 2px;
    transition: transform 0.2s, background 0.2s;
    text-transform: uppercase;
}

button:hover {
    background: #e5c05b;
    transform: scale(1.05);
}

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

.instructions {
    margin-top: 30px;
    font-size: 14px;
    color: #888;
}

@media (max-width: 600px) {
    .thai-style {
        font-size: 36px;
    }
}

/* Voice Monitor */
#voice-monitor {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--gold);
    border-radius: 10px;
    pointer-events: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

#voice-wave {
    width: 100%;
    height: 100%;
}

/* Character Creation Styling */
#character-creation-screen {
    width: 90%;
    max-width: 500px;
}

#camera-container {
    width: 100%;
    height: 300px;
    background: #000;
    border: 2px solid var(--gold);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#camera-feed,
#capture-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#camera-feed.hidden,
#capture-canvas.hidden {
    display: none;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#confirm-character:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}