/* Shared chrome for the prototype puzzles. Deliberately lighter than Triad:
   one toolbar, one status line, one board, one collapsible rules block. */

.proto-app {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.proto-intro {
    text-align: center;
    margin-bottom: 1.25rem;
}

.proto-intro h2 {
    margin-bottom: 0.3rem;
}

.proto-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #fff3d6;
    color: #8a5a00;
    border: 1px solid #f0d28a;
    margin-bottom: 0.6rem;
}

.proto-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.proto-tiers {
    display: flex;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.3rem;
    border-radius: 999px;
}

.proto-tiers button {
    border: none;
    background: transparent;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.proto-tiers button.active {
    background: #1769AA;
    color: #fff;
}

.proto-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.proto-actions button,
.proto-btn {
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #fff;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.3;
}

.proto-actions button.primary,
.proto-btn.primary {
    background: #1769AA;
    border-color: #1769AA;
    color: #fff;
}

.proto-actions button.danger,
.proto-btn.danger {
    background: #fff0f0;
    border-color: #d9534f;
    color: #a12a27;
}

.proto-actions button:disabled,
.proto-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.proto-status {
    text-align: center;
    font-weight: 600;
    margin-bottom: 0.3rem;
    min-height: 1.4em;
}

.proto-note {
    text-align: center;
    font-size: 0.85rem;
    color: #1769AA;
    min-height: 1.2em;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-bottom: 0.6rem;
}

.proto-note.visible {
    opacity: 1;
}

.proto-result {
    margin: 1.2rem auto 0;
    max-width: 560px;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #f6fbff;
}

.proto-result.win {
    border-color: #2e8b57;
    background: #f0fff5;
}

.proto-result.lose {
    border-color: #d9534f;
    background: #fff5f5;
}

.proto-result h3 {
    margin: 0 0 0.4rem;
}

.proto-result p {
    margin: 0 0 0.6rem;
}

.proto-result .proto-lesson {
    font-size: 0.9rem;
    color: #444;
    border-top: 1px dashed rgba(0, 0, 0, 0.15);
    padding-top: 0.6rem;
    margin-top: 0.6rem;
}

.proto-result .proto-lesson strong {
    color: #1769AA;
}

.proto-rules {
    margin-top: 2.5rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    padding: 1rem 1.4rem;
}

.proto-rules summary {
    cursor: pointer;
    font-weight: 700;
}

.proto-rules ul {
    margin: 0.6rem 0 0;
    padding-left: 1.2rem;
}

/* main.css hides native checkboxes and draws them via `input + label:before`,
   so the toggle must keep that sibling order. */
.proto-toggle {
    display: inline-block;
    font-size: 0.85rem;
    user-select: none;
}

.proto-toggle label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    line-height: 1.3;
}

.proto-hidden {
    display: none !important;
}

/* ---------------------------------------------------------------- Parity */

.parity-board {
    display: grid;
    gap: 0.45rem;
    margin: 0 auto;
    width: min(100%, 420px);
}

.parity-cell {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    background: #e9edf1;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.parity-cell:hover {
    transform: translateY(-2px);
}

.parity-cell.on {
    background: #f9c74f;
    border-color: #e0a800;
    box-shadow: 0 0 18px rgba(249, 199, 79, 0.75);
}

.parity-cell.hint {
    animation: parity-hint 0.5s ease 3;
}

@keyframes parity-hint {
    0%, 100% { box-shadow: 0 0 0 0 rgba(23, 105, 170, 0); }
    50% { box-shadow: 0 0 0 6px rgba(23, 105, 170, 0.85); }
}

.parity-map-wrap {
    margin: 1.4rem auto 0;
    width: min(100%, 420px);
    text-align: center;
    font-size: 0.85rem;
    color: #444;
}

.parity-map {
    display: grid;
    gap: 0.25rem;
    margin: 0.4rem auto 0;
    width: min(100%, 160px);
}

.parity-map span {
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    background: #e9edf1;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.parity-map span.odd {
    background: #1769AA;
    border-color: #1769AA;
}

/* ----------------------------------------------------------------- Weigh */

.weigh-coins {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 0.45rem;
    margin: 0 auto 1rem;
    width: min(100%, 520px);
}

.weigh-coin {
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 2px solid #b8860b;
    background: radial-gradient(circle at 35% 30%, #ffe9a3, #e0b13a 70%, #b8860b);
    font-weight: 700;
    font-size: 0.95rem;
    color: #5a3e00;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.weigh-coin:hover {
    transform: translateY(-2px);
}

.weigh-coin.left {
    box-shadow: 0 0 0 4px #1769AA;
}

.weigh-coin.right {
    box-shadow: 0 0 0 4px #B86400;
}

.weigh-coin.eliminated {
    opacity: 0.3;
    filter: grayscale(0.7);
}

.weigh-coin.culprit {
    box-shadow: 0 0 0 4px #2e8b57;
}

.weigh-coin.wrong {
    box-shadow: 0 0 0 4px #d9534f;
}

.weigh-coin.accusing {
    cursor: crosshair;
}

.weigh-scale {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    margin: 0 auto 0.6rem;
    width: min(100%, 520px);
}

.weigh-pan {
    flex: 1;
    border-radius: 10px;
    padding: 0.6rem;
    min-height: 3.2rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px dashed rgba(0, 0, 0, 0.15);
    transition: transform 0.35s ease;
}

.weigh-pan.left {
    border-color: #1769AA;
    color: #1769AA;
}

.weigh-pan.right {
    border-color: #B86400;
    color: #B86400;
}

.weigh-scale.tilt-left .weigh-pan.left { transform: translateY(10px); }
.weigh-scale.tilt-left .weigh-pan.right { transform: translateY(-10px); }
.weigh-scale.tilt-right .weigh-pan.left { transform: translateY(-10px); }
.weigh-scale.tilt-right .weigh-pan.right { transform: translateY(10px); }

.weigh-pivot {
    width: 2.2rem;
    text-align: center;
    font-size: 1.6rem;
    line-height: 1;
    padding-bottom: 0.6rem;
}

.weigh-log {
    margin: 0.8rem auto 0;
    width: min(100%, 520px);
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
}

.weigh-log li {
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.03);
    margin-bottom: 0.3rem;
}

.weigh-log .l { color: #1769AA; font-weight: 700; }
.weigh-log .r { color: #B86400; font-weight: 700; }

.weigh-direction {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.6rem;
}

/* --------------------------------------------------------------- Rule Lab */

.rulelab-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.35rem;
    margin: 0 auto 1rem;
    width: min(100%, 520px);
}

.rulelab-num {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.rulelab-num:hover:not(:disabled) {
    transform: translateY(-2px);
}

.rulelab-num:disabled {
    cursor: default;
}

.rulelab-num.yes {
    background: #e6f7ec;
    border-color: #2e8b57;
    color: #1f6a41;
}

.rulelab-num.no {
    background: #fdecec;
    border-color: #d9534f;
    color: #a12a27;
    text-decoration: line-through;
}

.rulelab-num.reveal-yes {
    box-shadow: inset 0 0 0 3px rgba(46, 139, 87, 0.35);
}

.rulelab-hyps {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    width: min(100%, 520px);
    display: grid;
    gap: 0.4rem;
}

.rulelab-hyp {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font-size: 0.9rem;
}

.rulelab-hyp.selected {
    border-color: #1769AA;
    background: #f1f7fc;
}

.rulelab-hyp.refuted {
    opacity: 0.45;
    text-decoration: line-through;
}

.rulelab-hyp.answer {
    border-color: #2e8b57;
    background: #f0fff5;
}

.rulelab-hyp .mark {
    width: 1.2rem;
    text-align: center;
    font-weight: 700;
}

.rulelab-commit {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.8rem;
}

@media (prefers-reduced-motion: reduce) {
    .parity-cell,
    .weigh-pan,
    .weigh-coin,
    .rulelab-num {
        transition: none;
    }

    .parity-cell.hint {
        animation: none;
        box-shadow: 0 0 0 6px rgba(23, 105, 170, 0.85);
    }
}
