/* ============================================
   ONBOARDING TUTORIAL - Madness Combat Style
   Interactive keyboard/mouse guide with world indicators
   ============================================ */

/* ============================================
   MAIN CONTAINER
   ============================================ */
#onboarding-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 50;
    font-family: 'Share Tech Mono', 'Orbitron', monospace;
    transition: opacity 0.6s ease;
}

#onboarding-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   GROUPED BLOCK: task text + controls together
   Positioned center-ish (slightly left of center)
   ============================================ */
.ob-group {
    position: absolute;
    top: 28%;
    left: 52%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: ob-group-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ob-group-in {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.ob-group.exit {
    animation: ob-group-out 0.4s ease-in forwards;
}

@keyframes ob-group-out {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

/* ============================================
   TASK TEXT (inside group, above controls)
   ============================================ */
.ob-task {
    text-align: center;
}

.ob-task-main {
    font-size: 38px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.6), 0 0 40px rgba(255, 0, 0, 0.2), 3px 3px 6px rgba(0,0,0,0.9);
    margin-bottom: 10px;
}

.ob-task-sub {
    font-size: 18px;
    color: #ccc;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
}

/* ============================================
   KEYBOARD + MOUSE WIDGET (inside group, below text)
   ============================================ */
.ob-controls {
    display: flex;
    align-items: flex-end;
    gap: 24px;
}

/* Keyboard keys layout */
.ob-keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ob-key-row {
    display: flex;
    gap: 6px;
}

.ob-key {
    width: 64px;
    height: 64px;
    background: rgba(15, 15, 15, 0.9);
    border: 3px solid #555;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    color: #777;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.ob-key.wide {
    width: 180px;
    font-size: 20px;
    letter-spacing: 2px;
}

.ob-key.active {
    color: #fff;
    border-color: #e00;
    background: rgba(100, 0, 0, 0.9);
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.5), 0 0 50px rgba(255, 0, 0, 0.2), 0 4px 12px rgba(0,0,0,0.6);
    animation: ob-key-pulse 1.2s ease-in-out infinite;
}

@keyframes ob-key-pulse {
    0%, 100% {
        box-shadow: 0 0 25px rgba(255, 0, 0, 0.5), 0 0 50px rgba(255, 0, 0, 0.2), 0 4px 12px rgba(0,0,0,0.6);
        border-color: #e00;
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 0, 0, 0.7), 0 0 80px rgba(255, 0, 0, 0.3), 0 4px 12px rgba(0,0,0,0.6);
        border-color: #f55;
    }
}

.ob-key.pressed {
    transform: scale(0.9);
    background: rgba(0, 120, 0, 0.9);
    border-color: #0e0;
    color: #0f0;
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.5);
    animation: none;
}

.ob-key-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    letter-spacing: 1px;
}

/* ============================================
   MOUSE WIDGET (larger)
   ============================================ */
.ob-mouse {
    width: 64px;
    height: 96px;
    position: relative;
    margin-bottom: 5px;
}

.ob-mouse-body {
    width: 64px;
    height: 96px;
    border: 3px solid #555;
    border-radius: 28px;
    background: rgba(15, 15, 15, 0.9);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

/* Divider line */
.ob-mouse-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 44px;
    background: #555;
}

/* Mouse horizontal split */
.ob-mouse-split {
    position: absolute;
    top: 44px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #555;
}

/* LMB area */
.ob-mouse-lmb {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 44px;
    border-radius: 28px 0 0 0;
    transition: all 0.3s ease;
}

.ob-mouse-lmb.active {
    background: rgba(200, 0, 0, 0.5);
    animation: ob-lmb-pulse 1.2s ease-in-out infinite;
}

@keyframes ob-lmb-pulse {
    0%, 100% { background: rgba(200, 0, 0, 0.3); }
    50% { background: rgba(255, 0, 0, 0.6); }
}

.ob-mouse-lmb.pressed {
    background: rgba(0, 200, 0, 0.5);
    animation: none;
}

/* Scroll wheel */
.ob-mouse-wheel {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 18px;
    border: 2px solid #666;
    border-radius: 5px;
    z-index: 1;
}

.ob-mouse-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    letter-spacing: 1px;
}

/* ============================================
   WORLD-SPACE INDICATORS (thicker, white+red)
   ============================================ */
.ob-indicator {
    position: fixed;
    pointer-events: none;
    z-index: 49;
}

/* Target ring on bot head / weapon — big, thick, white outline + red */
.ob-target-ring {
    width: 80px;
    height: 80px;
    border: 5px solid #ff2222;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: ob-ring-pulse 1s ease-in-out infinite;
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: -1px;
}

.ob-target-ring.green {
    border-color: #00dd00;
    outline-color: rgba(255, 255, 255, 0.8);
    animation: ob-ring-pulse-green 1s ease-in-out infinite;
}

@keyframes ob-ring-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.5), inset 0 0 15px rgba(255, 0, 0, 0.2);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0.85;
        box-shadow: 0 0 40px rgba(255, 0, 0, 0.7), inset 0 0 25px rgba(255, 0, 0, 0.3);
    }
}

@keyframes ob-ring-pulse-green {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.5), inset 0 0 15px rgba(0, 255, 0, 0.2);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0.85;
        box-shadow: 0 0 40px rgba(0, 255, 0, 0.7), inset 0 0 25px rgba(0, 255, 0, 0.3);
    }
}

/* Crosshair lines — thicker with white stroke */
.ob-target-ring::before,
.ob-target-ring::after {
    content: '';
    position: absolute;
}

.ob-target-ring::before {
    top: 50%; left: -14px; right: -14px; height: 4px;
    background: #ff2222;
    transform: translateY(-50%);
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}
.ob-target-ring::after {
    left: 50%; top: -14px; bottom: -14px; width: 4px;
    background: #ff2222;
    transform: translateX(-50%);
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}
.ob-target-ring.green::before { background: #00dd00; }
.ob-target-ring.green::after { background: #00dd00; }

/* Target label — bigger, bolder */
.ob-target-label {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 15px;
    font-weight: 900;
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.6), -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    white-space: nowrap;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.ob-target-label.green {
    color: #44ff44;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.6), -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* Offscreen arrow — much bigger & bolder */
.ob-offscreen-arrow {
    position: fixed;
    width: 0; height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 30px solid #ff2222;
    filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 12px rgba(255, 0, 0, 0.7));
    z-index: 49;
    animation: ob-arrow-bounce 0.8s ease-in-out infinite;
}

.ob-offscreen-arrow.green {
    border-bottom-color: #00dd00;
    filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 12px rgba(0, 255, 0, 0.7));
}

@keyframes ob-arrow-bounce {
    0%, 100% { transform: rotate(var(--arrow-rot, 0deg)) translateY(0); }
    50% { transform: rotate(var(--arrow-rot, 0deg)) translateY(-8px); }
}

/* Claim hint "or" separator */
.ob-claim-or {
    font-size: 16px;
    font-weight: 700;
    color: #666;
    display: flex;
    align-items: center;
    padding: 0 8px;
    text-transform: lowercase;
}

/* ============================================
   MISSION DIRECTIONAL ARROW (from ob-group to mission panel)
   ============================================ */
.ob-mission-arrow {
    position: fixed;
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        #ff2222 0px, #ff2222 10px,
        transparent 10px, transparent 16px
    );
    transform-origin: 0 50%;
    z-index: 50;
    pointer-events: none;
    border-radius: 3px;
    filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.5));
    animation: ob-mission-arrow-pulse 1.5s ease-in-out infinite;
}

/* Arrowhead triangle at the end */
.ob-mission-arrow::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-left: 20px solid #ff2222;
    filter: drop-shadow(2px 0 6px rgba(255, 0, 0, 0.7));
}

.ob-mission-arrow.green {
    background: repeating-linear-gradient(
        90deg,
        #00dd00 0px, #00dd00 10px,
        transparent 10px, transparent 16px
    );
    filter: drop-shadow(0 0 6px rgba(0, 255, 0, 0.5));
}

.ob-mission-arrow.green::after {
    border-left-color: #00dd00;
    filter: drop-shadow(2px 0 6px rgba(0, 255, 0, 0.7));
}

@keyframes ob-mission-arrow-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ============================================
   ANIMATED CHECKMARK (step complete)
   ============================================ */
.ob-checkmark-container {
    position: absolute;
    top: 28%;
    left: 52%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 55;
    animation: ob-check-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ob-check-pop {
    0% { transform: translate(-50%, -50%) scale(0); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.ob-checkmark-container.fadeout {
    animation: ob-check-fade 0.4s ease-in forwards;
}

@keyframes ob-check-fade {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; }
}

.ob-checkmark-svg {
    width: 100px;
    height: 100px;
}

.ob-checkmark-circle {
    fill: none;
    stroke: #0c0;
    stroke-width: 3;
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    animation: ob-circle-draw 0.4s ease forwards;
    filter: drop-shadow(0 0 12px rgba(0, 255, 0, 0.6));
}

@keyframes ob-circle-draw {
    0% { stroke-dashoffset: 220; }
    100% { stroke-dashoffset: 0; }
}

.ob-checkmark-check {
    fill: none;
    stroke: #0f0;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: ob-check-draw 0.3s ease forwards 0.35s;
    filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.7));
}

@keyframes ob-check-draw {
    0% { stroke-dashoffset: 50; }
    100% { stroke-dashoffset: 0; }
}

/* ============================================
   FINAL "YOU'RE READY" 
   ============================================ */
.ob-ready {
    position: absolute;
    top: 28%;
    left: 52%;
    transform: translate(-50%, -50%);
    text-align: center;
    animation: ob-ready-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.ob-ready-text {
    font-size: 48px;
    font-weight: 900;
    color: #0f0;
    text-transform: uppercase;
    letter-spacing: 8px;
    text-shadow: 0 0 25px rgba(0, 255, 0, 0.7), 0 0 50px rgba(0, 255, 0, 0.3), 3px 3px 6px #000;
}

@keyframes ob-ready-in {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    60% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.ob-ready.fadeout {
    animation: ob-ready-out 1s ease-in forwards;
}

@keyframes ob-ready-out {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* ============================================
   MOBILE: HIDE ONBOARDING
   ============================================ */
@media screen and (max-width: 900px) and (pointer: coarse) {
    #onboarding-overlay {
        display: none !important;
    }
}
