/*
 * Bridge City Poker — the tutorial's narrator and spotlight (tutorial.js).
 *
 * Built from the table's own two materials: the SLIP is a gusset plate — flat steel, a rivet
 * in each corner, the same plate the seats and the standings wear — and the SPOTLIGHT is the
 * cut-out in the dimmed table: what is lit simply shows through, with no outline. Above the dialogs (1100), under the start screen (1200).
 */

#tut-veil {
    position: fixed; inset: 0;
    z-index: calc(var(--dk-z-overlay, 1100) + 40);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.28s ease;
}
#tut-veil.on { opacity: 1; }
#tut-veil svg { display: block; }
#tut-veil .tut-shade { fill: rgba(5, 7, 24, 0.6); }
/* No outline around what is lit (user 2026-11-09: "remove the dashed borders"): the hole in
   the shade is the spotlight. */
#tut-veil .tut-rim { display: none; }

.tut-slip {
    position: fixed; left: 8px; top: 60px;
    z-index: calc(var(--dk-z-overlay, 1100) + 50);
    box-sizing: border-box;
    width: 420px; max-width: calc(100vw - 16px);
    overflow-y: auto;
    padding: 9px 15px 11px;
    background:
        radial-gradient(circle at 6px 6px, var(--bc-rivet) 1.4px, rgba(0, 0, 0, 0) 2.2px),
        radial-gradient(circle at calc(100% - 6px) 6px, var(--bc-rivet) 1.4px, rgba(0, 0, 0, 0) 2.2px),
        radial-gradient(circle at 6px calc(100% - 6px), var(--bc-rivet) 1.4px, rgba(0, 0, 0, 0) 2.2px),
        radial-gradient(circle at calc(100% - 6px) calc(100% - 6px), var(--bc-rivet) 1.4px, rgba(0, 0, 0, 0) 2.2px),
        linear-gradient(180deg, #263f55, var(--bc-steel) 40%, var(--bc-steel-lo));
    border: 1px solid var(--bc-steel-edge);
    border-radius: 3px;
    box-shadow: inset 0 1px 0 var(--bc-steel-lit), 0 0 0 1px rgba(5, 7, 24, 0.5), 0 10px 28px rgba(0, 0, 0, 0.55);
    font-family: var(--dk-font-ui);
    color: var(--bc-ink);
    opacity: 0; visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s, left 0.25s ease, top 0.25s ease;
}
.tut-slip.on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.22s ease, transform 0.22s ease, left 0.25s ease, top 0.25s ease; }
.tut-slip.on.aside { opacity: 0; pointer-events: none; }
.tut-slip.doing { border-color: var(--dk-accent); box-shadow: inset 0 1px 0 var(--bc-steel-lit), 0 0 0 1px var(--dk-accent-soft), 0 10px 28px rgba(0, 0, 0, 0.55); }

.tut-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 0 2px 5px; margin-bottom: 6px;
    border-bottom: 1px solid var(--bc-steel-edge);
}
.tut-where {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--bc-dim);
}
.tut-leave {
    all: unset; flex: none; cursor: pointer;
    display: grid; place-items: center;
    width: 28px; height: 28px; margin: -6px -8px -6px 0;
    border-radius: 3px; color: var(--bc-dim);
}
.tut-leave svg { width: 15px; height: 15px; }
.tut-leave:hover { color: #fff; background: rgba(174, 225, 246, 0.12); }
.tut-leave:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 1px; }

.tut-title {
    margin: 0 0 3px;
    font-family: var(--dk-font-display); font-size: 18px; font-weight: 700; line-height: 1.2;
    color: var(--dk-accent);
}
.tut-say { margin: 0; font-size: 14px; line-height: 1.45; color: var(--bc-ink); text-wrap: pretty; }

.tut-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 9px; }
.tut-foot:has(.tut-do:empty):has(.tut-buttons:empty) { display: none; }
.tut-do { margin-right: auto; font-size: 12.5px; font-weight: 600; color: var(--bc-gold); letter-spacing: 0.02em; }
.tut-do::before { content: '▸ '; }
.tut-do:empty { display: none; }
.tut-do.hey { color: #ff9aa8; }
.tut-buttons { display: flex; gap: 8px; }
.tut-buttons:empty { display: none; }

/* the steel bars of the action bar, small */
.tut-btn {
    all: unset; box-sizing: border-box; cursor: pointer;
    min-height: 44px; min-width: 44px; padding: 0 18px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 3px;
    font-family: var(--dk-font-ui); font-size: 14px; font-weight: 600; color: #edf6fb;
    background: var(--bc-steel-lo);
    box-shadow: inset 0 1px 0 var(--bc-steel-lit), 0 0 0 1px var(--bc-steel-edge), 0 3px 8px rgba(0, 0, 0, 0.4);
    touch-action: manipulation;
    transition: filter 0.15s, transform 0.1s;
}
.tut-btn.primary {
    padding: 0 26px;
    background:
        radial-gradient(circle at 10px 50%, var(--bc-rivet) 1.5px, rgba(0, 0, 0, 0) 2.3px),
        radial-gradient(circle at calc(100% - 10px) 50%, var(--bc-rivet) 1.5px, rgba(0, 0, 0, 0) 2.3px),
        linear-gradient(180deg, #2f76a6, #245d86);
    box-shadow: inset 0 1px 0 rgba(214, 238, 250, 0.35), 0 0 0 1px rgba(120, 190, 230, 0.7), 0 3px 10px rgba(0, 0, 0, 0.45);
}
.tut-btn:hover { filter: brightness(1.12); }
.tut-btn:active { transform: translateY(1px); }
.tut-btn:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 3px; }

/* the table's hint line steps back while the narrator talks (hints-live-in-themed-overlays) */
body.tut-on #status-line { visibility: hidden; }

/* a press on the table while the slip is talking: the slip shrugs */
.tut-slip.nudge { animation: tut-nudge 0.36s ease; }
@keyframes tut-nudge {
    0%, 100% { translate: 0 0; }
    25% { translate: -5px 0; }
    75% { translate: 5px 0; }
}

/* a phone: the same plate, tighter */
@media (max-height: 520px), (max-width: 700px) {
    .tut-slip { padding: 6px 11px 8px; }
    .tut-head { padding-bottom: 3px; margin-bottom: 4px; }
    .tut-where { font-size: 9.5px; }
    .tut-title { font-size: 15px; margin-bottom: 1px; }
    .tut-say { font-size: 12.5px; line-height: 1.36; }
    .tut-foot { margin-top: 5px; }
    .tut-btn { min-height: 40px; font-size: 13px; padding: 0 14px; }
    .tut-btn.primary { padding: 0 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .tut-slip, .tut-slip.on, #tut-veil { transition: none; }
    .tut-slip.nudge { animation: none; }
}
