/*
 * place-value-chart activity styles.
 *
 * The chart is a row of fixed-width column cells with the decimal
 * point as a fixed vertical line between two of them. Digit cells
 * animate horizontally (via translateX) when an operation is
 * applied; trailing zeros fade in at the new columns.
 */

.pvc-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;
}

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

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

/* Challenge-mode game-feel: par badge, live move counter, stars + streak. */
.pvc-target-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-basis: 100%;
    margin-top: 0.35rem;
}

.pvc-par-badge {
    background: #fff3df;
    border: 1px solid #f0c270;
    color: #8a5a00;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}

.pvc-move-counter {
    color: #6b4500;
    font-weight: 700;
    font-size: 0.85rem;
}

.pvc-stars {
    color: #f5a623;
    letter-spacing: 1px;
    font-weight: 800;
}

.pvc-streak {
    color: #b45309;
    font-weight: 800;
    margin-left: 0.35rem;
}

.pvc-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--maths-surface);
    border: 1px solid var(--maths-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

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

.pvc-starter-value {
    min-width: 7rem;
    min-height: 48px;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 2px solid var(--maths-border);
    border-radius: 10px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--maths-primary-dark);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    text-align: center;
}

.pvc-starter-value:hover { background: var(--maths-surface-alt); }

.pvc-history {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--maths-surface-alt);
    border: 1px solid var(--maths-border);
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    font-weight: 700;
    color: var(--maths-primary-dark);
    font-variant-numeric: tabular-nums;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 1.05rem;
}

.pvc-history-empty {
    color: var(--maths-ink-muted);
    font-weight: 600;
}

.pvc-chart-wrap {
    background: var(--maths-surface);
    border: 1px solid var(--maths-border);
    border-radius: 12px;
    padding: 1.1rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.pvc-chart {
    display: grid;
    gap: 0;
    justify-content: center;
    grid-auto-flow: column;
    grid-auto-columns: 70px;
}

.pvc-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-left: 1px solid var(--maths-border);
    padding: 0;
    position: relative;
}

.pvc-col:first-of-type { border-left: none; }

.pvc-col.is-decimal-point {
    grid-auto-columns: 22px;
    width: 22px;
    border-left: none;
    background: transparent;
}

.pvc-col-header {
    width: 100%;
    text-align: center;
    padding: 0.45rem 0.2rem;
    font-weight: 800;
    color: var(--maths-primary-dark);
    background: var(--maths-surface-alt);
    border-bottom: 2px solid var(--maths-primary);
    font-size: 1.1rem;
}

.pvc-col-cell {
    width: 100%;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--maths-ink);
    font-variant-numeric: tabular-nums;
    background: #FCFDFE;
    transition: transform 380ms cubic-bezier(0.7, 0, 0.3, 1), opacity 320ms ease;
}

.pvc-col-cell.is-empty { color: var(--maths-border); }

.pvc-col-cell.is-zero-fill {
    color: var(--maths-ink-muted);
    opacity: 0;
}

.pvc-col-cell.is-zero-fill.is-visible { opacity: 1; }

.pvc-col.is-decimal-point .pvc-col-header {
    background: transparent;
    border-bottom: none;
}

.pvc-col.is-decimal-point .pvc-col-cell {
    background: transparent;
    font-size: 2.2rem;
    color: var(--maths-primary);
    font-weight: 900;
    height: 92px;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.4rem;
}

.pvc-col.is-active .pvc-col-header {
    background: #FFF7DE;
    border-bottom-color: #E86A33;
}

.pvc-ops {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pvc-ops-group {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    flex: 1 1 auto;
    background: var(--maths-surface);
    border: 1px solid var(--maths-border);
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
}

.pvc-op-btn {
    background: var(--maths-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    min-height: 44px;
    flex: 1 1 auto;
    transition: background-color 160ms ease, transform 80ms ease;
}

.pvc-op-btn:hover { background: var(--maths-primary-dark); }

.pvc-op-btn:disabled {
    background: #b5bcc8;
    cursor: not-allowed;
}

.pvc-op-btn.is-pulsing {
    animation: pvc-pulse 800ms ease-in-out infinite;
}

@keyframes pvc-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232, 106, 51, 0); }
    50%      { box-shadow: 0 0 0 6px rgba(232, 106, 51, 0.35); }
}

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

.pvc-your-turn-label {
    font-weight: 800;
    color: #8a5a00;
    margin-bottom: 0.4rem;
}

.pvc-your-turn-list {
    margin: 0;
    padding-left: 1.2rem;
    color: #5e3c00;
    font-weight: 600;
}

body.display-mode .pvc-starter-value,
body.display-mode .pvc-op-btn {
    pointer-events: none;
}

/* Display mode is a static snapshot — no live operations, so the operation
   buttons add nothing. Hide the whole row. */
body.display-mode .pvc-ops {
    display: none;
}

body.display-mode .pvc-starter-value {
    border-color: transparent;
    background: transparent;
}

body.display-mode .pvc-op-btn {
    background: var(--maths-surface-alt);
    color: var(--maths-primary-dark);
}

/* Numeric keypad popover (decimal-aware) */
.pvc-keypad {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: #fff;
    border: 2px solid var(--maths-primary);
    border-radius: 14px;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.18);
    padding: 0.8rem;
    width: min(360px, 92vw);
}

.pvc-keypad[hidden] { display: none; }

.pvc-keypad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.pvc-keypad-prompt {
    font-weight: 800;
    color: var(--maths-primary-dark);
}

.pvc-keypad-close {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--maths-ink-muted);
}

.pvc-keypad-display {
    text-align: center;
    background: var(--maths-surface-alt);
    border-radius: 10px;
    padding: 0.6rem;
    font-size: 2rem;
    font-weight: 800;
    color: var(--maths-primary-dark);
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.6rem;
}

.pvc-keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.pvc-key {
    min-height: 54px;
    border: 2px solid var(--maths-border);
    border-radius: 10px;
    background: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--maths-primary-dark);
    cursor: pointer;
}

.pvc-key:hover { background: var(--maths-surface-alt); }
.pvc-key:active { background: var(--maths-primary); color: #fff; }
.pvc-key-back { color: var(--maths-danger); border-color: var(--maths-danger); }
.pvc-key-ok {
    color: #fff;
    background: var(--maths-primary);
    border-color: var(--maths-primary-dark);
}

@media (max-width: 640px) {
    .pvc-chart { grid-auto-columns: 50px; }
    .pvc-col-cell { height: 72px; font-size: 1.8rem; }
}
