:root {
    --primary-color: #00ffcc;
    --secondary-color: #ff00cc;
    --bg-color: #1a1a2e;
    --ui-bg: rgba(0, 0, 0, 0.85);
    --font-main: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    /* Prevent default touch actions like scrolling */
}

body {
    background-color: var(--bg-color);
    color: white;
    font-family: var(--font-main);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 600px;
    /* Limit width on desktop for better gameplay */
    background: #000;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through to canvas when playing */
}

/* HUD */
#hud {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 0 5px var(--primary-color);
    pointer-events: none;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ui-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    /* Re-enable clicks for UI */
    transition: opacity 0.3s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
    /* Completely hide */
}

.active {
    opacity: 1;
    display: flex;
}

h1 {
    font-size: 48px;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
}

h2 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Buttons */
button {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 12px 30px;
    font-size: 20px;
    font-family: var(--font-main);
    font-weight: 700;
    margin: 10px;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    min-width: 200px;
}

button:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 15px var(--primary-color);
    transform: scale(1.05);
}

.btn-secondary {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

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

/* Inputs */
input[type="text"] {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #fff;
    color: #fff;
    padding: 10px;
    font-size: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
    font-family: var(--font-main);
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
}

/* Leaderboard */
#leaderboard-list {
    list-style: none;
    width: 80%;
    max-width: 400px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
}

#leaderboard-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 18px;
}

#leaderboard-list li:last-child {
    border-bottom: none;
}

#leaderboard-list li span:first-child {
    color: var(--primary-color);
    font-weight: bold;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    h1 {
        font-size: 36px;
    }

    h2 {
        font-size: 18px;
    }

    button {
        padding: 10px 20px;
        font-size: 18px;
    }
}

/* Taunt Message */
#taunt-msg {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 900;
    color: #ffcc00;
    text-shadow: 0 0 10px #ff0000, 2px 2px 0 #000;
    pointer-events: none;
    z-index: 20;
    text-align: center;
    white-space: nowrap;
}

.taunt-anim {
    animation: tauntPop 3s forwards;
}

@keyframes tauntPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    10% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    20% {
        transform: translate(-50%, -50%) scale(1);
    }

    80% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Game Info Panel */
#game-info-panel {
    position: fixed;
    right: 20px;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 280px;
    padding: 25px;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.3);
    color: #fff;
    font-family: var(--font-main);
    z-index: 10;
}

.info-logo {
    width: 100%;
    max-width: 200px;
    display: block;
    margin: 0 auto 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
}

.info-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.3;
    text-shadow: 0 0 10px var(--primary-color);
}

.info-title span {
    font-size: 14px;
    color: var(--secondary-color);
    display: block;
    margin-top: 5px;
}

.info-description {
    margin-bottom: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 0;
}

.info-description p {
    margin: 8px 0;
    font-size: 14px;
    color: #fff;
}

.info-controls {
    margin-top: 15px;
}

.info-controls h3 {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
}

.info-controls p {
    margin: 6px 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.info-controls strong {
    color: var(--primary-color);
    font-weight: 900;
}

.info-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.info-btn {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    min-width: 0;
    background: rgba(0, 255, 204, 0.1);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.info-btn.pause-active {
    background: #ff3333;
    border-color: #ff3333;
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.6);
}

.info-btn.mute-active {
    background: #ffaa00;
    border-color: #ffaa00;
    color: #000;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.6);
}

/* Mobile: Hide info panel on small screens */
@media (max-width: 1024px) {
    #game-info-panel {
        display: none;
    }
}