/* =========================================================================
   DICE ÖZEL STİLLERİ
   ========================================================================= */

/* Oyun Başlık ve İkon */
.dice-game-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.dice-game-icon {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: var(--surface-900);
    border: 1px solid var(--surface-700);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: inset 0 0 15px rgba(var(--primary), 0.1);
}

.dice-game-icon img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

.dice-game-title h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.dice-game-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* Mod Değiştirici (Manuel / Otomatik) */
.dice-mode-toggle {
    display: flex;
    background: var(--surface-900);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--surface-700);
}

.dice-mode-toggle button {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dice-mode-toggle button.active {
    background: var(--surface-700);
    color: var(--text-primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Form Elemanları */
.dice-input-wrapper, .dice-auto-mode-field {
    margin-bottom: 16px;
}

.dice-input-label, .dice-auto-mode-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.dice-input-field, .dice-win-amount-display-wrapper, .dice-auto-mode-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--surface-900);
    border: 1px solid var(--surface-700);
    border-radius: 10px;
    padding: 8px 12px;
    position: relative;
    transition: border-color 0.3s ease;
}

.dice-input-field:focus-within {
    border-color: var(--brand-red);
}

.dice-input-icon, .dice-auto-mode-icon {
    margin-right: 12px;
    width: 24px;
    height: 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-input-icon-svg {
    width: 100%;
    height: 100%;
}

.dice-input, .dice-auto-mode-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    outline: none;
    width: 100%;
}

.dice-input-buttons {
    display: flex;
    gap: 4px;
}

.dice-input-button {
    background: var(--surface-700);
    border: 1px solid var(--surface-600);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dice-input-button:hover {
    background: var(--surface-600);
    color: var(--brand-red);
}

/* Kazanç Göstergesi */
.dice-win-amount-display-wrapper {
    padding: 14px 16px;
}

.dice-win-amount-display {
    flex: 1;
    font-size: 18px;
    font-weight: 800;
    color: #10b981; /* Kazanç yeşili */
}

/* Oyna Butonu */
.dice-play-buttons {
    margin-top: 24px;
}

.dice-play-button {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: var(--gradient);
    color: var(--text-on-accent, #000);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--primary), 0.4);
}

.dice-play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--primary), 0.6);
}

/* İstatistik İkonu */
.dice-stats-button-wrapper {
    position: absolute;
    top: 24px;
    right: 24px;
}

#dice-stats-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--surface-800);
    border: 1px solid var(--surface-700);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

#dice-stats-icon-btn:hover {
    color: var(--brand-red);
    border-color: var(--brand-red);
}

/* =========================================================================
   DICE OYUN ALANI (SAĞ)
   ========================================================================= */

.dice-game-area-wrapper {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--surface-700);
    background: var(--surface-900);
    display: flex;
    flex-direction: column;
    min-height: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.dice-game-area-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
    z-index: 0;
}

.dice-game-area-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(10, 10, 10, 0.4) 0%, rgba(10, 10, 10, 0.9) 100%);
    z-index: 1;
}

.dice-game-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 40px;
}

/* Zar Göstergesi (Ortadaki Büyük Sayı) */
.dice-value-display {
    text-align: center;
    margin-bottom: 40px;
    margin-top: auto;
}

.dice-value-label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.dice-value-number {
    font-size: 80px;
    font-weight: 900;
    color: var(--text-light, #fff);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
    line-height: 1;
    font-family: 'Courier New', Courier, monospace; /* Monospace for numeric align */
}

/* Zar Slider */
.dice-slider-container {
    width: 100%;
    margin-bottom: 60px;
    position: relative;
    padding: 20px 0;
}

.dice-slider-track {
    width: 100%;
    height: 12px;
    background: var(--surface-700);
    border-radius: 6px;
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    touch-action: none; /* Prevent scrolling when touching the slider */
}

.dice-slider-background {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background: #10b981; /* Kazanma bölgesi genelde yeşil */
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.dice-slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 36px;
    background: var(--text-light, #fff);
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    cursor: grab;
}

.dice-slider-handle:active {
    cursor: grabbing;
}

.dice-slider-tooltip {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-red);
    color: var(--text-on-accent, #000);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 14px;
}

.dice-slider-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: var(--brand-red) transparent transparent transparent;
}

.dice-slider-labels-desktop {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.dice-slider-labels-mobile {
    display: none;
}

/* Alt Kontroller (Çarpan, Üst/Alt, Kazanma Şansı) */
.dice-bottom-controls {
    background: rgba(22, 22, 22, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--surface-700);
    border-radius: 12px;
    padding: 20px;
    margin-top: auto;
}

.dice-bottom-controls-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
}

.dice-multiplier-input-field, .dice-win-chance-input-field {
    display: flex;
    align-items: center;
    background: var(--surface-900);
    border: 1px solid var(--surface-700);
    border-radius: 8px;
    padding: 10px 15px;
}

.dice-multiplier-input, .dice-win-chance-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-light, #fff);
    font-size: 16px;
    font-weight: 700;
    outline: none;
    width: 100%;
}

.dice-multiplier-input-icon, .dice-win-chance-input-icon {
    color: var(--text-muted);
}

.dice-direction-buttons-desktop {
    display: flex;
    background: var(--surface-900);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--surface-700);
}

.dice-direction-button {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.dice-direction-button.active {
    background: var(--brand-red);
    color: var(--text-on-accent, #000);
}

.dice-direction-buttons-mobile {
    display: none;
}

/* Ses İkonu */
.dice-volume-control {
    position: absolute;
    top: 24px;
    right: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 10;
}

.dice-volume-control:hover {
    color: var(--text-light, #fff);
}

/* Mobil Uyumluluk */
@media (max-width: 992px) {
    .dice-game-area-wrapper {
        min-height: auto;
    }
    .dice-game-content {
        padding: 20px 10px;
    }
    .dice-play-buttons {
        display: none !important;
    }
    .dice-play-buttons-mobile {
        display: block !important;
        margin-top: 16px;
        width: 100%;
    }
    .dice-bottom-controls-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .dice-multiplier-input-wrapper {
        order: 1;
    }
    .dice-win-chance-wrapper {
        order: 2;
    }
    .dice-direction-buttons {
        order: 3;
        grid-column: 1 / -1;
    }
    .dice-slider-labels-desktop {
        display: none;
    }
    .dice-slider-labels-mobile {
        display: flex;
        justify-content: space-between;
        margin-top: 15px;
        color: var(--text-muted);
        font-size: 12px;
    }
}

/* =========================================================================
   İSTATİSTİK MODAL
   ========================================================================= */
.dice-stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.dice-stats-modal.show {
    display: flex;
}

.dice-stats-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.dice-stats-modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background: linear-gradient(145deg, var(--surface-800) 0%, var(--surface-900) 100%);
    border: 1px solid var(--surface-700);
    border-radius: 16px;
    padding: 24px;
    z-index: 1001;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    animation: modalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPopIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.dice-stats-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--surface-700);
    padding-bottom: 16px;
}

.dice-stats-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.dice-stats-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px;
}

.dice-stats-modal-close:hover {
    color: var(--danger-color, #ef4444);
}

.dice-stats-tours {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.dice-stats-tour-item {
    flex: 1;
    background: var(--surface-900);
    border: 1px solid var(--surface-700);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.dice-stats-tour-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.dice-stats-tour-value {
    font-size: 24px;
    font-weight: 900;
}

.dice-stats-tour-value.wins { color: #10b981; }
.dice-stats-tour-value.losses { color: var(--danger-color, #ef4444); }

.dice-stats-chart {
    background: var(--surface-900);
    border: 1px solid var(--surface-700);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 24px;
    height: 120px;
}

.dice-stats-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dice-stats-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-900);
    padding: 12px 16px;
    border-radius: 8px;
}

.dice-stats-summary-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.dice-stats-summary-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dice-stats-summary-amount {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.dice-stats-summary-amount.profit {
    color: #10b981;
}

.dice-stats-coin-icon {
    width: 16px;
    height: 16px;
}
