/*
 * The feature pages: what a card under the product page's features opens. The page wears the product
 * page's look - its sections, its tiles and its closing band are home.css's - and adds a hero of its
 * own, the stage the feature plays on, the three things it does and the other five features.
 *
 * The stages for the HUD, the notes and the import are here; the replayer's is feature-replay.css,
 * the report's and the tables' feature-desk.css. Every stage is HTML and CSS: what a reader presses is
 * a radio button or a checkbox, and what changes is chosen with :has().
 */

/* ── The page ──────────────────────────────────────────────────────────────── */

.feature-hero { position: relative; overflow: clip; padding: 56px 0 24px; }
.feature-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(50% 70% at 50% 0%, rgba(37, 198, 133, 0.18), transparent 70%);
}
.feature-hero__inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.feature-back { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--text-secondary); text-decoration: none; }
.feature-back:hover { color: var(--accent-primary); }
.feature-hero__label { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-primary); }
.feature-hero__headline {
    max-width: 16em; font-size: clamp(36px, 4.6vw, 64px); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em;
    padding-bottom: 0.08em; text-wrap: balance;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-primary) 50%, var(--accent-primary) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.feature-hero__line { max-width: 40em; font-size: clamp(15px, 1.25vw, 18px); font-weight: 500; line-height: 1.6; color: var(--text-secondary); }

.feature-stage { display: flex; flex-direction: column; align-items: center; gap: 20px; padding-top: 24px; }
.feature-stage__hint {
    display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; text-align: center;
    background: rgba(37, 198, 133, 0.1); border: 1px solid rgba(37, 198, 133, 0.4); color: var(--accent-primary);
    font-size: 14px; font-weight: 600;
}
.feature-stage__hint::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: feature-ping 2s ease-out infinite; }
@keyframes feature-ping { 0% { box-shadow: 0 0 0 0 rgba(37, 198, 133, 0.6); } 70%, 100% { box-shadow: 0 0 0 8px rgba(37, 198, 133, 0); } }

.feature-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: point; }
.feature-point {
    position: relative; padding: 28px; border-radius: 20px; counter-increment: point;
    background: linear-gradient(180deg, var(--bg-surface), color-mix(in srgb, var(--bg-surface) 60%, transparent));
    border: 1px solid var(--border-subtle);
}
.feature-point::before {
    content: counter(point, decimal-leading-zero); display: block; margin-bottom: 14px;
    font-size: 13px; font-weight: 700; letter-spacing: 0.1em; color: var(--accent-primary);
}
.feature-point h2 { margin-bottom: 8px; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.feature-point p { font-size: 14px; font-weight: 500; line-height: 1.6; color: var(--text-secondary); }

.feature-more { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.feature-more__card {
    display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 16px;
    background: var(--bg-surface); border: 1px solid var(--border-subtle); color: inherit; text-decoration: none;
    transition: transform 220ms ease, border-color 220ms ease;
}
.feature-more__card:hover { transform: translateY(-3px); border-color: rgba(37, 198, 133, 0.45); }
.feature-more__card:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
.feature-more__card h3 { font-size: 15px; font-weight: 600; }
.feature-more__card p { flex: 1; font-size: 13px; font-weight: 500; line-height: 1.55; color: var(--text-secondary); }

/* A row of choices over a stage: each a radio button dressed as a chip. */
.feature-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.feature-switch__label { margin: 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.feature-switch__choice {
    position: relative; padding: 8px 14px; border-radius: 999px; cursor: pointer;
    background: var(--bg-surface); border: 1px solid var(--border-subtle); font-size: 13px; font-weight: 600; color: var(--text-secondary);
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.feature-switch__choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.feature-switch__choice:hover { color: var(--text-primary); border-color: var(--border-strong); }
.feature-switch__choice:has(input:checked) { background: rgba(37, 198, 133, 0.14); border-color: var(--accent-primary); color: var(--accent-primary); }
.feature-switch__choice:has(input:focus-visible) { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

/* ── The HUD: the table at rest, read over every hand or at the seat ───────────── */

.hud-shown { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 1080px; }
.hud-shown:has(input[value="seat"]:checked) .film__cell > b:first-child { display: none; }
.hud-shown:has(input[value="seat"]:checked) .film__at-seat { display: inline; }
.hud-shown:has(input[value="seat"]:checked) .film__position { color: var(--accent-primary); }

/* ── The notes: the seat's menu and the window open ──────────────────────────── */

.notes-shown { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: start; width: 100%; max-width: 1080px; }
.notes-shown__seat { font-size: 15px; }
.notes-shown__felt {
    position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 18px; padding: 36px 24px;
    border-radius: 22px; background: radial-gradient(ellipse at 50% 30%, #1d6b51 0%, var(--bg-felt) 60%, #0a2a20 100%);
    box-shadow: 0 0 0 1px var(--border-strong), inset 0 0 50px rgba(0, 0, 0, 0.45), 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.notes-shown__panel { cursor: default; transition: border-color 250ms ease, box-shadow 250ms ease; }
.notes-shown:has(input[value="reg"]:checked) .notes-shown__panel { border-left-color: var(--marker-reg); }
.notes-shown:has(input[value="whale"]:checked) .notes-shown__panel { border-left-color: var(--marker-whale); }
.notes-shown:has(input[value="unknown"]:checked) .notes-shown__panel { border-left-color: var(--text-muted); }
.notes-shown:has(input[value="reg"]:checked) .film-popup__dot { --seat-marker: var(--marker-reg); }
.notes-shown:has(input[value="whale"]:checked) .film-popup__dot { --seat-marker: var(--marker-whale); }
.notes-shown:has(input[value="unknown"]:checked) .film-popup__dot { --seat-marker: var(--text-muted); }

/* The seat's menu as a right-click opens it at the table: the application's own dark menu. */
.notes-shown__menu {
    display: flex; flex-direction: column; min-width: 210px; padding: 6px; border-radius: 8px;
    background: rgba(20, 20, 20, 0.97); border: 1px solid #3a3a3a; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
    font: 500 13px/1.4 "Inter", system-ui, sans-serif; color: #e9eef5;
}
.notes-shown__heading { padding: 4px 10px 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: #8a8a8a; }
.notes-shown__item { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 5px; }
.notes-shown__item:hover, .notes-shown__item--open { background: #2a2a2a; }
.notes-shown__item--lit { color: var(--accent-primary); font-weight: 600; animation: notes-shown-lit 2.4s ease-in-out infinite; }
@keyframes notes-shown-lit { 50% { background: rgba(37, 198, 133, 0.14); } }
.notes-shown__markers { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px 4px 8px 14px; margin-bottom: 4px; border-bottom: 1px solid #2a2a2a; }
.notes-shown__marker {
    position: relative; display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 5px; cursor: pointer;
    font-size: 12.5px; color: #bfbfbf; border: 1px solid transparent;
}
.notes-shown__marker::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); }
.notes-shown__marker--fish::before { background: var(--marker-fish); }
.notes-shown__marker--reg::before { background: var(--marker-reg); }
.notes-shown__marker--whale::before { background: var(--marker-whale); }
.notes-shown__marker input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.notes-shown__marker:hover { background: #2a2a2a; color: #fff; }
.notes-shown__marker:has(input:checked) { border-color: #4a4a4a; background: #222; color: #fff; font-weight: 600; }
.notes-shown__marker:has(input:focus-visible) { outline: 2px solid var(--accent-primary); }

/* The notes window, open in the page rather than over a table. */
.film-notes--open { width: 100%; max-width: none; max-height: none; overflow: visible; }

/* ── The import: three trackers, Start, and the bar filling ───────────────────── */

.import-shown { width: 100%; max-width: 720px; }
.import-shown__window {
    display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: 18px;
    background: var(--bg-surface); border: 1px solid var(--border-subtle); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.import-shown__trackers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.import-shown__tracker {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: 12px; cursor: pointer;
    background: var(--bg-raised); border: 1px solid var(--border-subtle); transition: border-color 150ms ease;
}
.import-shown__tracker input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.import-shown__tracker:hover { border-color: var(--border-strong); }
.import-shown__tracker:has(input:checked) { border-color: var(--accent-primary); box-shadow: 0 0 0 1px var(--accent-primary); }
.import-shown__tracker:has(input:focus-visible) { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.import-shown__badge { padding: 4px 8px; border-radius: 6px; background: var(--bg-canvas); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--text-secondary); }
.import-shown__found { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--status-win); }
.import-shown__found::before { content: "✓"; }
.import-shown__hint { display: none; font-size: 13px; line-height: 1.55; color: var(--text-secondary); }
.import-shown:has(input[value="pt4"]:checked) .import-shown__hint--pt4,
.import-shown:has(input[value="h2n"]:checked) .import-shown__hint--h2n,
.import-shown:has(input[value="dh"]:checked) .import-shown__hint--dh { display: block; }
.import-shown__ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.import-shown__asked { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.import-shown__asked + .import-shown__chip { margin-right: 12px; }
.import-shown__chip { padding: 6px 12px; border-radius: 999px; background: var(--bg-raised); border: 1px solid var(--border-subtle); font-size: 13px; font-weight: 600; }

.import-shown__run { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 16px; }
.import-shown__pressed { position: absolute; opacity: 0; pointer-events: none; }
.import-shown__start {
    padding: 11px 22px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600;
    background: var(--accent-primary); color: #06130d; box-shadow: 0 10px 28px -10px rgba(37, 198, 133, 0.7);
}
.import-shown__start:hover { filter: brightness(1.08); }
.import-shown__pressed:focus-visible + .import-shown__start { outline: 2px solid var(--accent-primary); outline-offset: 3px; }
.import-shown__progress { height: 8px; border-radius: 4px; background: var(--bg-raised); overflow: hidden; }
.import-shown__progress span { display: block; width: 0; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent-primary), #6ee7b7); }
.import-shown__running, .import-shown__outcome { grid-row: 2; grid-column: 1 / -1; display: none; font-size: 13px; font-weight: 600; }
.import-shown__running { color: var(--text-secondary); }
.import-shown__outcome { align-items: center; justify-content: space-between; gap: 12px; color: var(--status-win); }
.import-shown__again { cursor: pointer; font-size: 12.5px; color: var(--text-secondary); text-decoration: underline; text-underline-offset: 3px; }
.import-shown__again:hover { color: var(--text-primary); }
.import-shown:has(.import-shown__pressed:checked) .import-shown__start { opacity: 0.45; pointer-events: none; box-shadow: none; }
.import-shown:has(.import-shown__pressed:checked) .import-shown__progress span { animation: import-shown-fill 3.6s cubic-bezier(.4, .1, .3, 1) forwards; }
.import-shown:has(.import-shown__pressed:checked) .import-shown__running { display: block; animation: import-shown-running 3.6s step-end forwards; }
.import-shown:has(.import-shown__pressed:checked) .import-shown__outcome { display: flex; animation: import-shown-done 3.6s step-end both; }
@keyframes import-shown-fill { to { width: 100%; } }
@keyframes import-shown-running { 0% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes import-shown-done { 0% { opacity: 0; visibility: hidden; } 100% { opacity: 1; visibility: visible; } }

/* ── Tablets and phones ────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .feature-more { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .notes-shown { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .feature-hero { padding-top: 32px; }
    .feature-points, .feature-more { grid-template-columns: minmax(0, 1fr); }
    .feature-point { padding: 22px; }
    .notes-shown__felt { padding: 24px 12px; }
    .notes-shown__seat { font-size: 13px; }
    .import-shown__window { padding: 18px; }
    .tables-shown__controls .feature-switch__label { flex-basis: 100%; text-align: center; }
    .import-shown__trackers { grid-template-columns: minmax(0, 1fr); }
    .import-shown__run { grid-template-columns: minmax(0, 1fr); }
}

/* ── For a reader who asks for less motion ──────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .feature-stage__hint::before, .notes-shown__item--lit { animation: none; }
    .feature-more__card { transition: none; }
    .import-shown:has(.import-shown__pressed:checked) .import-shown__progress span { animation: none; width: 100%; }
    .import-shown:has(.import-shown__pressed:checked) .import-shown__running { display: none; }
    .import-shown:has(.import-shown__pressed:checked) .import-shown__outcome { animation: none; }
}
