/* 게임 전체 래퍼 (워드프레스 테마 간섭 최소화) */
#zsz-game-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #1a1a2e; /* 딥 다크 배경 */
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 600px; /* 워드프레스 본문 내 확보 */
    padding: 20px;
    border-radius: 16px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

#zsz-game-wrapper * {
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.game-container {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 2;
}

/* 타이틀 섹션 */
.header-section {
    text-align: center;
    margin-bottom: 20px;
}

.game-title {
    font-size: 32px;
    font-weight: 900;
    margin: 0;
    letter-spacing: -1px;
    color: #fff;
    text-transform: uppercase;
}

.game-title .accent {
    color: #e94560; /* 네온 레드 */
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

.game-desc {
    font-size: 14px;
    color: #8d93ab;
    margin-top: 5px;
}

/* 상태바 (타이머 & 다음 숫자) */
.status-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-box, .next-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-label, .next-label {
    font-size: 10px;
    color: #8d93ab;
    letter-spacing: 1px;
    font-weight: 700;
}

#timer {
    font-family: 'Courier New', Courier, monospace;
    font-size: 28px;
    font-weight: bold;
    color: #4ecca3; /* 네온 그린 */
    text-shadow: 0 0 8px rgba(78, 204, 163, 0.4);
    
    /* 기존 80px -> 120px로 확장하여 1분 이상 시간도 넉넉하게 표시 */
    min-width: 120px; 
    text-align: center;
    letter-spacing: -1px; /* 숫자가 많아지므로 자간 살짝 조절 */
}

#next-num-display {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
}

/* 그리드 영역 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    position: relative;
    background: rgba(22, 33, 62, 0.5);
    padding: 8px;
    border-radius: 16px;
}

.cell {
    aspect-ratio: 1/1;
    background: #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: #1a1a2e;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s, opacity 0.3s;
    box-shadow: 0 4px 0 #b0b0b0; /* 입체감 */
}

/* 1-25번과 26-50번 스타일 차별화 (선택사항) */
.cell.low-num {
    background: #fff;
}
.cell.high-num {
    background: #ffeb3b; /* 2라운드 컬러 강조 */
    box-shadow: 0 4px 0 #c7b714;
}

.cell:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 transparent;
}

.cell.clicked {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* 오답 흔들림 효과 */
.cell.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    background: #e94560 !important;
    color: white !important;
    box-shadow: 0 4px 0 #a62337 !important;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* 시작 버튼 오버레이 */
.overlay-start {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 16px;
    transition: opacity 0.3s;
}

.overlay-start.hidden {
    opacity: 0;
    pointer-events: none;
}

.btn-start, .btn-restart {
    background: linear-gradient(135deg, #0f3460 0%, #e94560 100%);
    border: none;
    padding: 16px 40px;
    font-size: 20px;
    font-weight: 900;
    color: white;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(233, 69, 96, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-start:hover, .btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(233, 69, 96, 0.6);
}

.btn-start:active {
    transform: translateY(1px);
}

/* 결과 모달 */
.modal {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    opacity: 1;
    transition: opacity 0.3s;
    border-radius: 16px;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #16213e;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid #0f3460;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
    color: #4ecca3;
    font-size: 32px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.final-score {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    margin: 10px 0 30px 0;
}

/* 기존 CSS 유지하되 아래 내용 추가/수정 */

/* 모달 내용 확장 */
.modal-content {
    background: #16213e;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    border: 2px solid #0f3460;
    width: 90%;
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto; /* 내용이 길어지면 스크롤 */
}

/* 입력 폼 스타일 */
.record-section {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

#player-name {
    background: #0f3460;
    border: 1px solid #1a1a2e;
    border-radius: 8px;
    padding: 10px;
    color: white;
    font-size: 16px;
    outline: none;
    width: 60%;
    text-align: center;
}

#player-name:focus {
    border-color: #e94560;
}

.btn-submit {
    background: #4ecca3;
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.btn-submit:hover {
    background: #fff;
}

.btn-submit:disabled {
    background: #555;
    cursor: not-allowed;
}

/* 리더보드 스타일 */
.leaderboard-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: left;
}

.leaderboard-container h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #8d93ab;
    text-align: center;
    letter-spacing: 1px;
}

#leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

#leaderboard-list li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

#leaderboard-list li:nth-child(1) { color: #ffd700; font-weight: bold; } /* 1등 금색 */
#leaderboard-list li:nth-child(2) { color: #c0c0c0; font-weight: bold; } /* 2등 은색 */
#leaderboard-list li:nth-child(3) { color: #cd7f32; font-weight: bold; } /* 3등 동색 */

.rank-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 10px;
}

.rank-score {
    font-family: 'Courier New', monospace;
}

.hidden {
    display: none !important;
}

/* 스크롤바 커스텀 */
#leaderboard-list::-webkit-scrollbar {
    width: 4px;
}
#leaderboard-list::-webkit-scrollbar-thumb {
    background: #e94560;
    border-radius: 2px;
}