/* Dice probability tool — Maths Vault + 3D dice widget */

@import url('/css/styles.css');
@import url('/assets/css_graphics/dice/dice.css');

body.dp-page {
    background: #f8f9fa !important;
    display: block !important;
    justify-content: unset !important;
    align-items: unset !important;
    min-height: auto !important;
    perspective: unset !important;
    text-align: left !important;
}

.dp-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    font-family: "Rockwell", "Rockwell Nova", "Roboto Slab", serif;
    color: #1d1d1b;
}

.dp-wrap h1 {
    color: #c90c0f;
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.dp-wrap h1 i {
    color: #fab719;
    margin-right: 0.35rem;
}

.dp-lead {
    text-align: center;
    color: #444;
    max-width: 720px;
    margin: 0 auto 1.5rem;
    line-height: 1.5;
}

.dp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .dp-grid {
        grid-template-columns: 1fr;
    }
}

.dp-panel {
    background: #fff;
    border: 3px solid #c90c0f;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.dp-panel h2 {
    color: #c90c0f;
    font-size: 1.15rem;
    margin: 0 0 1rem;
}

.dp-controls {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dp-control label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.dp-control select,
.dp-control input[type="number"] {
    width: 100%;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
}

.dp-count-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dp-count-btns button {
    flex: 1;
    min-width: 80px;
    padding: 8px 14px;
    border: 2px solid #c90c0f;
    background: #fff;
    color: #c90c0f;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.dp-count-btns button.active,
.dp-count-btns button:hover {
    background: #c90c0f;
    color: #fff;
}

.dp-dice-stage {
    background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    margin-bottom: 1rem;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dp-dice-stage .dice-area {
    margin: 0;
}

.dp-dice-stage .dice-container {
    width: 140px;
    height: 140px;
    margin: 0.5rem;
}

.dp-dice-stage .dice {
    width: 140px;
    height: 140px;
}

.dp-dice-stage .face {
    width: 140px;
    height: 140px;
}

.dp-dice-stage .front { transform: translateZ(70px); }
.dp-dice-stage .right { transform: rotateY(90deg) translateZ(70px); }
.dp-dice-stage .top { transform: rotateX(90deg) translateZ(70px); }
.dp-dice-stage .bottom { transform: rotateX(-90deg) translateZ(70px); }
.dp-dice-stage .left { transform: rotateY(-90deg) translateZ(70px); }
.dp-dice-stage .back { transform: translateZ(-70px) rotateY(180deg); }

.dp-dice-stage .dot {
    width: 22px;
    height: 22px;
}

.dp-roll-result {
    color: #fff;
    font-size: 1.05rem;
    text-align: center;
    min-height: 1.5em;
    margin-top: 0.5rem;
}

.dp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dp-btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.dp-btn-primary {
    background: #c90c0f;
    color: #fff;
}

.dp-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.dp-btn-secondary {
    background: #fff;
    color: #c90c0f;
    border: 2px solid #c90c0f;
}

.dp-prob-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dp-prob-box {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    border: 2px solid #dee2e6;
}

.dp-prob-box h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: #c90c0f;
}

.dp-prob-value {
    font-size: 1.35rem;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

.dp-prob-detail {
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.35rem;
}

.dp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.dp-stats span {
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.dp-chart {
    margin-top: 1rem;
}

.dp-chart h3 {
    font-size: 1rem;
    color: #c90c0f;
    margin-bottom: 0.75rem;
}

.dp-bar-row {
    display: grid;
    grid-template-columns: 36px 1fr 52px 52px;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.dp-bar-label {
    font-weight: 600;
    text-align: right;
}

.dp-bar-track {
    height: 22px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.dp-bar-exp {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(201, 12, 15, 0.2);
    border-radius: 4px;
    max-width: 100%;
}

.dp-bar-act {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #c90c0f;
    border-radius: 4px;
    max-width: 100%;
    min-width: 2px;
}

.dp-bar-theo,
.dp-bar-count {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #555;
}

.dp-legend {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #555;
}

.dp-legend span::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 10px;
    margin-right: 6px;
    vertical-align: middle;
    border-radius: 2px;
}

.dp-legend .leg-theo::before {
    background: rgba(201, 12, 15, 0.25);
}

.dp-legend .leg-act::before {
    background: #c90c0f;
}

.dp-progress {
    margin-top: 1rem;
}

.dp-progress-track {
    height: 10px;
    background: #e9ecef;
    border-radius: 999px;
    overflow: hidden;
}

.dp-progress-fill {
    height: 100%;
    width: 0%;
    background: #c90c0f;
    transition: width 0.2s ease-out;
}

.dp-progress-text {
    font-size: 0.85rem;
    color: #555;
    margin-top: 6px;
}

.dp-explain {
    margin-top: 1rem;
    padding: 1rem;
    background: #fffbf0;
    border-left: 4px solid #fab719;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    line-height: 1.5;
}
