.hidden {
    display: none !important;
}

/* Basic Styles */
body {
    font-family: 'Montserrat', sans-serif;
    background-color: #1a1a2e;
    /* Deep Royal Blue/Charcoal base */
    color: #fff;
    margin: 0;
    padding: 0;
    overflow: hidden;
    user-select: none;
}

/* Screen Management */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    z-index: 10;
}

.screen.active {
    display: flex;
}

/* Main Menu Visuals */
#main-menu {
    background: radial-gradient(circle at center, #1a1a2e 0%, #000 100%);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
}

.menu-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 10;
}

.floating-symbol {
    position: absolute;
    bottom: -50px;
    font-size: 2rem;
    color: rgba(0, 255, 255, 0.1);
    animation: floatUp 15s linear infinite;
    user-select: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.5;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-110vh) rotate(360deg);
        opacity: 0;
    }
}

/* Randomize symbols slightly */
.floating-symbol:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.floating-symbol:nth-child(2) {
    left: 25%;
    animation-delay: 4s;
    font-size: 3rem;
}

.floating-symbol:nth-child(3) {
    left: 45%;
    animation-delay: 8s;
}

.floating-symbol:nth-child(4) {
    left: 65%;
    animation-delay: 2s;
    font-size: 2.5rem;
}

.floating-symbol:nth-child(5) {
    left: 80%;
    animation-delay: 6s;
}

.floating-symbol:nth-child(6) {
    left: 90%;
    animation-delay: 10s;
}

.menu-content {
    position: relative;
    z-index: 5;
    text-align: center;
}

.game-title {
    font-size: 5rem;
    margin: 0;
    letter-spacing: 10px;
    text-shadow: none;
    /* Removed neon glow */
}

.game-title .accent {
    color: #FFD700;
    /* Gold accent */
}

.subtitle {
    font-size: 1rem;
    letter-spacing: 5px;
    color: #94a3b8;
    margin-bottom: 50px;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.menu-btn {
    background: transparent;
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    padding: 12px 40px;
    width: 250px;
    font-size: 1rem;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.menu-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    transform: scale(1.05);
}

.menu-btn.hidden {
    display: none;
}

.version-text {
    margin-top: 40px;
    font-size: 0.7rem;
    color: #444;
    letter-spacing: 2px;
}

.fade-out {
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        visibility: hidden;
    }
}

.game-info-top-left {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    z-index: 1000;
    pointer-events: none;
    display: none;
    /* Hidden until game starts */
}

.game-info-top-left .info-item {
    font-size: 1rem;
    color: #94a3b8;
    letter-spacing: 1px;
}

.game-info-top-left .info-item span {
    color: #fff;
    font-weight: bold;
}

.hands-left-container {
    position: fixed;
    top: 20px;
    left: 140px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #00ffff;
    padding: 6px 14px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    font-size: 0.8rem;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
    pointer-events: none;
    display: none;
    /* Hidden until game starts */
}

#hands-left-count {
    color: #ff3366;
    text-shadow: 0 0 5px #ff3366;
}

#goal-display {
    color: #ffd700;
}

.info-buttons-row {
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

#game-settings-button {
    pointer-events: auto;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 15px;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

#game-settings-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

.info-buttons {
    display: flex;
    gap: 10px;
}

.odds-button,
.shop-button {
    background: transparent;
    border: 1px solid #FFD700;
    /* Gold */
    color: #FFD700;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    font-family: inherit;
    transition: all 0.3s;
    pointer-events: auto;
}

.shop-button {
    border-color: #FFD700;
    color: #FFD700;
}

.odds-button:hover {
    background: #FFD700;
    color: #1a1a1a;
    box-shadow: 0 0 10px #FFD700;
}

.shop-button:hover {
    background: #FFD700;
    color: #1a1a1a;
    box-shadow: 0 0 10px #FFD700;
}

.rules-modal {
    background: rgba(10, 10, 20, 0.95);
    border: 2px solid #00ffff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.1);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    padding: 30px;
}

.rules-modal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
}

.rules-modal h2 {
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.theme-text {
    font-style: italic;
    color: #ccc;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.rules-list {
    text-align: left;
    margin-bottom: 15px;
}

.rule-item {
    margin-bottom: 8px;
    color: #fff;
}

.odds-tables-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    text-align: left;
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.1);
}

.odds-tables-container::-webkit-scrollbar {
    width: 6px;
}

.odds-tables-container::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 3px;
}

.odds-table-section {
    background: rgba(0, 255, 255, 0.05);
    padding: 15px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 5px;
}

.odds-table-section h4 {
    margin: 0 0 5px 0;
    color: #00ffff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table-desc {
    font-size: 0.75em;
    color: #aaa;
    margin-bottom: 10px;
    line-height: 1.4;
}

.odds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.odds-table th {
    text-align: left;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    padding-bottom: 5px;
}

.odds-table td {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.odds-table td:last-child {
    text-align: right;
    font-weight: bold;
    color: #ffd700;
}

.odds-table tr:hover td {
    background: rgba(0, 255, 255, 0.1);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.visible {
    display: flex;
}

/* Standardized Modal UI */
.standard-modal {
    background: #0a0a14;
    border: 2px solid #00ffff;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 255, 255, 0.2);
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 0;
    overflow: hidden;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    animation: modalAppear 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: transparent;
    overflow: hidden;
}

.modal-visual-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

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

.modal-header {
    display: flex;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid rgba(0, 255, 255, 0.2);
    background: rgba(0, 255, 255, 0.03);
    flex-shrink: 0;
    z-index: 100;
}

.modal-title {
    flex-grow: 1;
    text-align: center;
    margin: 0;
    color: #ff00ff;
    text-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
    letter-spacing: 6px;
    text-transform: uppercase;
    font-size: 1.8rem;
    font-weight: 700;
}

.modal-body {
    padding: 30px 40px;
    overflow-y: auto;
    flex-grow: 1;
    scrollbar-width: thin;
    scrollbar-color: #00ffff rgba(0, 0, 0, 0.2);
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 4px;
}

.modal-back-button {
    background: transparent;
    border: 2px solid #00ffff;
    color: #00ffff;
    padding: 10px 25px;
    cursor: pointer;
    font-weight: 800;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.modal-back-button::before {
    content: "←";
    margin-right: 10px;
    font-size: 1.2em;
}

.modal-back-button:hover {
    background: #00ffff;
    color: #121212;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

/* Modal Specific Adjustments */
.shop-modal {
    max-width: 1200px;
    width: 98vw;
    height: 95vh;
}

.rules-modal {
    max-width: 900px;
}

.settings-modal-content {
    max-width: 700px;
}

.shop-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    flex: 1;
    margin-top: 30px;
    overflow: hidden;
}

.shop-items-area {
    overflow-y: auto;
    padding-right: 20px;
}

.inventory-area {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inventory-area h3 {
    margin-top: 0;
    color: #00ffff;
    border-bottom: 1px solid #00ffff;
    padding-bottom: 10px;
}

.inventory-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 10px;
}

.inventory-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    margin-bottom: 10px;
    border-left: 3px solid #ff00ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    gap: 15px;
}

.inventory-item-image {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.inventory-item h4 {
    margin: 0;
    font-size: 0.9em;
    color: #ff00ff;
}

.inventory-item p {
    margin: 2px 0;
    font-size: 0.7em;
    opacity: 0.8;
}

.sell-button {
    background: #ff00ff;
    border: none;
    padding: 5px 10px;
    font-size: 0.8em;
    font-weight: bold;
    cursor: pointer;
    color: white;
}

.sell-button:hover {
    background: #cc00cc;
}

.shop-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.shop-tier h3 {
    border-bottom: 1px solid #ff00ff;
    padding-bottom: 5px;
    color: #ff00ff;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.shop-timer {
    text-align: center;
    color: #ff00ff;
    font-size: 0.9em;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.shop-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s;
    position: relative;
    min-height: 180px;
}

.shop-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00ffff;
    transform: translateY(-5px);
}

.shop-item-image {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0 auto 10px auto;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.rarity-tag {
    display: none;
}

.rarity-common .rarity-tag {
    background: #666;
    color: #fff;
}

.rarity-uncommon .rarity-tag {
    background: #27ae60;
    color: #fff;
}

.rarity-rare .rarity-tag {
    background: #2980b9;
    color: #fff;
}

.rarity-legendary .rarity-tag {
    background: #f1c40f;
    color: #000;
    box-shadow: 0 0 10px #f1c40f;
}

.shop-item.rarity-legendary {
    border: 1px solid #f1c40f;
    background: rgba(241, 196, 15, 0.05);
}

.shop-item h4 {
    margin: 5px 0;
    font-size: 1em;
    color: #fff;
}

.shop-item p {
    margin: 5px 0;
    font-size: 0.8em;
    color: #ccc;
    line-height: 1.4;
    flex-grow: 1;
}

.shop-item .buy-button {
    margin-top: 10px;
    width: 100%;
    padding: 8px;
    border-radius: 4px;
}

.settings-modal-content {
    min-width: 400px;
}

.settings-nav-buttons {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-nav-buttons .menu-button {
    margin: 0;
    width: 100%;
}

.info-top-row {
    display: flex;
    align-items: center;
    gap: 15px;
    pointer-events: auto;
}

.icon-button {
    background: transparent;
    border: 1px solid #00ffff;
    color: #00ffff;
    border-radius: 5px;
    cursor: pointer;
    padding: 5px;
    font-size: 1.2em;
    transition: all 0.3s;
    pointer-events: auto;
}

.icon-button:hover {
    background: #00ffff;
    color: #1a1a1a;
    box-shadow: 0 0 10px #00ffff;
}

.setting-item {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shop-item-info {
    display: flex;
    flex-direction: column;
}

.shop-item .shop-item-info {
    align-items: center;
    text-align: center;
}

.inventory-item .shop-item-info {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex: 1;
    text-align: left;
}

.shop-item-info h4 {
    margin: 0;
    font-size: 0.9em;
    color: #00ffff;
}

.shop-item-info p {
    margin: 2px 0;
    font-size: 0.7em;
    opacity: 0.8;
}

.buy-button {
    background: #00ffff;
    border: none;
    padding: 5px 10px;
    font-size: 0.8em;
    font-weight: bold;
    cursor: pointer;
}

.buy-button:disabled {
    background: #444;
    cursor: not-allowed;
}

.lootbox-section {
    margin-top: 20px;
    border-top: 1px solid #00ffff;
    padding-top: 10px;
}

.lootbox-buttons {
    display: flex;
    gap: 10px;
}

.lootbox-button {
    flex: 1;
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    border: none;
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    color: white;
}

.slider-container {
    width: 200px;
    height: 10px;
    background-color: #444;
    border-radius: 5px;
    position: relative;
}

.slider-fill {
    width: 50%;
    height: 100%;
    background-color: #00ffff;
    border-radius: 5px;
}

.slider-thumb {
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: #00ffff;
}

input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

.modal-close-button {
    background-color: transparent;
    border: 2px solid #00ffff;
    color: #00ffff;
    padding: 10px 25px;
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 2px;
    margin-top: 20px;
    transition: all 0.3s;
    text-transform: uppercase;
    flex-shrink: 0;
}

.modal-close-button:hover {
    background-color: #00ffff;
    color: #1a1a1a;
    box-shadow: 0 0 20px #00ffff;
}

/* Game View Styles */
.game-container {
    height: 100vh;
    width: 100vw;
    background-color: #0f172a;
    /* Dark Navy/Charcoal */
    background-image:
        radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    overflow: hidden;
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
}

.game-container.active {
    display: flex;
}

.table-surface {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1600px;
    max-height: 900px;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px 40px;
    box-sizing: border-box;
}

@media (max-aspect-ratio: 16/9) {
    .table-surface {
        width: 100vw;
        height: 56.25vw;
        /* 9/16 of width */
    }
}

@media (min-aspect-ratio: 16/9) {
    .table-surface {
        height: 100vh;
        width: 177.78vh;
        /* 16/9 of height */
    }
}

.dealer-area {
    height: 180px;
    /* Slightly more compact */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.player-area {
    height: 200px;
    /* Pull cards up more */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -30px;
    position: relative;
    /* Added for score badge positioning */
}

.dealer-hand-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.player-hand-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.player-hands-container {
    display: flex;
    flex-direction: row;
    gap: 40px;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.player-hand {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-width: 120px;
}

.score-badge {
    margin-left: 10px;
    width: 32px;
    height: 32px;
    background: #FFD700;
    /* Gold */
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    z-index: 100;
    border: 2px solid #fff;
    flex-shrink: 0;
}

#deck-container {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#deck-container .card {
    margin: 0;
    position: absolute;
}

/* Give the deck some depth */
#deck-container::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 140px;
    background: rgba(255, 255, 255, 0.05);
    /* Grounded slot */
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transform: translate(2px, 2px);
}

.dealer-label {
    font-size: 1.2em;
    font-weight: bold;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.3);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    margin-top: 10px;
    transition: opacity 0.3s ease;
}

.dealer-portrait-container {
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
    cursor: pointer;
}

.dealer-portrait-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* State when cards are out - shift to left */
.dealer-portrait-container.playing {
    position: absolute;
    left: calc(50% - 350px);
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 120px;
    margin-bottom: 0;
}

.dealer-portrait-container.playing img {
    border-width: 2px;
}

/* Hide label when playing to keep it clean */
.dealer-area.playing .dealer-label {
    opacity: 0;
}


/* Score displays moved to badges */
.dealer-score {
    display: none;
}

/* Player area moved up in block above */

.info-status {
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    color: #FFD700;
    /* Gold accent */
    min-height: 1.2em;
    margin: 20px 0;
}

/* Betting Spots */
.betting-spots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 20px;
    margin-bottom: 20px;
    transform: translateY(-25px);
    /* Nudged up further */
    z-index: 50;
    flex-grow: 1;
}

.bet-spot {
    width: 60px;
    /* Reduced size */
    height: 60px;
    /* Reduced size */
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bet-spot:hover {
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.bet-spot.main-bet {
    width: 100px;
    /* Also slightly smaller but still larger than side bets */
    height: 100px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.5);
}

.spot-label {
    font-size: 0.5em;
    /* Smaller label for smaller spots */
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    text-align: center;
}

.chip-stack {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* UI Overlay & Chips */
.ui-overlay {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    border-radius: 60px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 50px 40px 50px;
    /* Match bottom spacing of action bar */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    gap: 20px;
}

.balance-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
}

.balance-display .label {
    font-size: 0.6em;
    color: #00ffff;
    letter-spacing: 1px;
}

#balance-amount {
    font-size: 1.4em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.chip-tray {
    display: flex;
    justify-content: space-evenly;
    flex-grow: 1;
    gap: 10px;
}

.selectable-chip {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px dashed white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.selectable-chip:hover {
    transform: scale(1.1) translateY(-5px);
}

.selectable-chip.active {
    outline: 3px solid #00ffff;
    outline-offset: 5px;
    transform: scale(1.1);
}

.selectable-chip.red {
    background-color: #d63031;
}

.selectable-chip.blue {
    background-color: #0984e3;
}

.selectable-chip.green {
    background-color: #27ae60;
}

.selectable-chip.black {
    background-color: #2d3436;
}

.selectable-chip.gold {
    background-color: #f1c40f;
    color: #000;
    border-color: #000;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-self: end;
}

.action-buttons button {
    background: transparent;
    border: 2px solid #00ffff;
    color: #00ffff;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}

.action-buttons button:hover {
    background: #00ffff;
    color: #1a1a1a;
}

.controls {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 100;
}

.action-bar {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 30px;
    border-radius: 60px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-bar button {
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.action-bar .primary-btn {
    padding: 18px 45px;
    font-size: 1.2rem;
    background: #fff;
    color: #000;
}

.action-bar .secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.action-bar .primary-btn:hover:not(:disabled) {
    background: #FFD700;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
}

.action-bar .secondary-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Old button styles removed */

.controls button:disabled {
    opacity: 0.5;
    /* Requirement A: visual style for disabled state */
    cursor: not-allowed;
    filter: grayscale(1);
    transform: none !important;
}

.special-actions {
    display: flex;
    gap: 10px;
}

#rewind-button,
#bribe-button {
    background: #8b0000;
    color: white;
    border: 1px solid #ff0000;
    padding: 8px 15px;
    font-size: 0.8em;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

#rewind-button:hover,
#bribe-button:hover {
    background: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.card-selector-modal {
    max-width: 800px;
    width: 90%;
}

.card-selector-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    margin-bottom: 20px;
}

.selector-card {
    background: white;
    color: black;
    border-radius: 4px;
    padding: 10px 5px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    transition: transform 0.1s;
}

.selector-card:hover {
    transform: scale(1.1);
    background: #ffd700;
}

.selector-card.red {
    color: #d40000;
}

/* Action specific colors removed in favor of unified Action Bar */

.controls button:active:not(:disabled) {
    transform: scale(0.95);
}

/* The Card Container */
.card {
    width: 100px;
    height: 140px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    position: relative;
    display: inline-block;
    margin: 10px;
    font-family: 'Montserrat', sans-serif;
    /* Cleaner font */
    font-weight: bold;
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Hover Effect */
.card:hover {
    transform: translateY(-10px);
    /* Card pops up when you mouse over */
}

/* Top Left Number */
.card-top-left {
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 1.2rem;
}

/* Bottom Right Number (Rotated) */
.card-bottom-right {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 1.2rem;
    transform: rotate(180deg);
}

/* Center Suit (Big) */
.card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
}

/* Colors */
.card.red {
    color: #d63031;
}

.card.black {
    color: #2d3436;
}

.card.hidden-card {
    background: #1e293b;
    background-image:
        radial-gradient(circle at center, #334155 0%, #1e293b 100%);
    border: 2px solid #FFD700;
    /* Gold border for hidden card */
}

.card.hidden-card>* {
    display: none;
    /* Hide card value and suit */
}

/* Actual placed chips */
.placed-chip {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px dashed white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
    position: absolute;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    user-select: none;
}

.placed-chip.red {
    background-color: #d63031;
}

.placed-chip.blue {
    background-color: #0984e3;
}

.placed-chip.green {
    background-color: #27ae60;
}

.placed-chip.black {
    background-color: #2d3436;
}

.placed-chip.gold {
    background-color: #f1c40f;
    color: #000;
    border-color: #000;
}

/* Achievement Toast Styles */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3), inset 0 0 10px rgba(255, 215, 0, 0.1);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    clip-path: polygon(5% 0, 100% 0, 100% 80%, 95% 100%, 0 100%, 0 20%);
}

.toast.visible {
    transform: translateX(0);
}

.toast-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 5px #ffd700);
}

.toast-title {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #ffffff;
}

.total-bet-display {
    position: fixed;
    bottom: 10px;
    /* Moved down from 20px */
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    z-index: 1000;
    pointer-events: none;
}

/* Settings Menu Redesign */
#settings-modal {
    background: black;
    color: #0ff;
    overflow: hidden;
}

.glass-morphism {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 4px;
    z-index: 10;
}

.settings-container {
    width: 500px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.neon-text {
    font-family: 'Courier New', Courier, monospace;
    text-shadow: 0 0 10px #0ff;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 1rem;
}

.section-header {
    font-size: 0.9rem;
    color: #f0f;
    border-bottom: 1px solid #f0f;
    margin-bottom: 1rem;
    padding-bottom: 0.2rem;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.mono {
    font-family: 'Courier New', Courier, monospace;
}

.settings-input {
    background: #111;
    border: 1px solid #0ff;
    color: #0ff;
    padding: 0.4rem;
    width: 200px;
}

.void-button {
    background: transparent;
    border: 1px solid #f0f;
    color: #f0f;
    padding: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.void-button:hover {
    background: rgba(255, 0, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
}

#deal-button,
#re-bet-button,
#clear-bet-button {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#deal-button {
    background: linear-gradient(135deg, #ffd700, #b8860b);
    color: #000;
    border: none;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.4);
}

#re-bet-button {
    background: linear-gradient(135deg, #444, #222);
    color: #fff;
    border: 1px solid #666;
}

#clear-bet-button {
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
}

#deal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.6);
}

#re-bet-button:hover {
    background: linear-gradient(135deg, #555, #333);
}

#clear-bet-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.close-button.neon-border {
    background: #0ff;
    color: black;
    border: none;
    padding: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s;
}

.close-button.neon-border:hover {
    background: #fff;
    box-shadow: 0 0 20px #0ff;
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

/* Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border: 1px solid #0ff;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: #0ff;
    transition: .4s;
}

input:checked+.slider {
    background-color: rgba(0, 255, 255, 0.2);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.settings-range {
    -webkit-appearance: none;
    appearance: none;
    width: 200px;
    height: 6px;
    background: #111;
    outline: none;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 3px;
    margin: 10px 0;
}

.settings-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #0ff;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.settings-range::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #0ff;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Animations and Visual Polish */

@keyframes drawCard {
    0% {
        transform: translate(200px, -200px) rotate(20deg) scale(0.5);
        opacity: 0;
    }

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

.card.drawn {
    animation: drawCard 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes winFlash {
    0% {
        box-shadow: inset 0 0 0px #00ffff;
    }

    50% {
        box-shadow: inset 0 0 100px #00ffff;
    }

    100% {
        box-shadow: inset 0 0 0px #00ffff;
    }
}

.win-celebration {
    animation: winFlash 1s ease-in-out infinite;
}

/* Legendary Holo Effect */
.card.legendary {
    background: linear-gradient(135deg, #fff 0%, #f1c40f 50%, #fff 100%);
    background-size: 200% 200%;
    animation: holo 3s linear infinite;
    border: 2px solid #f1c40f;
}

@keyframes holo {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Inventory Icons / Markers */
.inventory-item {
    transition: transform 0.2s;
}

.inventory-item:hover {
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}


.inventory-item.rarity-common {
    border-left-color: #666;
}

/* Cheat Console */
.cheat-console-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    font-family: 'Montserrat', sans-serif;
}

.cheat-console-content {
    background: #1a1a1a;
    border: 2px solid #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    padding: 30px;
    border-radius: 10px;
    width: 400px;
    text-align: center;
}

.cheat-console-content h3 {
    color: #00ffff;
    margin-top: 0;
    letter-spacing: 2px;
}

.cheat-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.cheat-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cheat-group label {
    color: #ccc;
    font-size: 0.9em;
    width: 100px;
    text-align: left;
}

.cheat-group input,
.cheat-group select {
    background: #000;
    border: 1px solid #444;
    color: #fff;
    padding: 5px;
    flex-grow: 1;
}

.cheat-group button {
    background: #0088ff;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    transition: background 0.2s;
}

.cheat-group button:hover {
    background: #00aaff;
}

.cheat-hint {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 0;
}

.inventory-item.rarity-uncommon {
    border-left-color: #27ae60;
}

.inventory-item.rarity-rare {
    border-left-color: #2980b9;
}

.inventory-item.rarity-legendary {
    border-left-color: #f1c40f;
    box-shadow: 0 0 5px #f1c40f;
}

/* Status Text Glow */
.info-status {
    transition: all 0.5s;
}

.info-status.win {
    color: #00ffff !important;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
    transform: scale(1.1);
}

.info-status.loss {
    color: #ff4757 !important;
    text-shadow: 0 0 10px #ff4757;
}

/* ============================================
   RESPONSIVE SCALING FOR ALL SCREEN SIZES
   ============================================ */

/* Base responsive scaling using CSS custom properties */
:root {
    --scale-factor: 1;
    --card-width: 100px;
    --card-height: 140px;
    --chip-size: 60px;
    --font-scale: 1;
}

/* Ultra-wide and 4K screens (1920px+) */
@media (min-width: 1920px) {
    :root {
        --scale-factor: 1.1;
        --card-width: 110px;
        --card-height: 154px;
        --chip-size: 66px;
        --font-scale: 1.1;
    }
}

/* Large desktops (1600px - 1919px) */
@media (max-width: 1919px) and (min-width: 1600px) {
    :root {
        --scale-factor: 1;
        --card-width: 100px;
        --card-height: 140px;
        --chip-size: 60px;
        --font-scale: 1;
    }
}

/* Medium desktops (1400px - 1599px) */
@media (max-width: 1599px) and (min-width: 1400px) {
    :root {
        --scale-factor: 0.9;
        --card-width: 90px;
        --card-height: 126px;
        --chip-size: 54px;
        --font-scale: 0.92;
    }
}

/* Small desktops (1200px - 1399px) */
@media (max-width: 1399px) and (min-width: 1200px) {
    :root {
        --scale-factor: 0.8;
        --card-width: 80px;
        --card-height: 112px;
        --chip-size: 50px;
        --font-scale: 0.85;
    }
}

/* Laptops (1024px - 1199px) */
@media (max-width: 1199px) and (min-width: 1024px) {
    :root {
        --scale-factor: 0.7;
        --card-width: 70px;
        --card-height: 98px;
        --chip-size: 45px;
        --font-scale: 0.8;
    }
}

/* Small laptops (below 1024px) */
@media (max-width: 1023px) {
    :root {
        --scale-factor: 0.6;
        --card-width: 60px;
        --card-height: 84px;
        --chip-size: 40px;
        --font-scale: 0.7;
    }
}

/* Card Responsive Scaling */
@media (max-width: 1599px) {
    .card {
        width: var(--card-width);
        height: var(--card-height);
        margin: calc(10px * var(--scale-factor));
        border-radius: calc(8px * var(--scale-factor));
    }

    .card-top-left,
    .card-bottom-right {
        font-size: calc(1.2rem * var(--font-scale));
    }

    .card-center {
        font-size: calc(3rem * var(--font-scale));
    }

    #deck-container {
        width: var(--card-width);
        height: var(--card-height);
        right: calc(50px * var(--scale-factor));
    }

    #deck-container::before {
        width: var(--card-width);
        height: var(--card-height);
    }
}

/* Chip Tray Responsive */
@media (max-width: 1599px) {
    .selectable-chip {
        width: var(--chip-size);
        height: var(--chip-size);
        border-width: calc(4px * var(--scale-factor));
    }

    .placed-chip {
        width: calc(var(--chip-size) * 0.66);
        height: calc(var(--chip-size) * 0.66);
        font-size: calc(0.8em * var(--font-scale));
    }
}

/* UI Overlay Responsive */
@media (max-width: 1599px) {
    .ui-overlay {
        padding: calc(15px * var(--scale-factor)) calc(40px * var(--scale-factor));
        margin: 0 calc(50px * var(--scale-factor)) calc(40px * var(--scale-factor)) calc(50px * var(--scale-factor));
        border-radius: calc(60px * var(--scale-factor));
        gap: calc(20px * var(--scale-factor));
    }

    .balance-display .label {
        font-size: calc(0.6em * var(--font-scale));
    }

    #balance-amount {
        font-size: calc(1.4em * var(--font-scale));
    }

    .chip-tray {
        gap: calc(10px * var(--scale-factor));
    }
}

/* Action Bar Responsive */
@media (max-width: 1599px) {
    .action-bar {
        padding: calc(15px * var(--scale-factor)) calc(30px * var(--scale-factor));
        border-radius: calc(60px * var(--scale-factor));
        gap: calc(15px * var(--scale-factor));
    }

    .action-bar button {
        padding: calc(12px * var(--scale-factor)) calc(25px * var(--scale-factor));
        font-size: calc(1rem * var(--font-scale));
        border-radius: calc(40px * var(--scale-factor));
    }

    .action-bar .primary-btn {
        padding: calc(18px * var(--scale-factor)) calc(45px * var(--scale-factor));
        font-size: calc(1.2rem * var(--font-scale));
    }

    .controls {
        bottom: calc(40px * var(--scale-factor));
        gap: calc(20px * var(--scale-factor));
    }

    #deal-button,
    #re-bet-button,
    #clear-bet-button {
        padding: calc(1rem * var(--scale-factor)) calc(2rem * var(--scale-factor));
        font-size: calc(1.2rem * var(--font-scale));
    }
}

/* Table Surface Responsive */
@media (max-width: 1599px) {
    .table-surface {
        padding: calc(60px * var(--scale-factor)) calc(40px * var(--scale-factor));
    }

    .dealer-area {
        height: calc(180px * var(--scale-factor));
    }

    .player-area {
        height: calc(200px * var(--scale-factor));
        margin-top: calc(-30px * var(--scale-factor));
    }

    .dealer-portrait-container {
        width: calc(120px * var(--scale-factor));
        height: calc(120px * var(--scale-factor));
    }

    .dealer-portrait-container.playing {
        left: calc(50% - (350px * var(--scale-factor)));
        width: calc(120px * var(--scale-factor));
        height: calc(120px * var(--scale-factor));
    }

    .dealer-label {
        font-size: calc(1.2em * var(--font-scale));
    }
}

/* Betting Spots Responsive */
@media (max-width: 1599px) {
    .betting-spots {
        gap: calc(30px * var(--scale-factor));
        padding: calc(20px * var(--scale-factor));
        margin-bottom: calc(20px * var(--scale-factor));
    }

    .bet-spot {
        width: calc(60px * var(--scale-factor));
        height: calc(60px * var(--scale-factor));
    }

    .bet-spot.main-bet {
        width: calc(100px * var(--scale-factor));
        height: calc(100px * var(--scale-factor));
    }

    .spot-label {
        font-size: calc(0.5em * var(--font-scale));
    }
}

/* Score Badge Responsive */
@media (max-width: 1599px) {
    .score-badge {
        width: calc(32px * var(--scale-factor));
        height: calc(32px * var(--scale-factor));
        font-size: calc(1rem * var(--font-scale));
    }
}

/* Info Status Responsive */
@media (max-width: 1599px) {
    .info-status {
        font-size: calc(2em * var(--font-scale));
        margin: calc(20px * var(--scale-factor)) 0;
    }
}

/* Top Left Info Responsive */
@media (max-width: 1599px) {
    .game-info-top-left {
        top: calc(20px * var(--scale-factor));
        left: calc(20px * var(--scale-factor));
        gap: calc(12px * var(--scale-factor));
    }

    .game-info-top-left .info-item {
        font-size: calc(1rem * var(--font-scale));
    }

    #game-settings-button {
        padding: calc(8px * var(--scale-factor)) calc(15px * var(--scale-factor));
        font-size: calc(0.8rem * var(--font-scale));
    }

    .odds-button,
    .shop-button {
        padding: calc(6px * var(--scale-factor)) calc(12px * var(--scale-factor));
        font-size: calc(0.8rem * var(--font-scale));
    }
}

/* Hands Left Container Responsive */
@media (max-width: 1599px) {
    .hands-left-container {
        top: calc(20px * var(--scale-factor));
        left: calc(140px * var(--scale-factor));
        padding: calc(6px * var(--scale-factor)) calc(14px * var(--scale-factor));
        font-size: calc(0.8rem * var(--font-scale));
    }
}

/* Modal Responsive Scaling */
@media (max-width: 1599px) {
    .standard-modal {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: calc(20px * var(--scale-factor)) calc(30px * var(--scale-factor));
    }

    .modal-title {
        font-size: calc(1.8rem * var(--font-scale));
    }

    .modal-body {
        padding: calc(30px * var(--scale-factor)) calc(40px * var(--scale-factor));
    }

    .modal-back-button {
        padding: calc(10px * var(--scale-factor)) calc(25px * var(--scale-factor));
    }

    .shop-modal {
        width: min(98vw, calc(1200px * var(--scale-factor)));
        height: min(95vh, calc(900px * var(--scale-factor)));
    }

    .shop-layout {
        gap: calc(40px * var(--scale-factor));
        margin-top: calc(30px * var(--scale-factor));
    }

    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(calc(200px * var(--scale-factor)), 1fr));
        gap: calc(15px * var(--scale-factor));
    }

    .shop-item {
        padding: calc(15px * var(--scale-factor));
        min-height: calc(180px * var(--scale-factor));
    }

    .shop-item-image {
        width: calc(60px * var(--scale-factor));
        height: calc(60px * var(--scale-factor));
    }

    .shop-item h4 {
        font-size: calc(1em * var(--font-scale));
    }

    .shop-item p {
        font-size: calc(0.8em * var(--font-scale));
    }

    .inventory-item {
        padding: calc(10px * var(--scale-factor));
        margin-bottom: calc(10px * var(--scale-factor));
    }

    .inventory-item-image {
        width: calc(50px * var(--scale-factor));
        height: calc(50px * var(--scale-factor));
    }
}

/* Main Menu Responsive */
@media (max-width: 1599px) {
    .game-title {
        font-size: calc(5rem * var(--font-scale));
        letter-spacing: calc(10px * var(--scale-factor));
    }

    .subtitle {
        font-size: calc(1rem * var(--font-scale));
        letter-spacing: calc(5px * var(--scale-factor));
        margin-bottom: calc(50px * var(--scale-factor));
    }

    .menu-btn {
        padding: calc(12px * var(--scale-factor)) calc(40px * var(--scale-factor));
        width: calc(250px * var(--scale-factor));
        font-size: calc(1rem * var(--font-scale));
    }

    .button-container {
        gap: calc(15px * var(--scale-factor));
    }
}

/* Toast Responsive */
@media (max-width: 1599px) {
    #toast-container {
        top: calc(20px * var(--scale-factor));
        right: calc(20px * var(--scale-factor));
        gap: calc(10px * var(--scale-factor));
    }

    .toast {
        padding: calc(15px * var(--scale-factor)) calc(20px * var(--scale-factor));
        gap: calc(15px * var(--scale-factor));
        min-width: calc(300px * var(--scale-factor));
    }

    .toast-icon {
        font-size: calc(2rem * var(--font-scale));
    }

    .toast-title {
        font-size: calc(0.7rem * var(--font-scale));
    }

    .toast-message {
        font-size: calc(1rem * var(--font-scale));
    }
}

/* Settings Modal Responsive */
@media (max-width: 1599px) {
    .settings-container {
        width: min(500px, 90vw);
        gap: calc(1.5rem * var(--scale-factor));
        padding: calc(2rem * var(--scale-factor));
    }

    .settings-row {
        margin-bottom: calc(1rem * var(--scale-factor));
    }

    .settings-range {
        width: calc(200px * var(--scale-factor));
    }
}

/* Player Hands Container Responsive */
@media (max-width: 1599px) {
    .player-hands-container {
        gap: calc(40px * var(--scale-factor));
    }

    .player-hand {
        min-width: calc(120px * var(--scale-factor));
    }
}

/* Total Bet Display Responsive */
@media (max-width: 1599px) {
    .total-bet-display {
        bottom: calc(10px * var(--scale-factor));
        font-size: calc(1.5rem * var(--font-scale));
    }
}

/* Floating Symbols Responsive */
@media (max-width: 1599px) {
    .floating-symbol {
        font-size: calc(2rem * var(--font-scale));
    }

    .floating-symbol:nth-child(2) {
        font-size: calc(3rem * var(--font-scale));
    }

    .floating-symbol:nth-child(4) {
        font-size: calc(2.5rem * var(--font-scale));
    }
}

/* Height-based adjustments for short screens */
@media (max-height: 800px) {
    .table-surface {
        padding: 40px 30px;
    }

    .dealer-area {
        height: 140px;
    }

    .player-area {
        height: 160px;
        margin-top: -20px;
    }

    .betting-spots {
        transform: translateY(-15px);
    }

    .ui-overlay {
        margin-bottom: 25px;
    }

    .controls {
        bottom: 25px;
    }
}

@media (max-height: 700px) {
    .table-surface {
        padding: 30px 25px;
    }

    .dealer-area {
        height: 120px;
    }

    .player-area {
        height: 140px;
        margin-top: -15px;
    }

    .dealer-portrait-container,
    .dealer-portrait-container.playing {
        width: 80px;
        height: 80px;
    }

    .betting-spots {
        transform: translateY(-10px);
        padding: 10px;
    }

    .action-bar {
        padding: 10px 20px;
    }

    .action-bar button {
        padding: 8px 18px;
        font-size: 0.85rem;
    }

    .action-bar .primary-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}