:root {
    --bg-color: #f7f7f7;
    --text-color: #535353;
    --game-width: 800px;
    --game-height: 250px;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    user-select: none;
}

.game-container {
    position: relative;
    width: var(--game-width);
    height: var(--game-height);
    background-color: white;
    border-bottom: 2px solid var(--text-color);
    overflow: hidden;
}

/* Score Board */
#score, #high-score {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
    letter-spacing: 2px;
}

#high-score {
    right: 120px;
    color: #acacac;
}

/* Game Over Message */
#game-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
}

#game-message.hidden {
    display: none;
}

#game-message p {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 10px;
}

#restart-btn {
    background: none;
    border: none;
    font-size: 36px;
    cursor: pointer;
    color: var(--text-color);
    transition: transform 0.2s;
}

#restart-btn:hover {
    transform: rotate(180deg);
}

/* Dino Character */
.dino {
    position: absolute;
    bottom: 0;
    left: 50px;
    width: 44px;
    height: 47px;
    background-color: var(--text-color);
    /* Simple pixel art shape using mask or just a block for now */
    /* We'll use a simple block with an "eye" for simplicity without external assets */
    clip-path: polygon(
        40% 0%, 60% 0%, 60% 10%, 100% 10%, 100% 40%, 60% 40%, 60% 60%, 80% 60%, 80% 80%, 60% 80%, 60% 100%, 20% 100%, 20% 60%, 0% 60%, 0% 40%, 20% 40%, 20% 20%, 40% 20%
    );
}

.dino.running {
    animation: run 0.2s steps(2) infinite;
}

.dino.jumping {
    animation: jump 0.6s ease-out;
}

@keyframes run {
    0% { transform: translateY(0); }
    50% { transform: translateY(2px); } /* Simulate leg movement roughly */
    100% { transform: translateY(0); }
}

/* Cactus Obstacles */
.cactus {
    position: absolute;
    bottom: 0;
    width: 30px;
    height: 50px;
    background-color: var(--text-color);
    /* Simple cactus shape */
    clip-path: polygon(
        20% 0, 80% 0, 80% 100%, 20% 100%, 20% 60%, 0 60%, 0 30%, 20% 30%, 20% 0,
        80% 0, 80% 30%, 100% 30%, 100% 60%, 80% 60%, 80% 100%
    ); 
    /* Actually a simpler shape is better for hitboxes, let's just use a block with some "arms" visual */
    clip-path: polygon(
        30% 0, 70% 0, 70% 100%, 30% 100%, 
        30% 40%, 0 40%, 0 20%, 30% 20%,
        70% 50%, 100% 50%, 100% 30%, 70% 30%
    );
}

.cactus-small {
    width: 20px;
    height: 35px;
}

.cactus-group {
    width: 60px;
    clip-path: none;
    background: none;
    display: flex;
    align-items: flex-end;
}
.cactus-group .cactus-part {
    width: 20px;
    height: 40px;
    background-color: var(--text-color);
    margin-right: 2px;
}

/* Ground Line */
#ground {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 1px; /* The border-bottom of container handles the line, this can be for bumps */
}

.bump {
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 2px;
    background-color: var(--text-color);
}

/* Cloud */
.cloud {
    position: absolute;
    top: 50px;
    width: 60px;
    height: 20px;
    background-color: #dcdcdc;
    border-radius: 10px;
}

/* Instructions */
.instructions {
    margin-top: 20px;
    color: #999;
}

.key {
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-weight: bold;
}
