/* First-visit homepage tour (tutorial.js): a full-screen window whose spotlight dims everything
   but the feature it describes, with a note beside it. */
dialog.tutorial {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    color: #f5f0ff;
    background: transparent;
}

dialog.tutorial::backdrop {
    background: transparent;
}

body:has(dialog.tutorial[open]) {
    overflow: hidden;
}

/* The hole in the dimming, ringed in gold. Its huge shadow is the dimming. */
.tutorial-spotlight {
    position: absolute;
    border-radius: 16px;
    box-shadow:
        0 0 0 3px var(--reward),
        0 0 0 200vmax rgba(5, 7, 19, 0.82);
    pointer-events: none;
}

.tutorial-spotlight::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    animation: tutorial-pulse 1.6s ease-out infinite;
}

@keyframes tutorial-pulse {
    from {
        box-shadow: 0 0 0 0 rgba(253, 230, 138, 0.7);
    }

    to {
        box-shadow: 0 0 0 16px rgba(253, 230, 138, 0);
    }
}

.tutorial-card {
    position: absolute;
    width: min(340px, calc(100% - 32px));
    padding: 20px;
    border: 2px solid var(--brand);
    border-radius: 16px;
    background: #141021;
    box-shadow: 0 18px 60px #000a;
    font:
        1rem/1.5 Arial,
        sans-serif;
}

/* Later steps glide from one target to the next. */
dialog.tutorial.is-ready .tutorial-spotlight,
dialog.tutorial.is-ready .tutorial-card {
    transition-property: left, top, width, height;
    transition-duration: 0.35s;
    transition-timing-function: ease;
}

.tutorial-step {
    margin: 0 0 8px;
    color: #c4a0e0;
    font: bold 0.7rem monospace;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.tutorial-card h2 {
    margin: 0 0 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.15rem;
    line-height: 1.3;
}

.tutorial-text {
    margin: 0;
    color: #ddd0ec;
}

.tutorial-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

.tutorial-actions button {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #674780;
    border-radius: 10px;
    color: white;
    background: #281d39;
    font:
        bold 0.85rem Arial,
        sans-serif;
    cursor: pointer;
}

.tutorial-actions button:hover {
    background: #3a2a52;
}

.tutorial-actions button:focus-visible {
    outline: 3px solid var(--reward);
    outline-offset: 2px;
}

.tutorial-actions button[hidden] {
    display: none;
}

.tutorial-actions .tutorial-skip {
    margin-right: auto;
    padding: 0 4px;
    border: 0;
    color: var(--text-muted);
    background: none;
    font-weight: normal;
    text-decoration: underline;
}

.tutorial-actions .tutorial-skip:hover {
    color: white;
    background: none;
}

.tutorial-actions .tutorial-next {
    border-color: #c4a0e0;
    background: var(--brand);
}

.tutorial-actions .tutorial-next:hover {
    background: #a463d6;
}

@media (prefers-reduced-motion: reduce) {
    .tutorial-spotlight::after {
        animation: none;
    }

    dialog.tutorial.is-ready .tutorial-spotlight,
    dialog.tutorial.is-ready .tutorial-card {
        transition: none;
    }
}
