* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', cursive, Arial, sans-serif;
    background: linear-gradient(135deg, #222 0%, #111 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #fff;
    overflow: hidden;
    position: relative;
}

/* Game elements */

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Loading Screen Styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, #111 0%, #000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.click-text {
    font-size: 24px;
    color: white;
    text-shadow: 2px 2px 0 #000;
    position: relative;
    z-index: 10;
    margin-top: 20px;
    animation: blink 1s infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
}

.game-title {
    font-size: 72px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 4px 4px 0 #000;
    margin: 0 0 30px 0;
    font-family: 'Press Start 2P', cursive;
    letter-spacing: 5px;
    transform: scale(1, 1.2);
    -webkit-text-stroke: 2px #000;
    position: relative;
    z-index: 10;
    animation: pulse 1.5s infinite alternate;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

@keyframes pulse {
    from { transform: scale(1, 1.2); text-shadow: 0 0 10px rgba(255, 215, 0, 0.7); }
    to { transform: scale(1.05, 1.25); text-shadow: 0 0 20px rgba(255, 215, 0, 0.9); }
}

#dino-logo {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    max-height: 80vh;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin-bottom: 0;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.7));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

#dino-logo:hover {
    transform: scale(1.05);
}



@keyframes sparkle {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 100px 100px, 200px 200px, 300px 300px; }
}

.click-text {
    position: absolute;
    bottom: 10%;
    left: 0;
    width: 100%;
    text-align: center;
    color: #ffd700;
    font-size: 36px;
    font-weight: bold;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
    animation: pulse 1.5s infinite;
    z-index: 1001;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.container {
    display: none; /* Hide initially until loading screen is dismissed */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 300px;
    border: 3px solid #FFD700;
    border-radius: 10px;
    overflow: hidden;
    background-color: #f7f7f7;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    transition: all 0.5s ease;
    display: none; /* Hide initially until loading screen is dismissed */
}

#stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
    transition: opacity 1s ease;
}

#score-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 10;
}

.score-icon {
    color: #FFD700;
    margin-right: 10px;
    font-size: 1.2em;
    animation: rotate 3s linear infinite;
}

.features {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.feature-badge {
    background: linear-gradient(45deg, #B8860B, #FFD700);
    color: #000;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.6em;
    display: flex;
    align-items: center;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.feature-badge i {
    margin-right: 5px;
}

#achievement-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #FFD700;
    padding: 15px 25px;
    border-radius: 10px;
    border: 2px solid #FFD700;
    z-index: 100;
    display: flex;
    align-items: center;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    transition: all 0.3s ease;
}

#achievement-popup i {
    margin-right: 10px;
    font-size: 1.5em;
}

.character-shadow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    z-index: 1;
}

#score {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 5px #000;
}

.hidden {
    display: none !important;
}

/* Star animations */
.star {
    position: absolute;
    background-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 5s infinite;
}

@keyframes twinkle {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Power-up styles */
.power-up {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: gold;
    border-radius: 50%;
    box-shadow: 0 0 10px gold, 0 0 20px gold;
    animation: pulse-power 1s infinite alternate;
    z-index: 10;
}

@keyframes pulse-power {
    from { box-shadow: 0 0 10px gold, 0 0 20px gold; }
    to { box-shadow: 0 0 15px gold, 0 0 30px gold; }
}

/* Shield effect */
.shield {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(0, 191, 255, 0.7);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.7);
    animation: shield-pulse 1s infinite alternate;
    z-index: 5;
    pointer-events: none;
}

@keyframes shield-pulse {
    from { box-shadow: 0 0 15px rgba(0, 191, 255, 0.7); }
    to { box-shadow: 0 0 25px rgba(0, 191, 255, 0.9); }
}

/* Night mode */
.night-mode {
    background-color: #0a0a2a !important;
    transition: background-color 1s ease;
}

.night-mode #ground {
    background-color: #333 !important;
}

/* Star animation */
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: white;
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
    from { opacity: 0.2; }
    to { opacity: 1; box-shadow: 0 0 3px white; }
}

/* Character skins */
.skin-default {
    /* Default skin - no additional styles needed */
}

.skin-golden {
    filter: sepia(100%) hue-rotate(10deg) saturate(1000%) brightness(1.2) !important;
}

.skin-rainbow {
    animation: rainbow-skin 3s linear infinite !important;
}

.skin-ninja {
    filter: brightness(0.3) contrast(2) !important;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.7) !important;
}

@keyframes rainbow-skin {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    padding: 25px 45px;
    border-radius: 15px;
    border: 3px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
    animation: pulse-game-over 1.5s infinite alternate;
    text-align: center;
    min-width: 300px;
}

.game-over-title {
    font-size: 3em;
    color: #FFD700;
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.9), 0 0 30px rgba(255, 0, 0, 0.5);
    margin-bottom: 20px;
}

.score-summary {
    color: white;
    font-size: 1.5em;
    margin: 20px 0;
}

.final-score, .high-score {
    margin: 10px 0;
}

#final-score, #end-high-score {
    color: #FFD700;
    font-weight: bold;
}

#achievement-summary {
    margin-top: 15px;
    font-size: 0.9em;
    color: #AAA;
}

.achievement {
    margin: 5px 0;
    padding: 5px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 5px;
    color: #FFD700;
    animation: achievement-fade 0.5s ease-in;
}

@keyframes achievement-fade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-restart {
    animation: game-restart 0.5s ease-in-out;
}

@keyframes game-restart {
    0% { filter: brightness(0.5); }
    100% { filter: brightness(1); }
}

#restart-button {
    background: linear-gradient(to bottom, #FFD700, #B8860B);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    color: #000;
    font-size: 1.2em;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#restart-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

@keyframes pulse-game-over {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.9;
        box-shadow: 0 0 40px rgba(255, 0, 0, 0.8);
    }
}

@keyframes pulse-game-over {
    0% { transform: translate(-50%, -50%) scale(1); text-shadow: 0 0 10px rgba(255, 0, 0, 0.8); }
    50% { transform: translate(-50%, -50%) scale(1.1); text-shadow: 0 0 20px rgba(255, 0, 0, 1); }
    100% { transform: translate(-50%, -50%) scale(1); text-shadow: 0 0 10px rgba(255, 0, 0, 0.8); }
}

#trex {
    position: absolute;
    bottom: 0;
    left: 20px;
}

#trex {
    width: 100px;
    height: 100px;
    object-fit: contain;
    transition: transform 0.1s;
}

#trex.jumping {
    animation: rotate 0.5s linear;
}

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

#ground {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 1px;
    background-color: #ffd700;
    box-shadow: 0 0 5px #ffd700;
}

.obstacle {
    position: absolute;
    bottom: 0;
}

.cactus {
    width: 15px;
    height: 30px;
    background-color: #4a9c5d;
    border-radius: 2px;
    box-shadow: 0 0 5px #4a9c5d;
}

.rock {
    width: 25px;
    height: 20px;
    background-color: #a0a0a0;
    border-radius: 5px;
    box-shadow: 0 0 5px #a0a0a0;
}

.bird {
    width: 30px;
    height: 20px;
    background-color: #ffd700;
    border-radius: 50% 50% 0 0;
    box-shadow: 0 0 5px #ffd700;
}

.controls {
    margin-top: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

#start-button {
    padding: 12px 25px;
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(45deg, #B8860B, #FFD700);
    color: #000;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    background: linear-gradient(45deg, #FFD700, #FFA500);
}

.gold-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: #ffd700;
    border-radius: 50%;
    box-shadow: 0 0 3px #ffd700;
    pointer-events: none;
}