/* public/style.css */

/* =============================================== */
/* 공통 스타일 (모든 페이지에 적용) */
/* =============================================== */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #1a1a2e;
    color: #e0e0e0;
    margin: 0;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.container {
    max-width: 900px;
    width: 100%;
    background: #16213e;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 0 25px rgba(227, 20, 103, 0.5);
    border: 2px solid #e31467;
    box-sizing: border-box;
}

h1, h2, h3 {
    font-family: 'Press Start 2P', cursive;
    color: #00f5d4;
    text-align: center;
    text-shadow: 2px 2px #e31467;
}

a {
    color: #00f5d4;
    text-decoration: none;
}
a:hover {
    color: #f1faee;
}

/* =============================================== */
/* 메인 페이지 (index.html) 전용 스타일 */
/* =============================================== */
body.page-index h1 {
    margin-top: 0;
    margin-bottom: 40px;
    font-size: 1.8em;
}

.page-index .header-image-container {
 width: 95%; /* 보라색 경계에 더 가깝게 넓힘 */
 margin: 0 auto 20px auto; /* 하단 마진 약간 줄임 */
 padding: 5px; /* 내부 패딩 약간 줄임 */
 background-color: #0f182e;
 border-radius: 15px;
 border: 2px solid #00f5d4;
 box-shadow: 0 0 15px rgba(0, 245, 212, 0.4);
 box-sizing: border-box;
}

.page-index .header-image-container img {
 width: 100%;
 height: auto; /* 높이를 자동으로 조정하여 비율 유지 */
 object-fit: contain;
 display: block;
 border-radius: 10px;
}

.page-index .links-container {
    text-align: center;
    margin-bottom: 40px;
}

.page-index .links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.page-index .links#game-links {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.page-index .link-btn {
    display: inline-block;
    background: #e31467;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
    border-bottom: 4px solid #a10e4a;
    text-align: center;
}
.page-index .link-btn:hover {
    background-color: #ff3c8d;
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0,0,0,0.5);
}

.page-index .link-btn-guestbook {
    background-color: #00f5d4;
    border-bottom-color: #00a896;
    color: #16213e;
}
.page-index .link-btn-guestbook:hover {
    background-color: #2cffe3;
}

.page-index .link-btn.game-not-ready {
    background-color: #535c68;
    border-bottom-color: #343a40;
    cursor: not-allowed;
    opacity: 0.6;
}
.page-index .link-btn.game-not-ready:hover {
    background-color: #535c68;
    transform: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
}

.page-index .stats-section {
    margin-top: 40px;
    padding: 20px;
    background: #0f182e;
    border-radius: 15px;
    border: 1px solid #4a4a70;
}
.page-index .stats-list { list-style: none; padding: 0; }
.page-index .stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin: 8px 0;
    background: #16213e;
    border-radius: 8px;
    border-left: 5px solid #e31467;
}
.page-index .stats-label { font-weight: bold; color: #a9dfd8; }
.page-index .stats-value { font-weight: bold; font-family: 'Press Start 2P', cursive; color: #fff; }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); display: none;
    align-items: center; justify-content: center; z-index: 1000;
}
.modal-content {
    background: #16213e; padding: 30px 40px; border-radius: 10px;
    text-align: center; border: 2px solid #00f5d4;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); font-size: 20px; position: relative;
}
.modal-close-btn {
    font-family: 'Press Start 2P', cursive; background: #e31467; color: white;
    border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer;
    margin-top: 20px; font-size: 16px;
}

/* =============================================== */
/* 방명록 페이지 (guestbook.html) 전용 스타일 */
/* =============================================== */
body.page-guestbook .btn {
    font-family: 'Press Start 2P', cursive; background-color: #00f5d4; color: #16213e;
    padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer;
    font-size: 0.9em; transition: all 0.3s; border-bottom: 3px solid #00a896;
}
body.page-guestbook .btn:hover { background-color: #2cffe3; transform: translateY(-2px); }
body.page-guestbook .btn-danger { background-color: #e31467; color: white; border-bottom-color: #a10e4a; }
body.page-guestbook .btn-danger:hover { background-color: #ff3c8d; }
body.page-guestbook .btn-secondary { background-color: #535c68; color: white; border-bottom-color: #343a40; }
body.page-guestbook .btn-secondary:hover { background-color: #6c757d; }

.page-guestbook .home-link { display: block; text-align: center; margin-bottom: 20px; font-size: 1.2em; font-weight: bold; }
.page-guestbook .form-section, .page-guestbook .list-section {
    margin-bottom: 40px; padding: 20px; border: 1px solid #4a4a70;
    border-radius: 10px; background-color: #0f182e;
}
.page-guestbook .form-group { margin-bottom: 15px; }
.page-guestbook .form-group label { display: block; margin-bottom: 5px; font-weight: bold; color: #a9dfd8; }

.page-guestbook .form-group input[type="text"],
.page-guestbook .form-group textarea,
.page-guestbook .form-group input[type="password"] {
    width: 100%; padding: 10px; border-radius: 5px; border: 1px solid #4a4a70;
    background-color: #16213e; color: #e0e0e0; box-sizing: border-box; font-size: 1em;
}
.page-guestbook .form-group textarea { min-height: 100px; resize: vertical; }

.page-guestbook .entry {
    background: #16213e; border: 1px solid #4a4a70; padding: 15px;
    border-radius: 8px; margin-bottom: 15px;
}
.page-guestbook .entry-header {
    display: flex; justify-content: space-between; align-items: center;
    color: #888; font-size: 0.9em; margin-bottom: 10px; flex-wrap: wrap;
}
.page-guestbook .entry-author { font-weight: bold; color: #a9dfd8; }
.page-guestbook .entry-content {
    color: #e0e0e0; white-space: pre-wrap; word-wrap: break-word; margin: 10px 0;
}
.page-guestbook .entry-actions {
    margin-top: 10px; display: flex; gap: 10px; justify-content: flex-end;
}
.page-guestbook .admin-form, .page-guestbook .admin-comment-form {
    margin-top: 15px; padding-top: 15px; border-top: 1px dashed #4a4a70;
}
.page-guestbook .admin-comment {
    border-left: 4px solid #00f5d4; background: #0f182e; padding: 10px;
    margin-top: 15px; border-radius: 0 5px 5px 0;
}
.page-guestbook .admin-comment-header {
    display: flex; justify-content: space-between;
    font-size: 0.9em; color: #ccc;
}

/* =============================================== */
/* 방명록 관리자 코멘트 UI 개선 */
/* =============================================== */

.page-guestbook .admin-comment-form form {
    display: flex;
    flex-direction: column;
    gap: 10px; /* 텍스트 입력창과 아래 줄 사이의 간격 */
}

.page-guestbook .admin-comment-form .admin-form-row {
    display: flex;
    justify-content: space-between; /* 양쪽 끝으로 요소를 분산 */
    align-items: center; /* 세로 중앙 정렬 */
    gap: 10px;
    flex-wrap: wrap; /* 작은 화면에서 줄바꿈 */
}

/* 비밀번호 입력창이 너무 길지 않도록 조정 */
.page-guestbook .admin-comment-form .admin-form-row input[type="password"] {
    flex: 1 1 180px; /* 가변적으로 늘어나되 최소 너비 유지 */
}

.page-guestbook .admin-comment-form .admin-form-buttons {
    display: flex;
    gap: 10px; /* 버튼 사이의 간격 */
}

/* 게임 모달 전용 스타일 */
.modal-content.game-modal-content {
    width: 90vw; /* 화면 너비의 90% */
    height: 85vh; /* 화면 높이의 85% */
    padding: 15px; /* 내부 여백 */
    padding-top: 50px; /* 닫기 버튼을 위한 상단 여백 */
    box-sizing: border-box;
}

#gameFrame {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #000; /* 로딩 중 배경색 */
}

.game-modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 1001; /* iframe 위에 표시되도록 */
}
