/*
 * pie-chart-builder activity styles.
 *
 * SVG pie chart on the left, category legend with editable counts on
 * the right. Slice colours come from a small palette; each slice's
 * label sits at the centroid of the slice (with optional angle
 * readout).
 */

.pcb-mode-chip {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: var(--maths-surface-alt);
    color: var(--maths-primary-dark);
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pcb-target-label {
    font-weight: 800;
    color: #8a5a00;
    font-size: 0.95rem;
    margin-right: 0.5rem;
}

.pcb-target-prompt {
    flex: 1 1 auto;
    color: #6b4500;
    font-weight: 700;
    font-size: 1rem;
}

.pcb-stage {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

.pcb-chart-wrap {
    background: var(--maths-surface);
    border: 1px solid var(--maths-border);
    border-radius: 12px;
    padding: 0.6rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pcb-pie-svg {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 420px;
    aspect-ratio: 1 / 1;
    display: block;
}

.pcb-slice {
    stroke: #fff;
    stroke-width: 2;
    transition: opacity 200ms ease;
}

.pcb-slice-label {
    fill: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 19px;
    text-anchor: middle;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.pcb-slice-percent {
    fill: rgba(255, 255, 255, 0.9);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 15px;
    text-anchor: middle;
}

.pcb-legend {
    background: var(--maths-surface);
    border: 1px solid var(--maths-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pcb-legend-row {
    display: grid;
    grid-template-columns: 22px 1fr auto 60px;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0;
}

.pcb-legend-swatch {
    width: 22px;
    height: 22px;
    border-radius: 5px;
}

.pcb-legend-label {
    font-weight: 700;
    color: var(--maths-ink);
    font-size: 1.05rem;
}

.pcb-legend-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 2px solid var(--maths-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.pcb-legend-step-btn {
    min-width: 40px;
    min-height: 40px;
    border: 0;
    background: var(--maths-surface-alt);
    color: var(--maths-primary-dark);
    font-weight: 800;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.5rem;
}

.pcb-legend-step-btn:hover { background: var(--maths-surface); }
.pcb-legend-step-btn:active { background: var(--maths-primary); color: #fff; }
.pcb-legend-step-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pcb-legend-input {
    min-width: 2.5rem;
    padding: 0 0.6rem;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--maths-primary-dark);
    text-align: center;
    background: #fff;
    border-left: 1px solid var(--maths-border);
    border-right: 1px solid var(--maths-border);
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pcb-legend-angle {
    font-weight: 700;
    color: var(--maths-ink-muted);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.pcb-summary {
    background: var(--maths-surface);
    border: 1px solid var(--maths-border);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.pcb-summary-row {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.pcb-summary-label {
    font-weight: 700;
    color: var(--maths-ink-muted);
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.pcb-summary-value {
    font-weight: 800;
    color: var(--maths-primary-dark);
    font-variant-numeric: tabular-nums;
    font-size: 1.4rem;
}

.pcb-your-turn {
    background: #FFF7DE;
    border: 1px solid #F0C14B;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    margin-top: 1rem;
}

.pcb-your-turn-label { font-weight: 800; color: #8a5a00; margin-bottom: 0.4rem; }
.pcb-your-turn-list { margin: 0; padding-left: 1.2rem; color: #5e3c00; font-weight: 600; }

body.display-mode .pcb-legend-input,
body.display-mode #anglesToggle,
body.display-mode #resetButton {
    pointer-events: none;
}

@media (max-width: 720px) {
    .pcb-stage { grid-template-columns: 1fr; }
}
