/* ==========================================================================
   Story Play — per-story games and analysis tools
   ========================================================================== */

.play-page { max-width: 880px; }
.play-eyebrow a { color: inherit; }
.play-kind {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent, #00c8ff);
    border: 1px solid var(--accent, #00c8ff);
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    margin-bottom: 0.6rem;
}
.play-intro { font-style: italic; }

.play-status {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--surface, rgba(20, 22, 28, 0.95));
    border: 1px solid var(--border, #333);
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}
.play-status.good { border-color: #3ddc84; }
.play-status.bad { border-color: #ff6b6b; }

.play-hint { color: var(--muted, #9a9a9a); font-size: 0.9rem; }

.play-btn {
    background: var(--accent, #00c8ff);
    color: #001018;
    border: none;
    border-radius: 9px;
    padding: 0.55rem 1.1rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.12s ease;
}
.play-btn:hover { filter: brightness(1.12); }
.play-btn.secondary {
    background: transparent;
    color: var(--muted, #9ab);
    border: 1px solid var(--border, #445);
    font-weight: normal;
}
.play-btn.small { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
.play-btn.option { display: block; width: 100%; text-align: left; margin: 0.3rem 0; background: var(--surface, rgba(255,255,255,0.05)); color: inherit; border: 1px solid var(--border, #445); font-weight: normal; }
.play-btn.option:hover { border-color: var(--accent, #00c8ff); }
.play-btn.option.correct { border-color: #3ddc84; box-shadow: 0 0 0 1px #3ddc84 inset; }
.play-btn.option.wrong { border-color: #ff6b6b; box-shadow: 0 0 0 1px #ff6b6b inset; }

/* clue hunt */
.play-scene { line-height: 1.85; font-size: 1.02rem; }
.clue-spot {
    background: none;
    border: none;
    border-bottom: 1px dotted transparent;
    color: inherit;
    font: inherit;
    padding: 0 0.1em;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease;
}
.clue-spot:hover { background: rgba(0, 200, 255, 0.14); }
.clue-spot.found {
    background: rgba(61, 220, 132, 0.16);
    border-bottom-color: #3ddc84;
    cursor: default;
}
.clue-log { margin: 1.2rem 0 0; padding-left: 1.2rem; }
.clue-log li { margin: 0.45rem 0; line-height: 1.5; animation: play-in 0.25s ease; }

/* chain / timeline */
.chain-built { min-height: 1rem; padding-left: 1.4rem; }
.chain-built li { margin: 0.4rem 0; line-height: 1.5; animation: play-in 0.25s ease; }
.chain-bank { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; }
.chain-chip {
    background: var(--surface, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border, #445);
    color: inherit;
    font: inherit;
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    text-align: left;
    max-width: 100%;
    transition: border-color 0.15s ease;
}
.chain-chip:hover { border-color: var(--accent, #00c8ff); }

/* quiz / true-false */
.quiz-q { font-size: 1.15rem; }
.quiz-why { border-left: 3px solid var(--accent, #00c8ff); padding-left: 0.8rem; line-height: 1.6; }
.tf-row {
    border: 1px solid var(--border, #333);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    margin: 0.7rem 0;
}
.tf-row p { margin: 0 0 0.5rem; line-height: 1.55; }
.tf-actions { display: flex; gap: 0.5rem; }
.tf-row.correct { border-color: #3ddc84; }
.tf-row.wrong { border-color: #ff6b6b; }

/* elimination */
.suspect-rack { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.7rem; margin-bottom: 1.2rem; }
.suspect-card {
    background: var(--surface, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border, #445);
    border-radius: 12px;
    color: inherit;
    font: inherit;
    padding: 0.8rem 0.9rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: border-color 0.15s ease, opacity 0.3s ease;
}
.suspect-card:hover { border-color: var(--accent, #00c8ff); }
.suspect-card span { font-size: 0.85rem; color: var(--muted, #9a9a9a); line-height: 1.4; }
.suspect-card.cleared { opacity: 0.35; text-decoration: line-through; cursor: default; }
.evidence-box { border-top: 1px dashed rgba(128,128,128,0.3); padding-top: 1rem; }
.evidence-text { line-height: 1.6; }

/* cipher */
.cipher-box { text-align: center; }
.cipher-text {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    line-height: 2;
    background: var(--surface, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border, #333);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    white-space: pre-wrap;
    word-break: break-word;
}
.cipher-input { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.cipher-input input[type="text"] {
    flex: 1;
    min-width: 240px;
    background: var(--surface, rgba(128, 128, 128, 0.08));
    border: 1px solid var(--border, #445);
    border-radius: 9px;
    padding: 0.55rem 0.8rem;
    color: inherit;
    font-family: inherit;
    font-size: 0.95rem;
}

/* win overlay */
.play-win {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 10, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: play-in 0.25s ease;
    padding: 1rem;
}
.play-win-card {
    background: var(--surface-solid, #14161c);
    border: 1px solid var(--accent, #00c8ff);
    border-radius: 16px;
    max-width: 480px;
    padding: 1.8rem 2rem;
    text-align: center;
    box-shadow: 0 0 60px rgba(0, 200, 255, 0.2);
}
.play-win-card h2 { margin-top: 0; }
.play-win-card p { line-height: 1.6; }
.play-win-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.play-win-actions a { text-decoration: none; display: inline-block; }

/* calc tool */
.calc-form { display: grid; gap: 0.7rem; margin: 1.2rem 0; }
.calc-field { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.calc-field > span:first-child { flex: 1; min-width: 200px; }
.calc-input { display: flex; align-items: center; gap: 0.45rem; }
.calc-input input, .decoder-box textarea {
    background: var(--surface, rgba(128, 128, 128, 0.08));
    border: 1px solid var(--border, #445);
    border-radius: 9px;
    padding: 0.45rem 0.7rem;
    color: inherit;
    font-family: inherit;
    font-size: 0.95rem;
}
.calc-input input { width: 110px; }
.calc-input em { font-style: normal; color: var(--muted, #9a9a9a); font-size: 0.85rem; }
.calc-out { border-top: 1px dashed rgba(128, 128, 128, 0.3); padding-top: 0.8rem; }
.calc-line { display: flex; justify-content: space-between; gap: 1rem; margin: 0.4rem 0; }
.calc-line strong { font-variant-numeric: tabular-nums; }
.calc-verdict {
    border-left: 3px solid var(--accent, #00c8ff);
    padding: 0.5rem 0 0.5rem 0.9rem;
    font-style: italic;
    line-height: 1.6;
}

/* matrix tool */
.matrix-wrap { overflow-x: auto; margin: 1rem 0; }
.matrix-table { border-collapse: collapse; width: 100%; min-width: 480px; }
.matrix-table th, .matrix-table td {
    border: 1px solid var(--border, #333);
    padding: 0.5rem 0.7rem;
    text-align: center;
    font-size: 0.9rem;
}
.matrix-table tbody th { text-align: left; }
.matrix-table input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent, #00c8ff); }
.matrix-score { font-weight: bold; }
.matrix-truth { margin-top: 1rem; animation: play-in 0.3s ease; }
.matrix-truth p { line-height: 1.55; }

/* decoder tool */
.decoder-box textarea { width: 100%; box-sizing: border-box; margin: 0.4rem 0 0.8rem; }
.decoder-out {
    background: var(--surface, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border, #333);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    min-height: 2.4rem;
}

/* story page cards */
.story-play-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }

.shake { animation: play-shake 0.3s ease; }
@keyframes play-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
@keyframes play-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .shake, .clue-log li, .chain-built li, .play-win, .matrix-truth { animation: none; }
}
