/* UNO Multiplayer Game - Complete Styles with Fixed Screen Management */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}

/* Screen Management - FIXED */
.screen {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 20px;
    overflow-y: auto;
    z-index: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.screen.active {
    display: flex !important;
    flex-direction: column;
    z-index: 10;
}

/* Loading Screen */
#loading-screen {
    justify-content: center;
    align-items: center;
}

.loading-content {
    text-align: center;
}

.uno-logo h1 {
    font-size: 4rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.uno-logo p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
}

.uno-logo small {
    color: #ffd700;
    font-weight: 600;
    margin-top: 10px;
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 30px auto;
}

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

/* Main Menu */
#main-menu {
    justify-content: center;
    align-items: center;
}

.menu-container {
    max-width: 500px;
    width: 100%;
    text-align: center;
    padding: 40px 20px;
}

.menu-header {
    margin-bottom: 40px;
}

.game-title {
    font-size: 3.5rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
}

.game-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.player-setup {
    margin-bottom: 30px;
}

.player-setup input {
    width: 100%;
    max-width: 300px;
    padding: 15px 20px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transition: all 0.3s ease;
}

.player-setup input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 200px;
    justify-content: center;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
    min-width: 250px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-width: auto;
}

.btn-primary {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #333;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
}

.modal-body input, .modal-body select {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.modal-body input:focus, .modal-body select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
    background: white;
}

.modal-body select {
    cursor: pointer;
}

.modal-body small {
    display: block;
    margin-top: 10px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Browse Lobbies */
#browse-lobbies {
    display: block;
}

.browse-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.browse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.browse-header h2 {
    font-size: 2rem;
    color: white;
}

.browse-header div {
    display: flex;
    gap: 10px;
}

.lobbies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.lobby-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.lobby-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.lobby-card h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #ffd700;
}

.lobby-card p {
    margin: 5px 0;
    color: rgba(255, 255, 255, 0.9);
}

.lobby-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 5px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-waiting {
    background: #28a745;
    color: white;
}

.status-playing {
    background: #ffc107;
    color: #333;
}

.lobby-card .fa-lock {
    color: #ffc107;
    margin-left: 5px;
}

.no-content {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.no-content i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Lobby Screen */
#lobby-screen {
    display: block;
}

.lobby-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.lobby-info h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #ffd700;
}

.lobby-info p {
    font-size: 1rem;
    margin: 5px 0;
    color: rgba(255, 255, 255, 0.9);
}

.players-section {
    margin-bottom: 40px;
}

.players-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Players Grid - Extended for 8 players */
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 100%;
    margin: 20px 0;
}

/* Responsive grid for different screen sizes */
@media (min-width: 1200px) {
    .players-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .players-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .players-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.player-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    color: white;
    position: relative;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.player-card.current-user {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.3);
}

.player-card.empty-slot {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    color: #666;
    border: 2px dashed #999;
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.player-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.host-badge {
    background: linear-gradient(135deg, #ffc107, #ff8f00);
    color: #333;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 5px;
    display: inline-block;
}

.host-badge-small {
    background: linear-gradient(135deg, #ffc107, #ff8f00);
    color: #333;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 5px;
}

.kick-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.3s ease;
    z-index: 10;
}

.kick-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lobby-actions {
    text-align: center;
}

.start-info {
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Game Screen */
#game-screen {
    display: block;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.current-player {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Other Players Layout - Circular arrangement for 8 players */
.other-players {
    display: grid;
    grid-template-areas: 
        "p1 p2 p3"
        "p8 .  p4"
        "p7 p6 p5";
    gap: 15px;
    max-width: 600px;
    margin: 0 auto 20px;
    padding: 20px;
}

/* Position other players in circular layout */
.other-player:nth-child(1) { grid-area: p1; }
.other-player:nth-child(2) { grid-area: p2; }
.other-player:nth-child(3) { grid-area: p3; }
.other-player:nth-child(4) { grid-area: p4; }
.other-player:nth-child(5) { grid-area: p5; }
.other-player:nth-child(6) { grid-area: p6; }
.other-player:nth-child(7) { grid-area: p7; }
.other-player:nth-child(8) { grid-area: p8; }

.other-player {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    color: white;
    transition: all 0.3s ease;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.other-player.current-turn {
    background: rgba(255, 215, 0, 0.3);
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: pulse 2s infinite;
}

.other-player-name {
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.other-player-cards {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.uno-indicator {
    background: #ff4757;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 5px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
}

/* Game Board */
.game-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0;
}

.board-center {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

.deck-pile, .discard-pile {
    position: relative;
}

.card, .card-back {
    width: 80px;
    height: 120px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.card-back {
    background: linear-gradient(135deg, #333, #555);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.card-back:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.card-back i {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.card-back span {
    font-size: 0.8rem;
}

/* Current Color Indicator - Circular display */
.current-color-indicator {
    position: absolute;
    right: -100px;
    top: 50%;
    transform: translateY(-50%);
}

.color-display {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    text-align: center;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: colorPulse 2s infinite;
}

.color-display.red {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.color-display.yellow {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #333;
}

.color-display.green {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.color-display.blue {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

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

/* Color Chooser */
.color-chooser {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.color-chooser.hidden {
    display: none;
}

.color-chooser h4 {
    margin-bottom: 15px;
    color: white;
}

.color-options {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.color-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.color-btn.red {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.color-btn.yellow {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

.color-btn.green {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.color-btn.blue {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

/* Player Hand */
.player-hand {
    margin-top: 30px;
}

.hand-header {
    text-align: center;
    margin-bottom: 20px;
}

.hand-header h3 {
    color: white;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.hand-cards {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 100%;
    overflow-x: auto;
    padding: 10px;
}

.hand-cards .card {
    width: 70px;
    height: 105px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.hand-cards .card:hover {
    transform: translateY(-10px);
    z-index: 10;
}

.hand-cards .card.selected {
    transform: translateY(-15px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
    border-color: #ffd700;
}

.hand-cards .card.playable {
    border-color: #28a745;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.hand-cards .card.playable:hover {
    border-color: #ffd700;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

/* UNO Button */
.uno-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    animation: unoGlow 1s infinite alternate;
    font-size: 1.2rem;
    padding: 15px 25px;
    border-radius: 50px;
}

@keyframes unoGlow {
    0% {
        box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
    }
    100% {
        box-shadow: 0 8px 30px rgba(255, 193, 7, 0.6);
    }
}

/* Pass Button */
.pass-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    font-size: 1rem;
    padding: 12px 20px;
    border-radius: 25px;
}

/* Game Over Screen */
#game-over {
    justify-content: center;
    align-items: center;
}

.game-over-container {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.game-over-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
}

.game-over-content h1 {
    font-size: 2.5rem;
    color: #ffd700;
    margin-bottom: 20px;
}

.winner-info {
    margin: 30px 0;
}

.winner-info i {
    font-size: 3rem;
    color: #ffd700;
    margin-bottom: 15px;
}

.winner-info p {
    font-size: 1.3rem;
    color: white;
}

.game-over-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* Notifications */
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    max-width: 350px;
}

.notification {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
    border-left: 4px solid #007bff;
}

.notification.success {
    border-left-color: #28a745;
}

.notification.error {
    border-left-color: #dc3545;
}

.notification.warning {
    border-left-color: #ffc107;
}

.notification.info {
    border-left-color: #17a2b8;
}

.notification-content p {
    margin: 0;
    color: #333;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .other-players {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .other-player {
        flex: 0 1 calc(33.333% - 10px);
        min-width: 150px;
    }
    
    .current-color-indicator {
        position: static;
        margin: 20px auto 0;
        transform: none;
    }
}

@media (max-width: 768px) {
    .screen {
        padding: 10px;
    }
    
    .game-title {
        font-size: 2.5rem;
    }
    
    .menu-buttons {
        gap: 10px;
    }
    
    .btn-large {
        min-width: 200px;
        font-size: 1rem;
    }
    
    .board-center {
        gap: 20px;
    }
    
    .card, .card-back {
        width: 60px;
        height: 90px;
    }
    
    .hand-cards .card {
        width: 50px;
        height: 75px;
    }
    
    .other-player {
        flex: 0 1 calc(50% - 10px);
        min-width: 120px;
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .game-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .current-player {
        font-size: 1rem;
    }
    
    .color-display {
        width: 60px;
        height: 60px;
        font-size: 0.7rem;
    }
    
    .uno-button, .pass-button {
        position: static;
        margin: 10px auto;
        display: block;
    }
    
    .players-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .player-card {
        min-height: 100px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2rem;
    }
    
    .btn-large {
        min-width: 180px;
        padding: 12px 20px;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 20px;
    }
    
    .board-center {
        flex-direction: column;
        gap: 15px;
    }
    
    .color-options {
        gap: 10px;
    }
    
    .color-btn {
        width: 40px;
        height: 40px;
    }
    
    .other-player {
        flex: 0 1 100%;
        min-height: 60px;
    }
    
    .players-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .hand-cards {
        gap: 5px;
    }
    
    .notifications {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

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

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

.card-deal {
    animation: deal 0.5s ease-out;
}

@keyframes deal {
    0% {
        transform: translateX(-100px) rotate(-10deg);
        opacity: 0;
    }
    100% {
        transform: translateX(0) rotate(0);
        opacity: 1;
    }
}

.card-play {
    animation: play 0.4s ease-out;
}

@keyframes play {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.card:focus,
input:focus,
select:focus {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card, .card-back {
        border-width: 3px;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}
