/* 업무 피하기 게임 전용 스타일 (T-Rex 스타일) */

/* 게임 영역 */
.avoid-game-area {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 250px;
    margin: 0 auto 20px;
    background: linear-gradient(to bottom, #87ceeb 0%, #e0f6ff 50%, #d4f1d4 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

/* 구름 */
.cloud {
    position: absolute;
    background: white;
    border-radius: 50px;
    opacity: 0.8;
    animation: cloudMove 8s linear infinite;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

.cloud::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}

.cloud::after {
    width: 60px;
    height: 60px;
    top: -30px;
    right: 10px;
}

@keyframes cloudMove {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-600px);
    }
}

/* 지면 */
.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 80px;
    background: linear-gradient(to bottom, #8B7355 0%, #654321 100%);
    border-top: 4px solid #5a3a1a;
    animation: groundMove 3s linear infinite;
}

.ground::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: repeating-linear-gradient(
        90deg,
        #228B22 0px,
        #228B22 20px,
        #32CD32 20px,
        #32CD32 40px
    );
}

@keyframes groundMove {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* 캐릭터 (회사원) */
.character {
    position: absolute;
    bottom: 80px;
    left: 50px;
    width: 50px;
    height: 50px;
    font-size: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transform: scaleX(-1);
    transition: bottom 0.05s linear;
}

.character.jumping {
    animation: none;
}

.character.hit {
    animation: hit 0.5s ease-out;
}

@keyframes hit {
    0%, 100% {
        transform: scaleX(-1) rotate(0deg);
    }
    25% {
        transform: scaleX(-1) rotate(-15deg);
    }
    75% {
        transform: scaleX(-1) rotate(15deg);
    }
}

/* 장애물 (업무 서류) */
.obstacle {
    position: absolute;
    bottom: 80px;
    width: 60px;
    height: 60px;
    font-size: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    animation: none;
}

/* 게임 오버 상태 */
.avoid-game-area.game-over {
    animation: gameOverShake 0.5s ease-out;
}

@keyframes gameOverShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* 컨트롤 버튼 */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.controls .btn {
    min-width: 120px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.controls .btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.controls .btn:active:not(:disabled) {
    transform: translateY(0);
}

.controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

/* 게임 안내 */
.game-instructions {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.game-instructions h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.game-instructions p {
    color: #666;
    margin: 8px 0;
    font-size: 1em;
}

.game-instructions kbd {
    background: #f4f4f4;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 2em;
}

.modal-content .final-score {
    font-size: 1.5em;
    color: #333;
    margin: 20px 0;
    font-weight: bold;
}

.modal-content .final-score span {
    color: #667eea;
}

.name-input-group {
    margin: 25px 0;
}

.name-input-group label {
    display: block;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
}

.name-input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.name-input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.modal-buttons .btn {
    min-width: 100px;
}

.btn-secondary {
    background: linear-gradient(135deg, #a8a8a8 0%, #707070 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #707070 0%, #a8a8a8 100%);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .avoid-game-area {
        height: 200px;
    }
    
    .character {
        font-size: 2.5em;
        width: 40px;
        height: 40px;
    }
    
    .obstacle {
        font-size: 2em;
        width: 50px;
        height: 50px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .controls .btn {
        width: 100%;
        max-width: 300px;
    }
}
