/* css/case-board.css
   THE CASE BOARD — a noir corkboard panel. Corkboard texture is built from
   layered gradients (no image assets — CSP). Gold-on-dark to match the game;
   red string is a <canvas> drawn by caseBoard.js. Mobile collapses to a single
   column and hides the string canvas. */

/* ── Toolbar button ── */
.case-board-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    padding: 6px 8px;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.6));
    transition: transform 0.15s ease;
}
.case-board-button:hover { transform: scale(1.15) rotate(-6deg); }

/* ── Overlay ── */
.case-board-overlay {
    position: fixed;
    inset: 0;
    z-index: 8600;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    padding: 20px;
    box-sizing: border-box;
}

/* ── Panel shell ── */
.case-board {
    width: 100%;
    max-width: 920px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #241b12;
    border: 2px solid #7a5a2e;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7), inset 0 0 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.case-board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(180deg, #1c1710 0%, #2a2013 100%);
    border-bottom: 1px solid #4a3a22;
    flex: 0 0 auto;
}

.case-board-title {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 0.32em;
    text-indent: 0.32em;
    color: #f0c869;
    text-shadow: 0 0 12px rgba(240, 200, 105, 0.4);
}

.case-board-close {
    background: none;
    border: none;
    color: #b79a63;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    transition: color 0.15s ease;
}
.case-board-close:hover { color: #fff; }

/* ── Corkboard ── */
.case-board-cork {
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px;
    /* Cork texture from stacked radial speckles over a warm base. */
    background-color: #b8894a;
    background-image:
        radial-gradient(circle at 20% 35%, rgba(90, 60, 25, 0.35) 0 2px, transparent 3px),
        radial-gradient(circle at 65% 15%, rgba(120, 85, 40, 0.30) 0 2px, transparent 3px),
        radial-gradient(circle at 80% 70%, rgba(70, 45, 18, 0.35) 0 2px, transparent 3px),
        radial-gradient(circle at 40% 80%, rgba(140, 100, 50, 0.28) 0 2px, transparent 3px),
        linear-gradient(135deg, #b0813f 0%, #9c6f34 100%);
    background-size: 90px 90px, 70px 70px, 110px 110px, 80px 80px, 100% 100%;
}

/* Red string canvas sits above the cork, below the pinned cards. */
.case-board-string {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.case-board-cork > .case-board-directive,
.case-board-cork > .case-board-section {
    position: relative;
    z-index: 2;
}

/* ── Directive card ── */
.case-board-directive {
    max-width: 460px;
    margin: 0 auto 22px;
    padding: 14px 18px;
    background: #f5efe0;
    color: #201810;
    border-radius: 3px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    transform: rotate(-1.2deg);
    border-top: 22px solid #d8c9a6;
    position: relative;
}
/* Push-pin on the directive. */
.case-board-directive::before {
    content: '';
    position: absolute;
    top: -32px;
    left: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ff6b6b, #b32020);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.case-board-directive-tag {
    font-size: 0.68rem;
    letter-spacing: 0.28em;
    color: #9a2b2b;
    font-weight: 700;
    margin-bottom: 6px;
}
.case-board-directive-text {
    font-family: 'Courier New', monospace;
    font-size: 1.02rem;
    line-height: 1.4;
    font-weight: 700;
}

/* ── Sections ── */
.case-board-section { margin-bottom: 22px; }

.case-board-section-label {
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    color: #f0d9a6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    margin-bottom: 10px;
    border-bottom: 1px dashed rgba(245, 220, 160, 0.4);
    padding-bottom: 4px;
}

/* ── Pinned interviews (polaroids) ── */
.case-board-pins {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-start;
}

.case-board-pin {
    position: relative;
    width: 110px;
    padding: 8px 8px 10px;
    background: #fbf9f2;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
    transform: rotate(-2deg);
    transition: transform 0.15s ease;
}
.case-board-pin:nth-child(even) { transform: rotate(2.4deg); }
.case-board-pin:nth-child(3n) { transform: rotate(-3.5deg); }
.case-board-pin:hover { transform: rotate(0deg) scale(1.05); z-index: 3; }
.case-board-pin::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffd36b, #b3860f);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
}

.case-board-pin-photo {
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: #cfc4ac;
    background: linear-gradient(160deg, #2c2c34 0%, #14141a 100%);
    margin-bottom: 6px;
}

.case-board-pin-name {
    font-size: 0.72rem;
    color: #23201a;
    text-align: center;
    font-weight: 600;
    line-height: 1.2;
    min-height: 1.9em;
}

.case-board-pin-stamp {
    margin-top: 5px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 0;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    transform: rotate(-4deg);
    opacity: 0.85;
}
.case-board-stamp-great { color: #1f8a3b; }
.case-board-stamp-good { color: #2f6db5; }
.case-board-stamp-neutral { color: #9a7b1f; }
.case-board-stamp-bad { color: #b02626; }
.case-board-stamp-unknown { color: #555; }

.case-board-pins-tail {
    align-self: center;
    font-size: 0.78rem;
    font-style: italic;
    color: #f0d9a6;
    padding: 6px 10px;
}

/* ── Exhibit shelf ── */
.case-board-exhibits {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.case-board-exhibit-slot {
    width: 150px;
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 4px;
    box-sizing: border-box;
}

.case-board-exhibit-slot.empty {
    border: 2px dashed rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.18);
    /* chalk-outline feel */
    color: rgba(255, 255, 255, 0.55);
}

.case-board-exhibit-slot.filled {
    border: 2px solid #f0c869;
    background: rgba(240, 200, 105, 0.14);
    box-shadow: 0 0 16px rgba(240, 200, 105, 0.35);
    color: #fff4d6;
}

.case-board-exhibit-letter {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}
.case-board-exhibit-slot.filled .case-board-exhibit-letter {
    background: #f0c869;
    color: #2a1e08;
}
.case-board-exhibit-slot.empty .case-board-exhibit-letter {
    border: 2px dashed rgba(255, 255, 255, 0.5);
}

.case-board-exhibit-name {
    font-size: 0.8rem;
    line-height: 1.25;
    font-weight: 600;
}
.case-board-exhibit-slot.empty .case-board-exhibit-name {
    font-size: 1.4rem;
    font-weight: 800;
}

/* ── Open leads ── */
.case-board-leads {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.case-board-lead {
    background: rgba(20, 15, 8, 0.55);
    border-left: 3px solid #c62828;
    border-radius: 3px;
    padding: 8px 12px;
}
.case-board-lead-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: #f0d9a6;
}
.case-board-lead-step {
    font-size: 0.78rem;
    color: #cbb98f;
    margin-top: 2px;
}

.case-board-empty {
    font-size: 0.82rem;
    font-style: italic;
    color: rgba(245, 230, 200, 0.7);
    padding: 6px 2px;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .case-board-overlay { padding: 0; }
    .case-board {
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }
    /* Single column; hide the red string (positions aren't meaningful stacked). */
    .case-board-string { display: none; }
    .case-board-pins { justify-content: center; }
    .case-board-exhibit-slot { width: 100%; }
    .case-board-directive { transform: none; }
    .case-board-pin { transform: none; }
    .case-board-pin:nth-child(even),
    .case-board-pin:nth-child(3n) { transform: none; }
}
