:root {
    /* COLORS PULLED FROM YOUR LOGO */
    --bg-dark: #0a0a0a;
    --cream: #F2F0E9; /* Matches the card background */
    --brand-green: #1B3B30; /* Matches the ink color */
    
    /* GAMEPLAY COLORS */
    --neon-green: #39FF14;
    --neon-purple: #D500F9;
}

body {
    margin: 0;
    background-color: var(--bg-dark);
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    touch-action: none; 
    user-select: none;
}

/* CRT Scanline Overlay for texture */
body::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 1000;
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s;
    z-index: 10;
}

.hidden { display: none !important; }
.active { display: flex !important; }

/* --- START SCREEN --- */
.logo-container {
    margin-bottom: 40px;
    perspective: 1000px;
    /* These three lines force absolute centering */
    display: flex;
    justify-content: center;
    width: 100%; 
}
/* THE TAROT CARD STYLE */
.tarot-logo {
    width: 300px; /* Large size */
    max-width: 80%;
    height: auto;
    border-radius: 15px; /* Matches the card corners */
    
    /* A glow that matches the cream color */
    box-shadow: 0 0 50px rgba(242, 240, 233, 0.2); 
    
    /* The Magical Float Animation */
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.cta-container {
    text-align: center;
    z-index: 20;
}

.glitch-text {
    color: var(--cream);
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    letter-spacing: 4px;
    text-shadow: 0 0 15px var(--brand-green);
    font-weight: 100;
}

.subtitle {
    color: #aaa;
    line-height: 1.6;
    font-size: 0.9rem;
    margin-bottom: 40px;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    padding: 15px;
    background: rgba(0,0,0,0.8);
}

.gothic-btn {
    background: transparent;
    color: var(--cream);
    border: 2px solid var(--cream);
    padding: 20px 40px;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 2px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(242, 240, 233, 0.1);
    transition: all 0.2s;
}

.gothic-btn:active {
    background: var(--cream);
    color: var(--bg-dark);
    box-shadow: 0 0 30px rgba(242, 240, 233, 0.6);
}

.gothic-btn.small {
    font-size: 0.9rem;
    padding: 10px 20px;
    margin-top: 20px;
}

/* --- GAME UI --- */
#game-ui { background: transparent; }

canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    color: var(--cream);
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 20;
    text-shadow: 0 2px 5px black;
    pointer-events: none;
}

#feedback-text {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    width: 100%;
    text-align: center;
    font-size: 4rem;
    font-weight: 900;
    font-style: italic;
    z-index: 30;
    pointer-events: none;
    -webkit-text-stroke: 2px black;
}

/* --- END SCREEN --- */
#sign-screen {
    background: rgba(5,5,5,0.95);
    border: 2px solid var(--brand-green);
}
#sign-screen h2 {
    color: var(--cream);
    font-size: 2rem;
    letter-spacing: 3px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.input-group input {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--cream);
    color: var(--cream);
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5rem;
    text-align: center;
    padding: 15px;
    margin: 30px 0;
    outline: none;
    text-transform: uppercase;
    width: 250px;
}

/* --- SHARE CARD --- */
#share-overlay { background: #000; }

#share-card-visual {
    width: 300px;
    height: 500px;
    background-color: var(--cream);
    /* Using the brand green for the border */
    border: 8px double var(--brand-green);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.1);
    position: relative;
    padding: 20px;
    box-sizing: border-box;
}

.card-header-img {
    width: 80px;        /* Slightly narrower */
    height: auto;       /* Let height adjust naturally */
    border-radius: 5px; /* Small rounded corners like a card */
    border: 2px solid var(--brand-green);
    margin-bottom: 20px;
    object-fit: contain;
    background: var(--cream);
}

.card-body {
    width: 100%;
    text-align: center;
    color: var(--brand-green); /* Green text on Cream card */
}

.rank-title {
    font-size: 1.8rem;
    font-weight: 900;
    border-bottom: 2px solid var(--brand-green);
    margin-bottom: 20px;
    padding-bottom: 5px;
}

.stat-row {
    font-size: 1.1rem;
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--brand-green);
}

.card-footer {
    margin-top: 80px;
    font-size: 0.6rem;
    opacity: 0.8;
    letter-spacing: 1px;
    font-weight: bold;
}

.instruction {
    color: #666;
    margin-top: 10px;
    font-size: 0.8rem;
}

@keyframes pop {
    0% { transform: translate(-50%, -50%) scale(0.5) rotate(-5deg); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2) rotate(-5deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(-5deg); opacity: 0; }
}

/* --- MOBILE ADJUSTMENTS --- */
@media (max-width: 600px), (max-height: 800px) {
    .screen {
        justify-content: flex-start; /* Start from top instead of center */
        padding-top: 40px; /* Add some breathing room at top */
    }

    .logo-container {
        margin-bottom: 20px; /* Less gap below logo */
    }

    .tarot-logo {
        width: 200px; /* Smaller logo for mobile */
    }

    .glitch-text {
        font-size: 2.2rem; /* Smaller Title */
        margin-bottom: 5px;
    }

    .subtitle {
        font-size: 0.8rem; /* Smaller text */
        margin-bottom: 20px; /* Less gap */
        padding: 10px;
    }

    .gothic-btn {
        padding: 15px 30px; /* Smaller button */
        font-size: 1rem;
    }
    
    /* Ensure input fields on end screen fit */
    .input-group input {
        width: 80%;
        margin: 20px 0;
    }
}

/* --- MOBILE ADJUSTMENTS --- */
@media (max-width: 600px), (max-height: 800px) {
    .screen {
        justify-content: flex-start; /* Start from top instead of center */
        padding-top: 40px; /* Add some breathing room at top */
    }

    .logo-container {
        margin-bottom: 20px; /* Less gap below logo */
    }

    .tarot-logo {
        width: 200px; /* Smaller logo for mobile */
    }

    .glitch-text {
        font-size: 2.2rem; /* Smaller Title */
        margin-bottom: 5px;
    }

    .subtitle {
        font-size: 0.8rem; /* Smaller text */
        margin-bottom: 20px; /* Less gap */
        padding: 10px;
    }

    .gothic-btn {
        padding: 15px 30px; /* Smaller button */
        font-size: 1rem;
    }
    
    /* Ensure input fields on end screen fit */
    .input-group input {
        width: 80%;
        margin: 20px 0;
    }
}