:root {
    --primary-color: #ff0055;
    --secondary-color: #00e5ff;
    --bg-color: #1a1a1a;
    --font-main: 'Kanit', sans-serif;
}

* {
    box-sizing: border-box;
    touch-action: none;
    /* Prevent browser zooming/scrolling on mobile */
    user-select: none;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: var(--font-main);
    color: white;
}

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

canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#score-board {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
}

#combo-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    opacity: 0;
    /* Hidden by default, shown via JS */
    transition: opacity 0.2s;
    text-shadow: 2px 2px 0 #000;
}

#health-bar-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 20px;
    background-color: #333;
    border: 2px solid #fff;
    border-radius: 10px;
    overflow: hidden;
}

#health-bar {
    width: 50%;
    /* Default 50% */
    height: 100%;
    background: linear-gradient(90deg, #ff0000 0%, #00ff00 100%);
    transition: width 0.2s;
}

#mobile-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    /* Bottom 30% of screen for touch */
    display: flex;
    z-index: 10;
}

.control-lane {
    flex: 1;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.control-lane:active,
.control-lane.active {
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.screen h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: var(--secondary-color);
    text-shadow: 0 0 10px var(--secondary-color);
}

.screen p {
    font-size: 24px;
    cursor: pointer;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* User Interface additions */
#level-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.level-btn {
    padding: 15px 30px;
    font-family: var(--font-main);
    font-size: 18px;
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: white;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.level-btn:hover {
    background: var(--secondary-color);
    color: #000;
    box-shadow: 0 0 15px var(--secondary-color);
}

.level-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

#lang-toggle {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.lang-btn {
    padding: 8px 15px;
    background: #333;
    border: 1px solid #555;
    color: #aaa;
    cursor: pointer;
    font-family: var(--font-main);
    border-radius: 5px;
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Orientation Overlay */
#orientation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#orientation-overlay .msg-box {
    color: white;
}

#orientation-overlay h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

#orientation-overlay .icon {
    font-size: 60px;
    margin-top: 20px;
    animation: rotate 2s infinite linear;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Game Over Screen */
#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 900;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-over-screen .menu-box {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    box-shadow: 0 0 20px var(--primary-color);
}

#game-over-screen h1 {
    font-size: 40px;
    color: #fff;
    margin-bottom: 20px;
    text-transform: uppercase;
}

#final-score {
    font-size: 24px;
    color: var(--secondary-color);
    margin-bottom: 30px;
}

.menu-btn {
    padding: 15px 30px;
    font-family: var(--font-main);
    font-size: 20px;
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 0 15px var(--primary-color);
}

.menu-btn:hover {
    transform: scale(1.05);
    background: #ff3377;
}