/* UNO MANIA 3D - Pure Black UNO Theme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

h2 {
    color: #fff
}

body {
    font-family: 'Nunito', sans-serif;
    background: #000000;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #000000;
}

.floating-card {
    position: absolute;
    width: 60px;
    height: 90px;
    background: linear-gradient(45deg, #FF0000, #00FF00, #0000FF, #FFFF00);
    border-radius: 8px;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.floating-card:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-card:nth-child(2) {
    top: 20%;
    right: 15%;
    animation-delay: 1s;
}

.floating-card:nth-child(3) {
    bottom: 30%;
    left: 20%;
    animation-delay: 2s;
}

.floating-card:nth-child(4) {
    bottom: 20%;
    right: 10%;
    animation-delay: 3s;
}

.floating-card:nth-child(5) {
    top: 50%;
    left: 50%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(-40px) rotate(-5deg); }
    75% { transform: translateY(-20px) rotate(3deg); }
}

/* Screen Management */
.screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Welcome Screen Styles */
.title-container {
    text-align: center;
    margin-bottom: 40px;
}

.mega-title {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(4rem, 12vw, 8rem);
    margin: 0;
    perspective: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.letter {
    display: inline-block;
    background: linear-gradient(45deg, #FF0000, #00FF00, #0000FF, #FFFF00);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    animation: letterBounce 2s ease-in-out infinite, gradientShift 3s ease infinite;
    transform-style: preserve-3d;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
}

.letter:nth-child(1) { animation-delay: 0s; }
.letter:nth-child(2) { animation-delay: 0.2s; }
.letter:nth-child(3) { animation-delay: 0.4s; }

.mania {
    font-size: 0.6em;
    background: linear-gradient(45deg, #FFFF00, #FF0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse3D 1.5s ease-in-out infinite;
    margin-left: 20px;
    filter: drop-shadow(0 0 20px rgba(255, 255, 0, 0.8));
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes letterBounce {
    0%, 100% { transform: translateY(0) rotateX(0deg); }
    50% { transform: translateY(-20px) rotateX(15deg); }
}

@keyframes pulse3D {
    0%, 100% { transform: scale(1) rotateY(0deg); }
    50% { transform: scale(1.1) rotateY(10deg); }
}

.subtitle-3d {
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 700;
    background: linear-gradient(45deg, #FFFF00, #FF0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(255, 255, 0, 0.8);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 10px rgba(255, 255, 0, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(255, 255, 0, 1)); }
}

.welcome-content {
    text-align: center;
    max-width: 600px;
}

.game-rules {
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rule-item {
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: slideInUp 0.6s ease-out;
    animation-delay: calc(var(--i) * 0.2s);
    animation-fill-mode: both;
    color: #ffffff;
}

.rule-item:nth-child(1) { --i: 1; }
.rule-item:nth-child(2) { --i: 2; }
.rule-item:nth-child(3) { --i: 3; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mega Button Styles */
.mega-button {
    position: relative;
    background: linear-gradient(45deg, #FF0000, #0000FF);
    border: none;
    border-radius: 50px;
    padding: 20px 40px;
    font-family: 'Fredoka One', cursive;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: white;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.5);
    animation: buttonFloat 3s ease-in-out infinite;
}

.mega-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(255, 0, 0, 0.7);
}

.mega-button:active {
    transform: translateY(-2px) scale(1.02);
}

@keyframes buttonFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.button-text {
    position: relative;
    z-index: 2;
}

.button-sparkles {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 1.5em;
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: translateY(-50%) rotate(0deg) scale(1); }
    50% { transform: translateY(-50%) rotate(180deg) scale(1.2); }
}

/* Game Screen Styles */
#game {
    padding: 20px;
    gap: 20px;
    justify-content: flex-start;
    max-width: 1400px;
    margin: 0 auto;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.game-title {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2rem, 6vw, 3.5rem);
    margin: 0;
}

.uno-text {
    background: linear-gradient(45deg, #FF0000, #0000FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.8));
}

.mania-text {
    background: linear-gradient(45deg, #FFFF00, #00FF00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 10px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 0, 0.8));
}

.game-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    color: #ffffff;
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: #FFFF00;
}

/* Current Card Area */
.current-card-area {
    text-align: center;
    margin: 20px 0;
}

.current-card-label {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    color: #FFFF00;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
}

.current-card-container {
    position: relative;
    display: inline-block;
    perspective: 1000px;
}

.card-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, #FF0000, #00FF00, #0000FF, #FFFF00);
    border-radius: 20px;
    opacity: 0.5;
    animation: cardGlow 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes cardGlow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Wild Color Indicator */
.wild-color-indicator {
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

/* Hand Sections */
.hand-section {
    width: 100%;
    margin: 15px 0;
}

.hand-title {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.player-title {
    background: linear-gradient(45deg, #0000FF, #00FF00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.8));
}

.bot-title {
    background: linear-gradient(45deg, #FF0000, #FFFF00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.8));
}

.card-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    backdrop-filter: blur(10px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hand-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Card Styles */
.card-image {
    width: 80px;
    height: 120px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
    position: relative;
    transform-style: preserve-3d;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.card-image:hover {
    transform: translateY(-15px) rotateY(10deg) scale(1.1);
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.card-image.current-card {
    width: 120px;
    height: 180px;
    animation: cardPulse 2s ease-in-out infinite;
}

@keyframes cardPulse {
    0%, 100% { transform: scale(1) rotateY(0deg); }
    50% { transform: scale(1.05) rotateY(5deg); }
}

.card-image.playable {
    animation: playableGlow 1.5s ease-in-out infinite;
}

@keyframes playableGlow {
    0%, 100% { box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2); }
    50% { box-shadow: 0 5px 25px rgba(0, 255, 0, 0.8); }
}

.card-image.played {
    animation: cardPlay 0.6s ease-out;
}

@keyframes cardPlay {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Bot Hand Specific */
.bot-hand .card-image {
    animation: cardFloat 3s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.2s);
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.action-button {
    background: linear-gradient(45deg, #0000FF, #FF0000);
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

.action-button:active {
    transform: translateY(-1px);
}

.draw-button {
    background: linear-gradient(45deg, #0000FF, #00FF00);
}

.uno-button {
    background: linear-gradient(45deg, #FF0000, #FFFF00);
    animation: unoGlow 1s ease-in-out infinite;
}

@keyframes unoGlow {
    0%, 100% { box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2); }
    50% { box-shadow: 0 5px 25px rgba(255, 0, 0, 0.8); }
}

.button-icon {
    font-size: 1.3em;
}

/* Wild Color Selector */
.wild-color-selector {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 3px solid rgba(255, 255, 255, 0.5);
    z-index: 1000;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.selector-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 20px;
    color: #FFFF00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
}

.color-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.color-option {
    padding: 15px 25px;
    border: none;
    border-radius: 15px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.color-option.red {
    background: #FF0000;
}

.color-option.green {
    background: #00FF00;
}

.color-option.blue {
    background: #0000FF;
}

.color-option.yellow {
    background: #FFFF00;
    color: #000000;
}

.color-option:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.5);
}

/* Message Container */
.message-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 15px 30px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    font-weight: 700;
    font-size: 1.2rem;
    z-index: 999;
    animation: messageSlide 0.5s ease-out;
    max-width: 90vw;
    text-align: center;
    color: #ffffff;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.message-container.success {
    border-color: #00FF00;
    color: #00FF00;
}

.message-container.warning {
    border-color: #FFFF00;
    color: #FFFF00;
}

.message-container.error {
    border-color: #FF0000;
    color: #FF0000;
}

/* Game Over Screen */
.game-over-content {
    text-align: center;
    max-width: 600px;
}

.game-over-title {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: 20px;
    animation: gameOverBounce 1s ease-out;
}

.game-over-title.win {
    background: linear-gradient(45deg, #00FF00, #FFFF00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(0, 255, 0, 0.8));
}

.game-over-title.lose {
    background: linear-gradient(45deg, #FF0000, #FFFF00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255, 0, 0, 0.8));
}

@keyframes gameOverBounce {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.game-over-message {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 600;
    margin-bottom: 40px;
    opacity: 0.9;
    color: #ffffff;
}

/* Particle Effects */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #FFFF00;
    border-radius: 50%;
    animation: particleFloat 2s ease-out forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0);
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .game-stats {
        gap: 10px;
    }
    
    .card-image {
        width: 60px;
        height: 90px;
    }
    
    .card-image.current-card {
        width: 90px;
        height: 135px;
    }
    
    .hand-container {
        padding: 15px;
        gap: 8px;
    }
    
    .color-options {
        grid-template-columns: 1fr;
    }
    
    .game-controls {
        gap: 15px;
    }
    
    .action-button {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .card-image {
        width: 50px;
        height: 75px;
    }
    
    .card-image.current-card {
        width: 75px;
        height: 112px;
    }
    
    .hand-container {
        gap: 5px;
        padding: 10px;
    }
}

