/* ============================================
   JM Casino - Premium Design System
   ============================================ */

/* Google Fonts loaded in HTML */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    /* 3D Dice Sizes */
    --dice-size: 50px;
    --dice-translate: 25px;
    --dice-font-size: 2rem;

    /* Core Colors - Traditional Theme */
    --bg-primary: #120101;
    /* Dark Maroon */
    --bg-secondary: #2a0000;
    --bg-card: #2d0a0a;
    --bg-card-hover: #3a1010;
    --bg-elevated: #451515;

    /* Accent Colors - Gold/Yellow */
    --accent: #ffc107;
    /* Gold */
    --accent-glow: rgba(255, 193, 7, 0.3);
    --accent-light: #ffd54f;
    --accent-dark: #ffa000;

    /* Status Colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Text Colors */
    --text-primary: #fff;
    --text-secondary: #ffd700;
    --text-muted: #ff9999;

    /* Borders */
    --border-color: #ffc107;
    /* Gold border */
    --border-active: #fff;

    /* Gradients */
    --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #f59e0b 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    --gradient-header: linear-gradient(180deg, rgba(10, 14, 26, 0.98) 0%, rgba(10, 14, 26, 0.92) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Pattern */
    --dot-pattern: radial-gradient(#600 1px, transparent 1px);
    --dot-size: 15px 15px;
}

/* VIP Badges */
.vip-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.vip-BRONZE {
    background: linear-gradient(135deg, #a8a29e, #78716c);
    color: white;
}

.vip-SILVER {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #0f172a;
}

.vip-GOLD {
    background: linear-gradient(135deg, #fef08a, #f59e0b);
    color: #451a03;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.vip-DIAMOND {
    background: linear-gradient(135deg, #bae6fd, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
    animation: vip-shimmer 2s infinite linear;
    background-size: 200% auto;
}

@keyframes vip-shimmer {
    to {
        background-position: 200% center;
    }
}

/* Promo Banners */
.promo-container {
    padding: 2px 0;
    margin: 0 0 16px 0;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.promo-container::-webkit-scrollbar {
    display: none;
}

.promo-slider {
    display: flex;
}

.promo-slide {
    flex: 0 0 100%;
    max-width: none;
    aspect-ratio: 7 / 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}

.promo-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.promo-slide:active {
    transform: scale(0.98);
}

/* ============ RESET ============ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* Background pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 800px 600px at 50% 0%, rgba(245, 158, 11, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse 600px 400px at 80% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse 600px 400px at 20% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============ APP CONTAINER ============ */
.app-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: 110px;
    display: flex;
    flex-direction: column;
}

/* ============ HEADER ============ */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--gradient-header);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.logo-icon {
    font-size: 1.15rem;
}

.logo-text {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.live-badge {
    font-size: 0.62rem;
    color: var(--success);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: -1px;
}

.pulse-dot {
    width: 5px;
    height: 5px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--success);
    animation: live-pulse 1.2s infinite ease-in-out;
}

@keyframes live-pulse {
    0% {
        transform: scale(0.9);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }

    100% {
        transform: scale(0.9);
        opacity: 1;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-buttons button {
    background: transparent;
    border: 1.5px solid var(--accent);
    color: var(--accent);
    padding: 6px 18px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-buttons button:first-child {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.auth-buttons button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.vip-badge-outer {
    flex-shrink: 0;
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--success-bg);
    color: var(--success);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.balance-display:hover {
    background: rgba(16, 185, 129, 0.18);
}

.balance-display .add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
    margin-left: 4px;
}

.menu-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sound-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    padding: 0;
    position: relative;
    overflow: hidden;
}

/* ============ GAME BOARD ============ */
.game-board {
    padding: 8px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ============ RESULT AREA ============ */
.result-area {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.result-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-gold);
    opacity: 0.6;
}

/* Timer */
.timer-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    letter-spacing: 2px;
    transition: color var(--transition-fast);
    line-height: 1;
}

.timer.danger {
    color: var(--danger);
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    animation: pulse-danger 0.5s ease-in-out infinite alternate;
}

@keyframes pulse-danger {
    to {
        opacity: 0.6;
    }
}

.timer-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Timer Progress Bar */
.timer-bar {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    margin-bottom: 8px;
    overflow: hidden;
}

.timer-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 1s linear;
    box-shadow: 0 0 8px var(--accent-glow);
}

.timer-bar-fill.danger {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* 3D Dice */
.dice-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 15px 0;
    perspective: 1000px;
    height: 80px;
    align-items: center;
    flex-wrap: wrap;
}

.dice-3d-wrap {
    width: var(--dice-size);
    height: var(--dice-size);
    perspective: 1000px;
}

.dice-3d {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.2, 1.2, 0.3, 1);
}

.cube {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
}

.face {
    position: absolute;
    width: var(--dice-size);
    height: var(--dice-size);
    background: #fdf5d7;
    border: 2px solid #b38f00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--dice-font-size);
    font-weight: bold;
    color: #333;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    backface-visibility: hidden;
}

/* Proper 3D alignment for the faces */
.front {
    transform: rotateY(0deg) translateZ(var(--dice-translate));
}

.back {
    transform: rotateY(180deg) translateZ(var(--dice-translate));
}

.right {
    transform: rotateY(90deg) translateZ(var(--dice-translate));
}

.left {
    transform: rotateY(-90deg) translateZ(var(--dice-translate));
}

.top {
    transform: rotateX(90deg) translateZ(var(--dice-translate));
}

.bottom {
    transform: rotateX(-90deg) translateZ(var(--dice-translate));
}

/* Animation states */
.dice-3d.rolling {
    animation: tumble 1s infinite linear;
}

@keyframes tumble {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(360deg) rotateY(720deg) rotateZ(360deg);
    }
}

/* Reveal Positions - each symbol maps to a specific side */
.dice-3d[data-result="1"] {
    transform: rotateX(0) rotateY(0);
}

/* Heart (Front) */
.dice-3d[data-result="2"] {
    transform: rotateX(0) rotateY(-180deg);
}

/* Spade (Back) */
.dice-3d[data-result="3"] {
    transform: rotateX(0) rotateY(-90deg);
}

/* Diamond (Right) */
.dice-3d[data-result="4"] {
    transform: rotateX(0) rotateY(90deg);
}

/* Club (Left) */
.dice-3d[data-result="5"] {
    transform: rotateX(-90deg) rotateY(0);
}

/* Crown (Top) */
.dice-3d[data-result="6"] {
    transform: rotateX(90deg) rotateY(0);
}

/* Flag (Bottom) */

/* Sound Toggle */
.sound-btn.muted {
    opacity: 0.5;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.sound-btn.muted::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 2px;
    background: var(--danger);
    transform: translate(-50%, -50%) rotate(45deg);
    pointer-events: none;
}

/* Round Info */
.round-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.round-id-badge {
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

/* Status Indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: blink 1.5s ease-in-out infinite;
}

.status-dot.closed {
    background: var(--danger);
    animation: none;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* History Strip */
.history-strip {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    padding: 0 4px;
}

.history-strip::-webkit-scrollbar {
    display: none;
}

.history-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fdf5d7;
    /* Cream color */
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 1.2rem;
    font-weight: 900;
    color: #1a0505;
    /* Dark color for symbols */
    border: 2px solid #b38f00;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: all var(--transition-bounce);
    min-width: 100px;
    height: 42px;
}

.history-item:first-child {
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.4);
    transform: scale(1.05);
}

/* ============ BET GRID ============ */
.bet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    flex: 1;
    min-height: 0;
}

.bet-box {
    background: var(--bg-card);
    background-image: var(--gradient-card);
    border-radius: 20px;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 4px solid #ffc107;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: all var(--transition-bounce);
    position: relative;
    overflow: hidden;
    min-height: 120px;
    max-height: 180px;
    /* Prevent over-stretch */
    aspect-ratio: 1 / 1.1;
    /* Maintain shape */
    user-select: none;
    -webkit-user-select: none;
}

/* Force constrain any images that might stretch the box */
.bet-box img {
    max-height: 80px;
    width: auto;
    max-width: 90%;
    object-fit: contain;
}


/* When a background image is set on the bet-box */
.bet-box.has-bg {
    padding: 8px;
    justify-content: flex-end;
    align-items: flex-start;
}

.bet-box.has-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.80) 0%, rgba(0, 0, 0, 0.10) 55%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.bet-box.has-bg>* {
    position: relative;
    z-index: 2;
}

.bet-box.has-bg .symbol {
    font-size: 1.8rem;
    line-height: 1;
    margin-bottom: 2px;
}

.bet-box.has-bg .symbol-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.bet-box.has-bg .pool-label {
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    color: #fff;
}

.bet-box.has-bg .my-bet {
    font-size: 0.72rem;
    margin-top: 2px;
}

/* Custom symbol icon (PNG/JPG uploaded via admin) */
.custom-symbol {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 48px;
    height: 48px;
    display: block;
    margin: 4px auto;
}

.bet-box.has-bg .custom-symbol {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}


.pool-label {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.15);
    padding: 2px 6px;
    border-radius: 10px;
    letter-spacing: 0.2px;
    transition: opacity 0.3s ease;
}

.bet-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.bet-box:active {
    transform: scale(0.96);
}

.bet-box.selected {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.06);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.bet-box.winner {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.08);
    animation: winner-glow 1s ease-in-out infinite alternate;
}

@keyframes winner-glow {
    to {
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
    }
}

.bet-box.loser {
    opacity: 0.5;
    filter: grayscale(0.5);
}

.symbol {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 2px;
    transition: transform var(--transition-bounce);
}

.bet-box:active .symbol {
    transform: scale(1.15);
}

.symbol-name {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0;
}

/* Symbol Colors */
.heart {
    color: #ef4444;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.3));
}

.spade {
    color: #e2e8f0;
    filter: drop-shadow(0 0 4px rgba(226, 232, 240, 0.2));
}

.diamond {
    color: #3b82f6;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.3));
}

.club {
    color: #a855f6;
    filter: drop-shadow(0 0 4px rgba(168, 85, 246, 0.3));
}

.crown {
    color: #f59e0b;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.3));
}

.flag {
    color: #10b981;
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.3));
}

/* Bet Amount Badge */
.my-bet {
    position: absolute;
    top: 4px;
    right: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    padding: 1px 5px;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-4px);
    transition: all var(--transition-normal);
    z-index: 10;
}

.my-bet.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============ FOOTER / BET CONTROLS ============ */
.bet-controls {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
    border-top: 1px solid var(--border-color);
    z-index: 50;
}

.chips-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.chip {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
}

.chip::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border: 1.5px dashed rgba(255, 255, 255, 0.1);
}

.chip:active {
    transform: scale(0.92);
}

.chip.selected {
    background: var(--gradient-gold);
    color: #000;
    border-color: var(--accent);
    transform: scale(1.08);
    box-shadow: 0 0 16px var(--accent-glow);
}

.chip.selected::before {
    border-color: rgba(0, 0, 0, 0.2);
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.clear-btn {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
}

.clear-btn:hover {
    background: var(--danger);
    color: white;
}

#status-msg {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    flex: 1;
    font-weight: 500;
}

.total-bet {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
}

/* ============ MODALS ============ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fade-in var(--transition-normal) ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 380px;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    animation: slide-up var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.modal-body {
    padding: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* UPI Payment Info */
.upi-pay-info {
    margin-bottom: 14px;
}

.upi-id-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1.5px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-top: 8px;
    text-align: center;
}

.upi-id-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #10b981;
    margin-bottom: 6px;
}

.upi-id-value {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    word-break: break-all;
    user-select: all;
}

.upi-copy-btn {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.upi-copy-btn:hover {
    background: rgba(16, 185, 129, 0.25);
}

.upi-copy-btn.copied {
    background: rgba(16, 185, 129, 0.3);
    color: #fff;
}

.submit-btn {
    width: 100%;
    padding: 13px;
    background: var(--gradient-gold);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    margin-top: 6px;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.submit-btn.danger-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

/* Tabs */
.tab-container {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    transition: color var(--transition-fast);
    font-family: inherit;
}

.tab-btn.active {
    color: var(--accent);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Transaction History */
.txn-list {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 16px;
}

.txn-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.txn-item:last-child {
    border-bottom: none;
}

.txn-type {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.txn-type.deposit {
    color: var(--success);
}

.txn-type.withdraw {
    color: var(--danger);
}

.txn-type.bet {
    color: var(--warning);
}

.txn-type.win {
    color: var(--accent);
}

.txn-amount {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.txn-status {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.txn-status.pending {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.txn-status.completed {
    background: var(--success-bg);
    color: var(--success);
}

.txn-status.approved {
    background: var(--success-bg);
    color: var(--success);
}

.txn-status.rejected {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ============ SLIDE MENU ============ */
.slide-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

.slide-menu-overlay.active {
    display: block;
}

.slide-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 160;
    transition: right var(--transition-slow);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.slide-menu.active {
    right: 0;
}

.menu-user-section {
    padding: 24px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.menu-user-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.menu-user-balance {
    font-family: 'JetBrains Mono', monospace;
    color: var(--success);
    font-weight: 600;
}

.menu-links {
    padding: 12px 0;
    flex: 1;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    font-family: inherit;
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.menu-link .link-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.menu-link.danger {
    color: var(--danger);
    margin-top: auto;
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 20px;
}

/* ============ TOAST NOTIFICATION ============ */
.toast-container {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    width: 100%;
    max-width: 380px;
    padding: 0 16px;
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in var(--transition-bounce) forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.info {
    border-left: 3px solid var(--info);
}

.toast.win {
    border-left: 3px solid var(--accent);
    background: rgba(245, 158, 11, 0.1);
}

.toast-icon {
    font-size: 1.1rem;
}

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* ============ WIN OVERLAY ============ */
.win-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.win-overlay.active {
    display: flex;
    animation: fade-in 0.3s ease;
}

.win-amount-display {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
    animation: scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.win-label {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 600;
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.3);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============ CONFETTI ============ */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    z-index: 260;
    pointer-events: none;
}

/* ============ LOADING SPINNER ============ */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============ BET HISTORY MODAL ============ */
.bet-history-list {
    max-height: 350px;
    overflow-y: auto;
}

.bet-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
}

.bet-history-result {
    font-size: 1rem;
}

.bet-history-amount {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.bet-won {
    color: var(--success);
}

.bet-lost {
    color: var(--danger);
}

.bet-pending {
    color: var(--text-muted);
}

/* ============ RESPONSIVE ============ */

/* Compact mobile: fill exactly one screen */
@media (max-height: 700px) {
    :root {
        --dice-size: 44px;
        --dice-translate: 22px;
        --dice-font-size: 1.7rem;
    }

    .app-container {
        padding-bottom: 95px;
    }

    .game-header {
        padding: 6px 10px;
    }

    .game-board {
        padding: 6px 8px;
    }

    .result-area {
        padding: 8px 10px;
        margin-bottom: 6px;
    }

    .timer {
        font-size: 1.3rem;
    }

    .timer-section {
        margin-bottom: 4px;
    }

    .dice-container {
        margin: 4px 0;
        gap: 8px;
    }

    .round-info {
        margin-top: 4px;
    }

    .history-strip {
        margin-top: 4px;
    }

    .bet-grid {
        gap: 4px;
    }

    .symbol {
        font-size: 2.4rem;
    }

    .bet-box {
        padding: 6px 4px;
    }

    .symbol-name {
        font-size: 0.5rem;
    }

    .bet-controls {
        padding: 6px 10px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0));
    }

    .chip {
        width: 36px;
        height: 36px;
        font-size: 0.65rem;
    }

    .chips-row {
        gap: 6px;
        margin-bottom: 4px;
    }
}

/* Adjust header and dice size for small screen widths to prevent overlap */
@media (max-width: 450px) {
    :root {
        --dice-size: 44px;
        --dice-translate: 22px;
        --dice-font-size: 1.7rem;
    }

    .game-header {
        padding: 8px 10px !important;
    }

    .logo {
        gap: 4px !important;
        font-size: 0.9rem !important;
    }

    .logo-icon {
        font-size: 1rem !important;
    }

    .logo-text {
        font-weight: 700 !important;
    }

    .live-badge {
        font-size: 0.56rem !important;
    }

    .header-actions {
        gap: 4px !important;
    }

    .global-controls {
        gap: 4px !important;
    }

    .menu-btn, .sound-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.9rem !important;
    }

    .auth-buttons {
        gap: 5px !important;
    }

    .auth-buttons button {
        padding: 5px 10px !important;
        font-size: 0.74rem !important;
        letter-spacing: 0.2px !important;
    }

    .dice-container {
        gap: 8px !important;
    }
}

@media (max-width: 380px) {
    :root {
        --dice-size: 40px;
        --dice-translate: 20px;
        --dice-font-size: 1.5rem;
    }

    .symbol {
        font-size: 2.6rem;
    }

    .bet-box {
        padding: 6px 4px;
    }

    .chip {
        width: 38px;
        height: 38px;
        font-size: 0.68rem;
    }

    .timer {
        font-size: 1.4rem;
    }

    .dice-container {
        gap: 6px !important;
    }
}

@media (max-width: 320px) {
    :root {
        --dice-size: 35px;
        --dice-translate: 17.5px;
        --dice-font-size: 1.3rem;
    }

    .bet-grid {
        gap: 4px;
    }

    .symbol {
        font-size: 2.2rem;
    }

    .game-header {
        padding: 6px 6px !important;
    }

    .logo {
        font-size: 0.82rem !important;
    }

    .menu-btn, .sound-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.8rem !important;
    }

    .auth-buttons button {
        padding: 4px 8px !important;
        font-size: 0.7rem !important;
    }

    .dice-container {
        gap: 4px !important;
    }
}

/* Scrollbar for modals */
.modal-content::-webkit-scrollbar,
.txn-list::-webkit-scrollbar,
.bet-history-list::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* ============ SAFE AREA ============ */
@supports (padding: max(0px)) {
    .bet-controls {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* ============ TALL SCREENS (tablets, etc) ============ */
@media (min-height: 800px) {
    .result-area {
        padding: 16px;
    }

    .timer {
        font-size: 2rem;
    }

    .dice {
        width: 58px;
        height: 58px;
        font-size: 1.8rem;
    }

    .symbol {
        font-size: 3.2rem;
    }

    .bet-box {
        padding: 12px 8px;
    }

    .chip {
        width: 48px;
        height: 48px;
        font-size: 0.78rem;
    }
}

/* ============ DYNAMIC UI ELEMENTS ============ */

/* Win Overlay */
.win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 26, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: win-enter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.win-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

@keyframes win-enter {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.win-content {
    text-align: center;
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--accent);
    box-shadow: 0 0 50px var(--accent-glow);
    position: relative;
    overflow: hidden;
}

.win-sparkle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 15rem;
    opacity: 0.1;
    z-index: -1;
    animation: spin 10s infinite linear;
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.win-title {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    letter-spacing: 4px;
}

.win-amount {
    font-size: 4rem;
    font-weight: 800;
    color: var(--success);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* Toasts */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 400px;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    border-left: 5px solid var(--accent);
    animation: toast-enter 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.toast-success {
    border-left-color: var(--success);
}

.toast.toast-error {
    border-left-color: var(--danger);
}

.toast.toast-info {
    border-left-color: var(--accent);
}

@keyframes toast-enter {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast.fade-out {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
    transition: all 0.3s ease;
}

/* ===== Symbol Custom Image & Background Photo ===== */

.bet-box.has-bg {
    padding: 8px;
    justify-content: flex-end;
    align-items: flex-start;
}

.bet-box.has-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.80) 0%, rgba(0, 0, 0, 0.10) 55%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.bet-box.has-bg>* {
    position: relative;
    z-index: 2;
}

.bet-box.has-bg .symbol {
    font-size: 1.8rem;
    line-height: 1;
    margin-bottom: 2px;
}

.bet-box.has-bg .symbol-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.bet-box.has-bg .pool-label {
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    color: #fff;
}

.bet-box.has-bg .my-bet {
    font-size: 0.72rem;
    margin-top: 2px;
}

.custom-symbol {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 48px;
    height: 48px;
    display: block;
    margin: 4px auto;
}

.bet-box.has-bg .custom-symbol {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}


/* ===== Corner symbol overlay on image-filled bet boxes ===== */

/* Symbol emoji: bottom-left corner */
.box-corner-symbol {
    position: absolute;
    bottom: 8px;
    left: 10px;
    font-size: 1.4rem;
    line-height: 1;
    z-index: 3;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.9));
}

/* Name: absolute center of the box */
.box-corner-name {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 1), 0 0 16px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    z-index: 3;
    padding: 0 6px;
}

/* has-bg: my-bet shown bottom-right corner */
.bet-box.has-bg .my-bet {
    position: absolute !important;
    bottom: 8px !important;
    right: 8px !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    color: #fff !important;
    background: rgba(0, 0, 0, 0.45) !important;
    padding: 1px 6px !important;
    border-radius: 8px !important;
    z-index: 3;
}

.bet-box.has-bg .my-bet.active {
    background: rgba(245, 158, 11, 0.85) !important;
    color: #000 !important;
}


/* ==========================================================
   REFINE: Bet Box Background View (has-bg)
   ========================================================== */

/* 1. Background image fills the box, center content alignment */
.bet-box.has-bg {
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    background-size: cover !important;
    background-position: center !important;
}

/* 2. Contrast Overlay (ensures text is readable) */
.bet-box.has-bg::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.35) !important;
    z-index: 1 !important;
}

/* 3. SYMBOL NAME: Absolute center of the box */
.box-corner-name {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    text-align: center !important;
    font-size: 0.9rem !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    text-shadow: 2px 2px 4px #000, 0 0 10px rgba(0, 0, 0, 0.5) !important;
    z-index: 10 !important;
    pointer-events: none !important;
    margin: 0 !important;
}

/* 4. SYMBOL EMOJI: Left-bottom corner */
.box-corner-symbol {
    position: absolute !important;
    bottom: 10px !important;
    left: 10px !important;
    top: auto !important;
    right: auto !important;
    font-size: 1.8rem !important;
    z-index: 10 !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8)) !important;
    pointer-events: none !important;
}

/* 5. POOL: Right-top corner */
.bet-box.has-bg .pool-label {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    bottom: auto !important;
    background: rgba(0, 0, 0, 0.5) !important;
    padding: 4px 10px !important;
    border-radius: 20px !important;
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 1) !important;
    opacity: 1 !important;
    z-index: 10 !important;
    backdrop-filter: blur(4px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* 6. Bet marker: Bottom-right corner */
.bet-box.has-bg .my-bet {
    position: absolute !important;
    bottom: 10px !important;
    right: 10px !important;
    top: auto !important;
    left: auto !important;
    background: var(--accent) !important;
    color: #000 !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    padding: 2px 8px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
    z-index: 10 !important;
}


/* Fix overlapping Bet Amount and Pool Label */
.my-bet {
    position: absolute !important;
    top: auto !important;
    bottom: 8px !important;
    right: 8px !important;
    left: auto !important;
    background: var(--accent) !important;
    color: #000 !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    z-index: 15 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
    pointer-events: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.my-bet.active {
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* Ensure Pool Label is always top-right */
.pool-label {
    position: absolute !important;
    top: 6px !important;
    right: 8px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 12 !important;
}

/* Premium Traditional Theme Overrides */

/* History Strip Icons */
.history-icon {
    width: 15px;
    height: 15px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    margin: 0;
}

.history-item {
    background: #fdf5d7 !important;
    border: 2px solid #b38f00 !important;
    color: #1a0505 !important;
    padding: 4px 6px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    flex: 1;
    max-width: 110px;
    min-width: 0 !important;
    height: 36px !important;
    overflow: hidden;
}

.history-item:first-child {
    border-color: #ffc107 !important;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5) !important;
    transform: scale(1.02);
}

/* Bet Box Content refinement */
.box-corner-symbol {
    position: absolute !important;
    bottom: 10px !important;
    left: 10px !important;
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 12 !important;
}

.box-corner-name {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 1.1rem !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    text-shadow: 2px 2px 4px #000, 0 0 15px rgba(255, 193, 7, 0.8) !important;
    white-space: nowrap !important;
    letter-spacing: 0.5px !important;
    z-index: 12 !important;
}

/* Bet marker color for this theme */
.my-bet {
    background: #ffa000 !important;
    /* Goldier orange */
    color: #000 !important;
}

/* Main Background pattern */
body {
    background-color: #1a0505 !important;
    background-image: radial-gradient(#4d0000 1.5px, transparent 1.5px) !important;
    background-size: 20px 20px !important;
}

/* ===== Flying Chip Animation ===== */
.flying-chip {
    position: fixed;
    width: 38px;
    height: 38px;
    background: #ffc107;
    border: 3px dashed #b38f00;
    border-radius: 50%;
    color: #000;
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 0 5px rgba(255, 255, 255, 0.8);
    z-index: 9999;
    pointer-events: none;
    text-shadow: none;
    animation: chipSpin 0.6s ease-out;
}

.flying-chip::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

@keyframes chipSpin {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(0.6) rotate(360deg);
        opacity: 0.8;
    }
}

/* ===== Win Particles (Gold Rain) ===== */
.win-particle {
    position: fixed;
    top: -50px;
    z-index: 10001;
    pointer-events: none;
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: fallSpin linear forwards;
}

@keyframes fallSpin {
    0% {
        transform: translateY(0) rotate(0deg) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(110vh) rotate(720deg) translateX(50px);
        opacity: 0;
    }
}

.coin-particle {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ffd700, #b38f00);
    border-radius: 50%;
    border: 1.5px solid #ffc107;
    box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.5);
}

.star-particle {
    color: #ffc107;
}

/* Fix for symbol when no background is present */
.symbol-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.main-symbol-img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    margin-bottom: 5px;
}

/* Ensure centering for non-bg boxes */
.bet-box:not(.has-bg) {
    justify-content: center !important;
    align-items: center !important;
}

.bet-box:not(.has-bg) .symbol-name {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #fff !important;
    text-shadow: 1px 1px 2px #000 !important;
}

/* Win Overlay Visuals */
.win-content {
    text-align: center;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
    padding: 2rem;
    border-radius: 50%;
}

.win-sparkle {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: sparkleGrow 1.5s infinite alternate;
}

.win-title {
    font-size: 1.2rem;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 900;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.win-amount {
    font-size: 4.5rem;
    font-weight: 900;
    background: linear-gradient(to bottom, #fff 20%, #ffd700 80%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.7));
    margin: 0;
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes sparkleGrow {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.3);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}