html {
    font-size: 14px;
    position: relative;
    min-height: 100vh; /* ensure it covers viewport and content */
    height: 100vh; /* ensure it covers viewport and content */
    margin: 0;
    overflow: hidden;
    height: 100%;
}

body {
    background: linear-gradient(45deg, #2d5f88, #0b2942);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #eee;
    margin: 0;
    margin-bottom: 60px;
    min-height: 100vh; /* ensure it covers viewport and content */
    height: 100vh; /* ensure it covers viewport and content */
    background-attachment: fixed; /* keeps gradient fixed when scrolling */
    background-repeat: no-repeat;
    background-size: cover;
    height: 100%;
}

div {
    /*border:solid 1px red;*/
}

header {
    position: absolute;
    width: 100%;
}

footer {
    position: absolute;
    width: 100%;
    bottom: 0px;
}

.container, main, #GameTable {
    min-height: 100%;
    height: 100%;
    min-width: 100%;
    width: 100%;
}

main {
    padding-top: 90px;
}



/* Navbar Styling */
nav.navbar {
    background: linear-gradient(135deg, #37447e, #0b2942);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

    nav.navbar .navbar-brand {
        color: #a9ebe5;
        font-weight: bold;
        font-size: 1.5rem;
        text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    }

        nav.navbar .navbar-brand:hover {
            color: #d9f2ff;
        }

    nav.navbar .nav-link {
        color: #e6f7ff !important;
        font-weight: 500;
        transition: color 0.3s, transform 0.2s;
    }

        nav.navbar .nav-link:hover {
            color: #1abc9c !important;
            transform: scale(1.05);
        }

    nav.navbar .nav-item.active .nav-link {
        color: #1abc9c !important;
        font-weight: 600;
        text-decoration: underline;
    }

/* Mobile menu toggle */
.navbar-toggler {
    border-color: #1abc9c;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(169,235,229, 0.9)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/ %3E%3C/svg%3E");
}

h2 {
    text-align: center;
}

/* Collapse menu background on small screens */
.navbar-collapse {
    background: linear-gradient(135deg, #37447e, #0b2942);
    padding: 10px;
    border-radius: 6px;
}

/* Voice Chat Controls in Navbar */
.voice-chat-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}

    .voice-chat-controls .btn-outline-dark {
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
        border-color: #1abc9c;
        color: #1abc9c;
        transition: all 0.2s;
    }

        .voice-chat-controls .btn-outline-dark:hover {
            background-color: #1abc9c;
            border-color: #1abc9c;
            color: #0b2942;
        }

        .voice-chat-controls .btn-outline-dark.active,
        .voice-chat-controls .btn-outline-dark.mic-on {
            background-color: #1abc9c;
            border-color: #1abc9c;
            color: #0b2942;
        }

.voice-status-badge {
    font-size: 0.75rem;
    color: #1abc9c;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    background-color: rgba(26, 188, 156, 0.1);
    margin-left: 4px;
}

@media (max-width: 576px) {
    .navbar-nav {
        text-align: center;
    }

    .nav-item {
        margin: 5px 0;
    }

    footer {
        display: none;
    }
}


@media (min-width: 768px) {
    html {
        font-size: 16px;
    }

    #hand {
        bottom: initial;
        z-index: 2;
    }


    footer {
        display: none;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}




/* New Styles */
.BeatBox {
    box-shadow: red 0px 0px 00px 0px;
    transition: box-shadow 0.1s;
    width: 130px;
    height: 30px;
}

    .BeatBox .BackOnlyCard .card {
        left: 10px !important;
        top: 0 !important;
    }


.score {
    background-color: rgb(58, 69, 85);
    border: solid 2px rgb(9, 122, 112);
    color: rgb(169, 235, 229);
    padding: 5px 20px 5px 20px;
    position: absolute;
    top: -49px;
    right: 0px;
    display: block;
}

.scoreValues {
    float: left;
    padding-right: 20px;
}

    .scoreValues:hover {
        background-color: #f8f9fa;
        border-radius: 3px;
    }

        .scoreValues:hover div {
            background-color: #f8f9fa;
            color: rgb(58, 69, 85);
            border-radius: 3px;
        }

h5 {
    color: rgb(58, 69, 85);
}

    .card-header h5, .card-header .text-muted, h5.mb-2 {
        color: white !important;
    }

.game-scores-container .team-players {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.game-scores-container .player-name {
    font-weight: 600;
    padding: 2px 0;
}

.round-section {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    background-color: #ffffff;
}

.final-totals {
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 15px;
}

.PlayerState {
    white-space: nowrap;
    float: right;
}

.RefreshButton {
    float: right;
    padding-left: 30px;
}

.fontBold {
    font-weight: bold;
}

.btn {
    background: rgb(169, 235, 229);
    border: none;
    color: rgb(58, 69, 85);
    font-weight: 600;
    font-size: 16px;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 8px #3498db;
    transition: background 0.3s ease;
    user-select: none;
}

    .btn:hover {
        background: #3498db;
        color: rgb(169, 235, 229);
    }

    .btn:disabled {
        background-color: #cccccc; /* Grey background */
        color: #666666; /* Darker grey text */
        cursor: not-allowed; /* Change cursor to indicate non-interactivity */
        opacity: 0.7; /* Optional: make it slightly transparent */
    }

button[disabled] {
    /* Same styles as button:disabled */
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.7;
}



h1 {
    text-align: center;
    margin-bottom: 10px;
}

#deck-label, #hand-label, #premeld-label {
    font-size: 18px;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 1.1px;
}

#deck, #hand, #discards, #premeld {
    margin: 20px 0;
    position: relative;
    height: 160px;
    float: left;
}

#deck, #discards {
    width: 160px;
}

.PickupDiscards {
    position: absolute;
    left: 0;
    right: 0;
    width: 210px;
    height: 80px;
}

    .PickupDiscards .Meld {
        width: 100px;
        height: 80px;
    }

.PickUpDeckButton,
.PickUpDeckButton2 {
    position: absolute;
    top: 20px;
    left: 170px;
}

    .PickUpDeckButton:disabled,
    .PickUpDeckButton2:disabled {
        display: none;
    }

.Black3EndButton {
    position: absolute;
    top: 20px;
    left: 0px;
    width: 150px;
}

    .Black3EndButton:disabled {
        display: none;
    }

.bg-primary {
    --bs-bg-opacity: 1;
    background: linear-gradient(135deg, #37447e, #0b2942);
}

.history-card,
.stats-card {
    background: #0e61a5;
    border-radius: 10px;
    padding: 10px;
}

.table {
    border-radius: 20px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.card {
    cursor: pointer;
    width: 100px;
    height: 140px;
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.5);
    background: white;
    border: 2px solid #ccc;
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px 10px;
    font-weight: bold;
    user-select: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}


    .card.NewCard {
        box-shadow: 0 6px 16px #1ac218 !important;
    }

    .card.NewCardHidden {
        opacity: 0;
    }

    .card.BackCard {
        box-shadow: 0 6px 16px rgba(0,0,0,0.6);
        border-color: #2980b9;
        transition: none !important;
        background: url('../Images/CardBG.svg') center center no-repeat;
        background-size: cover;
    }

.BackOnlyCard .card {
    width: 100px;
    height: 140px;
    top: 10px !important;
    left: 20px !important;
    position: relative !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.6);
    border-color: #2980b9;
    transition: none !important;
    background: url('../Images/CardBG.svg') center center no-repeat;
    background-size: cover;
}

    .BackOnlyCard .card > div {
        display: none;
    }

        .BackOnlyCard .card > div.CardCount {
            display: block;
        }

#discards .card {
    width: 100px;
    height: 140px;
    top: 10px !important;
    left: 20px !important;
    position: absolute !important;
    box-shadow: none;
    border-color: #2980b9;
    transition: none !important;
}


    #discards .card:hover,
    #deck .card:hover {
        transform: scale(1.1) translateY(-10px) !important;
        box-shadow: 0 10px 30px rgba(41, 128, 185, 0.9) !important;
        border-color: #1abc9c !important;
    }



.card:hover {
    box-shadow: 0 12px 24px rgba(15, 13, 13, 0.7);
    transform: scale(1.1) translateY(-10px);
    border-color: #2980b9;
    z-index: 10;
}

.card .corner {
    font-size: 18px;
    line-height: 1;
}

.card .center {
    font-size: 48px;
    text-align: center;
    flex-grow: 1;
    line-height: 1;
}

.card.card.joker .center {
    line-height: 2;
}

.joker {
    color: #a93226;
}

.red {
    color: #d9534f;
}

.black {
    color: #222;
}

#hand, #premeld {
    height: 180px;
}

#hand {
    position: absolute;
    bottom: -5px; /* moves it up */
    left: 50%;
    transform: translateX(-50%);
    height: 160px;
    width: 500px;
}

#premeld {
    position: absolute;
    margin: auto;
    left: 30px;
    bottom: -140px;
}

.premeldButtons {
    position: absolute;
    margin: auto;
    left: 180px;
    bottom: 20px;
    z-index: 99;
}
/* Card styling and fan layout */
.fan-container {
    position: relative;
    height: 160px;
    user-select: none;
}

    .fan-container .card {
        cursor: pointer;
        width: 90px;
        height: 140px;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.35);
        background: white;
        border: 2px solid #bbb;
        position: absolute;
        top: 10px;
        transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 5px 8px;
        font-weight: bold;
        user-select: none;
    }

        .fan-container .card.red {
            color: #d9534f;
        }

        .fan-container .card.black {
            color: #222;
        }

        .fan-container .card.joker {
            color: #a93226;
        }

#premeld .discard,
.card .discard {
    display: none;
}

.fan-container .card .discard {
    display: none;
    top: 0;
    right: 0px;
    position: absolute;
    z-index: 100;
    padding: 2px 6px;
    border-radius: 5px;
    background-color: #2980b9;
    color: white;
}

.fan-container .card.highlighted .discard {
    display: block;
}

.fan-container .card.highlighted {
    border-color: #2980b9;
    box-shadow: 0 0 12px 4px #2980b9cc;
    z-index: 50 !important;
}

.fan-container .card.selected {
    transform: translateY(-25px) !important;
    border-color: #27ae60 !important;
    box-shadow: 0 0 16px 6px #27ae60cc !important;
    z-index: 60 !important;
}

.fan-container .card.wild {
    border-style: dashed;
    border-color: #f39c12 !important;
    box-shadow: 0 0 16px 6px #f39c12cc !important;
    z-index: 55 !important;
}
/* Deck top card style */
.tray {
    position: absolute;
    top: 210px;
    left: 50%;
    transform: translateX(-50%);
}

.trayLeft {
    background: #CD7F32;
    width: 161px;
    height: 202px;
    position: absolute;
    box-shadow: 0px 0px 7px 6px #7B3F00 inset;
}

.trayLeftCut {
    background: #CD7F32;
    width: 40px;
    height: 70%;
    top: 18%;
    position: absolute;
    opacity: 54%;
}

.trayRight {
    background: #CD7F32;
    width: 161px;
    height: 202px;
    position: absolute;
    margin-left: 161px;
    box-shadow: 0px 0px 7px 6px #7B3F00 inset;
}

#discards .card {
    width: 100px;
    height: 140px;
    top: 10px !important;
    left: 20px !important;
    position: absolute !important;
    box-shadow: none;
    border-color: #2980b9;
    transition: none !important;
}

#deck .card {
    width: 100px;
    height: 140px;
    top: 10px !important;
    left: 20px !important;
    position: relative !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.6);
    border-color: #2980b9;
    transition: none !important;
    background: url('../Images/CardBG.svg') center center no-repeat;
    background-size: cover;
}

    #deck .card > div {
        /* display: none;*/
    }


    #discards .card:hover,
    #deck .card:hover {
        transform: scale(1.1) translateY(-10px) !important;
        box-shadow: 0 10px 30px rgba(41, 128, 185, 0.9) !important;
        border-color: #1abc9c !important;
    }

#controls {
    text-align: center;
    margin-top: 10px;
}

#shuffle-btn {
    background: #2980b9;
    border: none;
    color: white;
    font-weight: 600;
    font-size: 16px;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 8px #1c5980;
    transition: background 0.3s ease;
    user-select: none;
}

    #shuffle-btn:hover {
        background: #3498db;
    }
/* Card suits */
.suit-spade, .suit-club {
    color: #222;
}

.suit-heart, .suit-diamond {
    color: #d9534f;
}

#discards .wildcard {
    transform: rotate(90deg);
    margin-left: -40px;
}

#discards .card.wildcard:hover {
    transform: rotate(90deg) scale(1.1) translateY(-10px) !important
}

.Meld {
    position: relative;
    width: 100px;
    height: 270px;
    float: left;
    zoom: 1;
}

    .Meld:empty {
        display: none;
    }
    .Meld.drag-over:empty {
         display: block !important; 
    }


    /* Offset each card by 20px more than the previous */

    .Meld .card {
        top: 0px;
    }

        .Meld .card:nth-child(1) {
            top: 0px;
        }

        .Meld .card:nth-child(2) {
            top: 25px;
        }

        .Meld .card:nth-child(3) {
            top: 50px;
        }

        .Meld .card:nth-child(4) {
            top: 75px;
        }

        .Meld .card:nth-child(5) {
            top: 100px;
        }

        .Meld .card:nth-child(6) {
            top: 125px;
        }

        .Meld .card:nth-child(7) {
            top: 150px;
        }


    .Meld:has(.card:nth-child(n+7)) .card:nth-child(1) {
        top: 0px;
    }

    .Meld:has(.card:nth-child(n+7)) .card:nth-child(2) {
        top: 5px;
    }

    .Meld:has(.card:nth-child(n+7)) .card:nth-child(3) {
        top: 10px;
    }

    .Meld:has(.card:nth-child(n+7)) .card:nth-child(4) {
        top: 15px;
    }

    .Meld:has(.card:nth-child(n+7)) .card:nth-child(5) {
        top: 20px;
    }

    .Meld:has(.card:nth-child(n+7)) .card:nth-child(6) {
        top: 25px;
    }

    .Meld:has(.card:nth-child(n+7)) .card:nth-child(7) {
        top: 30px;
    }

    .Meld:has(.card:nth-child(n+7)) .card:nth-child(8) {
        top: 35px;
    }

    .Meld:has(.card:nth-child(n+7)) .card:nth-child(9) {
        top: 40px;
    }

    .Meld:has(.card:nth-child(n+7)) .card:nth-child(10) {
        top: 45px;
    }

    .Meld:has(.card:nth-child(n+7)) .card:nth-child(11) {
        top: 50px;
    }

    .Meld:has(.card:nth-child(n+7)) .card:nth-child(12) {
        top: 55px;
    }

    /* If 7 or more cards to apply a modifier class */

    .Meld.MeldClosed .card:nth-child(1) {
        top: 0px;
    }

    .Meld.MeldClosed .card:nth-child(2) {
        top: 2px;
    }

    .Meld.MeldClosed .card:nth-child(3) {
        top: 4px;
    }

    .Meld.MeldClosed .card:nth-child(4) {
        top: 6px;
    }

    .Meld.MeldClosed .card:nth-child(5) {
        top: 8px;
    }

    .Meld.MeldClosed .card:nth-child(6) {
        top: 10px;
    }

    .Meld.MeldClosed .card:nth-child(7) {
        top: 12px;
    }

    .Meld.MeldClosed .card {
        top: 12px;
    }

    .Meld.MeldClosed {
        top: -50px;
    }

    .Meld.drag-over {
        background-color: rgba(255, 255, 255, 0.2);
        border: 2px dashed #fe00fe;
        border-radius: 5px;
        z-index: 10;
        padding: 0px 10px;
    }

        .Meld.drag-over:hover {
            background-color: rgba(0, 255, 0, 0.3);
            border-color: #0f0;
        }

#hand.drag-over {
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px dashed #fe00fe;
    border-radius: 5px;
    z-index: 10;
}

    #hand.drag-over:hover {
        background-color: rgba(0, 255, 0, 0.3);
        border-color: #0f0;
    }

#discards.drag-over {
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px dashed #fe00fe;
    border-radius: 5px;
    z-index: 10;
}

    #discards.drag-over:hover {
        background-color: rgba(0, 255, 0, 0.3);
        border-color: #0f0;
    }

.PlayerTopCards {
    width: 390px;
    height: 200px;
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.playerOpponent1 {
    position: absolute;
    top: 0;
    left: 0;
}

.playerTeamMate {
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
}

.playerOpponent2 {
    position: absolute;
    top: 0px;
    right: 0;
}

.playerTeamMeld {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 35%;
}

.OpponentTeamMeld {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35%;
}

.playerTitle {
    text-align: center;
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: 14px;
    white-space: nowrap;
}

.playerHand {
    bottom: 12px;
    position: absolute;
    left: 0;
    right: 0;
}

    .playerHand .playerTitle {
        bottom: 0px;
        position: absolute;
        margin: auto 47%;
        width: 100px;
        bottom: 270px;
        text-align: center;
    }

.MeldTitle {
    text-align: center;
    font-size: 24px;
    /* padding-bottom: 60px;*/
}

    .MeldTitle div {
        font-size: 16px;
    }

/* === Home Page Styles === */
.home-container {
    text-align: center;
    color: #e6f7ff;
    padding-top: 80px;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

form {
    width: 40vw;
    margin: auto;
    padding-top: 40px;
    padding-bottom: 110px;
}

.intro-section {
    animation: fadeInDown 1s ease-in-out;
}

.game-title {
    font-size: 3rem;
    letter-spacing: 1.2px;
    margin-bottom: 10px;
    color: #a9ebe5;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.4);
}

.subtitle {
    font-size: 1.3rem;
    color: #d9f2ff;
    margin-bottom: 40px;
}

.home-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.play-btn {
    background: #27ae60;
    color: white;
}

    .play-btn:hover {
        background: #2ecc71;
        transform: scale(1.05);
    }

.rules-btn {
    background: #3498db;
    color: white;
}

    .rules-btn:hover {
        background: #5dade2;
        transform: scale(1.05);
    }

.login-btn {
    background: #9b59b6;
    color: white;
}

    .login-btn:hover {
        background: #af7ac5;
        transform: scale(1.05);
    }

.feature-section {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 60px;
    flex-wrap: wrap;
    padding: 40px 0;
    animation: fadeInUp 1.5s ease;
}

.feature {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 12px;
    width: 250px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

    .feature:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-10px);
    }

    .feature i {
        font-size: 40px;
        margin-bottom: 15px;
        color: #f39c12;
    }

    .feature h3 {
        color: #a9ebe5;
        margin-bottom: 10px;
    }

    .feature p {
        color: #dceefc;
        font-size: 0.95rem;
    }

.home-footer {
    padding: 20px 0;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 0.9rem;
    color: #cfeaf6;
    text-align: center;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
