:root {
    --black: #111110;
    --panel: #1A1A18;
    --red: #C1121C;
    --wine: #7A0A12;
    --oxblood: #4A0507;
    --ivory: #A9A9A9;
    --white: #E8E6E1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent
}

html,
body {
    height: 100%;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
    touch-action: none
}

button,
a {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--ivory)
}

#scene {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 0
}

#vignette {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 55%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .55) 72%, rgba(0, 0, 0, .92) 100%)
}

#grain {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: .05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E")
}

/* ---------- OVERLAY UI ---------- */
#gate-ui {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(env(safe-area-inset-top) + 24px) 22px calc(env(safe-area-inset-bottom) + 18px);
    transition: opacity 1.1s ease, transform 1.4s ease
}

#gate-ui.hidden {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none
}

.wordmark {
    text-align: center;
    line-height: .95;
    margin-bottom: 34px;
    animation: fadeUp 1.1s .2s both cubic-bezier(.22, 1, .36, 1)
}

.wordmark .logo {
    width: 150px;
    max-width: 46vw;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 3px 18px rgba(0, 0, 0, .75))
}

.wordmark .l1 {
    font-family: 'Cinzel', serif;
    color: var(--white);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase
}

.wordmark .l2 {
    font-family: 'Cinzel', serif;
    font-style: italic;
    font-size: 15px;
    opacity: .62;
    margin: 5px 0 3px;
    letter-spacing: .08em
}

.wordmark .l3 {
    font-family: 'Cinzel', serif;
    color: var(--white);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase
}

.wordmark .rule {
    width: 52px;
    height: 1px;
    background: var(--red);
    margin: 16px auto 0;
    opacity: .85
}

h1 {
    font-family: 'Cinzel', serif;
    color: var(--white);
    font-weight: 400;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .85);
    font-size: clamp(19px, 5.1vw, 28px);
    letter-spacing: .012em;
    text-align: center;
    margin-bottom: 30px;
    max-width: 16ch;
    line-height: 1.24;
    animation: fadeUp 1.1s .38s both cubic-bezier(.22, 1, .36, 1)
}

.form {
    width: 100%;
    max-width: 330px;
    animation: fadeUp 1.1s .52s both cubic-bezier(.22, 1, .36, 1)
}

.choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px
}

.opt {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: rgba(10, 8, 7, .78);
    color: #FFFFFF;
    border: 1px solid rgba(232, 230, 225, .42);
    border-radius: 2px;
    padding: 16px 8px;
    font-family: 'Inter', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
    letter-spacing: .18em;
    text-transform: uppercase;
    box-shadow: 0 2px 14px rgba(0, 0, 0, .5);
    cursor: pointer;
    transition: border-color .35s, background .35s, box-shadow .35s, opacity .35s
}

.opt:hover {
    border-color: rgba(232, 230, 225, .75)
}

.opt.on {
    border-color: var(--red);
    background: rgba(52, 9, 12, .85);
    box-shadow: 0 0 0 1px rgba(193, 18, 28, .34), 0 0 22px -6px rgba(193, 18, 28, .5)
}

.opt.err {
    border-color: var(--red)
}

.cta {
    width: 100%;
    margin-top: 20px;
    padding: 17px;
    min-height: 54px;
    background: linear-gradient(180deg, var(--red), var(--wine));
    color: #FFFFFF;
    border: 1px solid rgba(255, 120, 110, .5);
    border-radius: 2px;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .55);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .55), 0 0 26px -8px rgba(193, 18, 28, .65);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: filter .35s, transform .15s, box-shadow .35s
}

.cta span {
    position: relative;
    z-index: 2
}

.cta:hover {
    filter: brightness(1.18);
    box-shadow: 0 4px 24px rgba(0, 0, 0, .6), 0 0 34px -6px rgba(193, 18, 28, .85)
}

.cta:active {
    transform: scale(.985)
}

.cta:disabled {
    opacity: .4;
    cursor: default
}

.deny {
    margin-top: 16px;
    text-align: center;
    font-size: 12.5px;
    line-height: 1.6;
    color: #E8A9A9;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity .5s, max-height .5s
}

.deny.show {
    opacity: 1;
    max-height: 130px
}

.deny a {
    color: var(--ivory);
    opacity: .55;
    text-decoration: underline;
    text-underline-offset: 4px;
    font-size: 10px;
    letter-spacing: .2em;
    text-transform: uppercase;
    display: inline-block;
    margin-top: 12px;
    cursor: pointer
}

.foot {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(env(safe-area-inset-bottom) + 15px);
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 11px;
    animation: fadeUp 1.1s .8s both cubic-bezier(.22, 1, .36, 1)
}

.legal {
    font-size: 9px;
    letter-spacing: .26em;
    text-transform: uppercase;
    opacity: .28
}

.gone {
    display: none !important;
}

#container-gate-gate.hidden {
    display: none !important;
}

.container-gate-gate {
    height: 100%;
    width: 100%;
    position: relative;
    opacity: 1;
    visibility: visible;
    transition:
        opacity .5s ease,
        visibility .5s ease;
}

.container-gate-gate.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}