/* Blackjack Game Styles */

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #1a1a2e;
}

#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#game-canvas {
    max-width: 100%;
    max-height: 100%;
}

/* ==================== BETTING CONTROLS ==================== */

.betting-controls {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid rgba(111, 66, 193, 0.3);
    z-index: 100;
    flex-wrap: wrap;
    justify-content: center;
}

.bet-amount {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bet-amount label {
    color: #fff;
    font-weight: bold;
}

.bet-amount input {
    width: 80px;
    padding: 8px;
    border: 2px solid #6f42c1;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    text-align: center;
}

.bet-amount input:focus {
    outline: none;
    border-color: #20c997;
}

.chip-buttons {
    display: flex;
    gap: 8px;
}

.chip-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 3px dashed rgba(255, 255, 255, 0.5);
    font-weight: bold;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

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

.chip-btn.chip-5 { background: linear-gradient(135deg, #dc3545, #c82333); color: #fff; }
.chip-btn.chip-10 { background: linear-gradient(135deg, #007bff, #0056b3); color: #fff; }
.chip-btn.chip-25 { background: linear-gradient(135deg, #28a745, #1e7e34); color: #fff; }
.chip-btn.chip-50 { background: linear-gradient(135deg, #6f42c1, #5a32a3); color: #fff; }
.chip-btn.chip-100 { background: linear-gradient(135deg, #1a1a2e, #000); color: #fff; }

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

.clear-btn {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.save-btn {
    background: linear-gradient(135deg, #6f42c1, #5a32a3) !important;
}

/* ==================== ACTION BUTTONS ==================== */

.action-buttons {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 100;
}

.action-btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.action-btn.hit {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: #fff;
}

.action-btn.stand {
    background: linear-gradient(135deg, #ffc107, #d39e00);
    color: #1a1a2e;
}

.action-btn.double {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    color: #fff;
}

.action-btn.split {
    background: linear-gradient(135deg, #17a2b8, #117a8b);
    color: #fff;
}

.action-btn.deal {
    background: linear-gradient(135deg, #20c997, #17a881);
    color: #fff;
    padding: 15px 50px;
}

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

.action-btn.cancel-btn:hover,
.action-btn.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.action-btn.reset-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
}

/* ==================== RESULT OVERLAY ==================== */

.result-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 30px 50px;
    border-radius: 16px;
    text-align: center;
    z-index: 200;
    animation: pop-in 0.3s ease;
    border: 2px solid rgba(111, 66, 193, 0.5);
}

@keyframes pop-in {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.result-overlay h2 {
    font-size: 2rem;
    margin: 0 0 10px 0;
}

.result-overlay.win h2 {
    color: #28a745;
    text-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.result-overlay.lose h2 {
    color: #dc3545;
}

.result-overlay.push h2 {
    color: #ffc107;
}

.result-overlay.blackjack h2 {
    color: #ffd700;
    text-shadow: 0 0 20px #ffd700;
    animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px #ffd700; }
    to { text-shadow: 0 0 40px #ffd700, 0 0 60px #ffa500; }
}

.result-amount {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 20px;
}

.result-stats {
    margin-bottom: 20px;
}

.hand-comparison {
    display: flex;
    justify-content: center;
    gap: 30px;
    color: #aaa;
    font-size: 0.9rem;
}

/* ==================== MODAL STYLES ==================== */

.settings-modal,
.leaderboard-modal,
.saveload-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 30px 40px;
    border-radius: 16px;
    border: 1px solid rgba(111, 66, 193, 0.5);
    min-width: 350px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: #fff;
    text-align: center;
    margin: 0 0 25px 0;
    font-size: 1.5rem;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

/* ==================== SETTINGS ==================== */

.settings-group {
    margin-bottom: 20px;
}

.settings-group > label {
    display: block;
    color: #aaa;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.settings-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #6f42c1;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
}

.settings-group select:focus {
    outline: none;
    border-color: #20c997;
}

.settings-group label input[type="checkbox"] {
    margin-right: 10px;
    accent-color: #6f42c1;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.settings-group label {
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* ==================== LEADERBOARD ==================== */

.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.tab-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tab-btn.active {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    border-color: #6f42c1;
    color: #fff;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    color: #fff;
}

.leaderboard-table th {
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    font-size: 0.85rem;
}

.leaderboard-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table tr.top-1 td {
    color: #ffd700;
    font-weight: bold;
}

.leaderboard-table tr.top-2 td {
    color: #c0c0c0;
}

.leaderboard-table tr.top-3 td {
    color: #cd7f32;
}

.empty-message {
    color: #aaa;
    text-align: center;
    padding: 30px;
    font-style: italic;
}

/* ==================== STATS GRID ==================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #20c997;
    margin-bottom: 5px;
}

.stat-item .stat-label {
    display: block;
    font-size: 0.8rem;
    color: #aaa;
    text-transform: uppercase;
}

/* ==================== SAVE/LOAD ==================== */

.save-slots {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.save-slot {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.save-slot.filled {
    border-color: rgba(32, 201, 151, 0.3);
}

.save-slot.empty {
    border-style: dashed;
}

.slot-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.slot-name {
    color: #fff;
    font-weight: bold;
}

.slot-balance {
    color: #20c997;
    font-size: 1.1rem;
}

.slot-date {
    color: #aaa;
    font-size: 0.8rem;
}

.slot-empty {
    color: #666;
    font-style: italic;
}

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

.slot-actions .action-btn {
    padding: 8px 15px;
    font-size: 0.85rem;
}

.slot-actions .delete-slot {
    background: transparent;
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #dc3545;
}

.slot-actions .delete-slot:hover {
    background: rgba(220, 53, 69, 0.2);
}

/* ==================== NOTIFICATION ==================== */

.game-notification {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(0, 0, 0, 0.9);
    padding: 12px 25px;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    z-index: 400;
    transition: transform 0.3s ease;
    border: 1px solid rgba(111, 66, 193, 0.5);
}

.game-notification.show {
    transform: translateX(-50%) translateY(0);
}

.game-notification.success {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.9);
}

.game-notification.error {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.9);
}

/* ==================== LG FRAMEWORK OVERRIDES ==================== */

.lg-menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98), rgba(22, 33, 62, 0.98));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.lg-menu-content {
    text-align: center;
}

.lg-title {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 40px;
    text-shadow: 0 0 20px rgba(111, 66, 193, 0.5);
}

.lg-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.lg-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lg-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.lg-btn-primary {
    background: linear-gradient(135deg, #20c997, #17a881);
    border: none;
}

.lg-btn-secondary {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    border: none;
}

.lg-btn-accent {
    background: linear-gradient(135deg, #17a2b8, #117a8b);
    border: none;
}

/* HUD */
.lg-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    z-index: 50;
}

.lg-hud-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lg-hud-item {
    color: #fff;
}

.lg-hud-label {
    color: #aaa;
    font-size: 0.85rem;
    margin-right: 5px;
}

.lg-hud-value {
    font-weight: bold;
    color: #20c997;
}

.lg-hud-controls {
    display: flex;
    gap: 10px;
}

.lg-btn-sm {
    padding: 8px 15px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lg-btn-sm:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Game Over */
.lg-gameover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.lg-gameover-content {
    text-align: center;
}

.lg-gameover .lg-title {
    color: #dc3545;
    margin-bottom: 20px;
}

.lg-gameover-stats {
    color: #fff;
    margin-bottom: 30px;
}

.lg-gameover-stats p {
    margin: 10px 0;
    font-size: 1.1rem;
}

.lg-gameover-stats span {
    color: #20c997;
    font-weight: bold;
}

/* Hidden class */
.hidden {
    display: none !important;
}
