/* BrokenBet - Minigames (Crash, Scratchcard, Vault, Achievements, Quests) */

/* 1. BROKEN CRASH MINIGAME */
.crash-stage {
    background: #0d0d0d;
    border: 2px solid var(--text-dark);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.crash-multiplier-text {
    font-size: clamp(2.8rem, 6vw, 4.2rem);
    font-weight: 900;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
    color: var(--accent-gold);
    transition: color 0.1s;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    z-index: 2;
}

.crash-multiplier-text.crashed {
    color: #c0392b !important;
    text-shadow: 0 0 15px rgba(192, 57, 43, 0.6);
    animation: shakeCrash 0.4s ease;
}

.crash-multiplier-text.cashed {
    color: var(--accent-color) !important;
    text-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
}

.crash-status-sub {
    font-size: 0.9rem;
    font-weight: bold;
    color: #888888;
    letter-spacing: 1px;
    margin-top: 5px;
    z-index: 2;
}

.crash-controls-row {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 15px;
}

.crash-input {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    border: 2px solid var(--text-dark);
    background: var(--bg-input, #ffffff);
    color: var(--text-dark);
    font-family: 'Courier New', Courier, monospace;
    text-align: center;
}

.btn-crash-action {
    flex: 2;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    border: 2px solid var(--text-dark);
    cursor: pointer;
    box-shadow: 3px 3px 0px var(--text-dark);
    transition: transform 0.1s, background 0.15s;
    touch-action: manipulation;
}

.btn-crash-start {
    background: var(--text-dark);
    color: #ffffff;
}

.btn-crash-start:hover:not(:disabled) {
    background: var(--accent-color);
}

.btn-crash-cashout {
    background: var(--accent-gold);
    color: #000000;
}

.btn-crash-cashout:hover:not(:disabled) {
    background: #e5b822;
}

@keyframes shakeCrash {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* 2. STUDIO SCRATCHCARD (INTERAKTIVES HTML5 CANVAS RUBBELLOS) */
.scratch-card-box {
    background: var(--bg-card, #ffffff);
    border: 2px solid var(--text-dark, #1a1a1a);
    padding: clamp(16px, 3vh, 28px);
    box-shadow: 4px 4px 0px var(--text-dark, #1a1a1a);
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    border-radius: 0 !important;
}

.scratch-ticket-wrapper {
    background: var(--bg-main, #f9f9f6);
    border: 2px solid var(--text-dark, #1a1a1a);
    padding: 16px;
    margin: 14px 0;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.08);
    position: relative;
    border-radius: 0 !important;
}

.scratch-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed var(--border-color, #e0e0d9);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.scratch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 10px 0;
    touch-action: none;
    user-select: none;
}

.scratch-cell {
    aspect-ratio: 1;
    background: var(--bg-card, #ffffff);
    color: var(--text-dark);
    border: 2px solid var(--text-dark, #1a1a1a);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05), 2px 2px 0px rgba(0, 0, 0, 0.04);
    border-radius: 0 !important;
}

.scratch-cell .scratch-symbol {
    font-size: clamp(2rem, 5vw, 2.5rem);
    z-index: 1;
    pointer-events: none;
    line-height: 1;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.scratch-cell.cleared .scratch-symbol {
    transform: scale(1.1);
}

.scratch-cell .scratch-prize-label {
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--accent-color);
    margin-top: 4px;
    z-index: 1;
    pointer-events: none;
}

.scratch-cell canvas.scratch-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    cursor: grab;
    touch-action: none;
    transition: opacity 0.35s ease;
}

.scratch-cell canvas.scratch-canvas:active {
    cursor: grabbing;
}

.scratch-cell.cleared canvas.scratch-canvas {
    pointer-events: none;
    opacity: 0;
}

.scratch-cell.winner-highlight {
    border-color: var(--accent-gold) !important;
    background: #fffdf0 !important;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.75) !important;
    animation: pulseWinCell 1s infinite alternate;
}

@keyframes pulseWinCell {
    from { transform: scale(1); }
    to { transform: scale(1.04); }
}

.scratch-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* 3. ZINS-TRESOR & BANK (VAULT) */
.vault-panel {
    background: var(--bg-card);
    border: 2px solid var(--text-dark);
    padding: 20px;
    box-shadow: 4px 4px 0px var(--text-dark);
}

.vault-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 15px;
    margin: 15px 0;
}

.vault-stat-box {
    text-align: center;
}

.vault-stat-val {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-color);
}

.vault-stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: bold;
}

/* 4. ACHIEVEMENTS & QUESTS */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.achievement-card {
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    position: relative;
}

.achievement-card.unlocked {
    border-color: var(--accent-gold);
    background: #ffffff;
    box-shadow: 2px 2px 0px var(--accent-gold);
}

.achievement-card.claimed {
    opacity: 0.65;
    border-color: var(--border-color);
}

.btn-claim-ach {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 900;
    background: var(--accent-gold);
    color: #000;
    border: 1px solid var(--text-dark);
    cursor: pointer;
}

.btn-claim-ach:hover:not(:disabled) {
    background: #e5b822;
}

/* Quests & Rolling Missions */
.quest-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
}


/* 5. PLEITE-HILFE NOTFALL-BANNER */
.bailout-banner {
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.15), rgba(212, 175, 55, 0.15));
    border: 2px dashed #c0392b;
    padding: 15px;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.btn-bailout {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 1px;
    background: #c0392b;
    color: #ffffff;
    border: 2px solid var(--text-dark);
    cursor: pointer;
    box-shadow: 3px 3px 0px var(--text-dark);
}

/* 6. PROGRESSIVE JACKPOT METER */
.jackpot-meter-box {
    background: #111111;
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 10px 20px;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 900;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    margin-bottom: 15px;
}

.jackpot-meter-val {
    font-size: 1.6rem;
    letter-spacing: 2px;
}

/* Responsive */
@media (max-width: 650px) {
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    .vault-stats {
        grid-template-columns: 1fr;
    }
}
