:root {
    --red: #e3251a;
    --yellow: #fee35d;
    --dot: rgba(227, 37, 26, 0.12); /* Subtle red tint for halftone dots */
    --dark: #2a1412;
    --white: #ffffff;
}

/* Base Resets */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    background-color: var(--yellow);
    /* Halftone dot pattern */
    background-image: radial-gradient(var(--dot) 2px, transparent 2.5px);
    background-size: 18px 18px;
    background-position: 0 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 20px;
    overflow-x: hidden;
}

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

/* Layout */
.site-wrapper {
    width: 100%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
    text-align: center;
}

/* Top Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    color: var(--red);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 8px 18px;
    border-radius: 99px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(227, 37, 26, 0.15);
    border: 2px solid var(--red);
}

.badge .dot {
    width: 10px;
    height: 10px;
    background: var(--red);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Headline */
h1 {
    font-family: 'Bagel Fat One', cursive;
    font-size: clamp(3.5rem, 10vw, 6rem);
    color: var(--red);
    line-height: 0.95;
    transform: rotate(-2deg);
    position: relative;
    text-shadow: 3px 3px 0px var(--white), -1px -1px 0px var(--white), 1px -1px 0px var(--white), -1px 1px 0px var(--white);
}

.scribble {
    position: absolute;
    bottom: -20px;
    left: 10%;
    width: 80%;
    height: 25px;
    overflow: visible;
}

/* Centerpiece Ticket Scene */
.ticket-scene {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto 40px auto;
}

.ticket {
    background: var(--white);
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(227, 37, 26, 0.15);
    position: relative;
    z-index: 2;
    /* Create the semi-circle notches on left/right using mask-image */
    -webkit-mask-image: radial-gradient(circle at 0 50%, transparent 18px, black 19px), radial-gradient(circle at 100% 50%, transparent 18px, black 19px);
    -webkit-mask-size: 51% 100%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: left, right;
    mask-image: radial-gradient(circle at 0 50%, transparent 18px, black 19px), radial-gradient(circle at 100% 50%, transparent 18px, black 19px);
    mask-size: 51% 100%;
    mask-repeat: no-repeat;
    mask-position: left, right;
}

.ticket-inner {
    border: 3px dashed var(--red);
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
}

.ticket-heading {
    font-family: 'Bagel Fat One', cursive;
    color: var(--dark);
    font-size: 2rem;
    margin-bottom: 10px;
}

.ticket-desc {
    font-size: 1.05rem;
    line-height: 1.5;
    color: #555;
    margin-bottom: 0;
}

.lock-icon {
    margin-bottom: 15px;
    display: inline-flex;
    padding: 12px;
    background: rgba(227, 37, 26, 0.08);
    border-radius: 50%;
}

/* Post-entry state inside ticket */
.code-box {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--red);
    background: rgba(227, 37, 26, 0.05);
    border: 2px solid rgba(227, 37, 26, 0.2);
    padding: 12px 30px;
    border-radius: 8px;
    letter-spacing: 5px;
    margin: 20px 0;
    display: inline-block;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.copy-btn {
    background: var(--red);
    color: var(--white);
    border: none;
    padding: 14px 32px;
    border-radius: 99px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(227, 37, 26, 0.3);
}

.copy-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(227, 37, 26, 0.4);
}

.copy-btn:active {
    transform: translateY(1px);
}

/* Mascot Illustration */
.mascot {
    position: absolute;
    right: -100px;
    top: 50%;
    transform: translateY(-50%) rotate(12deg);
    width: 200px;
    height: auto;
    /* mix-blend-mode allows a white-bg image to blend seamlessly into our yellow background */
    mix-blend-mode: multiply;
    z-index: 1; /* behind the ticket visually but within scene */
    pointer-events: none;
    filter: contrast(1.1);
}

/* Form Section */
.form-section {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 3;
}

.entry-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.entry-form input {
    width: 100%;
    padding: 20px 24px;
    font-size: 1.15rem;
    border: 3px solid var(--white);
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    background: var(--white);
    color: var(--dark);
    box-shadow: 0 8px 20px rgba(227, 37, 26, 0.1);
    transition: all 0.2s ease;
}

.entry-form input:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 10px 25px rgba(227, 37, 26, 0.2);
}

.entry-form input::placeholder {
    color: #999;
    font-weight: 400;
}

.submit-btn {
    width: 100%;
    background: var(--red);
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    padding: 20px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(227, 37, 26, 0.25);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    letter-spacing: 0.02em;
}

.submit-btn:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 15px 30px rgba(227, 37, 26, 0.35);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.status-msg {
    margin-top: 15px;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
}
.status-msg.error {
    background: rgba(227, 37, 26, 0.1);
    color: var(--red);
    border: 2px solid rgba(227, 37, 26, 0.2);
}

/* Footer */
footer {
    margin-top: 60px;
    font-family: 'Permanent Marker', cursive;
    color: var(--red);
    text-align: center;
    font-size: 1.25rem;
    opacity: 0.9;
    line-height: 1.6;
    max-width: 80%;
}

/* SDK Attribution */
#wbx-powered-by-slot {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Keyframes */
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(227, 37, 26, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(227, 37, 26, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(227, 37, 26, 0); }
}

@keyframes dropAndSpin {
    0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Media Queries */
@media (max-width: 600px) {
    body {
        padding: 30px 15px;
    }
    .mascot {
        width: 130px;
        right: -30px;
        top: -40px;
        transform: translateY(0) rotate(15deg);
        z-index: 3;
    }
    .ticket {
        -webkit-mask-image: radial-gradient(circle at 0 50%, transparent 12px, black 13px), radial-gradient(circle at 100% 50%, transparent 12px, black 13px);
        mask-image: radial-gradient(circle at 0 50%, transparent 12px, black 13px), radial-gradient(circle at 100% 50%, transparent 12px, black 13px);
    }
    .ticket-inner {
        padding: 30px 20px;
    }
    .code-box {
        font-size: 1.8rem;
        padding: 10px 20px;
    }
    footer {
        font-size: 1.1rem;
        max-width: 100%;
    }
}