@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #0f4c3a 0%, #1a5a45 50%, #0d3d2e 100%);
    --secondary-gradient: linear-gradient(135deg, #d4af37 0%, #f4cf67 50%, #d4af37 100%);
    --accent-gold: #d4af37;
    --accent-gold-light: #f4cf67;
    --accent-gold-dark: #b8960c;
    --bg-primary: #0a1628;
    --bg-secondary: #0f2847;
    --bg-tertiary: #162d50;
    --bg-card: rgba(15, 40, 71, 0.8);
    --bg-card-hover: rgba(22, 45, 80, 0.9);
    --text-primary: #f5f5f5;
    --text-secondary: #a8c5e2;
    --text-gold: #d4af37;
    --border-color: rgba(212, 175, 55, 0.3);
    --border-accent: rgba(212, 175, 55, 0.6);
    --glow-gold: 0 0 20px rgba(212, 175, 55, 0.4);
    --glow-emerald: 0 0 30px rgba(15, 76, 58, 0.6);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    background-image: 
        radial-gradient(ellipse at 20% 20%, rgba(15, 76, 58, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(15, 40, 71, 0.5) 0%, transparent 70%);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Premium Header */
.game-header {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-logo {
    height: 60px;
    width: auto;
    max-width: 100%;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
}

.game-logo:hover {
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.5));
    transform: scale(1.02);
}

/* Balance Display */
.balance-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.balance {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-accent);
    box-shadow: var(--glow-gold), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.balance:hover {
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#userBalance {
    transition: all 0.3s ease;
}

#userBalance.updating {
    animation: balancePulse 0.5s ease;
}

@keyframes balancePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); color: #f4cf67; }
}

.btn-reset {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--border-accent);
    color: var(--text-gold);
}

/* Main Layout */
.game-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

.game-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

/* Playfield Section */
.playfield-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 20px;
    border: 2px solid var(--border-accent);
    box-shadow: var(--glow-gold), var(--glow-emerald);
    overflow: hidden;
}

.canvas-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-gold), transparent, var(--accent-gold));
    border-radius: 22px;
    z-index: -1;
    opacity: 0.3;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

#gameCanvas {
    border-radius: 12px;
    max-width: 100%;
    height: auto;
    background: linear-gradient(180deg, #0f2847 0%, #162d50 50%, #0f2847 100%);
}

/* Control Console */
.control-console {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.console-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-gold);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.console-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.btn-casino {
    background: var(--secondary-gradient);
    color: #1a1a2e;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-casino::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.btn-casino:hover::before {
    left: 100%;
}

.btn-casino:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

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

.btn-drop {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    margin-left: 0.5rem;
}

.btn-drop:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

/* Wager Controls */
.wager-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wager-controls .input-group {
    display: flex;
    align-items: center;
    background: rgba(10, 22, 40, 0.8);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.wager-controls .input-group:focus-within {
    border-color: var(--border-accent);
    box-shadow: var(--glow-gold);
}

.wager-controls .btn {
    background: var(--bg-tertiary);
    color: var(--text-gold);
    border: none;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
}

.wager-controls .btn:hover {
    background: rgba(212, 175, 55, 0.2);
}

.wager-controls .input-group-text {
    background: transparent;
    border: none;
    color: var(--text-gold);
    padding: 0.75rem 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.no-spinners {
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: center;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    padding: 0.75rem;
    outline: none;
    max-width: 80px;
}

.no-spinners::-webkit-inner-spin-button,
.no-spinners::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.no-spinners {
    -moz-appearance: textfield;
}

/* Result Display */
#result {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    min-height: 50px;
    color: var(--text-gold);
}

.game-result {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
    border: 1px solid var(--border-accent);
    margin: 1rem 0;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.game-result:empty {
    display: none;
}

/* Sidebar */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Cards */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.game-card:hover {
    border-color: var(--border-accent);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
}

.card-header {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

.card-header h5 {
    font-family: 'Playfair Display', serif;
    color: var(--text-gold);
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.card-body {
    padding: 1.25rem;
}

/* Current Hand Display */
#currentHand {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    padding: 1rem;
    background: rgba(10, 22, 40, 0.5);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
    flex-wrap: wrap;
}

#currentHand img {
    height: 80px;
    width: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

#currentHand img:hover {
    transform: translateY(-5px);
}

/* Payout Table */
.payout-table {
    margin: 0;
    font-size: 0.85rem;
}

.payout-table td {
    padding: 0.5rem 0.75rem;
    border-color: var(--border-color);
    color: var(--text-secondary);
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.payout-table tr:first-child td {
    border-top: none;
}

.payout-table td:first-child {
    font-weight: 500;
    color: var(--text-primary);
}

.payout-table td:last-child {
    text-align: right;
    color: var(--text-gold);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* Instructions */
.instructions {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.instructions p {
    margin: 0;
}

/* Mobile Sticky Controls */
.mobile-controls {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 20%);
    padding: 1rem 1.5rem 1.5rem;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
}

.mobile-controls-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .game-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar-section {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .game-header {
        padding: 0.75rem 1rem;
    }
    
    .game-logo {
        height: 45px;
    }
    
    .balance {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .game-container {
        padding: 1rem;
        padding-bottom: 120px;
    }
    
    .sidebar-section {
        grid-template-columns: 1fr;
    }
    
    .canvas-container {
        padding: 1rem;
    }
    
    .control-console {
        display: none;
    }
    
    .mobile-controls {
        display: block;
    }
    
    .btn-casino {
        padding: 0.875rem 2rem;
        font-size: 0.9rem;
        min-height: 48px;
    }
    
    .wager-controls .btn {
        min-height: 48px;
        min-width: 48px;
    }
    
    #currentHand img {
        height: 60px;
    }
}

@media (max-width: 480px) {
    .game-logo {
        height: 40px;
    }
    
    .balance {
        font-size: 0.9rem;
        padding: 0.4rem 0.75rem;
    }
    
    .btn-reset {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    #currentHand img {
        height: 50px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.playfield-section {
    animation: fadeIn 0.6s ease-out;
}

.sidebar-section > * {
    animation: slideInRight 0.6s ease-out;
}

/* Footer */
.game-footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.game-footer a {
    color: var(--text-gold);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.game-footer a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

@media (max-width: 768px) {
    .game-footer {
        margin-bottom: 100px;
    }
}

.sidebar-section > *:nth-child(1) { animation-delay: 0.1s; }
.sidebar-section > *:nth-child(2) { animation-delay: 0.2s; }
.sidebar-section > *:nth-child(3) { animation-delay: 0.3s; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold-light);
}

/* Utility Classes */
.text-gold {
    color: var(--text-gold);
}

.font-display {
    font-family: 'Playfair Display', serif;
}
