* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Montserrat:wght@400;600;700&display=swap');

body {
    font-family: 'Montserrat', sans-serif;
    background: 
        radial-gradient(ellipse at top, rgba(218, 165, 32, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(218, 165, 32, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #0a1612 0%, #1a3a2e 50%, #0a1612 100%);
    min-height: 100vh;
    color: #f5f5f5;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.1) 2px, rgba(0, 0, 0, 0.1) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0, 0, 0, 0.1) 2px, rgba(0, 0, 0, 0.1) 4px);
    pointer-events: none;
    opacity: 0.3;
    z-index: 0;
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #DAA520;
    margin-bottom: 30px;
    font-size: 3em;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    text-shadow: 
        0 0 20px rgba(218, 165, 32, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(218, 165, 32, 0.4);
    letter-spacing: 3px;
    text-transform: uppercase;
}

h1::before {
    content: '♠ ';
    color: #DAA520;
}

h1::after {
    content: ' ♥';
    color: #DAA520;
}

/* Card Box */
.card-box {
    background: linear-gradient(135deg, #1a4d2e 0%, #0f2818 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 30px rgba(218, 165, 32, 0.2);
    margin-bottom: 30px;
    border: 3px solid rgba(218, 165, 32, 0.4);
    position: relative;
    overflow: hidden;
}

.card-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(218, 165, 32, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Inputs */
input[type="text"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid rgba(218, 165, 32, 0.5);
    border-radius: 10px;
    font-size: 17px;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.4);
    color: #DAA520;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

input[type="text"]::placeholder {
    color: rgba(218, 165, 32, 0.6);
}

input[type="text"]:focus {
    outline: none;
    border-color: #DAA520;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 20px rgba(218, 165, 32, 0.4);
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    padding: 15px 35px;
    border: 2px solid #DAA520;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    font-family: 'Montserrat', sans-serif;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(218, 165, 32, 0.5);
}

.btn:active {
    transform: translateY(-1px) scale(1.02);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, #DAA520 0%, #B8860B 100%);
    color: #000;
    box-shadow: 
        0 5px 15px rgba(218, 165, 32, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #FFD700 0%, #DAA520 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
    color: #DAA520;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a5a5a 0%, #3a3a3a 100%);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.btn-success:hover {
    background: linear-gradient(135deg, #3edc81 0%, #37be70 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ffac22 0%, #f68e32 100%);
}

.btn-info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-info:hover {
    background: linear-gradient(135deg, #44a8eb 0%, #3990c9 100%);
}

/* Rules */
.rules {
    background: linear-gradient(135deg, rgba(26, 77, 46, 0.95) 0%, rgba(15, 40, 24, 0.95) 100%);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(218, 165, 32, 0.3);
    position: relative;
    z-index: 1;
}

.rules h3 {
    color: #DAA520;
    margin-bottom: 20px;
    font-family: 'Cinzel', serif;
    font-size: 1.5em;
    text-shadow: 0 0 10px rgba(218, 165, 32, 0.5);
}

.rules ul {
    list-style-position: inside;
    line-height: 2;
    color: #f5f5f5;
}

.rules ul li {
    margin-bottom: 8px;
}

.rules ul li strong {
    color: #FFD700;
}

/* Players List */
#playersList {
    list-style: none;
    padding: 15px 0;
    position: relative;
    z-index: 1;
}

#playersList li {
    padding: 15px;
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.2) 0%, rgba(218, 165, 32, 0.1) 100%);
    margin: 10px 0;
    border-radius: 10px;
    font-weight: bold;
    border: 2px solid rgba(218, 165, 32, 0.3);
    color: #DAA520;
    transition: all 0.3s;
}

#playersList li:hover {
    transform: translateX(5px);
    border-color: #DAA520;
    box-shadow: 0 5px 15px rgba(218, 165, 32, 0.3);
}

/* Swap Phase */
.swap-area {
    margin: 20px 0;
}

.hand-cards, .table-cards {
    margin: 15px 0;
}

.hand-cards h4, .table-cards h4 {
    margin-bottom: 10px;
    color: #667eea;
}

/* Game Screen */
.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Other Players */
.other-players {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.player-info {
    background: linear-gradient(135deg, rgba(26, 77, 46, 0.8) 0%, rgba(15, 40, 24, 0.8) 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 10px;
    min-width: 220px;
    box-shadow: 
        0 5px 20px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(218, 165, 32, 0.2);
    border: 2px solid rgba(218, 165, 32, 0.3);
    transition: all 0.3s;
}

.player-info:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 25px rgba(218, 165, 32, 0.4);
}

.player-info.current-player {
    border: 3px solid #FFD700;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 215, 0, 0.7);
    animation: pulse 1.5s infinite;
}

.player-info h4 {
    margin-bottom: 15px;
    color: #FFD700;
    font-family: 'Cinzel', serif;
    font-size: 1.3em;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.player-cards {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.player-cards div {
    color: #DAA520;
    font-weight: 600;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

/* Center Area */
.center-area {
    background: linear-gradient(135deg, rgba(26, 77, 46, 0.95) 0%, rgba(15, 40, 24, 0.95) 100%);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 30px rgba(218, 165, 32, 0.2);
    border: 3px solid rgba(218, 165, 32, 0.4);
    position: relative;
    overflow: hidden;
}

.center-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(218, 165, 32, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.piles {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.draw-pile, .play-pile {
    text-align: center;
}

.pile-label {
    font-weight: bold;
    margin-bottom: 15px;
    color: #FFD700;
    font-size: 1.2em;
    font-family: 'Cinzel', serif;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    letter-spacing: 1px;
}

.card-pile {
    width: 120px;
    height: 160px;
    border: 3px dashed #ddd;
    border-radius: 10px;
    margin: 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #f8f9fa;
}

.pile-count {
    font-size: 16px;
    color: #DAA520;
    font-weight: 600;
    margin-top: 10px;
}

.seven-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    font-weight: bold;
    text-align: center;
    display: none;
    margin-top: 20px;
    border: 2px solid #d68910;
    box-shadow: 
        0 5px 20px rgba(243, 156, 18, 0.5),
        0 0 20px rgba(243, 156, 18, 0.3);
    font-size: 1.1em;
    animation: pulse 1s infinite;
}

.seven-warning.active {
    display: block;
}

.game-info {
    text-align: center;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.current-turn {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 15px;
    font-family: 'Cinzel', serif;
    text-shadow: 
        0 0 15px rgba(255, 215, 0, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
    animation: glow 2s infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.8); }
    50% { text-shadow: 0 0 25px rgba(255, 215, 0, 1), 2px 2px 4px rgba(0, 0, 0, 0.8); }
}

.phase-info {
    color: #DAA520;
    font-weight: 600;
    font-size: 1.1em;
}

/* Your Area */
.your-area {
    background: linear-gradient(135deg, rgba(26, 77, 46, 0.95) 0%, rgba(15, 40, 24, 0.95) 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 30px rgba(218, 165, 32, 0.2);
    border: 3px solid rgba(218, 165, 32, 0.4);
    position: relative;
}

.your-area h3 {
    color: #FFD700;
    margin-bottom: 30px;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 2em;
    text-shadow: 
        0 0 15px rgba(255, 215, 0, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

.your-table {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.table-section {
    text-align: center;
    margin: 10px;
}

.section-label {
    font-weight: bold;
    margin-bottom: 15px;
    color: #DAA520;
    font-size: 1.1em;
    text-shadow: 0 0 10px rgba(218, 165, 32, 0.5);
    letter-spacing: 1px;
}

.your-hand {
    margin: 20px 0;
    text-align: center;
}

.cards-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
    min-height: 100px;
}

/* Cards */
.card {
    width: 90px;
    height: 130px;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border: 3px solid #000;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    font-size: 26px;
    font-weight: 900;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    font-family: 'Cinzel', serif;
}

.card::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 2px solid rgba(218, 165, 32, 0.2);
    border-radius: 8px;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-10px) rotate(2deg) scale(1.1);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(218, 165, 32, 0.6);
    z-index: 10;
}

.card.selected {
    transform: translateY(-15px) scale(1.15);
    border-color: #DAA520;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(218, 165, 32, 0.8);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(218, 165, 32, 0.8); }
    50% { box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 40px rgba(218, 165, 32, 1); }
}

.card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(50%);
}

.card.disabled:hover {
    transform: none;
}

.card-back {
    background: 
        linear-gradient(45deg, #1a4d2e 25%, transparent 25%),
        linear-gradient(-45deg, #1a4d2e 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a4d2e 75%),
        linear-gradient(-45deg, transparent 75%, #1a4d2e 75%),
        linear-gradient(135deg, #0f2818 0%, #1a4d2e 100%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    color: #DAA520;
    border-color: #DAA520;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 0 20px rgba(218, 165, 32, 0.2);
}

.card-back::after {
    content: '♠♥♦♣';
    position: absolute;
    font-size: 24px;
    color: #DAA520;
    opacity: 0.8;
    font-weight: bold;
}

.card-value {
    font-size: 32px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.card-suit {
    font-size: 24px;
    margin-top: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.card.red {
    color: #c41e3a;
}

.card.red .card-suit {
    filter: drop-shadow(0 0 3px rgba(196, 30, 58, 0.5));
}

.card.black {
    color: #1a1a1a;
}

.card.black .card-suit {
    filter: drop-shadow(0 0 3px rgba(26, 26, 26, 0.5));
}

/* Small card */
.small-card {
    width: 40px;
    height: 55px;
    font-size: 16px;
}

.small-card .card-value {
    font-size: 14px;
}

.small-card .card-suit {
    font-size: 10px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Message Box */
.message-box {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    z-index: 1000;
}

.message {
    background: linear-gradient(135deg, #1a4d2e 0%, #0f2818 100%);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: 
        0 5px 20px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(218, 165, 32, 0.3);
    animation: slideIn 0.3s;
    border: 2px solid rgba(218, 165, 32, 0.5);
    color: #DAA520;
    font-weight: 600;
}

.message.error {
    background: linear-gradient(135deg, #5a1a1a 0%, #3a0a0a 100%);
    color: #ff6b6b;
    border-color: #ff6b6b;
    box-shadow: 
        0 5px 20px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 107, 107, 0.3);
}

.message.success {
    background: linear-gradient(135deg, #1a5a2e 0%, #0a3a1e 100%);
    color: #4ade80;
    border-color: #4ade80;
    box-shadow: 
        0 5px 20px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(74, 222, 128, 0.3);
}

.message.info {
    background: linear-gradient(135deg, #1a3a5a 0%, #0a2a4a 100%);
    color: #60a5fa;
    border-color: #60a5fa;
    box-shadow: 
        0 5px 20px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(96, 165, 250, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #1a4d2e 0%, #0f2818 100%);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(218, 165, 32, 0.4);
    max-width: 600px;
    border: 3px solid #DAA520;
    position: relative;
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
    from {
        transform: scale(0.5) rotate(-5deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #DAA520, #FFD700, #DAA520);
    border-radius: 20px;
    z-index: -1;
    animation: rotate 3s linear infinite;
}

.modal-content h2, .modal-content h3 {
    color: #FFD700;
    margin-bottom: 25px;
    font-family: 'Cinzel', serif;
    font-size: 2.5em;
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

.modal-content p {
    color: #f5f5f5;
    font-size: 1.3em;
    margin: 20px 0;
}

.modal-buttons {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .card {
        width: 60px;
        height: 85px;
        font-size: 18px;
    }
    
    .card-value {
        font-size: 20px;
    }
    
    .card-suit {
        font-size: 14px;
    }
    
    .game-container {
        padding: 10px;
    }
    
    .your-area, .center-area {
        padding: 15px;
    }
}

