/*
 * First-time interactive onboarding tutorial - "spotlight" overlay.
 * Dims the whole screen except the current step's real UI element (a rectangular cutout
 * built from 4 positioned panels, not a fake screenshot), with an instruction card and a
 * bottom-right hint/continue chip. Driven entirely by TutorialManager in game-bundle.js,
 * which injects/positions these elements at runtime - this file is styling only.
 * Appended directly to <body> (never nested inside a screen) to avoid the stacking-context
 * traps documented in .claude/issues/ for this project.
 */

#tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    pointer-events: none;
    font-family: var(--font-body);
}

.tutorial-dim-full,
.tutorial-dim {
    position: fixed;
    background: rgba(20, 14, 8, 0.72);
    pointer-events: auto;
}

.tutorial-dim-full {
    inset: 0;
}

.tutorial-dim {
    transition: top 0.35s ease, left 0.35s ease, width 0.35s ease, height 0.35s ease;
}

.tutorial-ring {
    position: fixed;
    border-radius: 14px;
    border: 3px solid var(--harvest-gold, #CA8A04);
    box-shadow: 0 0 0 4px rgba(202, 138, 4, 0.35), 0 0 24px rgba(202, 138, 4, 0.55);
    pointer-events: none;
    transition: top 0.35s ease, left 0.35s ease, width 0.35s ease, height 0.35s ease;
    animation: tutorial-ring-pulse 1.6s ease-in-out infinite;
}

@keyframes tutorial-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(202, 138, 4, 0.35), 0 0 18px rgba(202, 138, 4, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(202, 138, 4, 0.2), 0 0 32px rgba(202, 138, 4, 0.75); }
}

.tutorial-callout {
    position: fixed;
    width: 300px;
    max-width: calc(100vw - 24px);
    background: var(--white, #FEFEFE);
    border: 3px solid var(--dark-brown, #654321);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    animation: tutorial-callout-in 0.25s ease;
}

.tutorial-callout.centered {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 340px;
    text-align: center;
}

@keyframes tutorial-callout-in {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; }
}

.tutorial-callout.centered {
    animation: tutorial-callout-in-centered 0.25s ease;
}

@keyframes tutorial-callout-in-centered {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.tutorial-progress {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--dark-brown, #654321);
    opacity: 0.55;
    margin-bottom: 6px;
}

.tutorial-text {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--dark-brown, #654321);
}

.tutorial-action-btn {
    margin-top: 12px;
    width: 100%;
    padding: 10px 16px;
    background: var(--harvest-gold, #CA8A04);
    border: 3px solid var(--dark-brown, #654321);
    border-radius: 12px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 15px;
    color: var(--white, #FEFEFE);
    cursor: pointer;
    box-shadow: 0 3px 0 var(--dark-brown, #654321);
    transition: transform 0.15s, box-shadow 0.15s;
}

.tutorial-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--dark-brown, #654321);
}

.tutorial-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 0 var(--dark-brown, #654321);
}

.tutorial-hint {
    position: fixed;
    right: 20px;
    bottom: 20px;
    max-width: 260px;
    background: var(--dark-brown, #654321);
    color: var(--white, #FEFEFE);
    border-radius: 14px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    animation: tutorial-hint-bob 1.4s ease-in-out infinite;
}

@keyframes tutorial-hint-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.tutorial-skip {
    position: fixed;
    top: 18px;
    right: 20px;
    background: rgba(20, 14, 8, 0.55);
    color: var(--white, #FEFEFE);
    border: none;
    border-radius: 10px;
    padding: 7px 14px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    pointer-events: auto;
    opacity: 0.75;
    transition: opacity 0.2s;
}

.tutorial-skip:hover {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .tutorial-ring,
    .tutorial-hint {
        animation: none;
    }
    .tutorial-callout,
    .tutorial-callout.centered {
        animation: none;
    }
}

@media (max-width: 480px) {
    .tutorial-callout {
        width: calc(100vw - 24px);
    }
    .tutorial-hint {
        right: 12px;
        bottom: 12px;
        left: 12px;
        max-width: none;
        text-align: center;
    }
}
