:root {
    --casino-green: #1a472a;
    --casino-green-dark: #0d2b1a;
    --gold: #d4af37;
    --gold-bright: #f9e272;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    --panel-bg: rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
}

body {
    background-color: #000;
    color: #fff;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(1.0);
}

#bj-winner-overlay {
    overflow:visible;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0.5); 
    margin-top: 40px;
    margin-left: 100px;
    width: 400px;
    height: 300px;
    z-index: 666;
}


#game-container {
    width: 100vw;
    height: 100vh;
   display: grid;
    grid-template-areas:
        "sidebar-l header    sidebar-r"
        "sidebar-l main      sidebar-r"
        "sidebar-l footer    sidebar-r";
    grid-template-columns: 300px 1fr 120px;
    grid-template-rows: 60px 1fr 100px;
    background: radial-gradient(circle, var(--casino-green) 0%, var(--casino-green-dark) 100%);
    position: relative;
}

/* Sidebar Left: Stats & Nice Lady */
#sidebar-left {
    grid-area: sidebar-l;
    background: var(--panel-bg);
    border-right: 0 solid var(--glass-border); /* moet 1px zijn */
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 10;
}

.stats-panel {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #ccc;
}

.stat-value {
    color: var(--gold-bright);
    font-weight: bold;
}

.highlight-stat {
    border-bottom: 2px solid var(--gold);
    padding-bottom: 5px;
    margin-bottom: 20px;
}

#credits-display {
    color: #fff;
    margin-top: -11px;
    font-size: 1.2rem;
    background: #c00;
    padding: 5px 10px;
    border-radius: 4px;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Header: Info & Menu */
header {
    grid-area: header;
    background: var(--panel-bg);
    border-bottom: 0 solid var(--glass-border); /* moet 1px zijn */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 10;
}

.header-info {
    display: flex;
    gap: 30px;
    color: #eee;
    font-size: 0.85rem;
}

.header-info span {
    color: var(--gold-bright);
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-btn {
    background: var(--glass);
    border: 1px solid var(--gold);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
}

.header-btn:hover {
    background: var(--gold);
    color: #000;
}

/* Main: Table */
main {
    grid-area: main;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 40px;
}

#table-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    pointer-events: none;
}

.hand-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
    transition: 0.3s;
}

.hands-wrapper {
    display: flex;
    justify-content: center;
    gap: 40px;
    width: 100%;
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    min-height: 160px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    transition: 0.3s;
    border: 2px solid transparent;
}

.cards-container.active-hand {
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.label-container {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 5;
    border: 2px solid transparent;    
}

.hand-label {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: var(--text-shadow);
}

.hand-score {
    background: var(--gold);
    color: #000;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Banner Animations */
.banner {
    position: absolute;
    top: 98px;
    background: #c00;
    color: #fff;
    padding: 8px 100px;
    font-weight: bold;
    transform: skew(-20deg);
    border: 2px solid var(--gold-bright);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 20;
    display: none;
    animation: bannerPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bannerPop {
    from {
        opacity: 0;
        transform: skew(-20deg) scale(0.5);
    }

    to {
        opacity: 1;
        transform: skew(-20deg) scale(1);
    }
}

/* Sidebar Right: Chips */
#sidebar-right {
    grid-area: sidebar-r;
    background: var(--panel-bg);
    border-left: 0 solid var(--glass-border); /* moet 1px zijn */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.chip {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 5px dashed #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    position: relative;
    background-size: cover;
}
#Frie {
    justify-content: center;
    align-items: center;
    color: #444;
    font-weight: bold;
    font-family: Roboto Cn, Helvetica, Roboto Cn;
    font-style: italic;
    font-size: 0.65rem;    
}
.chip:hover {
    transform: scale(1.2) rotate(15deg);
   /* box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6); */
    box-shadow: 1px 1px 50px rgba(255, 0, 0, 1.0);    
}

.chip:active {
    transform: scale(0.95);
}

.chip.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(1);
}

.chip-100 {
    background: radial-gradient(circle, #5e2a84 0%, #3a1c52 100%);
}

.chip-50 {
    background: radial-gradient(circle, #2e7d32 0%, #1b5e20 100%);
}

.chip-25 {
    background: radial-gradient(circle, #c62828 0%, #8e0000 100%);
}

.chip-10 {
    background: radial-gradient(circle, #1565c0 0%, #0d47a1 100%);
}

.chip-5 {
    background: radial-gradient(circle, #ef6c00 0%, #e65100 100%);
}

/* Footer: Controls */
footer {
    grid-area: footer;
    background: var(--panel-bg);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    z-index: 10;
    padding: 0 20px;
}

.game-btn {
    background: linear-gradient(to bottom, #444, #222);
    border: 1px solid #666;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    min-width: 100px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    transition: 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.hand-label {
     display: flex;   
    
}
.game-btn:hover {
    background: linear-gradient(to bottom, #666, #444);
    border-color: #999;
}

.game-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: none;
}

.game-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.game-btn.primary {
    background: linear-gradient(to bottom, #d4af37, #aa8a1e);
    border-color: #f9e272;
    color: #000;
}

.game-btn.primary:hover:not(:disabled) {
    background: linear-gradient(to bottom, #f9e272, #d4af37);
}

/* Card Styles */
.card {
    width: 100px;
    height: 145px;
    background-color: #1a472a; /*#fff; */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    background-color: #1a472a;    
}

.card.hidden {
    transform: rotateY(180deg);
}

.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('./static/gray_back.png');
    /* Fallback if not loaded */
    background-size: cover;
    border-radius: 8px;
    backface-visibility: hidden;
    transform: rotateY(180deg);
}

.card-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

/* Animations */
@keyframes dealCard {
    from {
        transform: translate(500px, -500px) rotate(180deg);
        opacity: 0;
    }

    to {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
}

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

/* Tooltip/Advice */
#msg-bar {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 1px 81px;
    border-radius: 4px;
    border: 1px solid var(--gold);
    /*color: var(--gold-bright);*/
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-transform: uppercase;
    font-size: 0.88rem;
    z-index: 25;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    letter-spacing: 1px;
    pointer-events: none;
    white-space: nowrap;
/*    opacity: 0.2; */
}

.msg-bar {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: bold; 
    font-smooth: 2em;    
    color: #fff; 
    opacity: 1.0;
}