/* 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, #0f4c3a 0%, #1a5f4a 50%, #0f4c3a 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid #ffd700;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: #ffd700;
}

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

/* Game Selection */
.game-selection {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.game-selection label {
    font-weight: bold;
    font-size: 1.1rem;
}

.variant-select {
    padding: 8px 12px;
    border: 2px solid #ffd700;
    border-radius: 5px;
    background: #ffffff;
    color: #333;
    font-size: 1rem;
    min-width: 200px;
}

.variant-info {
    margin-left: auto;
    font-weight: bold;
    color: #ffd700;
}

/* Card Input Section */
.card-input-section {
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.card-input-section h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: #ffd700;
}

.card-input-section h3 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: #ffd700;
}

/* Selected Cards Display */
.selected-cards-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.selected-card {
    position: relative;
}

.selected-card-display {
    width: 90px;
    height: 125px;
    background: #ffffff;
    border: 3px solid #ffd700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
}

.selected-card-display:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.6);
}

.selected-card-display.has-card {
    background: #ffffff;
}

.selected-card-display.red-suit {
    color: #dc143c;
}

.selected-card-display.black-suit {
    color: #333;
}

.selected-card-display .card-placeholder {
    color: #ccc;
    font-size: 2rem;
}

/* Card Selector */
.card-selector {
    margin-top: 20px;
}

.deck-display {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 900px;
    margin: 0 auto;
}

.suit-row {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
}

.suit-header {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}

.suit-header.clubs { color: #333; }
.suit-header.diamonds { color: #dc143c; }
.suit-header.hearts { color: #dc143c; }
.suit-header.spades { color: #333; }

.cards-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.deck-card {
    width: 55px;
    height: 75px;
    background: #ffffff;
    border: 2px solid #333;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.deck-card:hover:not(.selected):not(.disabled) {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.5);
    border-color: #ffd700;
}

.deck-card.red-suit {
    color: #dc143c;
}

.deck-card.black-suit {
    color: #333;
}

.deck-card.selected {
    background: #ffd700;
    border-color: #ffd700;
    color: #333;
    transform: scale(0.95);
    opacity: 0.6;
    cursor: not-allowed;
}

.deck-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #e0e0e0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

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

.btn-primary {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    border: 2px solid #ffd700;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(45deg, #ffed4e, #ffd700);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.btn-primary:disabled {
    background: #666;
    color: #999;
    border-color: #666;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: #ffd700;
    border: 2px solid #ffd700;
}

.btn-secondary:hover {
    background: #ffd700;
    color: #333;
    transform: translateY(-2px);
}

/* Error Message */
.error-message {
    background: #dc143c;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
}

/* Results Section */
.results-section {
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.results-section h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8rem;
    color: #ffd700;
}

.current-hand-display {
    margin-bottom: 30px;
    text-align: center;
}

.current-hand-display h3 {
    margin-bottom: 15px;
    color: #ffd700;
}

.hand-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.hand-card {
    width: 60px;
    height: 80px;
    background: #ffffff;
    border: 2px solid #333;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hand-card.red-suit {
    color: #dc143c;
}

.hand-card.black-suit {
    color: #333;
}

.hand-type {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffd700;
    text-transform: capitalize;
}

/* Recommendations */
.recommendations-container h3 {
    margin-bottom: 20px;
    color: #ffd700;
    text-align: center;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recommendation {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.recommendation:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.recommendation.best-play {
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.recommendation-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.recommendation-rank {
    background: #ffd700;
    color: #333;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.recommendation-ev {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffd700;
    margin-left: auto;
}

.recommendation-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.hold-cards {
    display: flex;
    gap: 5px;
}

.hold-card {
    width: 40px;
    height: 55px;
    background: #ffffff;
    border: 1px solid #333;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
}

.hold-card.red-suit {
    color: #dc143c;
}

.hold-card.black-suit {
    color: #333;
}

.discard-info {
    color: #ccc;
    font-style: italic;
}

/* Paytable Display */
.analysis-details {
    margin-top: 30px;
    text-align: center;
}

.paytable-display {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
}

.paytable-display h4 {
    color: #ffd700;
    margin-bottom: 15px;
}

.paytable {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.paytable-row {
    display: contents;
}

.paytable-hand {
    text-align: left;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.paytable-payout {
    text-align: right;
    padding: 5px 10px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 5px;
    font-weight: bold;
    color: #ffd700;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #ccc;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card-input-container {
        gap: 10px;
    }
    
    .card-input {
        min-width: 100px;
    }
    
    .card-display {
        width: 70px;
        height: 95px;
        font-size: 1.2rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
    
    .recommendation-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .recommendation-ev {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .card-input-container {
        flex-direction: column;
        align-items: center;
    }
    
    .game-selection {
        flex-direction: column;
        text-align: center;
    }
    
    .variant-info {
        margin-left: 0;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: #ffd700;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}