/* 전체 페이지 기본 스타일 */
body {
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    text-align: center;
}

/* 페이지 컨테이너 공통 스타일 */
.page-container {
    background-color: #2d2d2d;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 900px;
    box-sizing: border-box;
}

h1, h2 {
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 25px;
}

/* 시작 화면 스타일 */
.button-group button {
    font-size: 1.2rem;
    padding: 15px 30px;
    margin: 10px;
    cursor: pointer;
    border: 1px solid #555;
    border-radius: 5px;
    background-color: #444;
    color: #e0e0e0;
    transition: background-color 0.3s;
}
.button-group button:hover {
    background-color: #555;
}
#game-list-container {
    margin-top: 30px;
}
#game-list a {
    display: block;
    background-color: #444;
    color: #e0e0e0;
    padding: 12px;
    margin: 8px auto;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s;
    max-width: 400px;
}
#game-list a:hover {
    background-color: #555;
}

/* 설정 화면 스타일 */
.top-settings-grid, .set-all-durations {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 15px;
    text-align: right;
    align-items: center;
    margin: 0 auto 20px auto;
    max-width: 500px;
}
.top-settings-grid label, .set-all-durations label {
    font-size: 0.9rem;
}
.top-settings-grid input, .set-all-durations input, .file-input-wrapper {
    background-color: #1e1e1e;
    border: 1px solid #555;
    color: #e0e0e0;
    padding: 8px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}
.set-all-durations {
    grid-template-columns: auto 1fr 1fr;
}
.set-all-durations input, .set-all-durations button {
    text-align: center;
    padding: 10px;
}
.blind-grid-header, .blind-grid-row {
    display: grid;
    grid-template-columns: 0.5fr 1fr 1fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 5px 0;
    align-items: center;
}
.blind-grid-header {
    font-weight: bold;
    padding-bottom: 10px;
}
.blind-grid-body {
    max-height: 40vh;
    overflow-y: auto;
}
.blind-grid-row input, .blind-grid-row button {
    width: 100%;
    padding: 10px;
    background-color: #444;
    border: 1px solid #555;
    color: white;
    border-radius: 4px;
    text-align: center;
    box-sizing: border-box;
    cursor: pointer;
}
#play-button {
    width: 100%;
    font-size: 1.8rem;
    padding: 15px;
    margin-top: 20px;
    background-color: #444;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 5px;
    cursor: pointer;
}

/* --- 타이머 화면 스타일 --- */
#timer-page {
    height: 90vh;
    padding: 15px;
}
.timer-grid-layout {
    display: grid;
    height: 100%;
    grid-template-columns: 1fr 4fr;
    grid-template-rows: 2fr 1fr;
    gap: 15px;
    grid-template-areas:
        "left top-right"
        "bottom bottom";
}
.left-column {
    grid-area: left;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    background-color: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
.top-right-section {
    grid-area: top-right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
}
.bottom-section {
    grid-area: bottom;
    background-color: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
}

/* 왼쪽 열 상세 스타일 */
.info-block {
    margin: 0;
}
.info-label {
    font-size: 0.8rem;
    color: #aaa;
    margin: 0;
}
.info-value {
    font-size: 1.4rem;
    font-weight: bold;
    margin: 2px 0;
}
.info-subtext {
    font-size: 0.8rem;
    color: #bbb;
    margin: 0;
}
.prize-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    font-size: 0.8rem;
    margin-top: 5px;
    text-align: left;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* 타이머 영역 상세 스타일 */
.timer-display-area {
    margin-bottom: 15px;
}
#level-label {
    font-size: 2.5rem;
    margin: 0;
}
.timer-wrapper {
    position: relative;
    display: inline-block;
}

#paused-indicator {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: transparent;
    color: red;
    font-size: 5rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 10px;
    border: 8px solid red;
    z-index: 8;
    white-space: nowrap;
    min-width: 180px;
    text-align: center;
}
.timer-paused #paused-indicator {
    display: block;
}

#timer-label {
    font-size: 8rem;
    font-weight: bold;
    margin: 0;
    line-height: 1;
}

#blinds-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    color: #ffffff;
    margin: 5px 0 0 0;
    font-weight: bold;
}

.blind-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    height: 1.5em;
    background-color: #555;
    color: #fff;
    border-radius: 50%;
    font-size: 0.8em;
    font-weight: bold;
    margin-right: 0.5em;
    flex-shrink: 0;
}

.blind-values { }

#next-blinds-label {
    font-size: 1.2rem;
    color: #e0e0e0;
}

.controls-area {
    width: 100%;
    max-width: 400px;
}
.slider {
    width: 100%;
    margin-bottom: 10px;
}
.timer-controls-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}
.timer-controls-row button {
    padding: 10px;
    font-size: 1rem;
    background-color: #444;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 5px;
    cursor: pointer;
}
#play-pause-btn {
    font-size: 1.5rem;
}

.controls-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #333;
}

/* 하단 영역 상세 스타일 */
.bottom-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: flex-start;
}

#go-home-btn, #sound-toggle-btn, #out-list-btn, #lock-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    background-color: #444;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 5px;
    cursor: pointer;
}

#lock-btn.locked {
    background-color: #0056b3;
    border-color: #007bff;
}

.table-container {
    overflow-y: auto;
    flex-grow: 1;
}
#realtime-data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}
#realtime-data-table th, #realtime-data-table td {
    padding: 8px;
    border-bottom: 1px solid #444;
    text-align: center;
}
#realtime-data-table th {
    color: #aaa;
    font-size: 0.9rem;
}
#realtime-data-tbody tr[style*="opacity: 0.5"] {
    cursor: pointer;
}
.out-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
    background-color: #c9302c;
    color: white;
    border: 1px solid #ac2925;
    border-radius: 4px;
    cursor: pointer;
}
.out-btn:disabled {
    background-color: #555;
    border-color: #444;
    cursor: not-allowed;
}

/* --- 모달(팝업) 스타일 --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #2d2d2d;
    padding: 25px;
    border: 1px solid #555;
    width: 90%;
    max-width: 450px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.6);
    position: relative;
    margin: 0;
}
.close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-btn:hover,
.close-btn:focus {
    color: #fff;
    text-decoration: none;
}
#out-player-list {
    list-style: none;
    padding: 0;
    text-align: left;
    max-height: 50vh;
    overflow-y: auto;
}
/* ==================== 💡 수정된 부분 시작 💡 ==================== */
#out-player-list li {
    background-color: #444;
    padding: 10px 15px; /* 양옆 패딩 추가 */
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 1.1rem;
    display: flex; /* Flexbox 사용 */
    justify-content: space-between; /* 이름과 버튼 양쪽 정렬 */
    align-items: center; /* 세로 중앙 정렬 */
}

/* 복귀 버튼 스타일 */
.restore-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
    background-color: #c9302c; /* 빨간 배경 */
    color: white; /* 흰 글씨 */
    border: 1px solid #ac2925; /* 약간 어두운 빨간 테두리 */
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px; /* 이름과의 간격 */
}

.restore-btn:hover {
    background-color: #ac2925; /* 호버 시 더 어두운 빨강 */
}
/* ==================== 💡 수정된 부분 끝 💡 ==================== */

.preset-buttons {
    margin-top: 15px;
    margin-bottom: 5px;
}

.preset-buttons button {
    font-size: 1rem;
    padding: 10px 20px;
    cursor: pointer;
    border: 1px solid #555;
    border-radius: 5px;
    background-color: #0056b3;
    color: #e0e0e0;
    transition: background-color 0.3s;
    margin: 0 5px;
}
.preset-buttons button:hover {
    background-color: #007bff;
}

#gems-mode-btn {
    background-color: #28a745;
}
#gems-mode-btn:hover {
    background-color: #218838;
}

#default-mode-btn {
    background-color: #FFB6C1;
    color: #333;
    border-color: #e8a5b1;
}
#default-mode-btn:hover {
    background-color: #f7a8b6;
}

#wake-lock-video {
    position: absolute;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}