:root {
    --bg-color: #0f1015;
    --primary: #00ffcc;
    --accent: #ff007f;
    --text: #ffffff;
    --surface: rgba(255, 255, 255, 0.05);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text);
    font-family: 'Vazirmatn', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 255, 204, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 0, 127, 0.08), transparent 25%);
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    z-index: 1;
}

header {
    text-align: center;
}

h1 {
    font-size: 3rem;
    font-weight: 900;
    margin: 0 0 0.5rem;
    color: var(--text);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

h1 span {
    color: var(--primary);
}

p {
    margin: 0;
    color: #a0a0b0;
    font-size: 1.1rem;
}

.game-wrapper {
    position: relative;
    width: 100%;
    height: 350px;
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

#game-board {
    position: relative;
    width: 100%;
    height: 100%;
    border-bottom: 3px solid var(--primary);
    box-sizing: border-box;
}

#dino {
    position: absolute;
    bottom: 0;
    left: 80px;
    width: 45px;
    height: 50px;
    background-color: var(--primary);
    border-radius: 12px 12px 4px 4px;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.6);
    /* No CSS transition on bottom to prevent visual lag */
}

#dino .eye {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background-color: var(--bg-color);
    border-radius: 50%;
}

.obstacle {
    position: absolute;
    bottom: 0;
    width: 35px;
    background-color: var(--accent);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.6);
}

.obstacle::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 5px;
    right: 5px;
    height: 5px;
    background: rgba(255,255,255,0.3);
    border-radius: 5px;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 16, 21, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.4s ease, visibility 0.4s;
}

.overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.overlay h2 {
    font-size: 2.5rem;
    margin: 0 0 1rem;
    color: var(--primary);
}

button {
    margin-top: 1.5rem;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-family: inherit;
    font-weight: bold;
    color: var(--bg-color);
    background: var(--primary);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(0, 255, 204, 0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 35px rgba(0, 255, 204, 0.7);
}

.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: var(--surface);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.score-board {
    font-size: 1.5rem;
    font-weight: bold;
}

#score {
    color: var(--primary);
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
}

.volume-meter {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 60%;
}

.meter-bar {
    flex-grow: 1;
    height: 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.1s ease-out;
    border-radius: 10px;
}

/* Add a threshold marker in the volume bar */
.meter-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%; /* ~30 volume threshold (out of 150) */
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 5px white;
    z-index: 2;
}
