/**
 * Tic Tac Toe Game Styles
 * Matches app theme with dark abstract design and glassmorphism
 */

/* ============================================
   CSS VARIABLES (Matching App Theme)
   ============================================ */
:root {
    --ttt-primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --ttt-secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --ttt-success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --ttt-warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    --ttt-bg-dark-base: #0a0a12;
    --ttt-bg-dark-layer1: #0f0f18;
    --ttt-bg-dark-layer2: #12121a;
    --ttt-bg-dark-layer3: #151520;
    --ttt-bg-glass: rgba(30, 41, 59, 0.95);
    --ttt-bg-glass-hover: rgba(15, 23, 42, 0.98);
    --ttt-bg-glass-light: rgba(35, 32, 45, 0.5);
    
    --ttt-border-glass: rgba(102, 126, 234, 0.25);
    --ttt-border-glass-hover: rgba(102, 126, 234, 0.4);
    --ttt-border-glow: rgba(102, 126, 234, 0.6);
    
    --ttt-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --ttt-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --ttt-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --ttt-glow-primary: 0 0 20px rgba(102, 126, 234, 0.4);
}

/* ============================================
   WRAPPER & LAYOUT
   ============================================ */
.tic-tac-toe-wrapper {
    min-height: calc(100vh - 120px);
    padding: 1.5rem 0;
    background: var(--ttt-bg-dark-base);
    position: relative;
    overflow: hidden;
}

.tic-tac-toe-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(240, 147, 251, 0.1) 0%, transparent 60%);
    pointer-events: none;
    animation: gradientShift 15s ease infinite;
}

.tic-tac-toe-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(102, 126, 234, 0.03) 2px, rgba(102, 126, 234, 0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(118, 75, 162, 0.03) 2px, rgba(118, 75, 162, 0.03) 4px);
    pointer-events: none;
    opacity: 0.5;
}

.tic-tac-toe-wrapper .container {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

/* ============================================
   GAME HEADER SECTION
   ============================================ */
.game-header-section {
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s ease-out;
}

.game-header-content {
    text-align: center;
}

.game-title-wrapper {
    margin-bottom: 1.5rem;
}

.game-icon-wrapper {
    display: inline-block;
    margin-bottom: 0.75rem;
    animation: iconFloat 3s ease-in-out infinite;
    position: relative;
}

.game-icon-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseGlow 2s ease-in-out infinite;
}

.game-main-icon {
    font-size: 3.5rem;
    background: var(--ttt-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.6));
    position: relative;
    z-index: 1;
}

.game-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin: 0;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 30px rgba(102, 126, 234, 0.3);
    letter-spacing: -0.5px;
    position: relative;
}

.game-meta-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.difficulty-badge {
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: capitalize;
    display: inline-flex;
    align-items: center;
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--ttt-shadow-md);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

.difficulty-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--ttt-shadow-lg);
    border-color: rgba(255, 255, 255, 0.3);
}

.difficulty-easy {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.9) 100%);
}

.difficulty-medium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(217, 119, 6, 0.9) 100%);
}

.difficulty-hard {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
}

.coin-reward-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.95) 0%, rgba(245, 158, 11, 0.95) 100%);
    border-radius: 50px;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: var(--ttt-shadow-md), 0 0 20px rgba(251, 191, 36, 0.3);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.coin-amount {
    font-size: 1.1rem;
    font-weight: 800;
}

.coin-label {
    font-size: 0.8rem;
    opacity: 0.95;
}

/* ============================================
   GAME STATS SECTION
   ============================================ */
.game-stats-section {
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--ttt-bg-glass);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
    border: 1.5px solid var(--ttt-border-glass);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--ttt-shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ttt-primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ttt-shadow-lg), var(--ttt-glow-primary);
    border-color: var(--ttt-border-glass-hover);
    background: var(--ttt-bg-glass-hover);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon-wrapper {
    margin-bottom: 0.75rem;
    font-size: 1.75rem;
    opacity: 0.9;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.stat-content {
    color: white;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    opacity: 0.85;
    color: rgba(255, 255, 255, 0.9);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    line-height: 1;
    color: white;
}

.stat-card-player {
    color: #10b981;
}

.stat-card-player .stat-icon-wrapper {
    color: #10b981;
    filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.5));
}

.stat-card-draws {
    color: #6366f1;
}

.stat-card-draws .stat-icon-wrapper {
    color: #6366f1;
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.5));
}

.stat-card-ai {
    color: #ef4444;
}

.stat-card-ai .stat-icon-wrapper {
    color: #ef4444;
    filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.5));
}

/* ============================================
   GAME STATUS SECTION
   ============================================ */
.game-status-section {
    margin-bottom: 2rem;
    text-align: center;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.game-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: var(--ttt-bg-glass);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: 1.5px solid var(--ttt-border-glass);
    box-shadow: var(--ttt-shadow-md);
    transition: all 0.3s ease;
}

.game-status-badge:hover {
    border-color: var(--ttt-border-glass-hover);
    box-shadow: var(--ttt-shadow-lg), var(--ttt-glow-primary);
}

.game-status-badge i {
    font-size: 1.1rem;
    animation: pulse 2s ease-in-out infinite;
    color: #8b5cf6;
}

/* ============================================
   GAME BOARD SECTION
   ============================================ */
.game-board-section {
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.board-container {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    background: var(--ttt-bg-glass);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1.5px solid var(--ttt-border-glass);
    box-shadow: var(--ttt-shadow-lg);
    position: relative;
    overflow: hidden;
}

.board-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.05) 0%, 
        transparent 50%,
        rgba(118, 75, 162, 0.05) 100%);
    pointer-events: none;
}

.tic-tac-toe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    position: relative;
    z-index: 1;
}

.tic-tac-toe-cell {
    aspect-ratio: 1;
    background: linear-gradient(135deg, 
        rgba(30, 41, 59, 0.95) 0%, 
        rgba(15, 23, 42, 0.98) 100%);
    border: 2px solid var(--ttt-border-glass);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 3.5rem;
    font-weight: 900;
    color: #ffffff;
    position: relative;
    box-shadow: var(--ttt-shadow-sm);
    touch-action: manipulation;
    user-select: none;
    overflow: hidden;
}

.tic-tac-toe-cell::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    border-radius: 50%;
}

.tic-tac-toe-cell:hover:not(.disabled)::before {
    width: 200%;
    height: 200%;
}

.tic-tac-toe-cell:hover:not(.disabled) {
    background: linear-gradient(135deg, 
        rgba(51, 65, 85, 0.95) 0%, 
        rgba(30, 41, 59, 0.98) 100%);
    border-color: var(--ttt-border-glass-hover);
    transform: scale(1.05) translateY(-2px);
    box-shadow: var(--ttt-shadow-md), var(--ttt-glow-primary);
}

.tic-tac-toe-cell:active:not(.disabled) {
    transform: scale(0.95);
}

.tic-tac-toe-cell.disabled {
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

.tic-tac-toe-cell.player {
    color: #10b981;
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.2) 0%, 
        rgba(5, 150, 105, 0.15) 100%);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    animation: cellPlace 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tic-tac-toe-cell.ai {
    color: #ef4444;
    background: linear-gradient(135deg, 
        rgba(239, 68, 68, 0.2) 0%, 
        rgba(220, 38, 38, 0.15) 100%);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    animation: cellPlace 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tic-tac-toe-cell.winning {
    animation: winningCell 0.8s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.8), 
                0 0 60px rgba(251, 191, 36, 0.4);
    z-index: 10;
    border-color: rgba(251, 191, 36, 0.8);
    background: linear-gradient(135deg, 
        rgba(251, 191, 36, 0.2) 0%, 
        rgba(245, 158, 11, 0.15) 100%);
}

/* ============================================
   GAME CONTROLS SECTION
   ============================================ */
.game-controls-section {
    margin-bottom: 2rem;
    text-align: center;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.btn-reset-game {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--ttt-primary-gradient);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--ttt-shadow-md), var(--ttt-glow-primary);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-reset-game::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-reset-game:hover::before {
    width: 300px;
    height: 300px;
}

.btn-reset-game:hover {
    transform: translateY(-3px);
    box-shadow: var(--ttt-shadow-lg), var(--ttt-glow-primary), 
                0 0 30px rgba(102, 126, 234, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-reset-game:active {
    transform: translateY(-1px);
}

.btn-reset-game:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-reset-game i {
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.btn-reset-game span {
    position: relative;
    z-index: 1;
}

/* ============================================
   DIFFICULTY SECTION
   ============================================ */
.difficulty-section {
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.difficulty-container {
    background: var(--ttt-bg-glass);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1.5px solid var(--ttt-border-glass);
    box-shadow: var(--ttt-shadow-md);
}

.difficulty-header {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.difficulty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1.5px solid var(--ttt-border-glass);
    color: white;
    background: rgba(30, 41, 59, 0.6);
    box-shadow: var(--ttt-shadow-sm);
    backdrop-filter: blur(5px);
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--ttt-shadow-md);
    border-color: var(--ttt-border-glass-hover);
    background: rgba(51, 65, 85, 0.7);
}

.difficulty-btn-easy.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.9) 100%);
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: var(--ttt-shadow-md), 0 0 20px rgba(16, 185, 129, 0.4);
}

.difficulty-btn-medium.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9) 0%, rgba(217, 119, 6, 0.9) 100%);
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: var(--ttt-shadow-md), 0 0 20px rgba(245, 158, 11, 0.4);
}

.difficulty-btn-hard.active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9) 0%, rgba(220, 38, 38, 0.9) 100%);
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: var(--ttt-shadow-md), 0 0 20px rgba(239, 68, 68, 0.4);
}

/* ============================================
   MODAL STYLES
   ============================================ */
.tic-tac-toe-modal .modal-dialog {
    max-width: 450px;
}

.game-modal-content {
    background: var(--ttt-bg-glass);
    backdrop-filter: blur(15px);
    border: 1.5px solid var(--ttt-border-glass);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--ttt-shadow-xl), var(--ttt-glow-primary);
}

.game-over-modal {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: var(--ttt-shadow-xl), 0 0 30px rgba(239, 68, 68, 0.3);
}

.game-over-modal .modal-icon-wrapper i {
    color: #ef4444;
    filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.6));
}

.game-over-modal .modal-icon-wrapper i.fa-handshake {
    color: #6366f1;
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.6));
}

.game-modal-header {
    border: 0;
    padding: 1.25rem 1.5rem 0;
    display: flex;
    justify-content: flex-end;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid var(--ttt-border-glass);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    backdrop-filter: blur(5px);
    pointer-events: auto !important;
    z-index: 10001;
    position: relative;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
    border-color: var(--ttt-border-glass-hover);
}

.btn-close-modal:active {
    transform: rotate(90deg) scale(0.9);
}

.game-modal-body {
    padding: 2rem 1.5rem;
    text-align: center;
    color: white;
}

.modal-icon-wrapper {
    margin-bottom: 1.5rem;
}

.modal-icon-wrapper i {
    font-size: 4rem;
    background: var(--ttt-primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.6));
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.modal-message {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

.modal-coins-display {
    margin-bottom: 2rem;
}

.coins-earned-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.75rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.95) 0%, rgba(245, 158, 11, 0.95) 100%);
    border-radius: 50px;
    color: white;
    font-weight: 700;
    box-shadow: var(--ttt-shadow-md), 0 0 20px rgba(251, 191, 36, 0.4);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.coins-amount {
    font-size: 1.5rem;
    font-weight: 800;
}

.coins-text {
    font-size: 0.9rem;
    opacity: 0.95;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-modal {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 1.75rem;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1.5px solid transparent;
    cursor: pointer;
}

.btn-modal-primary {
    background: var(--ttt-primary-gradient);
    color: white;
    box-shadow: var(--ttt-shadow-md), var(--ttt-glow-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-modal-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--ttt-shadow-lg), var(--ttt-glow-primary), 
                0 0 30px rgba(102, 126, 234, 0.6);
    color: white;
}

.btn-modal-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: var(--ttt-border-glass);
    backdrop-filter: blur(5px);
}

.btn-modal-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
    border-color: var(--ttt-border-glass-hover);
}

/* ============================================
   GAME LOSE ALERT
   ============================================ */
.game-lose-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    min-width: 320px;
    max-width: 90%;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 1.25rem 1.75rem;
    box-shadow: var(--ttt-shadow-lg), 0 0 30px rgba(239, 68, 68, 0.5);
    animation: slideDown 0.4s ease-out;
    backdrop-filter: blur(10px);
}

.game-lose-alert i {
    animation: shake 0.5s ease-in-out;
}

.game-lose-alert strong {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
    font-weight: 800;
}

.game-lose-alert .small {
    font-size: 0.9rem;
    opacity: 0.95;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes gradientShift {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

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

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

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes cellPlace {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes winningCell {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(251, 191, 36, 0.8), 
                    0 0 60px rgba(251, 191, 36, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 40px rgba(251, 191, 36, 1), 
                    0 0 80px rgba(251, 191, 36, 0.6);
    }
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-8deg); }
    20%, 40%, 60%, 80% { transform: rotate(8deg); }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 576px) {
    .tic-tac-toe-wrapper {
        padding: 1rem 0;
    }

    .game-title {
        font-size: 2rem;
    }

    .game-main-icon {
        font-size: 2.5rem;
    }

    .stats-container {
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem 0.75rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-icon-wrapper {
        font-size: 1.5rem;
    }

    .tic-tac-toe-board {
        gap: 8px;
        max-width: 100%;
    }

    .tic-tac-toe-cell {
        font-size: 2.5rem;
        border-radius: 12px;
    }

    .board-container {
        padding: 1rem;
    }

    .game-status-badge {
        font-size: 0.9rem;
        padding: 0.75rem 1.5rem;
    }

    .btn-reset-game {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .difficulty-container {
        padding: 1.25rem;
    }

    .difficulty-buttons {
        gap: 0.5rem;
    }

    .difficulty-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .game-meta-info {
        gap: 0.75rem;
    }

    .difficulty-badge,
    .coin-reward-badge {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-icon-wrapper i {
        font-size: 3rem;
    }

    .btn-modal {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .game-lose-alert {
        min-width: 280px;
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 400px) {
    .tic-tac-toe-cell {
        font-size: 2rem;
    }

    .stats-container {
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.875rem 0.5rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }
}
