/* ============================================
   DARK CASINO - SHARED GAME SHELL
   Consistent header, layout, and styling
   for all minigames
   ============================================ */

/* ===== CSS VARIABLES ===== */
:root {
    --dc-gold-primary: #d4a574;
    --dc-gold-accent: #c9963a;
    --dc-gold-dark: #b8964f;
    --dc-black-primary: #0a0a0a;
    --dc-black-secondary: #1a1a1a;
    --dc-black-tertiary: #2a2a2a;
    --dc-win-green: #10b981;
    --dc-lose-red: #ef4444;
    --dc-font-display: Georgia, 'Times New Roman', serif;
    --dc-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== GAME MODAL BASE ===== */
.game-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--dc-black-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== GAME HEADER (USES GLOBAL HEADER) ===== */
.game-modal .fixed-header {
    position: relative !important;
    flex-shrink: 0;
}

/* Back to Lobby button - replaces Casino/Sports tabs */
.game-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(212, 165, 116, 0.1);
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 8px;
    color: var(--dc-gold-primary);
    font-family: var(--dc-font-display);
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.game-back-btn:hover {
    background: rgba(212, 165, 116, 0.2);
    border-color: var(--dc-gold-primary);
    transform: translateY(-1px);
}

.game-back-btn i {
    font-size: 0.9rem;
}

/* Logo clickable in games */
.game-modal .logo {
    cursor: pointer !important;
}

/* ===== GAME CONTENT AREA ===== */
.game-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* ===== TWO-COLUMN LAYOUT (Stake Style) ===== */
.game-layout-two-column {
    display: flex;
    height: 100%;
    min-height: 0;
}

.game-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--dc-black-secondary);
    border-right: 1px solid rgba(212, 165, 116, 0.2);
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
    overflow-y: auto;
}

.game-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
}

/* ===== COMPACT CONTROL INPUTS ===== */
.dc-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dc-control-label {
    font-family: var(--dc-font-display);
    font-size: 0.75rem;
    color: var(--dc-gold-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.dc-control-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Compact input - 36px height */
.dc-input {
    flex: 1;
    height: 36px;
    background: var(--dc-black-primary);
    border: 2px solid rgba(212, 165, 116, 0.3);
    border-radius: 6px;
    color: #fff;
    font-family: var(--dc-font-display);
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    padding: 0 10px;
    transition: all 0.2s;
}

.dc-input:focus {
    outline: none;
    border-color: var(--dc-gold-primary);
    box-shadow: 0 0 10px rgba(212, 165, 116, 0.2);
}

/* Compact buttons - 32px height */
.dc-btn-small {
    width: 32px;
    height: 32px;
    background: var(--dc-black-tertiary);
    border: 2px solid rgba(212, 165, 116, 0.3);
    border-radius: 6px;
    color: var(--dc-gold-primary);
    font-family: var(--dc-font-display);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dc-btn-small:hover {
    background: rgba(212, 165, 116, 0.15);
    border-color: var(--dc-gold-primary);
}

/* Action button - 48px height */
.dc-btn-action {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--dc-gold-accent), var(--dc-gold-dark));
    border: 2px solid var(--dc-gold-primary);
    border-radius: 8px;
    color: var(--dc-black-primary);
    font-family: var(--dc-font-display);
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dc-btn-action:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 150, 58, 0.4);
}

.dc-btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Green action (cash out, confirm) */
.dc-btn-action.green {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: #fff;
    animation: dc-pulse-green 2s ease-in-out infinite;
}

@keyframes dc-pulse-green {
    0%, 100% { box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 6px 25px rgba(16, 185, 129, 0.6); }
}

/* ===== HISTORY PANEL ===== */
.dc-history-panel {
    background: var(--dc-black-primary);
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.dc-history-title {
    font-family: var(--dc-font-display);
    font-size: 0.8rem;
    color: var(--dc-gold-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

.dc-history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
}

.dc-history-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    background: var(--dc-black-secondary);
    border-radius: 4px;
    font-size: 11px;
}

.dc-history-item .win {
    color: var(--dc-win-green);
    font-weight: bold;
}

.dc-history-item .loss {
    color: var(--dc-lose-red);
    font-weight: bold;
}

/* ===== RESULT MODAL ===== */
.dc-result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: dc-fadeIn 0.3s ease-out;
}

.dc-result-overlay.active {
    display: flex;
}

@keyframes dc-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dc-result-card {
    background: var(--dc-black-secondary);
    border: 2px solid var(--dc-gold-primary);
    border-radius: 16px;
    padding: 28px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: dc-scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes dc-scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.dc-result-title {
    font-family: var(--dc-font-display);
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 16px;
}

.dc-result-title.win {
    color: var(--dc-win-green);
}

.dc-result-title.loss {
    color: var(--dc-lose-red);
}

.dc-result-title.push {
    color: var(--dc-gold-primary);
}

/* Positive Win Display - The main highlight */
.dc-win-display {
    background: linear-gradient(135deg, var(--dc-gold-accent), var(--dc-gold-dark));
    border: 2px solid var(--dc-gold-primary);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}

.dc-win-amount {
    font-family: var(--dc-font-display);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--dc-black-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dc-win-label {
    font-family: var(--dc-font-display);
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--dc-black-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}

/* Result Details */
.dc-result-details {
    background: var(--dc-black-primary);
    border-radius: 8px;
    padding: 12px;
    margin: 16px 0;
    text-align: left;
}

.dc-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

.dc-detail-row:last-child {
    border-bottom: none;
}

.dc-detail-row .label {
    color: #888;
}

.dc-detail-row .value {
    color: #fff;
    font-weight: bold;
}

/* Result Buttons */
.dc-result-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.dc-result-btn {
    flex: 1;
    height: 48px;
    border: 2px solid;
    border-radius: 10px;
    font-family: var(--dc-font-display);
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.dc-result-btn.primary {
    background: linear-gradient(135deg, var(--dc-gold-accent), var(--dc-gold-dark));
    border-color: var(--dc-gold-primary);
    color: var(--dc-black-primary);
}

.dc-result-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(201, 150, 58, 0.5);
}

.dc-result-btn.secondary {
    background: var(--dc-black-tertiary);
    border-color: rgba(212, 165, 116, 0.4);
    color: var(--dc-gold-primary);
}

.dc-result-btn.secondary:hover {
    background: rgba(212, 165, 116, 0.1);
}

/* Provably Fair Link */
.dc-fair-link {
    display: block;
    margin-top: 12px;
    color: #8b5cf6;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}

.dc-fair-link:hover {
    color: #a78bfa;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Stack to single column on mobile */
    .game-layout-two-column {
        flex-direction: column;
    }
    
    .game-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(212, 165, 116, 0.2);
        padding: 12px;
        max-height: none;
    }
    
    /* Larger touch targets on mobile */
    .dc-input {
        height: 40px;
        font-size: 1.1rem;
    }
    
    .dc-btn-small {
        width: 40px;
        height: 40px;
    }
    
    .dc-btn-action {
        height: 52px;
        font-size: 1rem;
    }
    
    /* Game back button compact on mobile */
    .game-back-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .game-back-btn span {
        display: none;
    }
    
    /* Result card mobile */
    .dc-result-card {
        padding: 20px;
    }
    
    .dc-result-title {
        font-size: 1.6rem;
    }
    
    .dc-win-amount {
        font-size: 2rem;
    }
}

/* ===== MOBILE DRAWER (for history, settings) ===== */
.dc-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.dc-drawer-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.dc-mobile-drawer {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    background: var(--dc-black-secondary);
    border-right: 2px solid var(--dc-gold-primary);
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
    padding: 20px;
    overflow-y: auto;
}

.dc-mobile-drawer.open {
    transform: translateX(0);
}

/* ===== UTILITY CLASSES ===== */
.dc-text-gold { color: var(--dc-gold-primary); }
.dc-text-win { color: var(--dc-win-green); }
.dc-text-loss { color: var(--dc-lose-red); }
.dc-text-muted { color: #888; }

.dc-font-display { font-family: var(--dc-font-display); }
.dc-font-bold { font-weight: bold; }
.dc-font-900 { font-weight: 900; }

.dc-uppercase { text-transform: uppercase; }
.dc-tracking-wide { letter-spacing: 2px; }