/* 칼퇴 하자 게임 스타일 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f5f5f5;
    color: #333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h1 {
    font-size: 2.5em;
    color: #4CAF50;
    margin-bottom: 10px;
    text-shadow: none;
}

.game-description {
    color: #666;
    font-size: 1.1em;
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.game-info {
    display: flex;
    gap: 30px;
    font-size: 1.2em;
}

.game-info span {
    color: #ccc;
}

.game-info strong {
    color: #4CAF50;
}

/* 게임 영역 */
#gameContainer {
    background: #e8f5e9;
    border: 3px solid #4CAF50;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.game {
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, #e3f2fd 0%, #bbdefb 100%);
}

/* 배경 그리드 */
.background {
    table-layout: fixed;
    border-spacing: 0;
}

.background td {
    padding: 0;
}

/* 벽 */
.wall {
    background: #8BC34A;
    border: solid 3px #689F38;
    box-sizing: border-box;
}

/* 야근 서류 (용암) */
.lava {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

/* 액터 (플레이어, 코인) */
.actor {
    position: absolute;
}

/* 서류 (코인) */
.coin {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: coinFloat 2s ease-in-out infinite;
}

@keyframes coinFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* 플레이어 */
.player {
    background: transparent;
    background-image: url('../images/1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: opacity 0.3s;
}

/* 게임 오버 상태 */
.lost .player {
    opacity: 0.3;
    filter: grayscale(100%);
}

/* 게임 클리어 상태 */
.won .player {
    animation: winPulse 0.5s ease-in-out infinite;
    filter: brightness(1.2);
}

@keyframes winPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 버튼 스타일 */
.btn {
    padding: 12px 24px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.btn-primary:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #666;
    color: white;
}

.btn-secondary:hover {
    background: #555;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d32f2f, #c62828);
}

/* 조작 방법 */
.instructions {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.instructions h3 {
    color: #4CAF50;
    margin-bottom: 15px;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    padding: 8px 0;
    color: #555;
    font-size: 1.1em;
}

/* 순위판 */
.leaderboard-section {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    margin-top: 30px;
    border: 1px solid #e0e0e0;
}

.leaderboard-section h2 {
    color: #4CAF50;
    text-align: center;
    margin-bottom: 20px;
}

.leaderboard-controls {
    text-align: center;
    margin-bottom: 20px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.leaderboard-table thead {
    background: rgba(76, 175, 80, 0.2);
}

.leaderboard-table th {
    padding: 15px;
    text-align: left;
    color: #4CAF50;
    font-weight: bold;
}

.leaderboard-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.leaderboard-table tr:hover {
    background: rgba(76, 175, 80, 0.1);
}

.leaderboard-table .rank-1 {
    background: rgba(255, 215, 0, 0.1);
}

.leaderboard-table .rank-2 {
    background: rgba(192, 192, 192, 0.1);
}

.leaderboard-table .rank-3 {
    background: rgba(205, 127, 50, 0.1);
}

.rank-medal {
    font-size: 1.3em;
    margin-right: 5px;
}

.no-records {
    display: none;
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.2em;
}

.no-records.show {
    display: block;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    min-width: 400px;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h2 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 2em;
}

.modal-content p {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 30px;
}

.modal-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    background: #f9f9f9;
    color: #333;
    font-size: 1em;
}

.modal-form input:focus {
    outline: none;
    border-color: #4CAF50;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons .btn {
    flex: 1;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 2em;
    }

    .game-controls {
        flex-direction: column;
        gap: 15px;
    }

    .game-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .modal-content {
        min-width: 90%;
        padding: 30px 20px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 10px 8px;
        font-size: 0.9em;
    }
}
