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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    overflow-x: hidden;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    padding: 20px;
    text-align: center;
    max-width: 700px;
    width: 95%;
}

h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2.2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 15px 0;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    flex-wrap: wrap;
    gap: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.info-label {
    font-size: 0.8em;
    opacity: 0.9;
    margin-bottom: 3px;
}

.info-value {
    font-size: 1.1em;
    font-weight: bold;
}

.current-player {
    padding: 4px 12px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.2);
    font-weight: bold;
    transition: all 0.3s ease;
}

.current-player.red {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.current-player.blue {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
}

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

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button.ai-active {
    background: linear-gradient(135deg, #26de81 0%, #20bf6b 100%);
}

.game-board {
    margin: 20px auto;
    display: inline-block;
}

.board-container {
    position: relative;
    background: linear-gradient(135deg, #f7b731 0%, #fed330 100%);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.drop-zone {
    display: flex;
    margin-bottom: 10px;
    gap: 2px;
}

.drop-column {
    width: 60px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.drop-column:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.drop-column.disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.drop-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.drop-column:hover .drop-preview {
    transform: translate(-50%, -50%) scale(1);
}

.drop-preview.red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #ee5a52);
}

.drop-preview.blue {
    background: radial-gradient(circle at 30% 30%, #74b9ff, #0984e3);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(7, 60px);
    grid-template-rows: repeat(6, 60px);
    gap: 2px;
    background: #2d3748;
    border-radius: 10px;
    padding: 10px;
}

.cell {
    width: 60px;
    height: 60px;
    background: #4a5568;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.cell.empty {
    background: radial-gradient(circle, #e2e8f0 0%, #cbd5e0 100%);
}

.cell.red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #ee5a52);
    box-shadow: 0 4px 8px rgba(238, 90, 82, 0.3);
}

.cell.blue {
    background: radial-gradient(circle at 30% 30%, #74b9ff, #0984e3);
    box-shadow: 0 4px 8px rgba(9, 132, 227, 0.3);
}

.cell.winning {
    animation: winningPulse 1s infinite;
    z-index: 10;
}

@keyframes winningPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(255,215,0,0.8);
    }
}

.cell.dropping {
    animation: dropAnimation 0.5s ease-out;
}

@keyframes dropAnimation {
    0% {
        transform: translateY(-300px);
        opacity: 0;
    }
    70% {
        transform: translateY(10px);
        opacity: 1;
    }
    85% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.column-indicators {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    opacity: 0.7;
}

.column-indicator {
    width: 60px;
    text-align: center;
    font-size: 12px;
    color: #4a5568;
    font-weight: bold;
}

.game-status {
    margin: 20px 0;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.status-message {
    font-size: 1.1em;
    font-weight: bold;
    color: #4a5568;
    padding: 10px 20px;
    background: #f7fafc;
    border-radius: 20px;
    border: 2px solid #e2e8f0;
}

.thinking-indicator {
    font-size: 1em;
    color: #667eea;
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    animation: thinking 1.5s infinite;
}

@keyframes thinking {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.victory-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    z-index: 1000;
    animation: victoryAppear 0.5s ease;
}

@keyframes victoryAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.victory-message h2 {
    font-size: 2em;
    margin-bottom: 20px;
    animation: victoryText 2s infinite;
}

@keyframes victoryText {
    0%, 100% { color: #FFD700; }
    50% { color: #FFA500; }
}

.victory-stats {
    margin: 20px 0;
    font-size: 1.1em;
}

.victory-stats div {
    margin: 8px 0;
}

.instructions {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
    border-radius: 15px;
    color: white;
    text-align: left;
}

.instructions h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
    text-align: center;
}

.instructions ul {
    margin-left: 20px;
    line-height: 1.6;
}

.instructions li {
    margin: 8px 0;
}

.instructions li strong {
    color: #FFD700;
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
        width: 98%;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .game-info {
        flex-direction: row;
        justify-content: space-between;
        gap: 5px;
    }
    
    .info-item {
        min-width: 60px;
    }
    
    .info-label {
        font-size: 0.7em;
    }
    
    .info-value {
        font-size: 1em;
    }
    
    .controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    button {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .game-grid {
        grid-template-columns: repeat(7, 50px);
        grid-template-rows: repeat(6, 50px);
        gap: 1px;
    }
    
    .cell, .drop-column {
        width: 50px;
        height: 50px;
    }
    
    .drop-preview {
        width: 35px;
        height: 35px;
    }
    
    .column-indicator {
        width: 50px;
        font-size: 11px;
    }
    
    .instructions {
        text-align: center;
        padding: 15px;
    }
    
    .instructions ul {
        margin-left: 0;
        list-style-position: inside;
    }
    
    .instructions li {
        font-size: 0.9em;
    }
    
    .victory-message {
        width: 90%;
        padding: 30px 20px;
    }
    
    .status-message {
        font-size: 1em;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: repeat(7, 40px);
        grid-template-rows: repeat(6, 40px);
    }
    
    .cell, .drop-column {
        width: 40px;
        height: 40px;
    }
    
    .drop-preview {
        width: 28px;
        height: 28px;
    }
    
    .column-indicator {
        width: 40px;
        font-size: 10px;
    }
    
    .info-item {
        min-width: 50px;
    }
    
    .info-label {
        font-size: 0.6em;
    }
    
    .info-value {
        font-size: 0.9em;
    }
    
    button {
        padding: 6px 12px;
        font-size: 11px;
    }
}