/* ==============================
   Import Base Styles
   ============================== */
@import url('../yukon-solitaire/style.css');

/* ==============================
   Canasta Specific Overrides
   ============================== */

/* Game Header */
.game-header {
    background: linear-gradient(135deg, #0a0a16 0%, #1a1a2e 50%, #16213e 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.font-game, .font-press-start {
    font-family: 'Press Start 2P', cursive;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.nav-btn.primary {
    background: #00ccff;
    border-color: #00ccff;
    color: #0a0a16;
    font-weight: bold;
}

/* Game Container */
.game-container {
    background: url('https://www.transparenttextures.com/patterns/asfalt-light.png') repeat, #228B22;
    background-size: 100px 100px;
    min-height: 100vh;
    padding: 20px;
}

/* Score Board - Enhanced for Canasta */
.score-board {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    color: white;
    flex-wrap: wrap;
    gap: 1rem;
}

.team-score {
    text-align: center;
    flex: 1;
    min-width: 160px;
}

.team-score h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 11px;
    margin-bottom: 0.5rem;
    color: #00ccff;
}

.score-display {
    font-size: 24px;
    font-weight: bold;
    font-family: 'Roboto', sans-serif;
    margin-bottom: 0.5rem;
}

.score-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.canastas-count, .red-threes {
    font-size: 9px;
    color: #ccc;
    font-family: 'Press Start 2P', cursive;
}

.game-info {
    text-align: center;
    flex: 1;
    min-width: 180px;
}

.round-display, .meld-requirement, .turn-display {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    margin: 0.25rem 0;
}

.meld-requirement {
    color: #ffff99;
}

/* Game Table */
.game-table {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    min-height: 800px;
    position: relative;
    display: grid;
    grid-template-areas: 
        ". top ."
        "left center right"
        ". bottom .";
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 1.5rem;
}

/* Player Areas */
.player-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.player-area.top { grid-area: top; }
.player-area.left { 
    grid-area: left; 
    align-items: flex-end;
}
.player-area.right { 
    grid-area: right; 
    align-items: flex-start;
}
.player-area.bottom { 
    grid-area: bottom; 
}

.center-area {
    grid-area: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

/* Player Info */
.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.player-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 9px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.cards-count {
    font-size: 8px;
    color: #ccc;
}

/* Hands */
.player-hand {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 100px;
    max-width: 600px;
}

.player-area.left .player-hand,
.player-area.right .player-hand {
    flex-direction: column;
    max-height: 300px;
    overflow-y: auto;
    max-width: 80px;
}

/* Melds and Red Threes Areas */
.melds-area, .red-threes-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    min-height: 60px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    max-width: 100%;
}

.red-threes-area {
    min-height: 40px;
    background: rgba(255, 0, 0, 0.1);
    border-color: rgba(255, 0, 0, 0.3);
}

.meld-group {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-direction: column;
    align-items: center;
}

.meld-cards {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    max-width: 200px;
}

.meld-info {
    font-size: 8px;
    color: #00ccff;
    font-family: 'Press Start 2P', cursive;
    text-align: center;
    margin-bottom: 3px;
}

.canasta-marker {
    background: gold;
    color: black;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 7px;
    font-weight: bold;
}

.natural-canasta {
    border-color: #ffff00;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
}

.mixed-canasta {
    border-color: #888;
    box-shadow: 0 0 10px rgba(136, 136, 136, 0.3);
}

/* Piles */
.stock-pile, .discard-pile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.pile-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.card-pile {
    width: 100px;
    height: 140px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-pile:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

.pile-status {
    font-size: 8px;
    color: white;
    font-family: 'Press Start 2P', cursive;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
}

.pile-status.frozen {
    color: #ff6666;
    background: rgba(255, 0, 0, 0.2);
}

/* Spread Discard Pile */
.spread-pile {
    width: 250px;
    height: 160px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    overflow: hidden;
}

.spread-pile .card {
    position: absolute;
    width: 50px;
    height: 75px;
}

/* Enhanced Card Styling */
.card {
    width: 55px;
    height: 80px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.card.selected {
    transform: translateY(-8px);
    border-color: #00ccff;
    box-shadow: 0 8px 15px rgba(0, 204, 255, 0.4);
}

.card.wild-card {
    border-color: #ff6600;
    box-shadow: 0 0 8px rgba(255, 102, 0, 0.4);
}

.card.red-three {
    border-color: #ff0000;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.4);
}

.card.black-three {
    border-color: #333;
    box-shadow: 0 0 8px rgba(51, 51, 51, 0.4);
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(135deg, #0a0a16, #1a1a2e);
    color: white;
    border: 2px solid #00ccff;
    padding: 12px 18px;
    border-radius: 8px;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    min-width: 100px;
}

.control-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    box-shadow: 0 4px 12px rgba(0, 204, 255, 0.3);
    transform: translateY(-2px);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #666;
}

.control-btn.go-out {
    border-color: #ffff00;
    color: #ffff00;
}

.control-btn.go-out:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(255, 255, 0, 0.3);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 2px solid #00ccff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #ccc;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #00ccff;
}

/* Meld Creation Modal */
.meld-instructions {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 11px;
    color: #ccc;
    line-height: 1.4;
}

.selected-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 1rem 0;
    min-height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.meld-validation {
    text-align: center;
    margin: 1rem 0;
    font-size: 10px;
    min-height: 20px;
    line-height: 1.3;
}

.meld-validation.valid {
    color: #28a745;
}

.meld-validation.invalid {
    color: #dc3545;
}

.meld-controls, .layoff-controls, .goout-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Go Out Modal */
.goout-check {
    text-align: center;
    margin-bottom: 1rem;
}

.canasta-status {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 11px;
}

.canasta-status.ready {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid #28a745;
}

.canasta-status.not-ready {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
}

/* Lay Off Modal */
.available-melds {
    max-height: 300px;
    overflow-y: auto;
    margin: 1rem 0;
}

.meld-option {
    display: flex;
    gap: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    align-items: center;
}

.meld-option:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00ccff;
}

.meld-option.selected {
    border-color: #00ccff;
    background: rgba(0, 204, 255, 0.2);
}

.meld-option-info {
    flex: 1;
}

.meld-option-cards {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Rules Modal */
.rules-content h2 {
    font-family: 'Press Start 2P', cursive;
    color: #00ccff;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 16px;
}

.rules-section h3 {
    font-family: 'Press Start 2P', cursive;
    color: #00ccff;
    margin: 1.5rem 0 1rem 0;
    font-size: 11px;
}

.rules-section p, .rules-section li {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 13px;
}

.rules-section ul, .rules-section ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Game Messages */
.game-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    border: 2px solid #00ccff;
    font-family: 'Press Start 2P', cursive;
    font-size: 11px;
    text-align: center;
    z-index: 1500;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    display: none;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-table {
        grid-template-areas: 
            "top top"
            "center center"
            "bottom bottom";
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .player-area.left,
    .player-area.right {
        grid-area: top;
        align-items: center;
    }
    
    .player-area.left .player-hand,
    .player-area.right .player-hand {
        flex-direction: row;
        max-height: none;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .score-board {
        flex-direction: column;
        gap: 1rem;
    }
    
    .game-table {
        padding: 1rem;
        min-height: 600px;
        gap: 1rem;
    }
    
    .game-controls {
        gap: 0.5rem;
    }
    
    .control-btn {
        padding: 8px 12px;
        font-size: 7px;
        min-width: 80px;
    }
    
    .card {
        width: 45px;
        height: 65px;
    }
    
    .modal-content {
        padding: 1rem;
        margin: 1rem;
    }
    
    .selected-cards {
        gap: 4px;
    }
}

/* Animations */
@keyframes cardDeal {
    from {
        opacity: 0;
        transform: translateY(-50px) rotateY(180deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateY(0deg);
    }
}

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

@keyframes canastaBuild {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.meld-group.canasta-complete {
    animation: canastaBuild 0.8s ease-in-out;
}

@keyframes redThreeBonus {
    0% { background: rgba(255, 0, 0, 0.1); }
    50% { background: rgba(255, 0, 0, 0.4); }
    100% { background: rgba(255, 0, 0, 0.1); }
}

.red-threes-area.bonus-scored {
    animation: redThreeBonus 1s ease-in-out;
}

/* SEO Content Styling */
.seo-content {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: white;
}

.text-primary-color {
    color: #00ccff;
}

.canasta-guide h3 {
    font-family: 'Press Start 2P', cursive;
}

.canasta-guide h4 {
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
}

.canasta-guide p, .canasta-guide li {
    font-family: 'Roboto', sans-serif;
}

/* Settings Options */
.settings-options input[type="checkbox"] {
    accent-color: #00ccff;
}

.settings-options input[type="range"] {
    accent-color: #00ccff;
}

.settings-options select {
    background: #1a1a2e;
    color: white;
    border: 1px solid #00ccff;
}
