#gameTitle {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 48px;
    font-weight: 900;
    color: #333;
    text-shadow: none;
    letter-spacing: -2px;
    transition: color 0.3s ease; /* 색상 변경 부드럽게 */
}

body {
    margin: 0;
    background-color: #f2f2f2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px;
    font-family: Arial, sans-serif;
    transition: background-color 0.4s ease;
}

#game {
    margin-top: 25px;
    position: relative;
    width: 600px;
    height: 200px;
    border: 2px solid black;
    overflow: hidden;
    background-color: white;
}

#background {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('images/bg1.png');
    background-repeat: repeat-x;
    background-position: 0 bottom;
    z-index: 1;
}

#dino {
    position: absolute;
    width: 40px;
    height: 50px;
    bottom: 0;
    left: 50px;
    z-index: 10;
}

#game img:not(#background):not(#dino) {
    position: absolute;
    z-index: 5; 
}

#score {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 18px;
    z-index: 20;
    transition: color 0.3s ease;
}

#hiScore {
    margin-right: 15px;
    color: inherit; /* 부모 색상 따라가기 */
    opacity: 0.7;
}

#startMessage {
    position: absolute;
    width: 100%;
    top: 80px;
    text-align: center;
    z-index: 30;
    font-weight: bold;
}

#gameOverMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 999;
    display: none;
    pointer-events: none;
}

#gameOverMessage .title {
    color: red;
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 5px;
}

#gameOverMessage .score {
    color: white;
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: bold;
}

#gameOverMessage .restart {
    color: white;
    font-size: 18px;
}

#credit {
    margin-top: 15px;
    font-size: 14px;
    color: #555;
    z-index: 100;
}

#gameGuide {
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #bbb;
    margin-top: 5px;
    margin-bottom: 15px;
    z-index: 100;
}

#flash {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 40;
}

.flash-effect { animation: flashAnim 0.5s ease; }
@keyframes flashAnim {
    0% { opacity: 0; }
    50% { opacity: 0.3; }
    100% { opacity: 0; }
}

#darkOverlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: black;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    transition: opacity 0.3s ease;
}

.shake { animation: shake 0.3s; }
@keyframes shake {
    0% { transform: translate(0,0); }
    20% { transform: translate(-5px, 2px); }
    40% { transform: translate(5px, -2px); }
    60% { transform: translate(-5px, 2px); }
    80% { transform: translate(5px, -2px); }
    100% { transform: translate(0,0); }
}

.special-shake { animation: specialShakeAnim 0.6s ease-in-out; }
@keyframes specialShakeAnim {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-12px, -8px) rotate(-3deg); }
    20% { transform: translate(12px, 8px) rotate(3deg); }
    30% { transform: translate(-12px, 8px) rotate(-2deg); }
    40% { transform: translate(12px, -8px) rotate(2deg); }
    50% { transform: translate(-10px, -6px) rotate(-1deg); }
    60% { transform: translate(10px, 6px) rotate(1deg); }
}

#soundControl {
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
}

#soundControl button {
    padding: 8px 15px;
    border: 2px solid #555;
    background-color: #eee;
    cursor: pointer;
    font-weight: bold;
    border-radius: 5px;
}

#soundControl button.active {
    background-color: #333;
    color: white;
}