/* Base Reset & Fonts */
* {
    box-sizing: border-box;
}

:root {
    --kreo-purple: #a578fd;
    --kreo-accent: #b99bf8;
    --kreo-black: #050505;
    /* Blacker black */
    --kreo-dark: #111111;
    --kreo-gray: #1f1f1f;
    --kreo-white: #ffffff;
    --text-muted: #888;
    --card-bg: #ececec;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--kreo-black);
    color: var(--kreo-white);
    font-family: 'Jost', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Alignment handled by containers */
}

/* GLOBAL UTILITIES */
.hidden {
    display: none !important;
}

.bold {
    font-weight: 700;
}

/* APP CONTAINER */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER */
header {
    padding: 0.8rem 0;
    /* Minimal padding */
    margin-bottom: 1rem;
    animation: fadeInDown 1s ease-out;
    background-image: linear-gradient(to bottom, rgba(5, 5, 5, 0.7), rgba(5, 5, 5, 1)), url('assets/hero-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid #222;
}

h1 {
    font-family: 'Jost', sans-serif;
    font-weight: 800;
    font-size: 1.8rem;
    /* Smaller */
    letter-spacing: -1px;
    margin: 0;
    text-transform: uppercase;
}


/* PAGE SECTIONS */

/* PAGE SECTIONS */
.page-section {
    width: 100%;
    animation: fadeIn 0.5s ease-out;
    padding-bottom: 50px;
}

.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    max-width: 600px;
    margin: 0 auto;
}

/* LANDING PAGE BLOCKS */
.info-blocks-container {
    margin: 4rem 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--kreo-accent);
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    text-align: left;
}

.info-block {
    background: var(--kreo-dark);
    padding: 2rem;
    border: 1px solid #333;
    border-radius: 12px;
    position: relative;
    transition: transform 0.3s, border-color 0.3s;
}

.info-block:hover {
    transform: translateY(-5px);
    border-color: var(--kreo-purple);
}

.block-num {
    font-size: 3rem;
    font-weight: 900;
    color: #222;
    position: absolute;
    top: 10px;
    right: 20px;
}

.info-block p {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #ddd;
    position: relative;
    z-index: 1;
    margin: 0;
}

.hero-actions {
    margin: 2rem 0;
}

.bottom-cta {
    margin-top: 4rem;
}

/* FORMS (Name & Contact) */
#page-name h2,
#page-contact h2 {
    font-size: 2rem;
    margin-bottom: 3rem;
    line-height: 1.4;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
    background: transparent;
    border: none;
    border-bottom: 2px solid #333;
    width: 100%;
    font-family: 'Jost', sans-serif;
    font-size: 1.5rem;
    color: var(--kreo-white);
    padding: 10px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

input:focus {
    border-color: var(--kreo-purple);
}

/* RULES */
.rules-content {
    text-align: left;
    max-width: 800px;
}

.rules-list {
    list-style: none;
    padding: 0;
    margin: 3rem 0;
}

.rules-list li {
    font-size: 1.2rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #222;
    color: #ccc;
}

.rules-list li strong {
    color: var(--kreo-accent);
}

/* BUTTONS */
.primary-btn {
    background: var(--kreo-purple);
    color: #fff;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 50px;
    /* Pill shape */
    transition: all 0.3s;
    margin-top: 2rem;
    font-family: 'Jost', sans-serif;
    letter-spacing: 1px;
}

.primary-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(165, 120, 253, 0.6);
}

.pulse-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(165, 120, 253, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(165, 120, 253, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(165, 120, 253, 0);
    }
}

.danger-btn {
    background: #ff3333;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    margin-top: 20px;
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    font-weight: bold;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.danger-btn:hover {
    opacity: 1;
}


/* KEYBOARD (Selection) */
/* Same logic as before, just ensuring it fits content */
.keyboard-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1rem;
}

.instruction-text {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    max-width: 90%;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.keyboard-container {
    position: relative;
    max-width: 900px;
    width: 100%;
}

.keyboard-image {
    width: 100%;
    display: block;
}

.keyboard-overlay {
    position: absolute;
    top: 4px;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 4.5% 3.2% 5% 3.2%;
    /* Aggressively squeezed to fix rightward drift */
}

.key-row {
    flex: 1;
    display: flex;
    margin-bottom: 0.5%;
}

.key-btn {
    margin: 0 0.2%;
    cursor: pointer;
    background: transparent;
    border-radius: 4px;
    transition: all .1s;
}

.key-btn:hover,
.key-btn.active-press {
    background: rgba(165, 120, 253, 0.5);
    box-shadow: 0 0 10px var(--kreo-purple);
}

.invisible-key {
    pointer-events: none;
}

.keyboard-locked {
    pointer-events: none;
    opacity: 0.5;
}


/* LOADER */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
}

.custom-loader {
    width: 120px;
    height: 120px;
    position: relative;
}

.loader-mask-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-mask-image: url('assets/loader.png');
    mask-image: url('assets/loader.png');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.layer-gray {
    background-color: #333;
}

/* ICONS & BLOCKS */
.block-icon {
    margin-bottom: 1rem;
    color: var(--kreo-purple);
}

.svg-icon {
    width: 50px;
    height: 50px;
}

.info-block h3 {
    margin: 10px 0;
    font-size: 1.2rem;
    color: #fff;
    text-transform: uppercase;
}

.highlight-text {
    font-size: 0.8rem;
    color: var(--kreo-purple);
    font-style: italic;
    display: block;
    margin-top: 5px;
}


/* CARD TEXT VISIBILITY FIX */
.card-text-block p {
    font-size: 0.95rem;
    color: #e0e0e0;
    /* Creating better contrast */
    margin: 8px 0;
    line-height: 1.4;
    text-transform: none;
    /* easier to read */
}

.card-text-block strong {
    color: var(--kreo-purple);
    text-transform: uppercase;
    font-size: 0.8rem;
    display: block;
    /* Stack labels */
    margin-bottom: 2px;
}


/* GIVEAWAY INSTRUCTIONS */
.giveaway-instructions {
    margin-top: 3rem;
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 12px;
    border: 1px dashed #444;
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.giveaway-instructions h3 {
    color: var(--kreo-accent);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.step-guide {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-num {
    background: var(--kreo-purple);
    color: #000;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    margin-bottom: 10px;
}

.step p {
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.4;
}

.fill-animation {
    background-color: #a578fd;
    width: 100%;
    height: 0%;
    /* Transitions handled by JS */
    position: absolute;
    bottom: 0;
}

.loader-percent {
    font-size: 2rem;
    font-weight: 800;
    color: var(--kreo-white);
    margin-top: 1rem;
}

.loader-text {
    color: var(--kreo-purple);
    letter-spacing: 2px;
}


/* TRUMP CARD DESIGN */
.result-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0;
    gap: 2rem;
}

@media (min-width: 900px) {
    .result-display {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 50px;
    }

    .result-left {
        flex: 0 0 auto;
    }

    .result-right {
        flex: 0 1 450px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        /* Left align actions on desktop? Or center? Let's keep center for now as inner items are centered */
        align-items: center;
    }
}

.trump-card {
    background: #000;
    /* Dark Card */
    border: 2px solid #333;
    border-radius: 16px;
    width: 420px;
    /* WIDER */
    /* overflow: hidden; */
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    text-align: left;
    font-family: 'Jost', sans-serif;
    /* Card gradient effect */
    background: linear-gradient(145deg, #111 0%, #0a0a0a 100%);
}

.card-header-row {
    background: var(--kreo-purple);
    color: #000;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 900;
    text-transform: uppercase;
}

.card-brand {
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.card-hp {
    font-size: 1.2rem;
}

.card-visual {
    width: 100%;
    height: 350px;
    /* Reduced */
    background: #fff;
    border-bottom: 2px solid var(--kreo-purple);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.card-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* PREVENTS STRETCHING */
}

.card-body {
    padding: 15px;
    /* Tight padding */
}


/* COPY CODE BLOCK */
.copy-code-container {
    margin-top: 1.5rem;
    text-align: center;
    width: 100%;
    max-width: 420px;
}

.copy-code-container p {
    color: #888;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.code-box-wrapper {
    display: flex;
    gap: 10px;
}

.code-box {
    background: #222;
    border: 1px dashed var(--kreo-purple);
    color: var(--kreo-white);
    padding: 12px;
    border-radius: 8px;
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    flex: 1;
    text-align: center;
    letter-spacing: 2px;
}

.copy-btn {
    background: var(--kreo-purple);
    border: none;
    color: black;
    font-weight: 900;
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    transition: transform 0.2s;
}

.copy-btn:hover {
    transform: scale(1.05);
}

.highlight-info {
    color: var(--kreo-accent) !important;
    font-size: 0.85rem !important;
    font-style: italic;
    margin-top: 8px !important;
}

/* User Name moves to top priority */
.card-user-name {
    color: var(--kreo-white);
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.1;
    text-shadow: 0 0 10px rgba(165, 120, 253, 0.3);
}

/* Archetype becomes subtitle */
.card-archetype {
    color: var(--kreo-purple);
    font-size: 1rem;
    font-weight: 700;
    margin: 2px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.card-uniqueness {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 25px;
    font-style: italic;
}

/* STATS BARS */
.card-stats-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: #ccc;
}

.stat-row>span:first-child {
    width: 100px;
    font-weight: 600;
}

.stat-bar-bg {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: var(--kreo-purple);
    width: 0%;
    /* JS sets this */
}

.stat-val {
    width: 25px;
    text-align: right;
    font-weight: bold;
    color: #fff;
}

.card-text-block p {
    font-size: 0.9rem;
    color: #bbb;
    margin: 5px 0;
    line-height: 1.4;
}

.card-text-block strong {
    color: var(--kreo-purple);
}

.card-footer {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid #333;
    padding-top: 15px;
}

.discount-badge {
    background: #222;
    border: 1px dashed var(--kreo-purple);
    color: var(--kreo-purple);
    padding: 5px 10px;
    font-weight: bold;
    font-size: 0.9rem;
}

.footer-tag {
    font-size: 0.7rem;
    color: #666;
}

.result-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.share-btn {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid var(--kreo-purple);
    background: transparent;
    color: var(--kreo-white);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Jost', sans-serif;
    transition: all 0.2s;
}

.share-btn:hover {
    background: var(--kreo-purple);
    color: #000;
}



.discord-btn {
    width: 100%;
    margin-top: 1.5rem;
    font-size: 1.1rem;
    background: #5865F2;
    /* Discord Blurple */
    color: white;
    font-weight: 800;
    /* Extra bold */
    border-radius: 12px;
    /* Match container roundedness */
    padding: 16px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
    display: flex;
    /* Centering text */
    justify-content: center;
    align-items: center;
    text-decoration: none;
    /* Ensure no underline */
}

.discord-btn:hover {
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.6);
    transform: translateY(-2px);
    background: #4752c4;
    /* Darker on hover */
    color: white;
    /* Force white text */
}

.download-btn {
    border-color: #fff;
}


/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .primary-btn {
        width: 100%;
        padding: 14px 0;
    }

    .trump-card {
        max-width: 300px;
        /* Specific max-width for mobile */
        margin: 0 auto;
        font-size: 0.9rem;
        /* Scale down text slightly */
    }

    .card-visual {
        height: 200px;
        /* Much shorter image area */
    }

    .card-user-name {
        font-size: 1.3rem;
        /* Smaller name */
    }

    .card-archetype {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }

    .rules-content {
        padding: 0 10px;
    }

    /* Force 2 columns on mobile for info blocks */
    .blocks-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .info-block {
        padding: 1rem;
    }

    .info-block h3 {
        font-size: 1rem;
    }

    .info-block p {
        font-size: 0.9rem;
    }
}

/* Rain Effect */
.rain-drop {
    position: fixed;
    top: -100px;
    opacity: 0.8;
    z-index: 9999;
    pointer-events: none;
    animation: rainFall linear forwards;
}

.rain-drop img {
    width: 60px;
    /* Force small size */
    height: auto;
}

@keyframes rainFall {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    100% {
        transform: translateY(110vh) rotate(360deg);
    }
}