* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    min-height: 100vh;
    position: relative;
}

/* 로고 컨테이너 */
.logo-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.logo-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
    box-shadow: 
        0 12px 30px rgba(102, 126, 234, 0.2),
        0 6px 15px rgba(0, 0, 0, 0.1),
        0 0 0 2px rgba(255, 255, 255, 0.8),
        inset 0 2px 0 rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: logoFloat 4s ease-in-out infinite;
    border: 3px solid rgba(102, 126, 234, 0.1);
}

.logo-circle:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 
        0 20px 40px rgba(102, 126, 234, 0.3),
        0 10px 20px rgba(0, 0, 0, 0.15),
        0 0 0 3px rgba(255, 255, 255, 0.9),
        inset 0 2px 0 rgba(255, 255, 255, 1);
    border: 3px solid rgba(102, 126, 234, 0.2);
}

.logo-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-circle:hover .logo-image {
    transform: scale(1.1) rotate(-5deg);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-12px) rotate(2deg);
    }
    50% {
        transform: translateY(-8px) rotate(0deg);
    }
    75% {
        transform: translateY(-12px) rotate(-2deg);
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.game-container {
    max-width: 100%;
    margin: 120px auto 0 auto;
    padding: 25px;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    color: #333;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

.game-header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* RAMI TEACHER 스타일의 메인 타이틀 */
.main-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
    color: #2c3e50;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.title-icon {
    font-size: 3rem;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.title-text {
    font-size: 2.8rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    text-shadow: none;
}

.title-subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 400;
    margin-top: -5px;
    opacity: 0.9;
}

.score-board {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(248, 249, 250, 0.95);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
}



.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

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

.score-item .label {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

.score-item .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Main Game Area */
.game-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.game-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    align-items: flex-start;
}

.game-canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.game-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#game-canvas {
    border: 3px solid #fff;
    border-radius: 10px;
    background: #2d5016;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 100%;
    height: auto;
}

/* 3D 캔버스 컨테이너 */
#3d-canvas-container {
    width: 100%;
    max-width: 800px;
    height: 400px;
    max-height: 50vh;
    margin: 0 auto;
    border: 3px solid #4a7c59; /* 부드러운 잔디색 테두리 */
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 8px 25px rgba(74, 124, 89, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #87ceeb 0%, #98d8e8 100%); /* 하늘색 그라데이션 */
}

#3d-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border-radius: 9px;
}

/* 캔버스 오버레이 */
.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.canvas-overlay .decision-buttons,
.canvas-overlay .pitch-info {
    pointer-events: auto;
}

/* 모바일 스코어 보드 */
.mobile-score-board {
    display: none;
}

/* 데스크톱 스코어 보드 */
.desktop-score-board {
    display: flex;
}



/* 데스크톱 판정 버튼 */
.desktop-decision-buttons {
    display: flex;
}



/* 캔버스 중앙 컨트롤 */
.canvas-center-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 30;
    text-align: center;
}

.canvas-center-controls .start-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
    min-width: 150px;
}

.canvas-center-controls .start-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.canvas-center-controls .start-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

/* 캔버스 pitch-info */
.canvas-pitch-info {
    display: block;
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 20;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-align: left;
    min-width: 80px;
}

.canvas-pitch-info .pitch-counter {
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: #666;
}

.canvas-pitch-info .pitch-speed {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 4px;
    color: #ffd700;
}

.canvas-pitch-info .pitch-type {
    font-size: 0.8rem;
    font-weight: bold;
    color: #87ceeb;
    padding: 2px 6px;
    background: rgba(135, 206, 235, 0.2);
    border-radius: 4px;
    display: inline-block;
}

/* 모바일용 스코어 섹션 */
.mobile-score-section {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
    padding: 0 20px;
}

/* 모바일에서 캔버스 위 오버레이로 표시 */
@media (max-width: 768px) {
    .mobile-score-section {
        position: absolute;
        top: 20px;
        left: 0;
        right: 0;
        z-index: 50;
        margin: 0;
        padding: 0 20px;
    }
}

/* 모바일용 하단 스코어보드 */
.mobile-score-board-bottom {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.mobile-score-board-bottom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}

/* 아웃카운트 표시 */
.out-count-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

/* 모바일에서 데스크톱 스코어보드 숨김 */
@media (max-width: 768px) {
    .desktop-score-board {
        display: none;
    }
}

/* 아웃카운트 컨테이너 */
.out-count-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    min-width: 60px;
    position: relative;
    overflow: hidden;
}

.out-count-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}

.out-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

/* 버튼 내부 텍스트 스타일 */
.mobile-decision-buttons .btn-text {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.mobile-decision-buttons .btn-key {
    font-size: 0.6rem;
    opacity: 0.8;
    font-weight: 500;
}

.out-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #34495e;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 1;
}

.out-circle.filled {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #c0392b;
    box-shadow: 
        0 4px 15px rgba(231, 76, 60, 0.4),
        0 2px 8px rgba(192, 57, 43, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 
            0 4px 15px rgba(231, 76, 60, 0.4),
            0 2px 8px rgba(192, 57, 43, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 6px 20px rgba(231, 76, 60, 0.6),
            0 3px 12px rgba(192, 57, 43, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

/* 데스크톱 아웃카운트 */
.desktop-out-count {
    margin: 15px 0;
}

.desktop-out-count .out-circle {
    width: 28px;
    height: 28px;
}

/* 게임 결과창 */
.game-result-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.game-result-modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-result-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 300px;
    width: 90%;
}

.game-result-content h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
}

.result-stats {
    margin-bottom: 25px;
}

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

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

.result-item .label {
    font-size: 16px;
    color: #666;
}

.result-item .value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.restart-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.restart-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* 결과창 버튼 컨테이너 */
.result-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 공유 버튼 */
.share-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.share-btn:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.mobile-score-board-bottom .score-item {
    text-align: center;
    flex: 1;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

.mobile-score-board-bottom .score-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-score-board-bottom .score-item .label {
    font-size: 0.6rem;
    color: #34495e;
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.mobile-score-board-bottom .score-item .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    display: block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

/* 모바일용 판정 버튼 */
.mobile-decision-buttons {
    display: none;
    flex-direction: row;
    gap: 6px;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 240px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* decision 토스트가 표시될 때만 모바일 버튼 보이기 */
.toast-notification.decision.show ~ .mobile-decision-buttons,
.toast-notification.decision.show + .mobile-decision-buttons {
    display: flex;
    opacity: 1;
}

/* 데스크톱에서 모바일 판정 버튼 숨기기 */
@media (min-width: 769px) {
    .mobile-decision-buttons {
        display: none !important;
    }
}

.mobile-decision-buttons .decision-btn {
    flex: 1;
    max-width: 110px;
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.mobile-decision-buttons .strike-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.mobile-decision-buttons .ball-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.mobile-decision-buttons .decision-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.mobile-decision-buttons .decision-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* 모바일에서 h1 간격 조정 */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }
    
    .mobile-decision-buttons {
        display: flex;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }
    
    .mobile-score-section {
        display: flex; /* 상단 스코어보드와 버튼 표시 */
        position: absolute;
        top: 10px;
        left: 0;
        right: 0;
        z-index: 50;
        margin: 0;
        padding: 0 15px;
        justify-content: space-between;
        align-items: flex-start;
    }
    
    .mobile-out-count {
        display: flex; /* 모바일에서 아웃카운트 표시 */
        flex-direction: row;
        
        
    }
    
    .out-count-container {
        padding: 4px 8px;
        border-radius: 6px;
        width: auto;
        margin: 0;
        position: absolute;
        top: 10px;
        right: 5%;
    }
    
    .out-label {
        font-size: 0.6rem;
        margin-bottom: 3px;
        margin-right: 9px;
    }
    
    /* 모바일에서 데스크톱 아웃카운트 완전 숨김 */
    .desktop-out-count {
        display: none !important;
    }
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    color: #333;
}

.pitch-info {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    text-align: center;
}

.pitch-counter {
    font-size: 1rem;
    margin-bottom: 8px;
}

.pitch-speed {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 8px;
}

.pitch-type {
    font-size: 1rem;
    font-weight: bold;
    color: #87ceeb;
    padding: 4px 8px;
    background: rgba(135, 206, 235, 0.2);
    border-radius: 8px;
    display: inline-block;
}

.batter-side {
    font-size: 0.9rem;
    font-weight: bold;
    color: #ffa500;
    padding: 3px 6px;
    background: rgba(255, 165, 0, 0.2);
    border-radius: 6px;
    display: inline-block;
    margin-top: 4px;
}

.decision-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.decision-btn {
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.decision-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.decision-btn:active {
    transform: translateY(0);
}

.strike-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.strike-btn:hover {
    background: linear-gradient(135deg, #ff5252, #e53935);
}

.ball-btn {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

.ball-btn:hover {
    background: linear-gradient(135deg, #26a69a, #00695c);
}

.btn-text {
    display: block;
    font-size: 1.2rem;
}

.btn-key {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 3px;
}

.game-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}

.control-btn {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.start-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: rgba(40, 167, 69, 0.3);
    font-weight: bold;
    font-size: 1rem;
    padding: 12px 20px;
}

.start-btn:hover {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.control-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

/* Result Display */
.result-display {
    grid-column: 1 / -1;
    margin-top: 20px;
    padding: 25px;
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    border: 2px solid rgba(102, 126, 234, 0.1);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.result-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    border-radius: 15px 15px 0 0;
}

.result-display.show {
    opacity: 1;
    transform: translateY(0);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-text {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-text.correct {
    color: #28a745;
}

.result-text.incorrect {
    color: #dc3545;
}

.result-explanation {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.5;
    color: #495057;
}



/* Responsive Design */
@media (max-width: 1024px) {
    .game-layout {
        flex-direction: column;
        align-items: center;
    }
    
    .game-sidebar {
        width: 100%;
        max-width: 500px;
    }
    
    .score-board {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .score-item {
        flex-direction: column;
        text-align: center;
        border-bottom: none;
        border-right: 1px solid rgba(102, 126, 234, 0.1);
    }
    
    .score-item:last-child {
        border-right: none;
    }
    
    .decision-buttons {
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .game-container {
        padding: 8px;
        margin: 2px;
        border-radius: 10px;
    }
    
    .game-header h1 {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    
    /* 모바일에서 스코어 보드 표시 */
    .mobile-score-board {
        display: flex;
        flex-direction: row;
        gap: 4px;
        padding: 8px;
        margin: 4px 0;
        background: rgba(248, 249, 250, 0.95);
        border-radius: 10px;
        border: 2px solid rgba(102, 126, 234, 0.1);
        box-shadow: 
            0 8px 25px rgba(0, 0, 0, 0.08),
            0 0 0 1px rgba(255, 255, 255, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    
    .mobile-score-board .score-item {
        flex: 1;
        flex-direction: column;
        text-align: center;
        border-right: 1px solid rgba(102, 126, 234, 0.1);
        padding: 4px 0;
    }
    
    .mobile-score-board .score-item:last-child {
        border-right: none;
    }
    
    .mobile-score-board .score-item .label {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }
    
    .mobile-score-board .score-item .value {
        font-size: 1rem;
    }
    
    /* 데스크톱 요소들 숨기기 */
    .desktop-score-board,
    .desktop-decision-buttons {
        display: none !important;
    }
    
    /* 모바일용 판정 버튼 표시 */
    .mobile-decision-buttons {
        display: flex !important;
    }
    

    
    .canvas-center-controls .start-btn {
        padding: 12px 25px;
        font-size: 16px;
        min-width: 120px;
    }
    
    .canvas-pitch-info {
        display: block !important;
        position: absolute;
        top: 15px;
        left: 15px;
        z-index: 20;
        background: rgba(255, 255, 255, 0.95);
        padding: 5px 8px;
        border-radius: 6px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        text-align: left;
        min-width: 60px;
    }
    
    /* 모바일 스코어보드 추가 스타일 */
    .mobile-score-board-bottom {
        padding: 6px 10px;
        border-radius: 10px;
        box-shadow: 
            0 3px 15px rgba(0, 0, 0, 0.08),
            0 1px 6px rgba(0, 0, 0, 0.06);
    }
    
    .mobile-score-board-bottom .score-item {
        padding: 3px 6px;
        border-radius: 6px;
    }
    
    .mobile-score-board-bottom .score-item .label {
        font-size: 0.55rem;
        margin-bottom: 2px;
        font-weight: 600;
    }
    
    .mobile-score-board-bottom .score-item .value {
        font-size: 0.95rem;
        font-weight: 700;
    }
    
    .canvas-pitch-info .pitch-counter {
        font-size: 0.7rem;
        margin-bottom: 3px;
        color: #666;
    }
    
    .canvas-pitch-info .pitch-speed {
        font-size: 0.9rem;
        font-weight: bold;
        margin-bottom: 3px;
        color: #ffd700;
    }
    
    .canvas-pitch-info .pitch-type {
        font-size: 0.7rem;
        font-weight: bold;
        color: #87ceeb;
        padding: 1px 4px;
        background: rgba(135, 206, 235, 0.2);
        border-radius: 3px;
        display: inline-block;
    }
    
    .game-layout {
        gap: 6px;
    }
    
    #3d-canvas-container {
        height: 220px;
        max-height: 35vh;
        border-radius: 10px;
        border: 2px solid #4a7c59; /* 부드러운 잔디색 테두리 */
        box-shadow: 
            0 5px 15px rgba(74, 124, 89, 0.2),
            0 0 0 1px rgba(255, 255, 255, 0.1);
        background: linear-gradient(135deg, #87ceeb 0%, #98d8e8 100%);
    }
    
    .game-sidebar {
        width: 100%;
    }
    
    .controls {
        gap: 6px;
    }
    
    .pitch-info {
        
        padding: 8px;
        margin: 4px 0;
        order: 2; /* decision-buttons 아래로 이동 */
    }
    
    .pitch-counter {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    
    .pitch-speed {
        font-size: 1rem;
        margin-bottom: 4px;
    }
    
    .pitch-type {
        font-size: 0.8rem;
        padding: 2px 4px;
    }
    
    .game-controls {
        gap: 6px;
        margin: 4px 0;
        order: 3;
    }
    
    .control-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    

}

@media (max-width: 480px) {
    .game-container {
        padding: 4px;
        margin: 0;
        border-radius: 8px;
    }
    
    .game-header h1 {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }
    
    .mobile-score-board {
        padding: 6px;
        margin: 3px 0;
    }
    
    .mobile-score-board .score-item .label {
        font-size: 0.6rem;
    }
    
    .mobile-score-board .score-item .value {
        font-size: 0.9rem;
    }
    
    .mobile-decision-buttons {
        margin: 6px 0;
        gap: 4px;
        max-width: 200px;
        top: 80%;
    }
    
    .mobile-decision-buttons .decision-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
        max-width: 90px;
        border-radius: 5px;
    }
    
    .mobile-decision-buttons .btn-text {
        font-size: 0.7rem;
    }
    
    .mobile-decision-buttons .btn-key {
        font-size: 0.55rem;
    }
    
    .out-count-display {
        gap: 10px;
        margin-bottom: 6px;
    }
    
    .out-circle {
        width: 20px;
        height: 20px;
    }
    

    
    .canvas-center-controls .start-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .canvas-pitch-info {
        top: 8px;
        left: 1px;
        padding: 4px 6px;
        min-width: 50px;
    }
    
    .canvas-pitch-info .pitch-counter {
        font-size: 0.6rem;
        margin-bottom: 2px;
    }
    
    .canvas-pitch-info .pitch-speed {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }
    
    .canvas-pitch-info .pitch-type {
        font-size: 0.6rem;
        padding: 1px 3px;
    }
    
    .game-layout {
        gap: 4px;
    }
    
    #3d-canvas-container {
        height: 220px;
        max-height: 35vh;
        border-radius: 8px;
        border: 2px solid #4a7c59;
        box-shadow: 
            0 4px 12px rgba(74, 124, 89, 0.2),
            0 0 0 1px rgba(255, 255, 255, 0.1);
        background: linear-gradient(135deg, #87ceeb 0%, #98d8e8 100%);
    }
    
    .game-sidebar {
        width: 100%;
    }
    
    .controls {
        gap: 4px;
    }
    
    .pitch-info {
        padding: 6px;
        top: 10%;
        order: 2;
    }
    
    .pitch-counter {
        font-size: 0.7rem;
        margin-bottom: 3px;
    }
    
    .pitch-speed {
        font-size: 0.9rem;
        margin-bottom: 3px;
    }
    
    .pitch-type {
        font-size: 0.7rem;
        padding: 2px 3px;
    }
    
    .game-controls {
        gap: 4px;
        margin: 3px 0;
        order: 3;
    }
    
    .control-btn {
        padding: 6px 8px;
        font-size: 0.7rem;
    }
    
    .instructions {
        margin-top: 8px;
        padding: 8px;
        font-size: 0.65rem;
    }
    
    .instructions h3 {
        margin-bottom: 4px;
        font-size: 0.8rem;
        cursor: pointer;
    }
    
    .toggle-instructions {
        font-size: 0.6rem;
    }
    
    .instructions.collapsed .toggle-instructions {
        transform: rotate(-90deg);
    }
    
    .instructions-content {
        transition: all 0.3s ease;
        overflow: hidden;
    }
    
    .instructions.collapsed .instructions-content {
        max-height: 0;
        opacity: 0;
    }
    

}

/* Animation Classes */
.ball-animation {
    animation: ballFly 1.5s ease-out;
}

@keyframes ballFly {
    0% {
        transform: translate(-100px, -100px) scale(0.5);
        opacity: 0.7;
    }
    50% {
        transform: translate(0, 0) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
}

.strike-zone-highlight {
    animation: zoneHighlight 0.5s ease-in-out;
}

@keyframes zoneHighlight {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.8;
    }
}

/* Button disabled state - 더 명확한 시각적 피드백 */
.decision-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    background: linear-gradient(135deg, #6c757d, #495057) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    position: relative;
}

.decision-btn:disabled::after {
    content: '대기 중...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.decision-btn:disabled .btn-text,
.decision-btn:disabled .btn-key {
    opacity: 0.3;
}

.decision-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* 토스트 알림 스타일 */
.toast-notification {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 300px;
    word-wrap: break-word;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast-notification.show {
    display: block;
    opacity: 1;
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* 게임 상태별 토스트 색상 */
.toast-notification.ready {
    background: rgba(52, 152, 219, 0.9);
}

.toast-notification.pitching {
    background: rgba(155, 89, 182, 0.9);
}

.toast-notification.decision {
    background: rgba(241, 196, 15, 0.9);
    color: #2c3e50;
}

.toast-notification.result {
    background: rgba(52, 73, 94, 0.9);
}

.toast-notification.replay {
    background: rgba(46, 204, 113, 0.9);
}

.toast-notification.correct {
    background: rgba(46, 204, 113, 0.9);
}

.toast-notification.incorrect {
    background: rgba(231, 76, 60, 0.9);
}

.toast-notification.gameover {
    background: rgba(155, 89, 182, 0.9);
    font-size: 18px;
    font-weight: bold;
}

/* 토스트 알림 반응형 스타일 */
@media (max-width: 768px) {
    .toast-notification {
        bottom: 20px;
        padding: 12px 20px;
        font-size: 14px;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .toast-notification {
        bottom: 60%;
        padding: 10px 18px;
        font-size: 12px;
        max-width: 260px;
    }
}

/* 플로팅 도움말 버튼 */
.floating-help-btn {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.floating-help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.floating-help-btn:active {
    transform: scale(0.95);
}

/* 도움말 모달 */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.help-modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.help-modal-content {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px 25px;
    border-bottom: 2px solid #f8f9fa;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px 15px 0 0;
}

.help-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-help-modal {
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.close-help-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.help-modal-body {
    padding: 25px;
}

.help-modal-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-modal-body li {
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    position: relative;
    padding-left: 25px;
    word-break: keep-all;
    word-wrap: break-word;
}

.help-modal-body li:last-child {
    border-bottom: none;
}

.help-modal-body li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
    font-size: 1.2rem;
}

/* 게임 내부 AdSense */
.game-adsense {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 푸터 */
.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    border-radius: 20px 20px 0 0;
    box-shadow: 
        0 -10px 30px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

/* 플로팅 공유 버튼 */
.floating-share-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 
        0 4px 15px rgba(76, 175, 80, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 22px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.floating-share-btn:hover {
    transform: scale(1.1);
    box-shadow: 
        0 6px 20px rgba(76, 175, 80, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* 플로팅 도움말 버튼 반응형 스타일 */
@media (max-width: 768px) {
    /* 게임 방법 모바일 최적화 */
    .help-modal-body li {
        padding: 8px 0;
        font-size: 0.9rem;
        line-height: 1.4;
        padding-left: 20px;
    }
    
    .help-modal-body li::before {
        font-size: 1rem;
    }
    
    .help-modal-content {
        max-width: 90%;
        margin: 20px;
    }
    .main-title {
        gap: 4px;
        margin-bottom: 15px;
    }
    
    .title-icon {
        font-size: 2.2rem;
        margin-bottom: 2px;
    }
    
    .title-text {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .title-subtitle {
        font-size: 0.9rem;
        margin-top: -2px;
        opacity: 0.9;
    }
    
    .floating-help-btn {
        left: 15px;
        bottom: 15px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .floating-share-btn {
        right: 15px;
        bottom: 15px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    /* 로고 컨테이너 모바일 스타일 */
    .logo-container {
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .logo-circle {
        width: 85px;
        height: 85px;
    }
    
    .logo-image {
        width: 80px;
        height: 80px;
    }
    
    /* 게임 컨테이너 모바일 여백 */
    .game-container {
        margin: 100px auto 0 auto;
    }
}

@media (max-width: 480px) {
    .floating-help-btn {
        left: 10px;
        bottom: 10px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .floating-share-btn {
        right: 10px;
        bottom: 10px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    /* 로고 컨테이너 작은 모바일 스타일 */
    .logo-container {
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .logo-circle {
        width: 75px;
        height: 75px;
    }
    
    .logo-image {
        width: 80px;
        height: 80px;
    }
    
    /* 게임 컨테이너 작은 모바일 여백 */
    .game-container {
        margin: 90px auto 0 auto;
    }
    
    /* 작은 모바일 타이틀 스타일 */
    .main-title {
        gap: 3px;
        margin-bottom: 12px;
    }
    
    .title-text {
        font-size: 1.5rem;
        line-height: 1.1;
    }
    
    .title-subtitle {
        font-size: 0.8rem;
        margin-top: -1px;
        opacity: 0.85;
    }
    
    .help-modal-content {
        max-width: 90%;
        margin: 20px;
    }
    
    .help-modal-header {
        padding: 15px 20px 10px 20px;
    }
    
    .help-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .help-modal-body {
        padding: 20px;
    }
    
    .help-modal-body li {
        font-size: 0.85rem;
        padding: 6px 0;
        line-height: 1.3;
        padding-left: 18px;
    }
    
    .help-modal-body li::before {
        font-size: 0.9rem;
    }
}

