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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    background-color: rgba(30, 30, 46, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 2px solid #0f3460;
}

header {
    background: linear-gradient(90deg, #0f3460 0%, #1a1a2e 100%);
    padding: 20px;
    text-align: center;
    border-bottom: 3px solid #44ff44;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 2.8rem;
    color: #44ff44;
    text-shadow: 0 0 10px rgba(68, 255, 68, 0.7);
    letter-spacing: 1px;
}

h1 i {
    margin-right: 15px;
    color: #ff4444;
}

.status-panel {
    background-color: rgba(15, 52, 96, 0.7);
    padding: 15px;
    margin: 20px;
    border-radius: 10px;
    border: 1px solid #0f3460;
}

.player-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.player-stat {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.player-stat.red {
    background-color: rgba(255, 68, 68, 0.2);
    border: 2px solid #ff4444;
    color: #ff8888;
}

.player-stat.green {
    background-color: rgba(68, 255, 68, 0.2);
    border: 2px solid #44ff44;
    color: #88ff88;
}

.vs-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 20px;
    color: #ffffff;
    text-shadow: 0 0 5px #ff4444, 0 0 5px #44ff44;
}

.player-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #cccccc;
}

.player-percent {
    font-size: 1.8rem;
    display: block;
    font-family: 'Orbitron', sans-serif;
}

.game-status {
    text-align: center;
    font-size: 1.3rem;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 10px;
    color: #ffff88;
    font-weight: bold;
}

.turn-indicator {
    text-align: center;
    font-size: 1.1rem;
    padding: 8px;
    background-color: rgba(68, 68, 255, 0.2);
    border-radius: 8px;
    border: 1px solid #4444ff;
    color: #8888ff;
}

.turn-indicator .fa-spinner {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

.turn-indicator .fa-gamepad {
    color: #44ff44;
    margin-right: 8px;
}

.turn-indicator .fa-trophy {
    color: #ffd700;
    margin-right: 8px;
}

.turn-indicator .fa-times-circle {
    color: #ff4444;
    margin-right: 8px;
}

.turn-indicator .fa-user-clock {
    color: #ffaa44;
    margin-right: 8px;
}

.turn-indicator .fa-check-circle {
    color: #44ff44;
    margin-right: 8px;
}

.turn-indicator .fa-play-circle {
    color: #44aaff;
    margin-right: 8px;
}

.turn-indicator .fa-hourglass-half {
    color: #ff8844;
    margin-right: 8px;
}

.turn-indicator .fa-user-slash {
    color: #ff4444;
    margin-right: 8px;
}

.turn-indicator .fa-plug {
    color: #ff8844;
    margin-right: 8px;
}

.turn-indicator .fa-redo {
    color: #8844ff;
    margin-right: 8px;
}

.turn-indicator .fa-users {
    color: #4488ff;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.game-container {
    display: flex;
    flex-wrap: wrap;
    margin: 20px;
    gap: 20px;
}

.game-board {
    flex: 2;
    min-width: 300px;
    background-color: #333;
    border: 4px solid #000;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    display: grid;
    grid-template-columns: repeat(40, 1fr);
    grid-template-rows: repeat(20, 1fr);
    aspect-ratio: 2 / 1;
}

.pixel {
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s, transform 0.1s;
    cursor: default;
}

.pixel:hover {
    transform: scale(1.05);
    z-index: 1;
}

.pixel.available {
    cursor: pointer;
    position: relative;
    border: 2px dashed yellow !important;
    z-index: 2;
}

.pixel.available::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid yellow;
    animation: borderGlow 1.5s infinite;
}

.pixel.available:hover {
    border: 2px solid white !important;
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 0 10px white;
}

@keyframes borderGlow {
    0% { border-color: yellow; opacity: 1; }
    50% { border-color: white; opacity: 0.7; }
    100% { border-color: yellow; opacity: 1; }
}

@keyframes pixelPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.game-info {
    flex: 1;
    min-width: 250px;
    background-color: rgba(15, 52, 96, 0.7);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #0f3460;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.ready-btn, .reset-btn, .modal-btn {
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ready-btn {
    background: linear-gradient(135deg, #44ff44 0%, #00cc00 100%);
    color: #003300;
}

.ready-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #66ff66 0%, #00ee00 100%);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(68, 255, 68, 0.4);
}

.ready-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ready-btn:not(:disabled) {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(68, 255, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(68, 255, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(68, 255, 68, 0); }
}

.reset-btn {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #ff6666 0%, #ee0000 100%);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.4);
}

.instructions {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
}

.instructions h3 {
    color: #44ff44;
    margin-bottom: 10px;
    font-family: 'Orbitron', sans-serif;
}

.instructions ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.instructions li {
    margin-bottom: 8px;
    color: #cccccc;
}

.player-info {
    background-color: rgba(68, 68, 255, 0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #4444ff;
}

.player-info p {
    margin-bottom: 10px;
    color: #8888ff;
}

.player-info i {
    margin-right: 10px;
    width: 20px;
}

footer {
    text-align: center;
    padding: 15px;
    background-color: rgba(15, 52, 96, 0.7);
    border-top: 1px solid #0f3460;
    color: #8888ff;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 3px solid #44ff44;
    box-shadow: 0 0 30px rgba(68, 255, 68, 0.5);
}

.modal h2 {
    color: #44ff44;
    margin-bottom: 20px;
    font-family: 'Orbitron', sans-serif;
}

.modal p {
    margin-bottom: 25px;
    font-size: 1.2rem;
    color: #ffffff;
    line-height: 1.5;
}

.modal-btn {
    background: linear-gradient(135deg, #4444ff 0%, #0000cc 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn:hover {
    background: linear-gradient(135deg, #6666ff 0%, #0000ee 100%);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(68, 68, 255, 0.4);
}

/* Naprawione kolory dla graczy */
.player-stat.red .player-label::after {
    content: " (Przeciwnik)";
}

.player-stat.green .player-label::after {
    content: " (Ty)";
}

/* Responsywność */
@media (max-width: 900px) {
    .game-container {
        flex-direction: column;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .player-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .vs-text {
        margin: 10px 0;
    }
    
    .game-board {
        aspect-ratio: 1.5 / 1;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .player-stat {
        padding: 10px;
        font-size: 1rem;
    }
    
    .player-percent {
        font-size: 1.5rem;
    }
    
    .game-status {
        font-size: 1.1rem;
    }
    
    .turn-indicator {
        font-size: 1rem;
    }
}
