/* ====== 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, #8B0000 0%, #DC143C 25%, #8B0000 50%, #DC143C 75%, #8B0000 100%);
    background-size: 400% 400%;
    animation: macaoGradient 15s ease infinite;
    min-height: 100vh;
    padding: 20px;
    color: #fff;
}

@keyframes macaoGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1600px;
    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: linear-gradient(135deg, #B8860B 0%, #FFD700 50%, #B8860B 100%);
    color: #8B0000;
    border: 2px solid #FFD700;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.lang-btn:hover {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    border-color: #FFA500;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.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: 30px;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.9) 0%, rgba(220, 20, 60, 0.9) 100%);
    border-radius: 20px;
    border: 4px double #FFD700;
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.4), inset 0 0 40px rgba(255, 215, 0, 0.1);
    position: relative;
}

header::before {
    content: '🐉';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 32px;
    opacity: 0.6;
}

header::after {
    content: '🐉';
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 32px;
    opacity: 0.6;
    transform: scaleX(-1);
}

header h1 {
    font-size: 36px;
    color: #FFD700;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.5);
    font-weight: 800;
}

.subtitle {
    font-size: 16px;
    color: #fff;
    opacity: 0.9;
}

/* ====== Mode Tabs ====== */
.mode-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
    border: 3px solid #FFD700;
    border-radius: 15px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.7) 0%, rgba(220, 20, 60, 0.7) 100%);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.mode-tab {
    flex: 1;
    max-width: 250px;
    padding: 18px 28px;
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.6) 0%, rgba(218, 165, 32, 0.6) 100%);
    border: 3px solid #DAA520;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mode-tab:hover {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-color: #FFD700;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.mode-tab.active {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    border-color: #FFD700;
    color: #8B0000;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.4);
    font-weight: 800;
}

.tab-icon {
    font-size: 24px;
}

/* ====== Mode Sections ====== */
.mode-section {
    display: none;
}

.mode-section.active {
    display: block;
}

/* Simulator mode 2-column layout */
#simulator-mode.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    grid-template-areas:
        "balance balance"
        "table betting"
        "roadmap betting"
        "history history";
}

#simulator-mode .balance-panel {
    grid-area: balance;
}

#simulator-mode .game-table {
    grid-area: table;
}

#simulator-mode .roadmap-section {
    grid-area: roadmap;
}

#simulator-mode .betting-column {
    grid-area: betting;
}

#simulator-mode .bet-history-section {
    grid-area: history;
}

/* ====== Stats Panel ====== */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.8) 0%, rgba(165, 42, 42, 0.8) 100%);
    padding: 25px;
    border-radius: 15px;
    border: 3px solid #FFD700;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3), inset 0 0 30px rgba(255, 215, 0, 0.1);
}

.stat-item {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.3) 0%, rgba(218, 165, 32, 0.3) 100%);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #DAA520;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.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;
    flex-direction: column;
    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;
    transition: transform 0.3s ease;
}

.card.red {
    color: #dc2626;
}

.card.black {
    color: #1f2937;
}

.card-rank {
    font-size: 20px;
    font-weight: 700;
}

.card-suit {
    font-size: 18px;
}

/* Card back (face down) */
.card-back {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 100%);
    border: 3px solid #FFD700;
    position: relative;
    overflow: hidden;
}

.card-back::before {
    content: '🐉';
    position: absolute;
    font-size: 40px;
    color: rgba(255, 215, 0, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.card-back::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 2px dashed rgba(255, 215, 0, 0.5);
    border-radius: 6px;
}

/* Card flip animation */
@keyframes cardFlip {
    0% {
        transform: rotateY(180deg) scale(0.8);
    }
    50% {
        transform: rotateY(90deg) scale(1.1);
    }
    100% {
        transform: rotateY(0deg) scale(1);
    }
}

.card-flip {
    animation: cardFlip 0.6s ease-out;
}

/* Card squeeze animation (for first two cards) */
@keyframes cardSqueeze {
    0% {
        transform: scaleY(0.1) scaleX(1.2) rotateX(85deg);
        opacity: 0.5;
    }
    40% {
        transform: scaleY(0.3) scaleX(1.1) rotateX(60deg);
        opacity: 0.7;
    }
    100% {
        transform: scaleY(1) scaleX(1) rotateX(0deg);
        opacity: 1;
    }
}

.card-squeeze {
    animation: cardSqueeze 0.8s ease-out;
    transform-origin: bottom center;
}

/* ====== 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, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    padding: 25px 35px;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 5px double #B8860B;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.balance-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.balance-label {
    font-size: 15px;
    font-weight: 700;
    color: #8B0000;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.balance-value {
    font-size: 32px;
    font-weight: 800;
    color: #8B0000;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.3);
}

.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, #006400 0%, #228B22 50%, #006400 100%);
    border-radius: 25px;
    padding: 35px;
    margin-bottom: 30px;
    border: 5px double #FFD700;
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.4), inset 0 0 50px rgba(255, 215, 0, 0.1);
    position: relative;
}

.game-table::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
}

.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;
}

.game-result.natural {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95) 0%, rgba(255, 165, 0, 0.95) 100%);
    border: 4px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.3);
    animation: naturalGlow 1.5s ease-in-out infinite;
}

@keyframes naturalGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.3); }
    50% { box-shadow: 0 0 50px rgba(255, 215, 0, 1), inset 0 0 30px rgba(255, 255, 255, 0.5); }
}

.result-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.result-text {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.game-result.natural .result-text {
    color: #8B0000;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 215, 0, 0.8);
}

.game-result.natural .result-icon {
    animation: iconBounce 1s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.result-amount {
    font-size: 24px;
    font-weight: 600;
}

.result-amount.win {
    color: #059669;
}

.result-amount.lose {
    color: #dc2626;
}

/* ====== Betting Area ====== */
.betting-area {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.8) 0%, rgba(165, 42, 42, 0.8) 100%);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 25px;
    border: 4px double #FFD700;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4), inset 0 0 40px rgba(255, 215, 0, 0.1);
}

.betting-area h3 {
    color: #FFD700;
    margin-bottom: 25px;
    text-align: center;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 215, 0, 0.5);
    font-weight: 800;
}

.betting-spots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.bet-spot {
    background: linear-gradient(135deg, #1E90FF 0%, #4169E1 100%);
    border: 4px solid #0047AB;
    border-radius: 18px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 71, 171, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.bet-spot:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 71, 171, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.bet-spot[data-bet-type="banker"] {
    background: linear-gradient(135deg, #DC143C 0%, #B22222 100%);
    border: 4px solid #8B0000;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.bet-spot[data-bet-type="banker"]:hover {
    box-shadow: 0 10px 20px rgba(139, 0, 0, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.bet-spot[data-bet-type="tie"] {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: 4px solid #B8860B;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.bet-spot[data-bet-type="tie"]:hover {
    box-shadow: 0 10px 20px rgba(184, 134, 11, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.bet-label {
    font-size: 20px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 12px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.bet-amount {
    font-size: 26px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 10px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
}

.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: linear-gradient(135deg, rgba(139, 0, 0, 0.8) 0%, rgba(165, 42, 42, 0.8) 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    border: 4px double #FFD700;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4), inset 0 0 40px rgba(255, 215, 0, 0.1);
}

.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: 75px;
    height: 75px;
    border-radius: 50%;
    border: 5px solid #8B0000;
    background: radial-gradient(circle at 30% 30%, #DC143C 0%, #8B0000 50%, #DC143C 100%);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 17px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    position: relative;
}

.chip-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40%;
    height: 40%;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
}

.chip-btn:hover {
    transform: translateY(-4px) scale(1.1) rotate(10deg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.chip-btn.active {
    border-color: #FFD700;
    background: radial-gradient(circle at 30% 30%, #FFD700 0%, #B8860B 50%, #FFD700 100%);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 6px 16px rgba(255, 215, 0, 0.5), inset 0 2px 6px rgba(255, 255, 255, 0.4);
    color: #8B0000;
    animation: chipPulse 2s ease-in-out infinite;
}

@keyframes chipPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 6px 16px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 1), 0 8px 20px rgba(255, 215, 0, 0.7); }
}

/* ====== 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;
}

.rebet-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #8B0000;
    font-weight: 800;
    border: 3px solid #B8860B;
}

.rebet-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 16px rgba(255, 215, 0, 0.6);
}

.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;
    color: #1f2937;
}

.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;
}

/* Betting column wrapper */
.betting-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ====== Responsive Design ====== */
@media (max-width: 1200px) {
    /* Switch to single column on smaller screens */
    #simulator-mode.active {
        grid-template-columns: 1fr;
        grid-template-areas:
            "balance"
            "table"
            "roadmap"
            "betting"
            "history";
    }

    .betting-column {
        display: block;
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .container {
        padding: 15px;
        max-width: 100%;
    }

    header {
        padding: 25px 20px;
    }

    header h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 15px;
    }

    .lang-btn {
        padding: 12px 18px;
        min-height: 44px;
    }

    .mode-tabs {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .mode-tab {
        max-width: 100%;
        min-height: 54px;
        padding: 16px 24px;
    }

    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 18px;
    }

    .stat-item {
        padding: 18px 15px;
    }

    .stat-label {
        font-size: 12px;
    }

    .stat-value {
        font-size: 24px;
    }

    .hands-display {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .betting-spots {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .bet-spot {
        padding: 24px;
        min-height: 90px;
    }

    .pair-bets {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .pair-bet-spot {
        padding: 18px;
        min-height: 70px;
    }

    .balance-panel {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        gap: 15px;
    }

    .balance-value {
        font-size: 28px;
    }

    .reset-balance-btn {
        min-height: 48px;
        padding: 14px 26px;
    }

    .chip-options {
        gap: 10px;
    }

    .chip-btn {
        width: 58px;
        height: 58px;
        font-size: 14px;
        /* Ensure minimum touch target */
        min-width: 44px;
        min-height: 44px;
    }

    .answer-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .answer-btn {
        padding: 18px 20px;
        min-height: 60px;
    }

    .game-controls {
        flex-direction: column;
        gap: 12px;
    }

    .sim-btn {
        min-height: 52px;
        padding: 16px 30px;
    }

    .roadmap-grid {
        grid-template-columns: repeat(15, 35px);
        grid-template-rows: repeat(6, 35px);
        gap: 2px;
    }

    .roadmap-cell {
        width: 35px;
        height: 35px;
    }

    .roadmap-bead {
        width: 30px;
        height: 30px;
    }

    .game-table {
        padding: 25px 18px;
    }

    .hand-section {
        padding: 18px;
    }

    .card {
        width: 62px;
        height: 88px;
    }

    .card-rank {
        font-size: 18px;
    }

    .card-suit {
        font-size: 16px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 12px;
    }

    header {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }

    header::before,
    header::after {
        font-size: 24px;
    }

    .mode-tabs {
        padding: 10px;
        gap: 8px;
    }

    .mode-tab {
        padding: 14px 20px;
        min-height: 50px;
        font-size: 15px;
    }

    .tab-icon {
        font-size: 20px;
    }

    .stats-panel {
        padding: 15px;
        gap: 10px;
    }

    .stat-item {
        padding: 15px 12px;
    }

    .stat-label {
        font-size: 11px;
    }

    .stat-value {
        font-size: 20px;
    }

    .balance-panel {
        padding: 18px 15px;
    }

    .balance-label {
        font-size: 13px;
    }

    .balance-value {
        font-size: 24px;
    }

    .reset-balance-btn {
        padding: 12px 22px;
    }

    .betting-area,
    .chip-selector {
        padding: 25px 15px;
    }

    .betting-area h3,
    .chip-selector .chip-label {
        font-size: 20px;
    }

    .bet-spot {
        padding: 20px 15px;
        min-height: 80px;
    }

    .bet-label {
        font-size: 18px;
    }

    .bet-amount {
        font-size: 22px;
    }

    .chip-btn {
        width: 52px;
        height: 52px;
        font-size: 13px;
        border-width: 4px;
    }

    .sim-btn {
        padding: 14px 26px;
        font-size: 16px;
    }

    .roadmap-section {
        padding: 20px 15px;
    }

    .roadmap-section h3 {
        font-size: 20px;
    }

    .roadmap-grid {
        grid-template-columns: repeat(12, 32px);
        grid-template-rows: repeat(6, 32px);
        padding: 8px;
    }

    .roadmap-cell {
        width: 32px;
        height: 32px;
    }

    .roadmap-bead {
        width: 28px;
        height: 28px;
        border-width: 2px;
    }

    .game-table {
        padding: 20px 15px;
    }

    .hand-section {
        padding: 15px;
    }

    .hand-total {
        font-size: 28px;
    }

    .card {
        width: 54px;
        height: 76px;
    }

    .card-rank {
        font-size: 16px;
    }

    .card-suit {
        font-size: 14px;
    }

    .result-icon {
        font-size: 52px;
    }

    .result-text {
        font-size: 24px;
    }

    .result-amount {
        font-size: 20px;
    }

    .answer-btn {
        padding: 16px 18px;
        min-height: 56px;
        font-size: 15px;
    }
}

/* Very small devices */
@media (max-width: 360px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 20px;
    }

    .subtitle {
        font-size: 13px;
    }

    header::before,
    header::after {
        font-size: 20px;
        top: 8px;
    }

    .mode-tab {
        padding: 12px 18px;
        font-size: 14px;
    }

    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px;
        gap: 8px;
    }

    .stat-value {
        font-size: 18px;
    }

    .balance-value {
        font-size: 20px;
    }

    .chip-btn {
        width: 46px;
        height: 46px;
        font-size: 12px;
    }

    .roadmap-grid {
        grid-template-columns: repeat(10, 30px);
        grid-template-rows: repeat(6, 30px);
    }

    .roadmap-cell {
        width: 30px;
        height: 30px;
    }

    .roadmap-bead {
        width: 26px;
        height: 26px;
    }

    .card {
        width: 48px;
        height: 68px;
    }

    .card-rank {
        font-size: 14px;
    }

    .card-suit {
        font-size: 12px;
    }

    .answer-btn {
        padding: 14px 16px;
        min-height: 52px;
        font-size: 14px;
    }

    .sim-btn {
        padding: 12px 22px;
        font-size: 15px;
    }
}

/* ====== Roadmap Section ====== */
.roadmap-section {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.8) 0%, rgba(165, 42, 42, 0.8) 100%);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    border: 4px double #FFD700;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4), inset 0 0 40px rgba(255, 215, 0, 0.1);
}

.roadmap-section h3 {
    color: #FFD700;
    margin-bottom: 20px;
    text-align: center;
    font-size: 22px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 215, 0, 0.5);
    font-weight: 800;
}

.roadmap-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(20, 45px);
    grid-template-rows: repeat(6, 45px);
    gap: 3px;
    max-height: 300px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.roadmap-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    grid-column: 1 / -1;
    grid-row: 1 / -1;
}

.roadmap-cell {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.roadmap-bead {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 3px solid;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.roadmap-bead:hover {
    transform: scale(1.15);
}

.bead-player {
    background: transparent;
    border-color: #4169E1;
}

.bead-banker {
    background: radial-gradient(circle at 30% 30%, #DC143C 0%, #B22222 100%);
    border-color: #DC143C;
}

/* Tie indicator - green diagonal line */
.roadmap-bead.has-tie::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 2px solid #32CD32;
    border-radius: 50%;
    pointer-events: none;
}

.tie-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #32CD32;
    color: white;
    font-size: 10px;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Pair indicators - small dots */
.pair-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: absolute;
    border: 1px solid white;
}

.player-dot {
    background: #4169E1;
    bottom: 3px;
    left: 3px;
}

.banker-dot {
    background: #DC143C;
    top: 3px;
    right: 3px;
}

.bead-new {
    animation: beadPop 0.6s ease-out;
}

@keyframes beadPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ====== Animations ====== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-area {
    animation: fadeIn 0.5s ease-out;
}
