*, h1 {
    margin: 0
}

body, h1, input {
    color: #fff
}

.card-face, .wrapped-bg, body {
    overflow: hidden
}

.rarity-common, :root {
    --accent: #a1a1aa;
    --glow: rgba(161, 161, 170, 0.1)
}

.error-msg, .loading-text, .stat-val, .username, h1 {
    font-weight: 700
}

.archetype-title, .rarity-pill, .stat-lbl, .subtitle {
    text-transform: uppercase
}

.actions, .bg-pattern, .card-face::after, .noise-overlay, .ui-layer.fade {
    pointer-events: none
}

:root {
    --bg-dark: #050505;
    --font-head: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --neon-green: #1ed760;
    --neon-pink: #d946ef;
    --neon-blue: #29339b
}

* {
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased
}

body {
    background-color: var(--bg-dark);
    font-family: var(--font-body);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center
}

.subtitle, h1, input {
    font-family: var(--font-head)
}

.card-face, .ui-layer {
    flex-direction: column
}

.wrapped-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: #080808
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .6;
    animation: 10s ease-in-out infinite alternate float
}

.blob-1 {
    width: 70vw;
    height: 70vw;
    background: var(--neon-blue);
    top: -20%;
    left: -20%;
    animation-duration: 12s
}

.blob-2 {
    width: 60vw;
    height: 60vw;
    background: var(--neon-pink);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s
}

.blob-3 {
    width: 40vw;
    height: 40vw;
    background: var(--neon-green);
    top: 40%;
    left: 40%;
    opacity: .4;
    animation-duration: 15s;
    mix-blend-mode: screen
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1)
    }

    100% {
        transform: translate(20px, 40px) scale(1.1)
    }
}

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    opacity: .07;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")
}

.card, .input-group, .input-wrapper, .ui-layer {
    position: relative
}

.ui-layer {
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .5s cubic-bezier(.7, 0, .3, 1)
}

.ui-layer.fade {
    opacity: 0;
    transform: scale(1.1);
    filter: blur(10px)
}

.hero-container {
    margin-bottom: 3rem;
    text-align: center
}

.modal-box h3 {
    margin-bottom: 20px
}

h1 {
    font-size: clamp(4rem, 12vw, 10rem);
    line-height: .85;
    letter-spacing: -.06em;
    text-shadow: 0 0 30px rgba(255, 255, 255, .2)
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    margin-top: 1rem;
    letter-spacing: .05em;
    opacity: .7
}

.input-wrapper {
    width: 100%;
    max-width: 450px;
    padding: 0 20px
}

.input-group {
    width: 100%;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .1);
    padding: 8px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, .3);
    backdrop-filter: blur(20px);
    transition: .3s
}

.input-group:focus-within {
    border-color: rgba(255, 255, 255, .8);
    box-shadow: 0 0 30px rgba(255, 255, 255, .2);
    transform: scale(1.02);
    background: rgba(255, 255, 255, .15)
}

input {
    flex: 1;
    background: 0 0;
    border: none;
    padding: 0 16px;
    font-weight: 500;
    font-size: 1.2rem;
    outline: 0;
    height: 50px;
    letter-spacing: -.02em
}

input::placeholder {
    color: rgba(255, 255, 255, .4)
}

.btn-search {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: none;
    background: #fff;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s cubic-bezier(.175, .885, .32, 1.275)
}

.btn-search:hover {
    transform: scale(1.1) rotate(-5deg);
    background: var(--neon-green)
}

.actions.show, .modal-overlay.active .modal-box {
    transform: translateY(0)
}

.error-msg {
    color: #ff4d4d;
    margin-top: 15px;
    background: rgba(0, 0, 0, .5);
    padding: 5px 12px;
    border-radius: 100px;
    font-size: .85rem;
    display: none
}

.card, .card-face {
    border-radius: 24px
}

.loading-text, .modal-box h3 {
    font-family: var(--font-head);
    font-size: 1.5rem
}

.loader-container {
    display: none;
    text-align: center;
    z-index: 50
}

.spinner {
    animation: rotate 2s linear infinite;
    z-index: 2;
    width: 60px;
    height: 60px;
    margin: 0 auto 20px auto;
}

.path {
    stroke: var(--neon-blue);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite, colors 4.5s ease-in-out infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

@keyframes colors {
    0% { stroke: var(--neon-blue); }
    33% { stroke: var(--neon-pink); }
    66% { stroke: var(--neon-green); }
    100% { stroke: var(--neon-blue); }
}

.loading-text {
    letter-spacing: .1em;
    animation: 1s infinite flash
}

@keyframes flash {

    0%,     100% {
        opacity: 1
    }

    50% {
        opacity: .5
    }
}

.scene {
    perspective: 1200px;
    display: none;
    z-index: 30
}

.card {
    width: 340px;
    height: 520px;
    transform-style: preserve-3d;
    transition: transform .1s
}

.bg-pattern, .card-face, .card-face::after {
    position: absolute;
    inset: 0
}

.card-face {
    background: #111;
    display: flex;
    transition: .3s;
    transform: translateZ(0);
    border: 2px solid var(--accent);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .5), 0 0 20px var(--glow)
}

.bg-pattern {
    z-index: 0;
    width: 100%;
    height: 100%;
    opacity: .3
}

.card-face.rarity-common.arch-architect .bg-pattern {
    background-image: linear-gradient(#a1a1aa 1px, transparent 1px), linear-gradient(90deg, #a1a1aa 1px, transparent 1px);
    background-size: 40px 40px
}

.card-face.rarity-rare.arch-architect .bg-pattern {
    background-image: linear-gradient(#06b6d4 1px, transparent 1px), linear-gradient(90deg, #06b6d4 1px, transparent 1px);
    background-size: 40px 40px
}

.card-face.rarity-epic.arch-architect .bg-pattern {
    background-image: linear-gradient(#d946ef 1px, transparent 1px), linear-gradient(90deg, #d946ef 1px, transparent 1px);
    background-size: 40px 40px
}

.card-face.rarity-legendary.arch-architect .bg-pattern {
    background-image: linear-gradient(#eab308 1px, transparent 1px), linear-gradient(90deg, #eab308 1px, transparent 1px);
    background-size: 40px 40px
}

.card-face.rarity-common.arch-forge .bg-pattern {
    background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, #a1a1aa 10px, #a1a1aa 12px)
}

.card-face.rarity-rare.arch-forge .bg-pattern {
    background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, #06b6d4 10px, #06b6d4 12px)
}

.card-face.rarity-epic.arch-forge .bg-pattern {
    background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, #d946ef 10px, #d946ef 12px)
}

.card-face.rarity-legendary.arch-forge .bg-pattern {
    background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, #eab308 10px, #eab308 12px)
}

.card-face.rarity-common.arch-droidsmith .bg-pattern {
    background-image: radial-gradient(#a1a1aa 2px, transparent 2px);
    background-size: 20px 20px
}

.card-face.rarity-rare.arch-droidsmith .bg-pattern {
    background-image: radial-gradient(#06b6d4 2px, transparent 2px);
    background-size: 20px 20px
}

.card-face.rarity-epic.arch-droidsmith .bg-pattern {
    background-image: radial-gradient(#d946ef 2px, transparent 2px);
    background-size: 20px 20px
}

.card-face.rarity-legendary.arch-droidsmith .bg-pattern {
    background-image: radial-gradient(#eab308 2px, transparent 2px);
    background-size: 20px 20px
}

.card-face.rarity-common.arch-serpent .bg-pattern {
    background-image: linear-gradient(135deg, #a1a1aa 25%, transparent 25%), linear-gradient(225deg, #a1a1aa 25%, transparent 25%), linear-gradient(45deg, #a1a1aa 25%, transparent 25%), linear-gradient(315deg, #a1a1aa 25%, transparent 25%);
    background-position: 10px 0, 10px 0, 0 0, 0 0;
    background-size: 20px 20px
}

.card-face.rarity-rare.arch-serpent .bg-pattern {
    background-image: linear-gradient(135deg, #06b6d4 25%, transparent 25%), linear-gradient(225deg, #06b6d4 25%, transparent 25%), linear-gradient(45deg, #06b6d4 25%, transparent 25%), linear-gradient(315deg, #06b6d4 25%, transparent 25%);
    background-position: 10px 0, 10px 0, 0 0, 0 0;
    background-size: 20px 20px
}

.card-face.rarity-epic.arch-serpent .bg-pattern {
    background-image: linear-gradient(135deg, #d946ef 25%, transparent 25%), linear-gradient(225deg, #d946ef 25%, transparent 25%), linear-gradient(45deg, #d946ef 25%, transparent 25%), linear-gradient(315deg, #d946ef 25%, transparent 25%);
    background-position: 10px 0, 10px 0, 0 0, 0 0;
    background-size: 20px 20px
}

.card-face.rarity-legendary.arch-serpent .bg-pattern {
    background-image: linear-gradient(135deg, #eab308 25%, transparent 25%), linear-gradient(225deg, #eab308 25%, transparent 25%), linear-gradient(45deg, #eab308 25%, transparent 25%), linear-gradient(315deg, #eab308 25%, transparent 25%);
    background-position: 10px 0, 10px 0, 0 0, 0 0;
    background-size: 20px 20px
}

.card-face.rarity-common.arch-void .bg-pattern {
    background-image: radial-gradient(circle at center, transparent 0, #a1a1aa 130%)
}

.card-face.rarity-rare.arch-void .bg-pattern {
    background-image: radial-gradient(circle at center, transparent 0, #06b6d4 130%)
}

.card-face.rarity-epic.arch-void .bg-pattern {
    background-image: radial-gradient(circle at center, transparent 0, #d946ef 130%)
}

.card-face.rarity-legendary.arch-void .bg-pattern {
    background-image: radial-gradient(circle at center, transparent 0, #eab308 130%)
}

.card-face.rarity-common.arch-diplomat .bg-pattern {
    background-image: linear-gradient(45deg, #a1a1aa 25%, transparent 25%, transparent 75%, #a1a1aa 75%), linear-gradient(45deg, #a1a1aa 25%, transparent 25%, transparent 75%, #a1a1aa 75%);
    background-position: 0 0, 20px 20px;
    background-size: 40px 40px
}

.card-face.rarity-rare.arch-diplomat .bg-pattern {
    background-image: linear-gradient(45deg, #06b6d4 25%, transparent 25%, transparent 75%, #06b6d4 75%), linear-gradient(45deg, #06b6d4 25%, transparent 25%, transparent 75%, #06b6d4 75%);
    background-position: 0 0, 20px 20px;
    background-size: 40px 40px
}

.card-face.rarity-epic.arch-diplomat .bg-pattern {
    background-image: linear-gradient(45deg, #d946ef 25%, transparent 25%, transparent 75%, #d946ef 75%), linear-gradient(45deg, #d946ef 25%, transparent 25%, transparent 75%, #d946ef 75%);
    background-position: 0 0, 20px 20px;
    background-size: 40px 40px
}

.card-face.rarity-legendary.arch-diplomat .bg-pattern {
    background-image: linear-gradient(45deg, #eab308 25%, transparent 25%, transparent 75%, #eab308 75%), linear-gradient(45deg, #eab308 25%, transparent 25%, transparent 75%, #eab308 75%);
    background-position: 0 0, 20px 20px;
    background-size: 40px 40px
}

.card-face::after {
    content: '';
    z-index: 1;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .2) 0, rgba(0, 0, 0, .8) 100%)
}

.rarity-rare {
    --accent: #06b6d4;
    --glow: rgba(6, 182, 212, 0.3)
}

.rarity-epic {
    --accent: #d946ef;
    --glow: rgba(217, 70, 239, 0.4)
}

.rarity-legendary {
    --accent: #eab308;
    --glow: rgba(234, 179, 8, 0.6);
    animation: 3s ease-in-out infinite breathe
}

@keyframes breathe {

    0%,     100% {
        box-shadow: 0 0 30px var(--glow)
    }

    50% {
        box-shadow: 0 0 60px var(--glow)
    }
}

.card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center
}

.header-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px
}

.rarity-pill {
    font-size: .6rem;
    letter-spacing: .2em;
    padding: 6px 12px;
    border-radius: 100px;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, .1);
    font-family: var(--font-head);
    color: var(--accent);
    border-color: var(--accent)
}

.avatar-frame {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .05));
    margin-bottom: 24px;
    position: relative
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(20%) contrast(1.1)
}

.user-info {
    text-align: center;
    margin-bottom: auto
}

.username {
    font-family: var(--font-head);
    font-size: 1.8rem;
    margin-bottom: 4px
}

.archetype-title {
    font-size: .8rem;
    letter-spacing: .15em;
    opacity: .8;
    color: var(--accent-color, #fff);
    margin-bottom: 8px
}

.archetype-icon {
    opacity: .7
}

.stats-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    background: rgba(0, 0, 0, .4);
    border-radius: 16px;
    padding: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .5);
    border-color: var(--accent)
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px
}

.stat-val {
    font-family: var(--font-head);
    font-size: 1rem
}

.stat-lbl {
    font-size: .6rem;
    opacity: .5
}

.footer {
    margin-top: 24px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: .65rem;
    opacity: .3;
    font-family: var(--font-head)
}

.btn-action, .modal-overlay {
    backdrop-filter: blur(10px);
    align-items: center
}

.actions, .modal-overlay {
    position: fixed;
    opacity: 0
}

.btn-action, .btn-modal-action {
    font-family: var(--font-body);
    cursor: pointer
}

.actions {
    bottom: 30px;
    display: flex;
    gap: 12px;
    transform: translateY(10px);
    transition: .5s;
    z-index: 40
}

.actions.show {
    opacity: 1;
    pointer-events: auto
}

.btn-action {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #fff;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: .8rem;
    transition: .2s;
    display: flex;
    gap: 8px;
    font-weight: 600
}

.btn-action:hover {
    background: #fff;
    color: #000;
    transform: scale(1.05)
}

.btn-linkedin {
    background: #0077b5;
    border-color: #0077b5;
    color: #fff
}

.btn-linkedin:hover {
    background: #005e93
}

.modal-overlay {
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 999;
    display: none;
    justify-content: center;
    transition: opacity .3s
}

.modal-overlay.active {
    opacity: 1
}

.modal-box {
    background: #111;
    border: 1px solid #333;
    padding: 30px;
    border-radius: 24px;
    max-width: 350px;
    text-align: center;
    transform: translateY(20px);
    transition: .3s;
    box-shadow: 0 20px 50px #000
}

.step-list {
    text-align: left;
    background: #1a1a1a;
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 15px
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: .9rem;
    color: #ccc
}

.step-item:last-child {
    margin-bottom: 0
}

.modal-hint {
    font-size: .75rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.4
}

.btn-modal-action {
    width: 100%;
    padding: 14px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    margin-bottom: 10px
}

.btn-modal-close {
    background: 0 0;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: .8rem
}

@media screen and (max-width:600px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding: 40px 20px
    }

    .ui-layer {
        margin-top: 15vh;
        width: 100%
    }

    .scene {
        display: none;
        width: 100%;
        justify-content: center;
        perspective: 1000px;
        margin-top: 40px;
        transform: scale(.95);
        transform-origin: top center;
        margin-bottom: 100px
    }

    .actions,     .card {
        transform: none !important
    }

    .scene[style*=block] {
        display: flex !important;
        height: auto
    }

    .card {
        margin: 0 auto;
        transition: none !important
    }

    .actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 20px;
        background: linear-gradient(to top, #000, transparent);
        margin-top: 0;
        display: flex;
        flex-direction: row;
        justify-content: center;
        width: 100%;
        gap: 10px;
        opacity: 0;
        z-index: 100
    }

    .actions.show {
        opacity: 1
    }

    .btn-action {
        flex: 1;
        justify-content: center;
        height: 50px;
        font-size: .7rem;
        padding: 0
    }

    h1 {
        font-size: 15vw
    }
}

.caption-area {
    width: 100%;
    height: 100px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    color: #a1a1aa;
    font-family: 'Space Grotesk', monospace;
    font-size: .75rem;
    padding: 12px;
    margin-bottom: 15px;
    resize: none;
    outline: 0;
    transition: .2s
}

.caption-area:focus {
    border-color: rgba(255, 255, 255, .4);
    color: #fff;
    background: rgba(255, 255, 255, .1)
}