/* =============================================================================
   fischer-practice.css — shared styles for the three Fischer projection pages
   (fischer-rs, fischer-relationships, fischer-meso).
   Layout follows the reserved-zone/no-frameshift conventions: every canvas has
   a fixed height from page load; reveals redraw INSIDE the same box.
   ============================================================================= */

.hidden { display: none !important; }

/* --- sub-nav strip (same look as the NMR family strip) --- */
.fischer-subnav {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin: 2px 0 12px;
    font-size: 0.92rem;
}
.fischer-subnav-label { color: #666; }
.fischer-subnav-sep { color: #bbb; }
.fischer-subnav-link { text-decoration: none; }
.fischer-subnav-link:hover { text-decoration: underline; }
.fischer-subnav-current { font-weight: 700; color: #333; }

/* --- difficulty pills --- */
#difficulty-pills {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 0 0 10px;
}
.diff-pill {
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 999px;
    padding: 3px 14px;
    font-size: 0.88rem;
    cursor: pointer;
    color: #444;
}
.diff-pill.active {
    background: #6153cc;
    border-color: #6153cc;
    color: #fff;
}
#difficulty-pills.pills-disabled .diff-pill {
    opacity: 0.35;
    cursor: default;
}
#pool-pills {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin: -2px 0 10px;
}
.pool-label { font-size: 0.88rem; color: #666; }
.pool-pill {
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 999px;
    padding: 3px 14px;
    font-size: 0.88rem;
    cursor: pointer;
    color: #444;
}
.pool-pill.active {
    background: #2a7d6f;
    border-color: #2a7d6f;
    color: #fff;
}

/* --- single-canvas pages (rs, meso) --- */
#fischer-main {
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    max-width: 420px;
}
#fischer-main svg { height: 100%; max-width: 100%; }

/* rs page: persistent stage wrapping the canvas so the 3D overlay + corner
   button survive re-renders (renderFischer clears #fischer-main's children;
   the 3Dmol viewer must keep its ONE WebGL context across problems). */
#fischer-stage {
    position: relative;
    max-width: 420px;
    margin: 0 auto 6px;
}
#fischer-stage #fischer-main { margin: 0; max-width: none; }
/* 3D drawer: absolutely positioned in the whitespace BESIDE the centered
   canvas, so opening/closing never reflows the page (no-frameshift). The
   wrapper animates its clip width; the inner panel (and the 3Dmol canvas)
   keep a fixed size throughout. */
#fischer-3d-wrap {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    margin-left: 10px;
    width: 0;
    overflow: hidden;
    z-index: 4;
    transition: width 0.35s ease;
}
#fischer-3d-wrap.open { width: 300px; }
#fischer-3d-panel {
    position: relative;
    width: 300px;
    height: 100%;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}
/* Narrow viewports: no side whitespace — the drawer slides over the
   canvas's right edge instead (still zero layout impact). */
@media (max-width: 1079px) {
    #fischer-3d-wrap { left: auto; right: 0; margin-left: 0; }
}
#fischer-3d-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #ccc;
    background: rgba(255, 255, 255, 0.92);
    color: #333;               /* site-wide button default is white-on-purple */
    cursor: pointer;
}
#fischer-3d-btn.hidden { display: none; }
.fischer-3d-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    z-index: 2;
    text-align: center;
    font-size: 0.78rem;
    color: #666;
    pointer-events: none;
    padding: 0 6px;
}

/* wedge/hash annotation at the asked center (post-answer re-render) */
.fischer-svg .fischer-wedge { fill: #222; stroke: none; }
.fischer-svg .fischer-hash { stroke: #222; stroke-width: 1.5; }

/* --- relationships page: pair panels + conversion grid --- */
#pair-wrap {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: stretch;
    margin-bottom: 6px;
}
.fischer-panel {
    flex: 1 1 0;
    max-width: 300px;
    height: 320px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.fischer-panel svg { height: 94%; max-width: 96%; }
/* conversion problems show ONE Fischer panel centered above the grid */
#pair-wrap.single-panel #panel-b { display: none; }
#pair-wrap.single-panel .fischer-panel { max-width: 340px; height: 250px; }
.fischer-panel h4 {
    position: absolute;
    margin: 0;
}

#choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0 auto 6px;
}
@media (max-width: 900px) {
    #choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 560px;
    }
}
.fischer-choice-panel {
    position: relative;
    height: 150px;
    border: 2px solid #d8d8d8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.12s;
}
.fischer-choice-panel:hover:not(:disabled) { border-color: #6153cc; }
.fischer-choice-panel:disabled { cursor: default; }
.fischer-choice-letter {
    position: absolute;
    top: 5px;
    left: 9px;
    font-weight: 700;
    color: #888;
    font-size: 0.9rem;
}
.fischer-choice-mol { width: 100%; height: 100%; }
.fischer-choice-mol svg { width: 100%; height: 100%; }
/* verdict colors for the clickable panels (buttons get theirs from
   feedback-zone.css; panels need the border treatment) */
.fischer-choice-panel.choice-verdict-correct {
    border-color: #2a9d8f;
    box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.25);
}
.fischer-choice-panel.choice-verdict-wrong {
    border-color: #d32f2f;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.25);
}

/* --- the hand-drawn Fischer SVG --- */
.fischer-svg .fischer-bond {
    stroke: #222;
    stroke-width: 1.7;
    stroke-linecap: round;
}
.fischer-svg .fischer-label {
    fill: #222;
    font-family: inherit;
}
.fischer-svg .fischer-target {
    fill: rgba(97, 83, 204, 0.13);
    stroke: #6153cc;
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}
.fischer-svg .fischer-mirror {
    stroke: #d32f2f;
    stroke-width: 1.4;
    stroke-dasharray: 6 4;
}
.fischer-svg .fischer-mirror-label { fill: #d32f2f; font-style: italic; }
.fischer-svg .fischer-badge { fill: #444; }
.fischer-svg .fischer-badge-halo { fill: #fff; }
.fischer-svg .fischer-badge-num { fill: #fff; font-weight: 700; }
.fischer-svg .fischer-cip-letter { fill: #666; font-style: italic; }

/* name element only feeds bookmarks on these pages */
.visually-hidden-name {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* compact for laptop viewports (site convention: game fits one screen) */
@media (max-height: 940px) {
    #fischer-main { height: 300px; }
    .fischer-panel { height: 280px; }
    .fischer-choice-panel { height: 146px; }
}
