* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent: rgba(150, 170, 220, 1);
    --accent-dim: rgba(150, 170, 220, 0.3);
}

body {
    background: #000;
    color: #fff;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    cursor: crosshair;
    -webkit-font-smoothing: antialiased;
}

/* ── Canvas ── */

#canvas-container {
    position: fixed;
    inset: 0;
    z-index: 1;
}

#canvas-container canvas {
    display: block;
}

/* ── Loading ── */

#loading {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 1.2s ease, visibility 1.2s ease;
}

#loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-text {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    letter-spacing: 1.2em;
    text-indent: 1.2em;
    color: #fff;
    animation: loadPulse 2s ease-in-out infinite;
}

@keyframes loadPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* ── UI Overlay ── */

#ui-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 40px 24px;
}

/* ── Header ── */

.header {
    text-align: center;
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeSlideDown 1.5s ease 2.2s forwards;
}

.logo-wrap {
    display: inline-block;
    line-height: 1;
}

.logo {
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 300;
    letter-spacing: 0.7em;
    text-indent: 0.7em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 60px var(--accent-dim);
}

.logo-reflection {
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 300;
    letter-spacing: 0.7em;
    text-indent: 0.7em;
    color: rgba(255, 255, 255, 0.12);
    transform: scaleY(-1);
    margin-top: -8px;
    -webkit-mask-image: linear-gradient(to top, transparent 10%, rgba(0,0,0,0.6) 100%);
    mask-image: linear-gradient(to top, transparent 10%, rgba(0,0,0,0.6) 100%);
    user-select: none;
}

.tagline {
    font-size: clamp(0.65rem, 1.5vw, 0.85rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 10px;
    letter-spacing: 0.18em;
}

/* ── Fortune ── */

.fortune {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 300;
    color: rgba(200, 210, 240, 0);
    text-align: center;
    max-width: 480px;
    transform: translateY(10px) scale(0.97);
    transition: color 0.8s ease, transform 0.8s ease;
    text-shadow: 0 0 40px var(--accent-dim);
    letter-spacing: 0.04em;
    line-height: 1.7;
    white-space: pre-line;
}

.fortune.visible {
    color: rgba(200, 210, 240, 0.9);
    transform: translateY(0) scale(1);
}

/* ── Footer ── */

.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    opacity: 0;
    animation: fadeIn 1.5s ease 2.8s forwards;
}

.cam-btn {
    pointer-events: all;
    position: relative;
    background: rgba(150, 170, 220, 0.03);
    border: 1px solid rgba(150, 170, 220, 0.12);
    color: rgba(200, 210, 240, 0.55);
    padding: 11px 30px 11px 26px;
    border-radius: 100px;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.4s ease;
    outline: none;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cam-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(150, 170, 220, 0.1), transparent);
    animation: btnShimmer 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes btnShimmer {
    0%, 100% { left: -60%; opacity: 0; }
    10% { opacity: 1; }
    50% { left: 100%; opacity: 1; }
    60%, 100% { opacity: 0; }
}

.cam-btn:hover {
    border-color: rgba(150, 170, 220, 0.35);
    color: rgba(200, 210, 240, 0.95);
    background: rgba(150, 170, 220, 0.06);
    box-shadow: 0 0 30px rgba(150, 170, 220, 0.1), inset 0 0 20px rgba(150, 170, 220, 0.03);
}

.cam-btn.active {
    border-color: rgba(150, 170, 220, 0.45);
    color: rgba(200, 210, 240, 1);
    background: rgba(150, 170, 220, 0.06);
    box-shadow: 0 0 40px rgba(150, 170, 220, 0.15), inset 0 0 25px rgba(150, 170, 220, 0.04);
}

.cam-icon {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    flex-shrink: 0;
    animation: iconPulse 3s ease-in-out infinite;
}

.cam-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.cam-btn.active .cam-icon {
    border-color: rgba(150, 170, 220, 0.9);
    box-shadow: 0 0 8px rgba(150, 170, 220, 0.4);
    animation: iconPulseActive 2s ease-in-out infinite;
}

.cam-btn.active .cam-dot {
    background: rgba(150, 170, 220, 1);
    box-shadow: 0 0 6px rgba(150, 170, 220, 0.6);
}

@keyframes iconPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes iconPulseActive {
    0%, 100% { opacity: 0.8; box-shadow: 0 0 6px rgba(150, 170, 220, 0.3); }
    50% { opacity: 1; box-shadow: 0 0 12px rgba(150, 170, 220, 0.6); }
}

.cam-label {
    position: relative;
}

.token-info {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.08em;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.ca {
    pointer-events: all;
    cursor: pointer;
    transition: color 0.3s ease;
}

.ca:hover {
    color: rgba(150, 170, 220, 0.6);
}

.ca.copied {
    color: rgba(150, 170, 220, 0.8);
}

.hint {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.12);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    animation: hintPulse 3s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* ── Keyframes ── */

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes fadeSlideDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ── */

@media (max-width: 768px) {
    #ui-overlay {
        padding: 28px 16px;
    }
    .footer {
        gap: 10px;
    }
}

@media (max-height: 600px) {
    #ui-overlay {
        padding: 16px 16px;
    }
    .logo-reflection {
        display: none;
    }
}
