/* ===== LANDING SCREEN ===== */
.landing-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--grey-900);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s var(--ease-power);
    overflow: hidden;
}

.landing-screen.connected {
    opacity: 0;
    pointer-events: none;
}

.landing-bg-grid {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
    background-size: 80px 80px;
}

.landing-title {
    font-size: clamp(1.6rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -1.5px;
    color: var(--white);
    margin-bottom: var(--space-3xl);
    text-align: center;
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-power) 0.3s forwards;
}

.landing-title span {
    background: linear-gradient(135deg, var(--blue-400), var(--blue-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-instruction {
    position: absolute;
    bottom: 50px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    opacity: 0;
    animation: fadeIn 1s var(--ease-smooth) 1.2s forwards;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    letter-spacing: 0.3px;
}

.landing-instruction .hint-arrows {
    display: flex;
    gap: 2px;
    animation: float 2s ease-in-out infinite;
}

.landing-instruction .hint-arrows span {
    opacity: 0.6;
}

/* ===== PLUG CONNECTION AREA ===== */
.plug-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    position: relative;
    height: 200px;
    opacity: 0;
    animation: fadeIn 0.8s var(--ease-power) 0.6s forwards;
}

/* ===== SHARED PLUG STYLES ===== */
.plug-connector {
    position: relative;
    user-select: none;
    touch-action: none;
}

/* ===== MALE PLUG (RIGHT SIDE — draggable) ===== */
.plug-male {
    cursor: grab;
    z-index: 10;
    display: flex;
    align-items: center;
    flex-direction: row;
    transition: filter 0.3s;
}

.plug-male:active {
    cursor: grabbing;
}

.plug-male:hover {
    filter: drop-shadow(0 0 12px rgba(0, 82, 204, 0.35));
}

/* Cable coming from right */
.cable {
    width: 120px;
    height: 14px;
    border-radius: 7px;
    position: relative;
    overflow: hidden;
}

.cable-male {
    background: linear-gradient(180deg, #3a3a3a 0%, #222 40%, #2a2a2a 100%);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(0,0,0,0.3);
}

.cable::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    border-radius: 3px;
}

/* Male plug head */
.plug-head-male {
    width: 56px;
    height: 52px;
    background: linear-gradient(145deg, #555 0%, #333 50%, #444 100%);
    border-radius: 8px 4px 4px 8px;
    position: relative;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        inset 0 -1px 0 rgba(0,0,0,0.3),
        2px 0 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 2px;
}

.plug-head-male::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 6px;
    height: 35%;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 100%);
    border-radius: 5px 2px 0 0;
}

/* Prongs sticking out to the left */
.prongs-horizontal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    left: -24px;
}

.prong-h {
    width: 26px;
    height: 5px;
    background: linear-gradient(90deg, #aaa, #ccc, #aaa);
    border-radius: 1px 3px 3px 1px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.4),
        0 1px 2px rgba(0,0,0,0.3);
}

/* ===== FEMALE PLUG (LEFT SIDE — target) ===== */
.plug-female {
    z-index: 5;
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
}

.cable-female {
    background: linear-gradient(180deg, #3a3a3a 0%, #222 40%, #2a2a2a 100%);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(0,0,0,0.3);
}

.plug-head-female {
    width: 56px;
    height: 52px;
    background: linear-gradient(145deg, #555 0%, #333 50%, #444 100%);
    border-radius: 4px 8px 8px 4px;
    position: relative;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        inset 0 -1px 0 rgba(0,0,0,0.3),
        -2px 0 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    transition: var(--transition-med);
}

.plug-head-female::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    right: 3px;
    height: 35%;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 100%);
    border-radius: 2px 5px 0 0;
}

/* Socket holes on the right face */
.socket-holes-h {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    right: -2px;
}

.socket-slot {
    width: 10px;
    height: 6px;
    background: #111;
    border-radius: 2px;
    border: 1px solid #2a2a2a;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.8);
    transition: var(--transition-fast);
}

/* Near state */
.plug-head-female.near {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        inset 0 -1px 0 rgba(0,0,0,0.3),
        -2px 0 8px rgba(0,0,0,0.3),
        0 0 20px rgba(0, 82, 204, 0.4);
}

.plug-head-female.near .socket-slot {
    box-shadow:
        inset 0 1px 3px rgba(0,0,0,0.8),
        0 0 6px rgba(0, 82, 204, 0.5);
    border-color: rgba(0, 82, 204, 0.4);
}

/* ===== SPARK CANVAS ===== */
.spark-canvas {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
}

/* ===== LIGHT PULSE ===== */
.light-pulse {
    position: fixed;
    z-index: 9997;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 82, 204, 0.5), transparent 70%);
    width: 0;
    height: 0;
    opacity: 0;
}

.light-pulse.active {
    animation: pulseExpand 1.2s var(--ease-power) forwards;
}

@keyframes pulseExpand {
    0% { width: 20px; height: 20px; opacity: 1; }
    100% { width: 300vmax; height: 300vmax; opacity: 0; }
}

/* ===== LOGO REVEAL ===== */
.landing-logo-reveal {
    position: absolute;
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: -2px;
    color: var(--white);
    opacity: 0;
    transform: scale(0.8);
    z-index: 10;
}

.landing-logo-reveal.powered {
    animation: logoPowerOn 0.6s var(--ease-power) forwards;
}

.landing-logo-reveal span {
    background: linear-gradient(135deg, var(--blue-400), var(--blue-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes logoPowerOn {
    0% { opacity: 0; transform: scale(0.8); filter: blur(8px); }
    50% { opacity: 1; filter: blur(0); }
    100% { opacity: 1; transform: scale(1); }
}

/* Skip */
.skip-landing {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
    background: none;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    z-index: 10;
    opacity: 0;
    animation: fadeIn 1s var(--ease-smooth) 2s forwards;
    letter-spacing: 0.3px;
}

.skip-landing:hover {
    color: rgba(255,255,255,0.7);
    border-color: rgba(255,255,255,0.3);
}

@media (max-width: 768px) {
    .plug-area {
        gap: 40px;
        transform: scale(0.7);
    }
}