/* ======================
   FEATURE OVERLAY (orientation, color, paint)
   ====================== */
.feature-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg-heavy);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    z-index: var(--z-overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-medium) ease;
}

.feature-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.feature-overlay-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

/* Color overlay — viewfinder box, no dimming (same as QR scanner) */
.color-overlay {
    background: transparent;
}

.color-overlay-content {
    position: fixed;
    top: calc(var(--title-y) + 4rem);
    left: 50%;
    transform: translateX(-50%);
    width: 70vw;
    max-width: 320px;
    aspect-ratio: 1;
}

#colorCanvas {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    border: 2px solid var(--warm-grey);
    box-shadow: 0 0 0 4px rgba(0,0,0,0.3), 0 4px 20px rgba(0,0,0,0.4);
}

#colorVideo {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.color-timer {
    position: fixed;
    top: calc(var(--title-y) + 1.5rem);
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-subheading);
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: var(--ls-body);
    margin: 0;
}

.color-release-btn {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cormorant', Georgia, serif;
    font-size: var(--text-button);
    letter-spacing: var(--ls-button);
    text-transform: lowercase;
    background: none;
    border: 1px solid var(--accent);
    color: var(--text-muted);
    padding: var(--space-xs) var(--space-lg);
    cursor: pointer;
    transition: all var(--duration-normal) ease;
    -webkit-tap-highlight-color: transparent;
}

.feature-timer {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: var(--ls-button);
    color: var(--text-primary);
}

.feature-hint {
    font-size: var(--text-body);
    color: var(--text-primary);
    letter-spacing: var(--ls-body);
}

/* Lasso vowel display — big letter with crossfade morphing */
.lasso-vowel-display {
    position: relative;
    width: 1em;
    height: 1.1em;
    font-family: 'Cormorant', Georgia, serif;
    font-size: 8rem;
    font-weight: 300;
    line-height: 1;
    color: var(--text-primary);
    letter-spacing: var(--ls-heading);
}

.lasso-vowel {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.08s linear;
}

.lasso-vowel-next {
    opacity: 0;
}

/* Virtual phone — 3D tilt control for desktop (no gyroscope) */
.virtual-phone-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 280px;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    z-index: calc(var(--z-overlay) + 1);
}

.virtual-phone-container:active {
    cursor: grabbing;
}

.virtual-phone-scene {
    width: 100%;
    height: 100%;
    perspective: 600px;
}

.virtual-phone {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.05s linear;
    border-radius: 24px;
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
}

.virtual-phone-screen {
    position: absolute;
    inset: 8px;
    border-radius: 18px;
    background: linear-gradient(180deg,
        rgba(80, 70, 60, 0.3) 0%,
        rgba(40, 35, 30, 0.5) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.virtual-phone-notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.6);
}

/* Paint overlay — semi-opaque backdrop with modal card */
.paint-overlay {
    background: var(--overlay-bg);
}

.paint-overlay-content {
    position: relative;
    width: calc(100% - 3rem);
    max-width: 400px;
    height: calc(100% - 6rem);
    max-height: 600px;
    background: var(--warm-white);
    border: 1px solid var(--warm-grey);
    border-radius: var(--radius-md);
    overflow: hidden;
}

#paintCanvas {
    position: absolute;
    inset: 0;
    touch-action: none;
}


.paint-timer {
    font-size: var(--text-subheading);
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: var(--ls-body);
    margin: 0;
}

.paint-close-btn {
    position: absolute;
    bottom: var(--space-sm);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-content);
    font-family: 'Cormorant', Georgia, serif;
    font-size: var(--text-button);
    letter-spacing: var(--ls-button);
    text-transform: lowercase;
    background: none;
    border: 1px solid var(--accent);
    color: var(--text-muted);
    padding: var(--space-xs) var(--space-lg);
    cursor: pointer;
    transition: all var(--duration-normal) ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .paint-close-btn:hover {
        background: var(--accent);
        color: var(--warm-white);
    }
}

/* Paint square bubble — slightly smaller, no glass effect */
.feature-bubble.paint-square {
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(0, 0, 0, 0.45);
    width: 62px !important;
    height: 68px !important;
    position: absolute;
    overflow: hidden;
}

.feature-bubble.paint-square canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.feature-bubble.paint-square::before,
.feature-bubble.paint-square::after {
    display: none;
}

/* Glass shard collectibles — angular, colored, small */
.feature-bubble.glass-shard {
    width: 24px !important;
    height: 24px !important;
    padding: 10px !important;
    margin: -10px !important;
    background-clip: content-box;
    border-radius: 0;
    border: none;
    overflow: visible;
    background: linear-gradient(135deg,
        hsl(var(--shard-hue) 35% 72%) 0%,
        hsl(var(--shard-hue) 40% 55%) 40%,
        hsl(var(--shard-hue) 45% 30%) 100%);
    transform: rotate(var(--shard-rotate, 0deg));
}
.feature-bubble.glass-shard::before,
.feature-bubble.glass-shard::after {
    display: none;
}
.feature-bubble.glass-shard:active,
.feature-bubble.glass-shard.claiming {
    background: linear-gradient(135deg,
        hsl(var(--shard-hue) 35% 72%) 0%,
        hsl(var(--shard-hue) 40% 55%) 40%,
        hsl(var(--shard-hue) 45% 30%) 100%);
    filter: none;
    opacity: 1;
}
.shard-shape-0 { clip-path: polygon(15% 0%, 90% 10%, 100% 75%, 40% 100%, 0% 60%); }
.shard-shape-1 { clip-path: polygon(25% 0%, 100% 20%, 85% 95%, 10% 100%, 0% 35%); }
.shard-shape-2 { clip-path: polygon(10% 5%, 80% 0%, 100% 55%, 70% 100%, 0% 80%); }
.shard-shape-3 { clip-path: polygon(5% 15%, 95% 0%, 100% 70%, 50% 100%, 0% 90%); }

.shard-fragment {
    position: absolute;
    width: 10px;
    height: 10px;
    pointer-events: none;
    background: linear-gradient(135deg,
        hsl(var(--shard-hue) 35% 72%) 0%,
        hsl(var(--shard-hue) 40% 55%) 40%,
        hsl(var(--shard-hue) 45% 30%) 100%);
}

/* Watercolor palette — shown during active painting */
.paint-palette {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    background: rgba(30, 28, 26, 0.85);
    border: 1px solid rgba(60, 55, 50, 0.6);
    border-radius: var(--radius-md);
    z-index: var(--z-palette);
}

.paint-palette.visible {
    display: flex;
}

.paint-swatch {
    width: 36px;
    height: 18px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.paint-swatch.active {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 1px;
}

.paint-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 2px 0;
}

.paint-thickness-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.paint-thickness-btn.active {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 1px;
}

.paint-thickness-dot {
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.85);
}
