/* ====== Reset & Base Styles ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 50%, #1a472a 100%);
    min-height: 100vh;
    padding: 20px;
    color: #fff;
}

.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 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.lang-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.3);
}

.globe-icon {
    font-size: 18px;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: none;
    min-width: 140px;
}

.lang-dropdown.active {
    display: block;
}

.lang-option {
    display: block;
    padding: 12px 20px;
    color: #ffd700;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.lang-option:hover {
    background: rgba(255, 215, 0, 0.2);
}

.lang-option.active {
    background: rgba(255, 215, 0, 0.3);
    color: #ffd700;
    font-weight: 600;
}

/* ====== Header ====== */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

header h1 {
    font-size: 36px;
    color: #ffd700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 16px;
    color: #fff;
    opacity: 0.9;
}

/* ====== Mode Tabs ====== */
.mode-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.mode-tab {
    flex: 1;
    max-width: 250px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.mode-tab:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: translateY(-2px);
}

.mode-tab.active {
    background: rgba(255, 215, 0, 0.3);
    border-color: #ffd700;
    color: #ffd700;
}

.tab-icon {
    font-size: 24px;
}

/* ====== Mode Sections ====== */
.mode-section {
    display: none;
}

.mode-section.active {
    display: block;
}

/* ====== Stats Panel ====== */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.stat-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid rgba(255, 215, 0, 0.2);
}

.stat-label {
    font-size: 13px;
    color: #ccc;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #ffd700;
}

.stat-value.correct {
    color: #4caf50;
}

.stat-value.incorrect {
    color: #f44336;
}

/* ====== Question Area ====== */
.question-area {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
}

.question-header h2 {
    font-size: 22px;
    color: #ffd700;
    margin-bottom: 20px;
    text-align: center;
}

.question-content {
    margin-top: 20px;
}

.hands-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.hand-group {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.hand-group h4 {
    color: #ffd700;
    margin-bottom: 15px;
    font-size: 16px;
}

/* ====== Cards Display ====== */
.cards-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 100px;
    align-items: center;
}

.card {
    width: 70px;
    height: 100px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.card.red {
    color: #dc2626;
}

.card.black {
    color: #1f2937;
}

.card-rank {
    font-size: 20px;
    font-weight: 700;
}

.card-suit {
    font-size: 18px;
}

/* ====== Answer Options ====== */
.answer-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.answer-btn {
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.answer-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.3);
}

.answer-btn:active {
    transform: translateY(0);
}

.answer-btn.correct {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.answer-btn.incorrect {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.answer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* ====== Feedback Area ====== */
.feedback-area {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.feedback-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feedback-text {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.feedback-detail {
    font-size: 16px;
    color: #fff;
    line-height: 1.6;
    opacity: 0.9;
}

.feedback-area.correct {
    background: rgba(76, 175, 80, 0.3);
    border: 2px solid #4caf50;
}

.feedback-area.correct .feedback-text {
    color: #4caf50;
}

.feedback-area.incorrect {
    background: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
}

.feedback-area.incorrect .feedback-text {
    color: #f44336;
}

/* ====== Balance Panel (Simulator) ====== */
.balance-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 3px solid #f59e0b;
    flex-wrap: wrap;
    gap: 15px;
}

.balance-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.balance-label {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.balance-value {
    font-size: 28px;
    font-weight: 700;
    color: #78350f;
}

.reset-balance-btn {
    padding: 12px 24px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-balance-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* ====== Game Table ====== */
.game-table {
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 4px solid #fbbf24;
}

.game-table h3 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
}

.hand-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.hand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.hand-header h4 {
    color: white;
    font-size: 18px;
}

.hand-total {
    font-size: 32px;
    font-weight: 700;
    color: #fbbf24;
}

.banker-section {
    border: 3px solid #dc2626;
}

.player-section {
    border: 3px solid #3b82f6;
}

.game-result {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    margin-top: 20px;
}

.result-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.result-text {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.result-amount {
    font-size: 24px;
    font-weight: 600;
}

.result-amount.win {
    color: #059669;
}

.result-amount.lose {
    color: #dc2626;
}

/* ====== Betting Area ====== */
.betting-area {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.betting-area h3 {
    color: #ffd700;
    margin-bottom: 20px;
    text-align: center;
}

.betting-spots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.bet-spot {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border: 3px solid #0369a1;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.bet-spot:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(3, 105, 161, 0.3);
}

.bet-spot[data-bet-type="banker"] {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #dc2626;
}

.bet-spot[data-bet-type="tie"] {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.bet-label {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.bet-amount {
    font-size: 24px;
    font-weight: 700;
    color: #059669;
    margin-bottom: 8px;
}

.payout-info {
    font-size: 14px;
    color: #ccc;
    font-weight: 600;
}

/* ====== Pair Bets ====== */
.pair-bets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.pair-bet-spot {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border: 2px solid #9333ea;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.pair-bet-spot:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(147, 51, 234, 0.3);
}

/* ====== Chip Selector ====== */
.chip-selector {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.chip-label {
    font-size: 16px;
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 15px;
    text-align: center;
}

.chip-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.chip-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid #333;
    background: radial-gradient(circle, #fff 0%, #ddd 100%);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.chip-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.chip-btn.active {
    border-color: #fbbf24;
    background: radial-gradient(circle, #fef3c7 0%, #fbbf24 100%);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

/* ====== Game Controls ====== */
.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.sim-btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.deal-btn {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
}

.deal-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(5, 150, 105, 0.4);
}

.deal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.clear-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.clear-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.4);
}

/* ====== History Sections ====== */
.log-section,
.bet-history-section {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.log-header,
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.log-header h3,
.history-header h3 {
    font-size: 20px;
    color: #ffd700;
}

.clear-log-btn,
.clear-history-btn {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-log-btn:hover,
.clear-history-btn:hover {
    background: #dc2626;
}

.log-content,
.bet-history-content {
    max-height: 300px;
    overflow-y: auto;
}

.log-empty,
.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.log-item,
.history-item {
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #4CAF50;
}

.log-item.incorrect {
    border-left-color: #dc2626;
}

/* ====== Help & Reference Sections ====== */
.help-section,
.rules-section,
.reference-section,
.glossary-section {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.help-section h3,
.rules-section h3,
.reference-section h3,
.glossary-section h3 {
    font-size: 20px;
    color: #ffd700;
    margin-bottom: 15px;
}

.help-section ul,
.rules-section ul {
    list-style: none;
    padding: 0;
}

.help-section li,
.rules-section li {
    padding: 12px 0;
    padding-left: 30px;
    position: relative;
    line-height: 1.6;
}

.help-section li:before,
.rules-section li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: 700;
    font-size: 18px;
}

/* ====== Payout Grid ====== */
.payout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.payout-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    text-align: center;
}

.payout-card.banker-highlight {
    background: rgba(255, 215, 0, 0.2);
    border-color: #fbbf24;
}

.payout-card h4 {
    font-size: 16px;
    color: #ffd700;
    margin-bottom: 10px;
}

.house-edge {
    font-size: 13px;
    color: #ccc;
    font-weight: 600;
}

/* ====== Glossary ====== */
.glossary-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.glossary-item:last-child {
    border-bottom: none;
}

.glossary-item h4 {
    font-size: 18px;
    color: #ffd700;
    margin-bottom: 8px;
}

.glossary-item p {
    line-height: 1.6;
    color: #fff;
    opacity: 0.9;
}

/* ====== Footer ====== */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid rgba(255, 215, 0, 0.3);
    opacity: 0.8;
}

footer p {
    margin-bottom: 10px;
    color: #fff;
    line-height: 1.6;
}

.warning {
    color: #ffd700;
    font-weight: 600;
}

.copyright {
    font-size: 14px;
    color: #ccc;
    opacity: 0.7;
}

/* ====== Responsive Design ====== */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 28px;
    }

    .mode-tabs {
        flex-direction: column;
    }

    .mode-tab {
        max-width: 100%;
    }

    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    .hands-display {
        grid-template-columns: 1fr;
    }

    .betting-spots {
        grid-template-columns: 1fr;
    }

    .pair-bets {
        grid-template-columns: 1fr;
    }

    .balance-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .chip-options {
        gap: 10px;
    }

    .chip-btn {
        width: 60px;
        height: 60px;
        font-size: 14px;
    }

    .answer-options {
        grid-template-columns: 1fr;
    }
}

/* ====== Animations ====== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dealCard {
    from {
        opacity: 0;
        transform: translateY(-50px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateY(0);
    }
}

.card {
    animation: dealCard 0.5s ease-out;
}

.feedback-area {
    animation: fadeIn 0.5s ease-out;
}
