/* 메인 스타일 */
/* 추가적인 페이지별 스타일은 여기에 정의 */

/* 다운로드 페이지 스타일 */
.download-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-item h3 {
    color: #dc3545;
    margin-bottom: 0.5rem;
}

.download-item p {
    color: #666;
    margin-bottom: 1rem;
}

/* 왼쪽 설명이 길어도 오른쪽 버튼 칸은 줄어들지 않게 합니다.
 *
 * .download-item 은 좌우로 나뉜 flex 인데, 버튼 쪽에 아무 지시가 없어
 * 설명이 길면 이쪽이 대신 눌렸습니다. '윈도우 64bits 용 the board 1.5
 * 서버 프로그램' 항목에서 버튼 폭이 81px 에서 70px 로 좁아지며 '다운로드'
 * 가 두 줄로 깨졌습니다. 폭 1280px 에서도 그랬습니다.
 *
 * 줄어들지 않게 하는 것만으로도 지금 글자는 한 줄에 들어가지만,
 * 아래 nowrap 을 함께 둡니다 — 버튼 글자는 '다운로드 불가'·'로그인 필요'
 * 처럼 띄어쓰기가 있는 것도 있어서, 칸이 좁아지는 다른 경우가 생기면
 * 또 갈라집니다. */
.download-action {
    flex-shrink: 0;
}

.download-btn {
    padding: 0.5rem 1rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    /* 버튼 글자는 한 줄로 둡니다. 두 줄이 되면 버튼만 세로로 커져
     * 항목마다 높이가 들쭉날쭉해집니다. */
    white-space: nowrap;
}

.download-btn:hover {
    background-color: #218838;
}

/* 목록은 누구나 보지만 로그인/권한이 없으면 실제로 받을 수 없는 상태 */
.download-btn.is-disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
}

.download-btn.is-disabled:hover {
    background-color: #adb5bd;
}

/* '로그인 필요' 안내는 눌러서 로그인 페이지로 이동할 수 있습니다 */
a.download-btn.is-disabled {
    cursor: pointer;
}

/* 게시판 스타일 */
.board-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.board-form textarea {
    width: 100%;
    min-height: 150px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    resize: vertical;
}

.board-posts {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.board-post {
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.board-post:last-child {
    border-bottom: none;
}

.board-post h3 {
    color: #dc3545;
    margin-bottom: 0.5rem;
}

.board-post .post-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.board-post .post-content {
    line-height: 1.6;
}

/* 관리자 전용 스타일 */
.admin-only {
    display: none;
}

.admin-only.show {
    display: block;
}

/* 접근 통계 스타일 */
.stats-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #dc3545;
}

.stat-label {
    color: #666;
    margin-top: 0.5rem;
}

/* 지도 컨테이너 */
.map-container {
    height: 400px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.map-placeholder {
    color: #666;
    font-size: 1.2rem;
}

/* 접근 지역 목록 */
.access-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.access-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.access-item:last-child {
    border-bottom: none;
}

.access-location {
    font-weight: 500;
}

.access-time {
    color: #666;
    font-size: 0.9rem;
}

/* 차트 컨테이너 */
.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.chart-placeholder {
    height: 300px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

/* 사용자 프로필 */
.user-profile {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: #dc3545;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.profile-info h3 {
    color: #dc3545;
    margin-bottom: 0.5rem;
}

.profile-email {
    color: #666;
}

/* 비밀번호 변경 폼 */
.password-change-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.password-change-form h3 {
    color: #dc3545;
    margin-bottom: 1rem;
}

/* 알림 메시지 */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 게임 페이지 스타일 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.game-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.game-card-preview {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-card-preview .game-icon {
    font-size: 3rem;
    letter-spacing: 4px;
}

.game-card-preview .game-icon-svg {
    width: 120px;
    height: 120px;
    display: block;
}

.blocks2d-preview {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e94560;
}

.snake-preview {
    background: linear-gradient(135deg, #1a1a2e 0%, #0a2e1a 100%);
    color: #00ff88;
}

.game-card-info {
    padding: 1.5rem;
}

.game-card-info h3 {
    color: #dc3545;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.game-card-info p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.game-controls-info {
    background: #f8f9fa;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.game-controls-info small {
    color: #888;
    font-size: 0.8rem;
}

.game-play-btn {
    display: inline-block;
    padding: 0.6rem 2rem;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.game-play-btn:hover {
    background-color: #c82333;
}

/* /games 하단 리더보드. 게임이 늘어도 한 줄에 억지로 밀어넣지 않고
   폭에 맞춰 접히도록 auto-fit 으로 둡니다. */
.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* 모바일: 게임 목록/리더보드/통계 1열 정리 */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    .game-card-preview { height: 120px; }
    .game-card-info { padding: 1rem; }
    .game-card-info h3 { font-size: 1.2rem; }
    .game-play-btn { display: block; text-align: center; padding: 0.8rem; }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }

    /* /games 페이지 하단 리더보드 */
    .leaderboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .data-table { font-size: 0.85rem; }
    .data-table th, .data-table td { padding: 0.35rem !important; }
}
