/* 틱택토 게임 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 50%, #fff3e0 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(120, 190, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 200, 120, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(15px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header {
    text-align: center;
    padding: 30px 20px 20px;
    background: linear-gradient(135deg, #4a90e2 0%, #2c5aa0 100%);
    color: white;
}

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

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 광고 영역 */
.ad-container {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

/* 게임 정보 영역 */
.game-info {
    padding: 25px 20px;
    border-bottom: 2px solid #f0f0f0;
}

.players {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 15px;
    border: 2px solid #e1e5e9;
    min-width: 120px;
    transition: all 0.3s ease;
}

.player.active {
    border-color: #4a90e2;
    background: #4a90e2;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3);
}

.player-symbol {
    font-size: 2rem;
}

.player-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.player-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4a90e2;
}

.player.active .player-score {
    color: white;
}

.vs {
    font-weight: 700;
    font-size: 1.2rem;
    color: #4a90e2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-status {
    text-align: center;
}

.current-turn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #4a90e2 0%, #2c5aa0 100%);
    color: white;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

#turn-symbol {
    font-size: 1.5rem;
}

/* 게임 보드 */
.game-board {
    padding: 30px 20px;
    display: flex;
    justify-content: center;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    background: #4a90e2;
    padding: 8px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(74, 144, 226, 0.3);
}

.cell {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.cell:hover {
    background: #f0f8ff;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.cell.filled {
    cursor: not-allowed;
    background: #f8f9ff;
}

.cell.filled:hover {
    transform: none;
    background: #f8f9ff;
}

.cell.winner {
    background: #4CAF50 !important;
    color: white;
    animation: winnerPulse 0.6s ease;
}

@keyframes winnerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cell.placed {
    animation: placePiece 0.3s ease;
}

@keyframes placePiece {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* 게임 결과 */
.game-result {
    text-align: center;
    padding: 0 20px 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.game-result.show {
    opacity: 1;
    visibility: visible;
}

.result-message {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 15px;
    color: white;
    background: linear-gradient(135deg, #4a90e2 0%, #2c5aa0 100%);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.result-message.winner {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.result-message.draw {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

/* 게임 컨트롤 */
.game-controls {
    padding: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.game-controls button {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.play-again-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.play-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.reset-btn {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.3);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.4);
}

.new-game-btn {
    background: linear-gradient(135deg, #4a90e2 0%, #2c5aa0 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.new-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

/* 푸터 */
footer {
    text-align: center;
    padding: 20px;
    background: #f8f9ff;
    color: #666;
    font-size: 0.9rem;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .players {
        flex-direction: column;
        gap: 15px;
    }
    
    .vs {
        order: 2;
        transform: rotate(90deg);
    }
    
    .player {
        min-width: 200px;
        flex-direction: row;
        justify-content: space-between;
        padding: 15px 20px;
    }
    
    .cell {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .current-turn {
        flex-direction: column;
        gap: 5px;
        padding: 15px 20px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .game-controls button {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .game-info {
        padding: 20px 15px;
    }
    
    .game-board {
        padding: 20px 15px;
    }
    
    .cell {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .board {
        gap: 6px;
        padding: 6px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .result-message {
        font-size: 1.3rem;
        padding: 15px;
    }
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
    .container {
        background: rgba(30, 30, 30, 0.95);
        color: #e0e0e0;
    }
    
    .player {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .cell {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .cell:hover {
        background: #3a3a3a;
    }
    
    footer {
        background: #2a2a2a;
        color: #aaa;
    }
} 