body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
    color: white;
    background-color: #2196F3; /* 초기 파란색 배경 */
    cursor: pointer;
    overflow-x: hidden; /* 가로 스크롤 방지 */
}

/* 게임 컨테이너: 풀스크린 중앙 정렬 */
#game-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    height: 100vh; /* 뷰포트 높이 전체 사용 */
    transition: background-color 0.1s ease; /* 색상 변화 애니메이션 */
    user-select: none; /* 텍스트 선택 방지 */
    box-sizing: border-box; /* 패딩/보더를 너비에 포함 */
}

#main-text {
    font-size: 5vw; /* 반응형 폰트 사이즈 */
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    padding: 0 20px;
}

#sub-text {
    font-size: 2vw;
    font-weight: 300;
    margin-top: 10px;
}

/* 게임 상태별 배경색 */

/* 시작 대기 (파란색) - 기본값 */
.state-start {
    background-color: #2196F3; /* 깊은 파란색 */
}

/* 준비/대기 (빨간색) */
.state-wait {
    background-color: #F44336; /* 빨간색 */
}
.state-wait #main-text {
    font-size: 3.5vw;
}


/* 반응 측정 (초록색) */
.state-go {
    background-color: #4CAF50; /* 초록색 */
}

/* 결과 화면 */
.state-result {
    background-color: #2196F3;
}

/* 오류 화면 (너무 빠름) */
.state-error {
    background-color: #2196F3;
}
.state-error #main-text:before {
    content: "⚠️";
    display: block;
    font-size: 8vw;
    margin-bottom: 20px;
}

/* 결과 표시 영역 스타일 */
#results-display {
    padding: 30px;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.1);
}

#time-result {
    font-size: 8vw;
    font-weight: 900;
    margin-bottom: 15px;
}

#attempts-count, #history-chart p {
    font-size: 1.8vw;
    font-weight: 400;
    opacity: 0.8;
}
#history-chart {
    margin-top: 15px;
}

/* 유틸리티 */
.hidden {
    display: none !important;
}

/* 모바일 최적화 (뷰포트 너비 600px 이하) */
@media (max-width: 600px) {
    #main-text {
        font-size: 10vw;
    }
    #sub-text {
        font-size: 4vw;
    }
    #time-result {
        font-size: 15vw;
    }
    #attempts-count, #history-chart p {
        font-size: 4vw;
    }
}


/* SEO 콘텐츠 영역 스타일링 */
#content-section {
    min-height: 50vh; /* 스크롤 가능하게 충분한 길이 확보 */
    background-color: #f8f8f8;
    color: #333;
    padding: 40px 20px;
    box-sizing: border-box;
    line-height: 1.6;
}

#content-section h2, #content-section h3 {
    text-align: center;
    color: #0d47a1; /* 진한 파란색 */
    margin-top: 30px;
    margin-bottom: 15px;
}

#content-section ul {
    max-width: 600px;
    margin: 20px auto;
    text-align: left;
    list-style-type: disc;
    padding-left: 20px;
}
#content-section p {
    max-width: 700px;
    margin: 10px auto;
    text-align: justify;
}

/* 푸터 스타일 */
footer {
    background-color: #333;
    color: #ccc;
    text-align: center;
    padding: 15px 0;
    font-size: 0.9em;
}
footer a {
    color: #81d4fa;
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}