:root {
    --bg: #070510;
    --game: #0b0814;
    --table: #09070f;
    --sidebar: #120d20;
    --sidebar-dark: #0c0916;
    --input: #0a0712;
    --button: #130e22;
    --button-hover: #1f1735;
    --border: #2b2142;
    --border-soft: #1c152d;
    --text: #fbf8ff;
    --muted: #9a8eb0;
    --muted-2: #6f6188;
    --purple: #8b45ff;
    --purple-light: #d8beff;
    --purple-dark: #321765;
    --green: #38d98f;
    --red: #ff5f93;
    --yellow: #d8a7ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background:
            radial-gradient(circle at 74% 18%, rgba(124, 60, 255, 0.22), transparent 32%),
            radial-gradient(circle at 18% 88%, rgba(183, 140, 255, 0.13), transparent 30%),
            linear-gradient(180deg, #070510, #0a0714 55%, #05040b);
    color: var(--text);
    font-family: Inter, Arial, Helvetica, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.game {
    width: min(1210px, 100%);
    min-height: 610px;
    background: var(--game);
    border: 1px solid rgba(183, 140, 255, 0.12);
    box-shadow:
            0 20px 90px rgba(0, 0, 0, 0.62),
            0 0 60px rgba(124, 60, 255, 0.08);
    display: grid;
    grid-template-columns: 300px 1fr;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar {
    background:
            linear-gradient(180deg, rgba(30, 20, 53, 0.96), rgba(12, 9, 22, 0.99)),
            var(--sidebar);
    border-right: 1px solid rgba(183, 140, 255, 0.13);
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 21px;
}

.tabs {
    background: #080812;
    border: 1px solid #131323;
    border-radius: 10px;
    padding: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    overflow: visible;
    position: relative;
}

.tab {
    height: 36px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted-2);
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    box-shadow: none;
}

.tab.active {
    background: linear-gradient(180deg, #2b1f48, #1d1435);
    color: white;
    box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.08),
            inset 0 0 0 1px rgba(183, 126, 255, 0.08),
            0 6px 14px rgba(0, 0, 0, 0.22);
}

.side-bets-tab {
    overflow: visible;
}

.new-pill {
    position: absolute;
    top: -12px;
    right: -4px;
    background: linear-gradient(180deg, #69ff9e, #25c766);
    color: #06190d;
    font-size: 8px;
    font-weight: 1000;
    padding: 2px 6px;
    border-radius: 3px;
    box-shadow: 0 0 12px rgba(56, 217, 143, 0.25);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.label,
.sol-value {
    font-size: 12px;
    color: #b8aee0;
    font-weight: 900;
}

.sol-value {
    color: #6f6188;
}

.bet-row {
    display: grid;
    grid-template-columns: 1fr 39px 39px;
    gap: 6px;
}

.input-box {
    height: 42px;
    background: var(--input);
    border: 1px solid rgba(183, 140, 255, 0.12);
    border-radius: 7px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 9px;
    box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.025),
            0 0 18px rgba(124, 60, 255, 0.04);
}

.coin {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #d8beff 30%, #8c43ff 68%, #5d22d5 100%);
    color: #180b2f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 1000;
    box-shadow: 0 0 15px rgba(183, 140, 255, 0.4);
    flex: 0 0 auto;
}

.small-coin {
    width: 15px;
    height: 15px;
    font-size: 10px;
}

.gem {
    width: 15px;
    height: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #d8beff 30%, #8c43ff 68%, #5d22d5 100%);
    clip-path: polygon(50% 0%, 100% 35%, 78% 100%, 22% 100%, 0% 35%);
    filter: drop-shadow(0 0 8px rgba(183, 140, 255, 0.75));
    flex: 0 0 auto;
    display: inline-block;
    vertical-align: middle;
}

input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-weight: 1000;
    font-size: 14px;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    appearance: none;
    margin: 0;
}

.small-btn,
.action-btn,
.primary-btn,
.footer-btn {
    border: 1px solid rgba(183, 140, 255, 0.11);
    background: var(--button);
    color: #8f82aa;
    border-radius: 7px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.18s ease;
}

.small-btn {
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.25);
}

.small-btn:hover,
.action-btn:not(:disabled):hover,
.footer-btn:hover {
    background: var(--button-hover);
    color: white;
    box-shadow: 0 0 18px rgba(124, 60, 255, 0.12);
}

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.action-btn {
    height: 46px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-icon {
    width: 12px;
    height: 14px;
    border-radius: 2px;
    display: inline-block;
    transform: rotate(-10deg);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.green-icon {
    background: linear-gradient(180deg, #46ff9a, #018f42);
}

.red-icon {
    background: linear-gradient(180deg, #ff8a94, #9c3139);
}

.purple-icon {
    background: linear-gradient(180deg, #d8beff, #8b45ff);
}

.yellow-icon {
    background: linear-gradient(180deg, #ffe3a6, #b97b21);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.select-box {
    height: 42px;
    background: var(--input);
    border: 1px solid rgba(183, 140, 255, 0.12);
    border-radius: 7px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    font-size: 13px;
    font-weight: 1000;
    box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.025),
            0 0 18px rgba(124, 60, 255, 0.04);
}

.disabled-mode {
    opacity: 0.36;
    pointer-events: none;
    user-select: none;
    filter: grayscale(0.6);
}

.disabled-mode .select-box {
    background: #080610;
    border-color: rgba(183, 140, 255, 0.06);
    color: #6f6188;
    cursor: not-allowed;
    box-shadow: none;
}

.disabled-mode .label {
    color: #6f6188;
}

.primary-btn {
    height: 47px;
    background: linear-gradient(180deg, #9255ff, #672fd1);
    color: #f4edff;
    border: 1px solid rgba(216, 190, 255, 0.25);
    border-radius: 8px;
    font-size: 13px;
    box-shadow:
            0 14px 34px rgba(124, 60, 255, 0.22),
            inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.primary-btn:not(:disabled):hover {
    filter: brightness(1.12);
    color: #ffffff;
    box-shadow:
            0 16px 42px rgba(124, 60, 255, 0.32),
            inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.balance-box {
    margin-top: 4px;
    background: rgba(124, 60, 255, 0.045);
    border: 1px solid rgba(183, 140, 255, 0.12);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #d8ccf0;
    font-weight: 900;
    font-size: 12px;
}

.footer {
    margin-top: auto;
    display: flex;
    gap: 8px;
}

.footer-btn {
    height: 31px;
    padding: 0 10px;
    font-size: 11px;
    background: #0f0b1a;
}

.table {
    position: relative;
    background:
            radial-gradient(circle at 54% 46%, rgba(124, 60, 255, 0.12), transparent 30%),
            radial-gradient(circle at 80% 12%, rgba(183, 140, 255, 0.08), transparent 22%),
            linear-gradient(180deg, #100c1d, #0b0814 58%, #090712);
    overflow: hidden;
}

.table::before {
    content: "";
    position: absolute;
    inset: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.015);
    pointer-events: none;
}

.table > a {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 70px;
    height: 98px;
    text-decoration: none;
    z-index: 3;
    display: block;
}

.deck-link {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 70px;
    height: 98px;
    text-decoration: none;
    z-index: 3;
    display: block;
}

/* Detailed SolFlip deck */
.deck {
    position: relative;
    width: 70px;
    height: 98px;
    border-radius: 12px;
    background:
            linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 23%),
            radial-gradient(circle at 50% 27%, rgba(225, 202, 255, 0.28), transparent 18%),
            repeating-linear-gradient(
                    45deg,
                    rgba(255, 255, 255, 0.035) 0,
                    rgba(255, 255, 255, 0.035) 3px,
                    rgba(0, 0, 0, 0.04) 3px,
                    rgba(0, 0, 0, 0.04) 6px
            ),
            linear-gradient(180deg, #9e5cff 0%, #6f31dc 46%, #2b125d 100%);
    border: 2px solid rgba(230, 212, 255, 0.48);
    box-shadow:
            0 0 30px rgba(139, 69, 255, 0.55),
            0 16px 30px rgba(0, 0, 0, 0.42),
            inset 0 1px 0 rgba(255, 255, 255, 0.28),
            inset 0 -12px 26px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transform: rotate(1deg);
    overflow: hidden;
    isolation: isolate;
}

.deck::before {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
            inset 0 0 0 1px rgba(62, 20, 125, 0.55),
            inset 0 0 18px rgba(255, 255, 255, 0.035);
    pointer-events: none;
    z-index: 1;
}

.deck::after {
    content: "";
    position: absolute;
    inset: 11px;
    border-radius: 7px;
    border: 1px dashed rgba(239, 224, 255, 0.16);
    background:
            radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.055), transparent 38%),
            linear-gradient(135deg, transparent 0 46%, rgba(255, 255, 255, 0.08) 47% 50%, transparent 51% 100%);
    pointer-events: none;
    z-index: 1;
}

.deck .gem {
    width: 26px;
    height: 26px;
    z-index: 3;
    background:
            linear-gradient(135deg, #ffffff 0%, #e7d7ff 24%, #ae78ff 52%, #6b25ef 100%);
    filter:
            drop-shadow(0 0 8px rgba(255, 255, 255, 0.22))
            drop-shadow(0 0 12px rgba(183, 140, 255, 0.85));
}

.deck .gem::before {
    content: "";
    position: absolute;
}

.deck span:last-child,
.deck-brand {
    position: relative;
    z-index: 3;
    color: #ffffff;
    font-size: 8px;
    font-weight: 1000;
    line-height: 1;
    letter-spacing: 0.75px;
    text-transform: none;
    text-shadow:
            0 1px 1px rgba(0, 0, 0, 0.45),
            0 0 8px rgba(255, 255, 255, 0.32),
            0 0 14px rgba(183, 140, 255, 0.72);
}

.deck span:last-child::before,
.deck-brand::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -7px;
    width: 34px;
    height: 1px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
}

.deck span:last-child::after,
.deck-brand::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 28px;
    height: 1px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
}

.deck:hover {
    transform: rotate(1deg) translateY(-2px);
    box-shadow:
            0 0 38px rgba(139, 69, 255, 0.68),
            0 18px 34px rgba(0, 0, 0, 0.48),
            inset 0 1px 0 rgba(255, 255, 255, 0.32),
            inset 0 -12px 26px rgba(0, 0, 0, 0.28);
}

.center-message {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.twenty-one {
    font-size: 58px;
    line-height: 0.9;
    font-weight: 1000;
    color: rgba(124, 60, 255, 0.38);
    text-shadow: 0 0 24px rgba(124, 60, 255, 0.22);
    margin-bottom: 14px;
}

h1 {
    font-size: 30px;
    font-weight: 1000;
    color: #ffffff;
    text-shadow:
            0 0 18px rgba(183, 140, 255, 0.18),
            2px 2px 0 rgba(255, 255, 255, 0.08);
    letter-spacing: -1.5px;
}

.subtitle {
    margin-top: 13px;
    color: #827392;
    font-size: 12px;
    font-weight: 1000;
    letter-spacing: 2px;
}

.play-area {
    position: absolute;
    inset: 0;
    padding: 38px 34px 30px;
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
}

.hand-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 190px;
}

.hand-title {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #c7b9e5;
    font-size: 12px;
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.score {
    color: #ffffff;
    background: rgba(124, 60, 255, 0.22);
    border: 1px solid rgba(183, 140, 255, 0.28);
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    box-shadow: 0 0 18px rgba(124, 60, 255, 0.16);
}

.cards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 116px;
    perspective: 1000px;
}

.card {
    width: 76px;
    height: 108px;
    border-radius: 9px;
    background: linear-gradient(180deg, #f8f8f8, #d7d7db);
    color: #111116;
    box-shadow:
            0 14px 25px rgba(0, 0, 0, 0.48),
            inset 0 1px 0 rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.55);
    position: relative;
    padding: 9px;
    font-weight: 1000;
    transform-style: preserve-3d;
    animation: dealCard 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
    will-change: transform, opacity;
}

.card.no-animation {
    animation: none;
}

.card.flipping {
    animation: flipCard 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.card.red {
    color: #c93e48;
}

.card.back {
    background:
            radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.16), transparent 18%),
            repeating-linear-gradient(
                    45deg,
                    rgba(255, 255, 255, 0.035) 0,
                    rgba(255, 255, 255, 0.035) 3px,
                    rgba(0, 0, 0, 0.04) 3px,
                    rgba(0, 0, 0, 0.04) 6px
            ),
            linear-gradient(135deg, #8b45ff, #26104e);
    border-color: rgba(216, 190, 255, 0.4);
    box-shadow:
            0 0 22px rgba(124, 60, 255, 0.18),
            0 14px 25px rgba(0, 0, 0, 0.42);
}

.card.back::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.13);
}

.card-value {
    font-size: 20px;
    line-height: 1;
}

.card-suit {
    font-size: 22px;
    margin-top: 3px;
}

.card-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.active-hand {
    outline: 1px solid rgba(183, 140, 255, 0.55);
    box-shadow: 0 0 28px rgba(124, 60, 255, 0.2);
    border-radius: 14px;
    padding: 10px 16px;
}

.hand-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.notice {
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    min-width: 280px;
    max-width: calc(100% - 50px);
    padding: 12px 18px;
    border-radius: 8px;
    background: rgba(13, 9, 24, 0.9);
    border: 1px solid rgba(183, 140, 255, 0.13);
    text-align: center;
    color: #e8ddff;
    font-size: 13px;
    font-weight: 900;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 24px rgba(124, 60, 255, 0.1);
}

.hidden {
    display: none !important;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 10;
}

.modal-card {
    width: min(430px, 100%);
    background: #120d20;
    border: 1px solid rgba(183, 140, 255, 0.16);
    border-radius: 14px;
    padding: 22px;
    box-shadow:
            0 25px 90px rgba(0, 0, 0, 0.6),
            0 0 55px rgba(124, 60, 255, 0.12);
}

.modal-card h2 {
    margin-bottom: 10px;
}

.modal-card p,
.modal-card li {
    color: #b7b5be;
    font-size: 14px;
    line-height: 1.6;
}

.modal-card ul {
    padding-left: 18px;
    margin: 10px 0 18px;
}

@keyframes dealCard {
    0% {
        opacity: 0;
        transform: translate(260px, -170px) rotate(13deg) scale(0.72);
        filter: blur(3px);
    }

    55% {
        opacity: 1;
        transform: translate(-8px, 5px) rotate(-2deg) scale(1.03);
        filter: blur(0);
    }

    100% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
        filter: blur(0);
    }
}

@keyframes flipCard {
    0% {
        opacity: 0.2;
        transform: rotateY(-90deg) scale(1.05);
    }

    45% {
        opacity: 0.7;
        transform: rotateY(-20deg) scale(1.04);
    }

    100% {
        opacity: 1;
        transform: rotateY(0deg) scale(1);
    }
}

@media (max-width: 780px) {
    body {
        align-items: flex-start;
        padding: 10px;
    }

    .game {
        grid-template-columns: 1fr;
        min-height: 900px;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(183, 140, 255, 0.13);
    }

    .table {
        min-height: 610px;
    }

    .table > a,
    .deck-link {
        width: 56px;
        height: 78px;
        right: 18px;
    }

    .deck {
        width: 56px;
        height: 78px;
    }

    .deck .gem {
        width: 20px;
        height: 20px;
    }

    .deck span:last-child,
    .deck-brand {
        font-size: 7px;
        letter-spacing: 0.5px;
    }

    .card {
        width: 62px;
        height: 90px;
    }

    h1 {
        font-size: 25px;
    }

    .footer {
        display: none;
    }
}