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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f4c3a 0%, #1a6b4f 50%, #0f4c3a 100%);
    min-height: 100vh;
    padding: 20px;
    color: #fff;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '♠';
    position: fixed;
    top: 5%;
    left: 5%;
    font-size: 20em;
    color: rgba(255, 255, 255, 0.04);
    z-index: 0;
    pointer-events: none;
    transform: rotate(-25deg);
    animation: floatSuit1 20s ease-in-out infinite;
}

body::after {
    content: '♥';
    position: fixed;
    bottom: 10%;
    right: 8%;
    font-size: 18em;
    color: rgba(220, 53, 69, 0.05);
    z-index: 0;
    pointer-events: none;
    transform: rotate(20deg);
    animation: floatSuit2 25s ease-in-out infinite;
}

@keyframes floatSuit1 {
    0%, 100% { transform: rotate(-25deg) translateY(0); }
    50% { transform: rotate(-20deg) translateY(-30px); }
}

@keyframes floatSuit2 {
    0%, 100% { transform: rotate(20deg) translateY(0); }
    50% { transform: rotate(25deg) translateY(30px); }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Language Selector */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #ffd700;
    border-radius: 8px;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.globe-icon {
    font-size: 1.2em;
}

.current-lang {
    font-weight: 500;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ffd700;
    border-radius: 8px;
    min-width: 150px;
    display: none;
    flex-direction: column;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.lang-dropdown.show {
    display: flex;
}

.lang-option {
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: rgba(255, 215, 0, 0.2);
    padding-left: 25px;
}

.lang-option.active {
    background: rgba(255, 215, 0, 0.3);
    color: #ffd700;
    font-weight: 600;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid #ffd700;
}

header h1 {
    font-size: 2.5em;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    color: #fff;
    font-size: 1.1em;
    opacity: 0.9;
}

/* Stats Panel */
.stats-panel {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2em;
    font-weight: 600;
    color: #ffd700;
}

.stat-value.correct {
    color: #4caf50;
}

.stat-value.incorrect {
    color: #f44336;
}

/* Game Area */
.game-area {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 40px;
    position: relative;
    overflow: hidden;
}

.game-area::before {
    content: '♦';
    position: absolute;
    top: -20px;
    right: 30px;
    font-size: 8em;
    color: rgba(220, 53, 69, 0.06);
    pointer-events: none;
    transform: rotate(25deg);
}

.game-area::after {
    content: '♣';
    position: absolute;
    bottom: -20px;
    left: 30px;
    font-size: 8em;
    color: rgba(255, 255, 255, 0.06);
    pointer-events: none;
    transform: rotate(-25deg);
}

.dealer-section {
    background: rgba(220, 53, 69, 0.15);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid rgba(220, 53, 69, 0.4);
}

.player-section {
    background: rgba(40, 167, 69, 0.15);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid rgba(40, 167, 69, 0.4);
}

.dealer-section h3 {
    text-align: center;
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.player-section h3 {
    text-align: center;
    color: #51cf66;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.card-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.card {
    width: 110px;
    height: 150px;
    background: white;
    color: #000;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    border: 4px solid #333;
    transition: all 0.3s;
    gap: 5px;
}

.dealer-section .card {
    border-color: #dc3545;
    box-shadow: 0 6px 12px rgba(220, 53, 69, 0.5), 0 0 20px rgba(220, 53, 69, 0.3);
}

.player-section .card {
    border-color: #28a745;
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.5), 0 0 20px rgba(40, 167, 69, 0.3);
}

.card.red {
    color: #e74c3c;
}

.card-rank {
    font-size: 3em;
    line-height: 1;
}

.card-suit {
    font-size: 2.5em;
    line-height: 1;
}

.hand-description {
    text-align: center;
    font-size: 1.3em;
    color: #fff;
    font-weight: 500;
    padding: 15px;
    background: rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(40, 167, 69, 0.3);
    margin-top: 10px;
}

/* Feedback Area */
.feedback-area {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-area.correct {
    background: rgba(76, 175, 80, 0.3);
    border: 2px solid #4caf50;
}

.feedback-area.incorrect {
    background: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
}

.feedback-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.feedback-text {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 10px;
}

.feedback-detail {
    font-size: 1.1em;
    opacity: 0.9;
    line-height: 1.6;
}

.feedback-detail strong {
    font-weight: 600;
    font-size: 1.2em;
}

.feedback-detail small {
    display: block;
    margin-top: 10px;
    font-size: 0.9em;
    opacity: 0.85;
    line-height: 1.5;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.win-rate-comparison {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 12px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 0.95em;
}

.win-rate-comparison span {
    display: block;
}

.rate-label {
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 5px;
}

.rate-user {
    color: #f8b4b4;
}

.rate-correct {
    color: #90ee90;
    font-weight: 600;
}

.rate-diff {
    color: #ffd700;
    font-size: 0.9em;
    font-style: italic;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 150px;
    max-width: 180px;
    padding: 20px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    border: 3px solid #ffd700;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #34495e, #2c3e50);
}

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

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

.btn-label {
    font-size: 1.2em;
}

.btn-key {
    font-size: 0.8em;
    color: #ffd700;
    opacity: 0.8;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.control-btn {
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.new-hand-btn {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    border: 2px solid #2e7d32;
}

.new-hand-btn:hover {
    background: linear-gradient(135deg, #45a049, #4caf50);
    transform: scale(1.05);
}

.reset-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border: 2px solid #c62828;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #d32f2f, #f44336);
    transform: scale(1.05);
}

/* Log Section */
.log-section {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.log-header h3 {
    color: #ffd700;
    font-size: 1.3em;
    margin: 0;
}

.clear-log-btn {
    padding: 8px 20px;
    background: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-log-btn:hover {
    background: rgba(244, 67, 54, 0.5);
    transform: scale(1.05);
}

.log-content {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
}

.log-content::-webkit-scrollbar {
    width: 10px;
}

.log-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.log-content::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 5px;
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}

.log-empty {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.log-entry {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 4px solid;
}

.log-entry.correct {
    border-left-color: #4caf50;
}

.log-entry.incorrect {
    border-left-color: #f44336;
}

.log-entry-header {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-entry-time {
    font-size: 0.85em;
    opacity: 0.7;
}

.log-entry-hand {
    color: #ffd700;
    margin-bottom: 6px;
}

.log-entry-action {
    margin-bottom: 6px;
}

.log-entry-winrate {
    margin: 8px 0;
    font-size: 0.85em;
}

.log-entry-winrate .win-rate-comparison {
    padding: 8px;
    margin: 0;
}

.log-entry-explanation {
    font-size: 0.9em;
    opacity: 0.8;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-top: 8px;
    line-height: 1.5;
}

/* Help Section */
.help-section {
    background: rgba(0, 0, 0, 0.4);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.help-section h3 {
    color: #ffd700;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.help-section ul {
    list-style-position: inside;
    line-height: 1.8;
    margin-bottom: 20px;
}

.help-section li {
    margin-bottom: 10px;
}

.strategy-reminder {
    background: rgba(255, 215, 0, 0.1);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffd700;
}

.strategy-reminder h4 {
    color: #ffd700;
    margin-bottom: 10px;
}

.strategy-reminder ol {
    list-style-position: inside;
    line-height: 1.8;
}

/* Glossary Section */
.glossary-section {
    background: rgba(0, 0, 0, 0.4);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.glossary-section h3 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.glossary-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #ffd700;
    transition: all 0.3s;
}

.glossary-item:last-child {
    margin-bottom: 0;
}

.glossary-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.glossary-item h4 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.glossary-item p {
    color: #fff;
    line-height: 1.6;
    opacity: 0.9;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    opacity: 0.8;
}

footer p {
    margin: 5px 0;
}

.warning {
    color: #ffd700;
    font-weight: 500;
    font-size: 1.1em;
}

.copyright {
    font-size: 0.9em;
    opacity: 0.7;
    margin-top: 10px;
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .language-selector {
        position: relative;
        margin-bottom: 15px;
        display: flex;
        justify-content: center;
    }

    .lang-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }

    .lang-dropdown {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }

    header h1 {
        font-size: 1.8em;
    }

    .stats-panel {
        flex-wrap: wrap;
        gap: 15px;
    }

    .stat-item {
        flex: 1 1 45%;
    }

    .card {
        width: 80px;
        height: 110px;
    }

    .card-rank {
        font-size: 2em;
    }

    .card-suit {
        font-size: 1.8em;
    }

    .dealer-section h3, .player-section h3 {
        font-size: 1.2em;
    }

    .game-area {
        gap: 30px;
        padding: 20px;
    }

    .dealer-section, .player-section {
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        max-width: 100%;
    }

    .control-buttons {
        flex-direction: column;
    }
}

/* Animation for correct/incorrect */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.shake {
    animation: shake 0.5s;
}

.pulse {
    animation: pulse 0.5s;
}

/* ============================================
   SIMULATOR MODE STYLES
   ============================================ */

/* Mode Selector Tabs */
.mode-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.mode-tab {
    flex: 1;
    max-width: 300px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mode-tab:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.mode-tab.active {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #0f4c3a;
    border-color: #ffd700;
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.5);
}

/* Mode Content */
.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
}

/* Balance Panel */
.balance-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.balance-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.balance-label {
    color: #ffd700;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-value {
    font-size: 2em;
    font-weight: 700;
    color: #fff;
}

.reset-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #f44336, #d32f2f);
    border: 2px solid #c62828;
    border-radius: 8px;
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #d32f2f, #f44336);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.4);
}

/* Dealer and Player Sections for Simulator */
.dealer-section-sim,
.player-section-sim {
    background: rgba(0, 0, 0, 0.4);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    text-align: center;
}

.dealer-section-sim h3 {
    color: #ff6b6b;
    font-size: 1.3em;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.player-section-sim h3 {
    color: #51cf66;
    font-size: 1.3em;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hand-total {
    font-size: 2.5em;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 15px;
}

.hand-total.busted {
    color: #f44336;
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    min-height: 160px;
}

/* Simulator Cards */
.card-sim {
    width: 100px;
    height: 140px;
    background: white;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    border: 3px solid #333;
    transition: all 0.3s;
    animation: cardDeal 0.3s ease-out;
}

@keyframes cardDeal {
    from {
        opacity: 0;
        transform: translateY(-20px) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(0);
    }
}

.card-sim.red {
    color: #e74c3c;
}

.card-sim.black {
    color: #2c3e50;
}

.card-sim.card-back {
    background: linear-gradient(135deg, #1a6b4f, #0f4c3a);
    color: #ffd700;
    font-size: 3em;
    border-color: #ffd700;
}

.card-sim .card-rank {
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1;
}

.card-sim .card-suit {
    font-size: 2em;
    line-height: 1;
}

/* Betting Area */
.betting-area {
    background: rgba(0, 0, 0, 0.5);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.betting-area h3 {
    color: #ffd700;
    font-size: 1.3em;
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Betting Table */
.betting-table {
    display: flex;
    justify-content: center;
    padding: 30px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #0a3a2a, #0f4c3a);
    border-radius: 15px;
    border: 3px solid rgba(255, 215, 0, 0.4);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

.betting-table::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.3) 100%);
    border-radius: 12px;
    pointer-events: none;
}

.betting-spot {
    position: relative;
    width: 180px;
    height: 180px;
    border: 4px dashed rgba(255, 215, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.15), transparent);
    cursor: pointer;
    transition: all 0.3s;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
    }
}

.betting-spot:hover {
    border-color: rgba(255, 215, 0, 0.8);
    background: radial-gradient(circle, rgba(255, 215, 0, 0.25), transparent);
}

.betting-spot-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 215, 0, 0.4);
    font-size: 2em;
    font-weight: 700;
    letter-spacing: 3px;
    pointer-events: none;
    z-index: 1;
}

.betting-chips-stack {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    z-index: 2;
}

.betting-chips-stack .chip {
    margin-bottom: -50px;
    animation: chipDrop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chipDrop {
    0% {
        opacity: 0;
        transform: translateY(-100px) scale(0.3) rotate(180deg);
    }
    60% {
        transform: translateY(5px) scale(1.1) rotate(-5deg);
    }
    80% {
        transform: translateY(-2px) scale(0.98) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

.betting-amount-display {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 215, 0, 0.9);
    color: #0f4c3a;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1.3em;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    min-width: 80px;
    text-align: center;
    z-index: 3;
    transition: all 0.3s;
}

.betting-amount-display.updated {
    animation: amountPulse 0.3s ease-out;
}

@keyframes amountPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.2);
        background: rgba(255, 215, 0, 1);
    }
}

.chip-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.chip-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.chip-btn:hover {
    transform: scale(1.1);
}

.chip {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1em;
    border: 4px solid;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
}

.chip-5 {
    background: linear-gradient(135deg, #f44336, #c62828);
    border-color: #b71c1c;
    color: #fff;
}

.chip-10 {
    background: linear-gradient(135deg, #2196f3, #1565c0);
    border-color: #0d47a1;
    color: #fff;
}

.chip-25 {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    border-color: #1b5e20;
    color: #fff;
}

.chip-50 {
    background: linear-gradient(135deg, #ff9800, #e65100);
    border-color: #bf360c;
    color: #fff;
}

.chip-100 {
    background: linear-gradient(135deg, #9c27b0, #6a1b9a);
    border-color: #4a148c;
    color: #fff;
}

.bet-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.bet-action-btn {
    padding: 15px 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 8px;
    color: #fff;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.bet-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.bet-action-btn.primary {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    border-color: #1b5e20;
}

.bet-action-btn.primary:hover {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
}

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

/* Game Actions */
.game-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.game-action-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 3px solid #ffd700;
    border-radius: 10px;
    color: #fff;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}

.game-action-btn:hover {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.4);
}

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

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

/* Game Result */
.game-result {
    background: rgba(0, 0, 0, 0.6);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    border: 3px solid;
    animation: resultAppear 0.5s ease-out;
}

@keyframes resultAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.game-result.win {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.2);
}

.game-result.lose {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.2);
}

.game-result.push {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.2);
}

.game-result.blackjack {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.3);
}

.result-text {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 15px;
}

.game-result.win .result-text {
    color: #4caf50;
}

.game-result.lose .result-text {
    color: #f44336;
}

.game-result.push .result-text {
    color: #ffd700;
}

.game-result.blackjack .result-text {
    color: #ffd700;
    animation: glow 1s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
    50% { text-shadow: 0 0 40px rgba(255, 215, 0, 1); }
}

.result-amount {
    font-size: 1.8em;
    font-weight: 600;
}

/* Game History */
.game-history-section {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-header h3 {
    color: #ffd700;
    font-size: 1.3em;
    margin: 0;
}

.clear-history-btn {
    padding: 8px 20px;
    background: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
    border-radius: 6px;
    color: #fff;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-history-btn:hover {
    background: rgba(244, 67, 54, 0.5);
    transform: scale(1.05);
}

.history-content {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.history-content::-webkit-scrollbar {
    width: 10px;
}

.history-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.history-content::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 5px;
}

.history-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}

.history-empty {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.history-entry {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #ffd700;
}

.history-entry:last-child {
    margin-bottom: 0;
}

.history-time {
    font-size: 0.85em;
    opacity: 0.7;
    margin-bottom: 5px;
}

.history-outcome {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.history-bet {
    font-size: 0.9em;
    color: #ffd700;
}

/* Responsive Design for Simulator */
@media (max-width: 768px) {
    .mode-selector {
        flex-direction: column;
        gap: 10px;
    }

    .mode-tab {
        max-width: 100%;
    }

    .balance-panel {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .betting-table {
        padding: 20px;
    }

    .betting-spot {
        width: 140px;
        height: 140px;
    }

    .betting-spot-label {
        font-size: 1.5em;
    }

    .betting-amount-display {
        font-size: 1.1em;
        padding: 6px 15px;
    }

    .chip-selector {
        gap: 10px;
    }

    .chip {
        width: 60px;
        height: 60px;
        font-size: 1em;
    }

    .bet-controls {
        flex-direction: column;
    }

    .bet-action-btn {
        width: 100%;
    }

    .game-actions {
        flex-direction: column;
    }

    .game-action-btn {
        width: 100%;
    }

    .card-sim {
        width: 70px;
        height: 98px;
    }

    .card-sim .card-rank {
        font-size: 2em;
    }

    .card-sim .card-suit {
        font-size: 1.5em;
    }

    .hand-total {
        font-size: 2em;
    }

    .result-text {
        font-size: 2em;
    }

    .result-amount {
        font-size: 1.5em;
    }
}
