/* Probability Tree Lab — Maths Vault */

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

body.pt-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;
}

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

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

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

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

.pt-back {
    display: inline-block;
    color: #c90c0f;
    font-weight: 600;
    margin-bottom: 1rem;
    text-decoration: none;
}

.pt-back:hover {
    text-decoration: underline;
}

.pt-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.pt-tab {
    padding: 0.6rem 1.1rem;
    border: 2px solid #c90c0f;
    background: #fff;
    color: #c90c0f;
    border-radius: 10px;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.pt-tab i {
    margin-right: 0.35rem;
}

.pt-tab:hover {
    background: #fab719;
    border-color: #fab719;
    color: #1d1d1b;
}

.pt-tab.active {
    background: #c90c0f;
    border-color: #c90c0f;
    color: #fff;
}

.pt-tab.active:hover {
    background: #a00a0c;
    color: #fff;
}

.pt-panel {
    display: none;
}

.pt-panel.active {
    display: block;
}

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

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

.pt-card h2 i {
    color: #fab719;
    margin-right: 0.35rem;
}

.pt-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.pt-presets-label {
    font-weight: 600;
    color: #555;
    margin-right: 0.25rem;
}

.pt-preset-btn {
    padding: 0.45rem 0.85rem;
    border: 2px solid #dee2e6;
    background: #fff;
    color: #333;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    font-weight: 600;
}

.pt-preset-btn:hover {
    border-color: #c90c0f;
    color: #c90c0f;
}

.pt-preset-btn.active {
    border-color: #c90c0f;
    background: #fff5f5;
    color: #c90c0f;
}

.pt-setup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.pt-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
}

.pt-field select,
.pt-field input[type="number"] {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background: #fff;
    color: #1d1d1b;
}

.pt-field select:focus,
.pt-field input:focus {
    outline: none;
    border-color: #c90c0f;
    box-shadow: 0 0 0 2px rgba(201, 12, 15, 0.15);
}

.pt-trials-config {
    display: grid;
    gap: 1rem;
}

.pt-trial-box {
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 1rem;
    background: #fafafa;
}

.pt-trial-box h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: #333;
}

.pt-trial-box h3 span {
    color: #c90c0f;
}

.pt-bag-editor {
    margin-top: 0.75rem;
}

.pt-bag-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pt-bag-swatch {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.pt-bag-row input[type="number"] {
    width: 4rem;
    padding: 0.35rem 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-family: inherit;
}

.pt-bag-row label {
    flex: 1;
    font-weight: 500;
    font-size: 0.9rem;
}

.pt-shared-bag-note {
    margin: 0.5rem 0 0;
    font-size: 0.88rem;
    color: #666;
    line-height: 1.45;
}

.pt-info {
    padding: 0.75rem 1rem;
    background: #f0f7ff;
    border: 2px solid #b8d4f0;
    border-radius: 8px;
    font-size: 0.92rem;
    color: #333;
    line-height: 1.5;
}

.pt-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

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

.pt-tree-wrap {
    overflow-x: auto;
    margin: 1rem 0;
    padding: 0.5rem;
    background: #fafafa;
    border-radius: 10px;
    border: 2px solid #eee;
}

.pt-tree-wrap svg {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.pt-tree-compact-note {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #fff8e6;
    border: 2px solid #fab719;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #444;
}

.pt-path-table-wrap {
    overflow-x: auto;
    max-height: 420px;
    overflow-y: auto;
    border: 2px solid #eee;
    border-radius: 8px;
}

.pt-path-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.pt-path-table th,
.pt-path-table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.pt-path-table th {
    background: #f5f5f5;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.pt-path-table tr:hover td {
    background: #fff8f8;
}

.pt-stage {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    min-height: 120px;
}

.pt-widget {
    text-align: center;
    min-width: 100px;
}

.pt-widget-label {
    font-weight: 600;
    font-size: 0.88rem;
    margin-top: 0.5rem;
    color: #555;
}

.pt-coin {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.pt-coin-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.4rem;
    backface-visibility: hidden;
    border: 3px solid #b8860b;
}

.pt-coin-heads {
    background: linear-gradient(145deg, #fab719, #e5a000);
    color: #1d1d1b;
    transform: rotateY(0deg);
}

.pt-coin-tails {
    background: linear-gradient(145deg, #c0c0c0, #909090);
    color: #1d1d1b;
    transform: rotateY(180deg);
}

.pt-coin.pt-coin-show-tails {
    transform: rotateY(180deg);
}

.pt-coin.pt-coin-flip {
    animation: pt-coin-spin 0.55s ease-in-out;
}

@keyframes pt-coin-spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(1800deg); }
}

.pt-bag-viz {
    width: 90px;
    height: 100px;
    margin: 0 auto;
    position: relative;
}

.pt-bag-shape {
    width: 80px;
    height: 90px;
    margin: 0 auto;
    background: linear-gradient(180deg, #8b6914 0%, #6b4f10 100%);
    border-radius: 8px 8px 20px 20px;
    border: 2px solid #5a4010;
    position: relative;
    overflow: hidden;
}

.pt-bag-counters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    padding: 12px 6px 8px;
}

.pt-counter-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.pt-drawn-counter {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin: 0.5rem auto 0;
    border: 3px solid rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.pt-stage-arrow {
    font-size: 1.5rem;
    color: #c90c0f;
    font-weight: 700;
}

.pt-last-outcome {
    text-align: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 1rem 0;
    min-height: 2.5rem;
}

.pt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.pt-btn {
    padding: 0.65rem 1.1rem;
    border-radius: 10px;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    border: 2px solid transparent;
}

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

.pt-btn-primary:hover {
    background: #a00a0c;
    border-color: #a00a0c;
    color: #fff;
}

.pt-btn-secondary {
    background: #fff;
    color: #c90c0f;
    border-color: #c90c0f;
}

.pt-btn-secondary:hover {
    background: #c90c0f;
    color: #fff;
}

.pt-progress {
    margin: 1rem 0;
}

.pt-progress-track {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.pt-progress-fill {
    height: 100%;
    background: #c90c0f;
    width: 0%;
    transition: width 0.15s;
}

.pt-progress-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.35rem;
}

.pt-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.pt-freq-table-wrap {
    overflow-x: auto;
    max-height: 360px;
    overflow-y: auto;
}

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

@media (max-width: 600px) {
    .pt-compare-row {
        grid-template-columns: 1fr;
    }
}

.pt-prob-box {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #eee;
    text-align: center;
}

.pt-prob-box h3 {
    margin: 0 0 0.5rem;
    font-size: 0.92rem;
    color: #555;
}

.pt-prob-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #c90c0f;
}

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

/* Venn tab (legacy) */
.pt-venn-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.pt-venn-out {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.pt-venn-svg {
    margin-top: 1rem;
    text-align: center;
}

.pt-venn-svg svg {
    max-width: 100%;
    height: auto;
}
