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

body {
    font-family: 'Arial', sans-serif;
    background: #0a0a0a;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(86, 82, 84, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(255, 255, 0, 0.05) 0%, transparent 50%);
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 
        0 0 10px #87ceeb,
        0 0 20px #87ceeb,
        0 0 30px #87ceeb;
    color: #87ceeb;
    animation: neonSoftBlueGlow 2s ease-in-out infinite;
}

@keyframes neonSoftBlueGlow {
    0%, 100% { 
        text-shadow: 
            0 0 10px #87ceeb,
            0 0 20px #87ceeb,
            0 0 30px #87ceeb;
    }
    50% { 
        text-shadow: 
            0 0 15px #87ceeb,
            0 0 25px #87ceeb,
            0 0 35px #87ceeb,
            0 0 45px #87ceeb;
    }
}

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

.game-board {
    display: grid;
    grid-template-columns: 1fr 300px 1fr;
    gap: 30px;
    margin-bottom: 40px;
    align-items: center;
}

.player-section {
    text-align: center;
}

.player-info h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

.card-count {
    font-size: 1.1rem;
    margin-bottom: 20px;
    background: rgba(255, 20, 147, 0.2);
    border: 1px solid #ff1493;
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.3);
}

.card-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    min-height: 150px;
}

.deck {
    position: relative;
}

.deck .card {
    width: 100px;
    height: 140px;
    background: #000;
    border: 2px solid #00ffff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 10px;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.5),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.deck .card.back {
    background: linear-gradient(135deg, #ff1493, #00ffff);
    box-shadow: 
        0 0 30px rgba(255, 20, 147, 0.6),
        0 0 60px rgba(0, 255, 255, 0.4);
}

.deck .card.back::before {
    content: '⚔️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.deck .card.flipped {
    transform: rotateY(180deg);
}

.deck .card.shuffling {
    animation: shuffle 0.8s ease-in-out infinite;
}

@keyframes shuffle {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    25% { 
        transform: translateY(-20px) rotate(-5deg); 
    }
    50% { 
        transform: translateY(-40px) rotate(5deg); 
    }
    75% { 
        transform: translateY(-20px) rotate(-3deg); 
    }
}

.sword-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
    display: none;
}

.sword {
    font-size: 4rem;
    color: #ffff00;
    text-shadow: 
        0 0 20px #ffff00,
        0 0 40px #ffff00,
        0 0 60px #ffff00;
    animation: swordSlash 1.5s ease-out forwards;
}

@keyframes swordSlash {
    0% {
        transform: translateX(-100px) translateY(-100px) rotate(-45deg) scale(0.5);
        opacity: 0;
    }
    20% {
        opacity: 1;
        transform: translateX(-50px) translateY(-50px) rotate(-22deg) scale(0.8);
    }
    50% {
        transform: translateX(0) translateY(0) rotate(0deg) scale(1.2);
    }
    80% {
        transform: translateX(50px) translateY(50px) rotate(22deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(100px) translateY(100px) rotate(45deg) scale(0.5);
        opacity: 0;
    }
}

.sword-impact {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #ff4500;
    text-shadow: 
        0 0 30px #ff4500,
        0 0 60px #ff4500;
    animation: impact 0.8s ease-out forwards;
    z-index: 1001;
}

@keyframes impact {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.played-card {
    width: 80px;
    height: 120px;
    border: 2px solid #00ffff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 
        0 0 15px rgba(0, 255, 255, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.played-card.red {
    background: #0a0a0a;
    color: #ff1493;
    text-shadow: 0 0 5px #ff1493;
}

.played-card.black {
    background: #0a0a0a;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

.played-card.joker {
    background: linear-gradient(45deg, #ff1493, #ffff00, #00ff00, #00ffff, #ff1493);
    background-size: 400% 400%;
    animation: neonGlow 2s ease-in-out infinite;
    color: #000;
    font-weight: bold;
}

.card-value {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.card-suit {
    font-size: 1.5rem;
}

.middle-section {
    text-align: center;
}

.game-status {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn:not(:disabled) {
    background: linear-gradient(45deg, #ff1493, #00ffff);
    color: #000;
    box-shadow: 0 0 15px rgba(255, 20, 147, 0.5);
}

.btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(255, 20, 147, 0.8);
}

.btn:disabled {
    background: #666;
    color: #ccc;
    cursor: not-allowed;
}

.war-indicator {
    background: linear-gradient(45deg, #ff4500, #ffff00);
    border: 2px solid #ff4500;
    padding: 15px;
    border-radius: 10px;
    animation: pulse 1s infinite, neonBorder 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.6);
}

@keyframes neonBorder {
    0%, 100% { border-color: #ff4500; box-shadow: 0 0 20px rgba(255, 69, 0, 0.6); }
    50% { border-color: #ffff00; box-shadow: 0 0 20px rgba(255, 255, 0, 0.6); }
}

.war-indicator h3 {
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

footer {
    text-align: center;
    margin-top: 40px;
}

.game-rules {
    background: rgba(255, 255, 0, 0.1);
    border: 1px solid #ffff00;
    padding: 20px;
    border-radius: 10px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.3);
}

.game-rules h3 {
    color: #32cd32;
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-shadow: 0 0 10px #32cd32;
}

.game-rules ul {
    list-style: none;
    text-align: left;
}

.game-rules li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.game-rules li::before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #ff1493;
    text-shadow: 0 0 5px #ff1493;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 2px;
        margin: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .game-container {
        max-width: 90%;
        width: 90%;
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    header {
        text-align: center;
        margin-bottom: 5px;
        width: 100%;
    }
    
    header h1 {
        font-size: 1.6rem;
        margin-bottom: 2px;
        color: #87ceeb;
        text-shadow: 0 0 15px rgba(135, 206, 235, 0.8);
    }
    
    header p {
        font-size: 0.8rem;
        margin-bottom: 0;
    }
    
    .game-board {
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: 1;
        width: 100%;
    }
    
    .player-section {
        background: rgba(0, 0, 0, 0.8);
        border: 2px solid #00ffff;
        border-radius: 15px;
        padding: 6px;
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
        width: 100%;
    }
    
    .player-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 4px;
        padding: 0 3px;
    }
    
    .player-info h2 {
        font-size: 1rem;
        margin: 0;
        color: #00ffff;
        text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    }
    
    .card-count {
        font-size: 0.8rem;
        color: #ffff00;
        text-shadow: 0 0 5px rgba(255, 255, 0, 0.5);
    }
    
    .card-area {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 12px;
        min-height: 70px;
        padding: 2px;
    }
    
    .deck {
        position: relative;
        margin: 0;
    }
    
    .deck .card {
        width: 95px;
        height: 133px;
        margin: 0;
        border-radius: 8px;
    }
    
    .deck .card.back {
        background: linear-gradient(135deg, #1a1a2e, #16213e);
        border: 2px solid #00ffff;
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    }
    
    .deck .card.back::before {
        font-size: 2.8rem;
        color: #00ffff;
        text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    }
    
    .played-card {
        width: 95px;
        height: 133px;
        margin: 0;
        border: 2px solid #00ffff;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        padding: 8px;
        background: #000;
        box-shadow: 
            0 0 15px rgba(0, 255, 255, 0.3),
            inset 0 0 15px rgba(0, 255, 255, 0.1);
    }
    
    .played-card .card-value {
        font-size: 1.2rem;
        font-weight: bold;
    }
    
    .played-card .card-suit {
        font-size: 1.8rem;
    }
    
    .played-card.red {
        color: #ff1493;
        text-shadow: 0 0 8px rgba(255, 20, 147, 0.5);
    }
    
    .played-card.black {
        color: #00ffff;
        text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
    }
    
    .played-card.joker {
        color: #ffff00;
        text-shadow: 0 0 8px rgba(255, 255, 0, 0.5);
    }
    
    .middle-section {
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #ff1493;
        border-radius: 15px;
        padding: 8px;
        box-shadow: 0 0 20px rgba(255, 20, 147, 0.3);
        text-align: center;
        width: 100%;
        order: 3;
    }
    
    .game-status {
        font-size: 0.8rem;
        margin-bottom: 8px;
        padding: 6px;
        background: rgba(0, 0, 0, 0.8);
        border: 1px solid #00ffff;
        border-radius: 8px;
        color: #00ffff;
        text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    }
    
    .controls {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 5px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.7rem;
        min-width: 80px;
        border-radius: 8px;
        border: 2px solid #00ffff;
        background: linear-gradient(135deg, #1a1a2e, #16213e);
        color: #00ffff;
        text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
        transition: all 0.3s ease;
    }
    
    .btn:hover {
        background: linear-gradient(135deg, #16213e, #1a1a2e);
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
        transform: translateY(-2px);
    }
    
    .war-indicator {
        margin-bottom: 5px;
    }
    
    .war-indicator h3 {
        font-size: 1rem;
        margin: 0;
        color: #ff1493;
        text-shadow: 0 0 10px rgba(255, 20, 147, 0.8);
    }
    
    .sword {
        font-size: 2rem;
    }
    
    .sword-impact {
        font-size: 1rem;
    }
    
    footer {
        display: none;
    }
    
    @keyframes shuffle {
        0%, 100% { 
            transform: translateY(0) rotate(0deg); 
        }
        25% { 
            transform: translateY(-10px) rotate(-2deg); 
        }
        50% { 
            transform: translateY(-20px) rotate(2deg); 
        }
        75% { 
            transform: translateY(-10px) rotate(-1deg); 
        }
    }
}

@media (max-width: 480px) {
    body {
        padding: 1px;
    }
    
    .game-container {
        max-width: 90%;
        width: 90%;
    }
    
    header h1 {
        font-size: 1.4rem;
        color: #87ceeb;
        text-shadow: 0 0 12px rgba(135, 206, 235, 0.8);
    }
    
    header p {
        font-size: 0.7rem;
    }
    
    .player-info h2 {
        font-size: 0.9rem;
    }
    
    .card-count {
        font-size: 0.7rem;
    }
    
    .card-area {
        gap: 8px;
        min-height: 60px;
    }
    
    .deck .card {
        width: 85px;
        height: 119px;
    }
    
    .deck .card.back::before {
        font-size: 2.5rem;
    }
    
    .played-card {
        width: 85px;
        height: 119px;
        padding: 6px;
    }
    
    .played-card .card-value {
        font-size: 1.1rem;
    }
    
    .played-card .card-suit {
        font-size: 1.6rem;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 0.6rem;
        min-width: 70px;
    }
    
    .game-status {
        font-size: 0.7rem;
        padding: 4px;
        margin-bottom: 5px;
    }
    
    .war-indicator h3 {
        font-size: 0.9rem;
    }
    
    .sword {
        font-size: 1.8rem;
    }
    
    .sword-impact {
        font-size: 0.9rem;
    }
    
    @keyframes shuffle {
        0%, 100% { 
            transform: translateY(0) rotate(0deg); 
        }
        25% { 
            transform: translateY(-6px) rotate(-1deg); 
        }
        50% { 
            transform: translateY(-12px) rotate(1deg); 
        }
        75% { 
            transform: translateY(-6px) rotate(-0.5deg); 
        }
    }
}

/* Touch-friendly adjustments */
@media (hover: none) {
    .deck .card {
        cursor: pointer;
        transition: transform 0.2s ease;
    }
    
    .deck .card:active {
        transform: scale(0.95);
    }
    
    .btn {
        cursor: pointer;
        transition: transform 0.2s ease;
    }
    
    .btn:active {
        transform: scale(0.95);
    }
}

/* Card flip animation */
.card-flip {
    animation: flipCard 0.6s ease-in-out;
}

@keyframes flipCard {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

/* Win animation */
.win-animation {
    animation: winPulse 0.8s ease-in-out;
}

@keyframes winPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); box-shadow: 0 0 30px rgba(255, 255, 0, 1); }
    100% { transform: scale(1); }
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #ff1493;
    position: absolute;
    animation: confetti-fall 3s linear infinite;
}

.confetti:nth-child(odd) {
    background: #00ffff;
    width: 8px;
    height: 8px;
    animation-duration: 2.5s;
}

.confetti:nth-child(3n) {
    background: #ffff00;
    width: 12px;
    height: 12px;
    animation-duration: 3.5s;
}

.confetti:nth-child(4n) {
    background: #32cd32;
    width: 6px;
    height: 6px;
    animation-duration: 2.8s;
}

.confetti:nth-child(5n) {
    background: #ff4500;
    width: 14px;
    height: 14px;
    animation-duration: 3.2s;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}
