/* ==========================================================================
   ROYAL UNDER-OVER 7 CASINO GAME - OPTIMIZED STYLES
   ========================================================================== */

/* CSS Variables for consistent theming */
:root {
    --gold-gradient: linear-gradient(135deg, #fde68a 0%, #d97706 50%, #b45309 100%);
    --casino-felt: #064e3b;
    --amber-500: #f59e0b; --amber-600: #d97706; --amber-800: #92400e; --amber-900: #78350f;
    --slate-200: #e2e8f0; --slate-300: #cbd5e1; --slate-400: #94a3b8; --slate-500: #64748b;
    --slate-700: #334155; --slate-800: #1e293b; --slate-900: #0f172a; --slate-950: #020617;
    --red-500: #ef4444; --red-600: #dc2626; --red-700: #b91c1c;
    --green-500: #10b981; --green-600: #059669;
    --blue-600: #2563eb; --purple-600: #7c3aed;
}

/* Global Reset & Base Styles */
* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; }
body { 
    font-family: 'Inter', sans-serif; 
    background: radial-gradient(circle at center, #064e3b 0%, #022c22 40%, #020617 100%);
    color: #f8fafc; height: 100vh; width: 100vw; overflow: hidden; margin: 0; position: fixed; 
}

/* Typography */
.font-cinzel { font-family: 'Cinzel', serif; }
.gold-text { background: linear-gradient(to bottom, #fde68a, #d97706); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.gold-gradient { background: var(--gold-gradient); }

/* Background & Surface Styles */
.casino-felt { 
    background-color: #064e3b; 
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0); 
    background-size: 20px 20px; box-shadow: inset 0 0 100px rgba(0,0,0,0.5); 
}
.glass-panel { background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(12px); border: 1px solid rgba(212, 175, 55, 0.3); }

/* Interactive Elements */
.btn { transition: transform 0.1s ease, background-color 0.2s; user-select: none; }
.btn:active { transform: scale(0.92); }
.btn-disabled { background-color: #555 !important; cursor: not-allowed; transform: none !important; }

/* Dice 3D System */
.dice-container { perspective: 1200px; width: 80px; height: 80px; }
@media (min-width: 768px) { .dice-container { width: 100px; height: 100px; } }
.dice-cube { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.dice-face { 
    position: absolute; width: 100%; height: 100%; 
    background: linear-gradient(135deg, #be123c 0%, #9f1239 50%, #881337 100%); 
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; 
    display: flex; align-items: center; justify-content: center; 
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5); backface-visibility: hidden; 
}
.dice-dot { 
    background: radial-gradient(circle at 30% 30%, #ffffff 0%, #f8fafc 40%, #e2e8f0 100%); 
    box-shadow: 0 1px 2px rgba(0,0,0,0.5); border-radius: 50%; width: 42%; height: 42%; 
}

/* Dice Face Positioning */
.face-1 { transform: rotateY(0deg) translateZ(40px); }
.face-2 { transform: rotateY(180deg) translateZ(40px); }
.face-3 { transform: rotateY(90deg) translateZ(40px); }
.face-4 { transform: rotateY(-90deg) translateZ(40px); }
.face-5 { transform: rotateX(90deg) translateZ(40px); }
.face-6 { transform: rotateX(-90deg) translateZ(40px); }
@media (min-width: 768px) {
    .face-1 { transform: rotateY(0deg) translateZ(50px); }
    .face-2 { transform: rotateY(180deg) translateZ(50px); }
    .face-3 { transform: rotateY(90deg) translateZ(50px); }
    .face-4 { transform: rotateY(-90deg) translateZ(50px); }
    .face-5 { transform: rotateX(90deg) translateZ(50px); }
    .face-6 { transform: rotateX(-90deg) translateZ(50px); }
}

/* Animations */
@keyframes dice-rolling { 0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); } 100% { transform: rotateX(1440deg) rotateY(720deg) rotateZ(360deg); } }
@keyframes chip-land { 0% { transform: translateY(-50px) scale(1.5) rotate(15deg); opacity: 0; } 70% { transform: translateY(5px) scale(0.9) rotate(-5deg); opacity: 1; } 100% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; } }
@keyframes loading { 0% { transform: translateX(-100%); } 100% { transform: translateX(200%); } }
@keyframes zoom-in { 0% { transform: scale(0.95); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.is-rolling { animation: dice-rolling 0.4s linear infinite !important; }
.chip-animate { animation: chip-land 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.chip-shadow { box-shadow: 0 2px 0 rgba(0,0,0,0.5), 0 4px 6px rgba(0,0,0,0.3); }
.zoom-in-95 { animation: zoom-in 0.2s ease-out forwards; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-in, .fade-in { animation: fadeIn 0.7s ease-out; }
.zoom-in { animation: zoom-in 0.7s ease-out; }

/* Loading Bar */
.splash-loading-bar { position: relative; overflow: hidden; }
.splash-loading-bar::after { content: ''; position: absolute; inset: 0; background: #f59e0b; width: 50%; animation: loading 2s ease-in-out infinite; }

/* Layout Containers */
.game-container { display: none; height: 100vh; width: 100%; flex-direction: column; align-items: center; justify-content: flex-start; background: black; overflow: hidden; user-select: none; }
.splash-screen { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; background: black; overflow: hidden; cursor: pointer; }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(4px); }

/* Game Header */
.game-header { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(245, 158, 11, 0.2); z-index: 10; }
.header-controls { display: flex; align-items: center; background: rgba(0, 0, 0, 0.4); padding: 0.25rem; border-radius: 9999px; border: 1px solid rgba(245, 158, 11, 0.2); }
.header-button { padding: 0.5rem; color: #cbd5e1; cursor: pointer; transition: color 0.2s, transform 0.2s; border: none; background: none; }
.header-button:hover { color: var(--amber-500); } .header-button:active { transform: scale(0.9); }
.balance-button { display: flex; align-items: center; gap: 0.75rem; background: rgba(0, 0, 0, 0.6); padding: 0.5rem 1rem; border-radius: 9999px; border: 1px solid rgba(245, 158, 11, 0.4); box-shadow: inset 0 0 10px rgba(0,0,0,0.3); cursor: pointer; transition: all 0.2s; border: none; }
.balance-button:hover { background: rgba(0, 0, 0, 0.8); } .balance-button:active { transform: scale(0.95); }
.balance-display { font-size: 1.125rem; font-weight: 900; color: white; }

/* Main Game Board */
.game-main { flex: 1; width: 100%; max-width: 28rem; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem 1.5rem; gap: 1rem; overflow: hidden; padding-bottom: 2rem; }
.game-board { width: 100%; height: 520px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 1.5rem 1rem; border-radius: 2.5rem; border: 6px solid rgba(120, 53, 15, 0.8); position: relative; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }
@media (min-width: 768px) { .game-board { border-width: 8px; } }
.game-board::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to bottom, rgba(255,255,255,0.05), transparent); pointer-events: none; }

/* Status & Messages */
.status-message { width: 100%; text-align: center; padding: 0.5rem 1rem; border-radius: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.625rem; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); background: rgba(2, 6, 23, 0.8); color: var(--amber-500); }
@media (min-width: 768px) { .status-message { font-size: 0.75rem; } }
.win-message { background: rgba(16, 185, 129, 0.4) !important; color: rgb(110, 231, 183) !important; border-color: rgba(16, 185, 129, 0.5) !important; box-shadow: 0 0 30px rgba(16, 185, 129, 0.4); }
.lose-message { background: rgba(239, 68, 68, 0.4) !important; color: rgb(254, 202, 202) !important; border-color: rgba(239, 68, 68, 0.5) !important; }

/* Dice Area */
.dice-area { display: flex; justify-content: center; align-items: center; gap: 2rem; margin: 0.5rem 0; position: relative; }
@media (min-width: 768px) { .dice-area { gap: 3.5rem; } }
.dice-shadow { position: absolute; bottom: -1.5rem; left: 50%; transform: translateX(-50%); width: 90%; height: 1.5rem; background: rgba(0, 0, 0, 0.5); filter: blur(1rem); border-radius: 50%; transition: all 0.7s; opacity: 0.7; }

/* Betting Interface */
.betting-zone { width: 100%; height: 4rem; position: relative; margin-top: 1rem; }
.bet-sectors { display: flex; gap: 0.5rem; width: 100%; margin-top: 0.5rem; }
.bet-button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 0.5rem; border-radius: 1rem; border-width: 4px; transition: all 0.2s; position: relative; overflow: hidden; background: rgba(15, 23, 42, 0.4); border: 4px solid var(--slate-700); cursor: pointer; }
.bet-button:hover { border-color: var(--slate-500); }
.bet-button::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent); transition: all 0.2s; }
.bet-button:hover::before { background: linear-gradient(to right, transparent, rgba(255,255,255,0.4), transparent); }
.selected-bet { background: rgba(245, 158, 11, 0.1) !important; border-color: var(--amber-500) !important; transform: scale(1.05); box-shadow: 0 0 30px rgba(245, 158, 11, 0.4); }
.selected-bet .bet-label { color: var(--amber-500) !important; } .selected-bet .bet-multiplier { color: white !important; }

.bet-label { font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: -0.025em; color: var(--slate-400); margin-bottom: 0.25rem; }
.bet-multiplier { font-size: 1.5rem; font-weight: 900; color: var(--slate-200); }
@media (min-width: 768px) { .bet-label { font-size: 0.875rem; } .bet-multiplier { font-size: 1.875rem; } }

/* Chip System */
.chip-selector { display: flex; justify-content: space-between; align-items: center; background: rgba(0, 0, 0, 0.3); padding: 0.375rem; border-radius: 9999px; width: 100%; margin: 0.75rem 0; }
.chip-button { width: 2.5rem; height: 2.5rem; border-radius: 50%; border-width: 2px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; position: relative; cursor: pointer; border-style: solid; }
@media (min-width: 768px) { .chip-button { width: 3rem; height: 3rem; border-width: 4px; } }
.chip-button:hover { transform: scale(1.1); } .chip-button:active { transform: scale(0.9); }
.chip-button::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 50%; border: 2px dashed rgba(255,255,255,0.1); }
.chip-value { font-size: 0.625rem; font-weight: 900; color: white; }
@media (min-width: 768px) { .chip-value { font-size: 0.75rem; } }
.chip-5 { background-color: var(--red-600); border-color: #7f1d1d; }
.chip-10 { background-color: var(--blue-600); border-color: #1e40af; }
.chip-25 { background-color: var(--green-600); border-color: #065f46; }
.chip-50 { background-color: var(--slate-800); border-color: var(--slate-950); }
.chip-100 { background-color: var(--purple-600); border-color: #5b21b6; }

/* Game Controls */
.game-controls { width: 100%; display: flex; gap: 0.5rem; }
.control-button { display: flex; align-items: center; justify-content: center; border-radius: 0.75rem; background: var(--slate-900); border: 2px solid var(--slate-700); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); color: var(--slate-400); cursor: pointer; }
.control-button:active { transform: scale(0.9); }
.reset-button { width: 3rem; height: 3rem; } @media (min-width: 768px) { .reset-button { width: 3.5rem; height: 3.5rem; } }

.bet-display { flex: 1; height: 3rem; background: var(--slate-950); border: 2px solid rgba(120, 53, 15, 0.5); border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; position: relative; box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); padding: 0 0.5rem; }
@media (min-width: 768px) { .bet-display { height: 3.5rem; } }
.bet-label-small { position: absolute; left: 0.5rem; color: rgba(245, 158, 11, 0.4); font-weight: 900; font-style: italic; font-size: 0.5rem; }
@media (min-width: 768px) { .bet-label-small { left: 0.75rem; font-size: 0.625rem; } }
.bet-amount-display { min-width: 80px; text-align: center; transition: none !important; }
.bet-amount { font-size: 1.5rem; font-weight: 900; color: white; } @media (min-width: 768px) { .bet-amount { font-size: 1.875rem; } }
.clear-bet-button { position: absolute; right: 0.5rem; color: var(--red-500); background: none; border: none; cursor: pointer; display: none; }
.bet-display:active { transform: none !important; }

.roll-button { flex: 1; height: 3rem; border-radius: 0.75rem; font-weight: 900; font-size: 1.125rem; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); transition: all 0.2s; border-bottom-width: 4px; display: flex; align-items: center; justify-content: center; gap: 0.5rem; background: linear-gradient(to bottom, #fbbf24, #d97706); border: 2px solid var(--amber-800); border-bottom: 4px solid var(--amber-800); color: var(--slate-950); cursor: pointer; }
@media (min-width: 768px) { .roll-button { height: 3.5rem; font-size: 1.25rem; } }
.roll-button:active { transform: scale(0.95); }
.roll-button-disabled, .disabled-roll { background: var(--slate-700) !important; border-color: var(--slate-800) !important; color: var(--slate-500) !important; cursor: not-allowed !important; opacity: 0.7; }

/* Modal System */
.modal-content { width: 100%; max-width: 28rem; border-radius: 1.5rem; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem; border-bottom: 1px solid rgba(245, 158, 11, 0.2); background: rgba(15, 23, 42, 0.5); }
.modal-title { font-size: 1.25rem; font-weight: 900; color: white; text-transform: uppercase; letter-spacing: 0.1em; font-family: 'Cinzel', serif; }
.modal-close { padding: 0.5rem; color: var(--slate-400); background: none; border: none; cursor: pointer; transition: color 0.2s; }
.modal-close:hover { color: white; }
.modal-body { padding: 1.5rem; overflow-y: auto; max-height: 70vh; }

.history-item { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem; border-radius: 1rem; background: var(--slate-900); border: 1px solid var(--slate-800); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); margin-bottom: 0.75rem; }

/* Utility Classes - Consolidated */
.hidden { display: none !important; }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-center { justify-content: center; } .justify-between { justify-content: space-between; }
.relative { position: relative; } .absolute { position: absolute; } .fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.rounded-full { border-radius: 9999px; } .rounded-xl { border-radius: 0.75rem; } .rounded-2xl { border-radius: 1rem; } .rounded-3xl { border-radius: 1.5rem; }
.overflow-hidden { overflow: hidden; } .select-none { user-select: none; } .pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; } .cursor-not-allowed { cursor: not-allowed; }
.transition-all { transition: all 0.2s; } .transition-colors { transition: background-color 0.2s, border-color 0.2s, color 0.2s; } .transition-transform { transition: transform 0.2s; }
.hover-scale-110:hover { transform: scale(1.1); } .active-scale-90:active { transform: scale(0.9); } .active-scale-95:active { transform: scale(0.95); }

/* Grid & Spacing Utilities */
.grid { display: grid; } .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-rows-3 { grid-template-rows: repeat(3, minmax(0, 1fr)); }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; }
.space-y-3 > * + * { margin-top: 0.75rem; } .space-y-6 > * + * { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; } .mb-3 { margin-bottom: 0.75rem; } .mb-4 { margin-bottom: 1rem; } .mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; } .mt-4 { margin-top: 1rem; } .mt-12 { margin-top: 3rem; }
.p-2 { padding: 0.5rem; } .p-3 { padding: 0.75rem; } .p-4 { padding: 1rem; } .p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; } .px-4 { padding-left: 1rem; padding-right: 1rem; } .px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; } .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; } .py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; } .py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; } .py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }

/* Typography Scale */
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; } .text-sm { font-size: 0.875rem; } .text-base { font-size: 1rem; } .text-lg { font-size: 1.125rem; } .text-xl { font-size: 1.25rem; } .text-2xl { font-size: 1.5rem; } .text-3xl { font-size: 1.875rem; } .text-4xl { font-size: 2.25rem; } .text-6xl { font-size: 3.75rem; }
.font-bold { font-weight: 700; } .font-black { font-weight: 900; }
.uppercase { text-transform: uppercase; } .italic { font-style: italic; }
.tracking-widest { letter-spacing: 0.1em; } .tracking-tighter { letter-spacing: -0.025em; }

/* Sizing */
.w-full { width: 100%; } .w-5 { width: 1.25rem; } .w-6 { width: 1.5rem; } .w-8 { width: 2rem; } .w-12 { width: 3rem; } .w-32 { width: 8rem; } .w-48 { width: 12rem; }
.h-5 { height: 1.25rem; } .h-6 { height: 1.5rem; } .h-8 { height: 2rem; } .h-12 { height: 3rem; } .h-32 { height: 8rem; }

/* Colors */
.bg-black { background-color: black; } .bg-slate-900 { background-color: var(--slate-900); } .bg-slate-950 { background-color: var(--slate-950); } .bg-amber-500 { background-color: var(--amber-500); }

/* Effects */
.opacity-20 { opacity: 0.2; } .opacity-40 { opacity: 0.4; } .opacity-50 { opacity: 0.5; }
.border { border-width: 1px; } .border-2 { border-width: 2px; } .border-4 { border-width: 4px; }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); }
.rotate-45 { transform: rotate(45deg); }
