/*
 * pizza-slicer — SVG pie divided into N slices; click to shade.
 * Teaches fractions, proportion, and pie-chart reading.
 */

.maths-activity .ps-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.maths-activity .ps-pizza-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.maths-activity .ps-pizza {
    width: 300px;
    height: 300px;
    max-width: 100%;
    filter: drop-shadow(0 6px 14px rgba(20, 40, 80, 0.12));
}

.maths-activity .ps-pizza-crust {
    fill: #f4d28a;
    stroke: #c48a3a;
    stroke-width: 4;
}

.maths-activity .ps-slice {
    fill: #ffe9c4;
    stroke: #c48a3a;
    stroke-width: 1.5;
    cursor: pointer;
    transition: fill 160ms ease-out;
}

.maths-activity .ps-slice:hover {
    fill: #ffdca0;
}

.maths-activity .ps-slice.shaded {
    fill: #d84315;
    stroke: #8d2a0b;
}

.maths-activity .ps-slice.shaded:hover {
    fill: #bf360c;
}

.maths-activity .ps-pizza-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.maths-activity .ps-control {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--maths-text, #1f2937);
}

.maths-activity .ps-control input[type="range"] {
    width: 100%;
    accent-color: var(--maths-primary, #2E7D32);
    cursor: pointer;
}

.maths-activity .ps-readouts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    align-content: start;
}

.maths-activity .ps-readout {
    background: #fff;
    border: 1px solid var(--maths-border, #e0e7ef);
    border-radius: 14px;
    padding: 1rem 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 2px 8px rgba(20, 40, 80, 0.04);
}

.maths-activity .ps-readout-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--maths-text-muted, #6b7280);
}

.maths-activity .ps-readout-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--maths-primary-dark, #1b5e20);
    line-height: 1.1;
}

.maths-activity .ps-readout-sub {
    font-size: 1rem;
    color: var(--maths-text-muted, #6b7280);
    font-weight: 700;
}

.maths-activity .ps-readout-value sup,
.maths-activity .ps-readout-value sub { font-size: 0.6em; font-weight: 700; }
.maths-activity .ps-readout-value sup { vertical-align: 0.6em; }
.maths-activity .ps-readout-value sub { vertical-align: -0.35em; }

.maths-activity .ps-readout-words .ps-readout-value {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--maths-text, #1f2937);
}

.maths-activity .ps-target-label {
    font-weight: 800;
    color: #8d4e0b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.maths-activity .ps-target-prompt { flex: 1; font-weight: 700; color: #1f2937; }

.maths-activity .ps-mode-chip {
    display: inline-block;
    background: var(--maths-primary-soft, #e8f5e9);
    color: var(--maths-primary-dark, #1b5e20);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.5rem;
}


.maths-activity .ps-your-turn {
    margin-top: 1rem;
    background: #f3f7fb;
    border: 1px dashed var(--maths-border, #bac6d4);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.maths-activity .ps-your-turn-label { font-weight: 800; color: var(--maths-primary-dark, #1b5e20); margin-bottom: 0.5rem; }
.maths-activity .ps-your-turn-list { margin: 0; padding-left: 1.25rem; }

@media (max-width: 720px) {
    .maths-activity .ps-layout { grid-template-columns: 1fr; }
}

/* Display mode — read-only snapshot. Pizza visual on the left, the four
 * readouts (fraction / decimal / percentage / words) on the right as a
 * 2×2 grid. Slice / shade sliders, target panel, callout and challenge
 * runner are all out of scope. Your-turn prompts stay — those are
 * display-only discussion prompts.
 */
body.display-mode .ps-pizza-controls,
body.display-mode .ps-target-panel,
body.display-mode .ps-callout,
body.display-mode #challengeRunner { display: none !important; }

body.display-mode .ps-slice { cursor: default; pointer-events: none; }

body.display-mode .ps-layout {
    grid-template-columns: minmax(220px, 260px) 1fr;
    gap: 1.25rem;
    align-items: center;
}

body.display-mode .ps-pizza {
    width: 220px;
    height: 220px;
}

body.display-mode .ps-readout {
    padding: 0.7rem 0.9rem;
}

body.display-mode .ps-readout-value {
    font-size: 1.5rem;
}

body.display-mode .ps-readout-sub {
    font-size: 0.9rem;
}

body.display-mode .ps-readout-words .ps-readout-value {
    font-size: 1.05rem;
}
