:root {
    --bg-color: #f0f2f5;
    --text-color: #1a1a1a;
    --primary: #2d3436;
    --accent: #e17055;
    --danger: #d63031;
    --success: #00b894;
    --ui-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    margin: 0;
    padding: 0;
    touch-action: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: none; /* Hide default cursor */
    touch-action: none; /* Prevent default touch actions like scrolling */
}

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

.hud-panel {
    position: absolute;
    padding: 24px;
    font-weight: 800;
    letter-spacing: -1px;
}

.top-left { top: 0; left: 0; }
.top-right { top: 0; right: 0; text-align: right; }

.stat-row {
    margin-bottom: 15px;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 32px;
    color: var(--primary);
}

.level-progress-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.05);
}

#level-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent);
    transition: width 0.2s;
}

.menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Backdrop */
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    z-index: 1000;
}

.menu-content {
    background: var(--ui-bg);
    padding: 60px;
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--shadow);
    text-align: center;
    width: 90%;
    max-width: 500px;
    box-sizing: border-box;
    max-height: 90vh; /* Ensure it fits on screen */
    overflow-y: auto; /* Enable scrolling within the card */
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-size: 64px;
    margin: 0 0 20px 0;
    color: var(--primary);
    line-height: 1;
}

/* ... Mobile Styles will be moved to bottom ... */

h2 {
    font-size: 48px;
    margin: 0 0 10px 0;
    color: var(--primary);
}

p {
    color: #636e72;
    font-size: 18px;
    margin-bottom: 40px;
}

.btn-group {
    display: flex;
    gap: 20px;
    justify-content: center;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

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

.special-btn {
    background: var(--success);
}
.special-btn:hover {
    background: #00cec9;
}

.upgrade-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.upgrade-card {
    background: #f8f9fa;
    border: 2px solid #dfe6e9;
    border-radius: 12px;
    padding: 20px;
    width: 150px;
    min-width: 150px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1 1 150px;
    max-width: 200px;
}

.upgrade-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background: white;
    box-shadow: 0 10px 20px var(--shadow);
}

.upgrade-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--primary);
}

.upgrade-card p {
    font-size: 14px;
    margin: 0;
}

.hidden {
    display: none !important;
}

#combo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.combo-count {
    font-size: 120px;
    font-weight: 900;
    color: rgba(45, 52, 54, 0.1);
    transition: transform 0.1s;
}
