:root {
    --white: #ffffff;
    --yellow: #fff100;
    --cyan: #00dcff;
    --blue: #0c9bea;
    --purple: #350064;
    --deep-purple: #19003d;
    --pink: #ff2aa5;
    --shadow: 0 12px 24px rgba(13, 0, 60, 0.45);
    --radius: 28px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #43237d;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    color: var(--white);
    background-color: #43237d;
    background-image: url('../img/tpremiabg.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    background-attachment: fixed;
    font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.screen {
    --screen-gutter: 22px;
    width: min(100%, 620px);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: max(12px, env(safe-area-inset-top)) var(--screen-gutter) max(22px, env(safe-area-inset-bottom));
    overflow: hidden;
}

.screen--initial {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.hero-banner,
.final-banner {
    display: block;
    width: calc(100% + var(--screen-gutter) + var(--screen-gutter));
    max-width: none;
    height: auto;
    margin-right: calc(0px - var(--screen-gutter));
    margin-left: calc(0px - var(--screen-gutter));
    user-select: none;
    -webkit-user-drag: none;
}

.notice {
    margin: 12px 6px;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 16px;
    background: rgba(10, 0, 44, 0.8);
    font-size: 0.92rem;
    line-height: 1.35;
    text-align: center;
}

.notice--error {
    border-color: rgba(255, 82, 130, 0.85);
    background: rgba(76, 0, 42, 0.88);
}

.participation-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(24px, 6vw, 38px);
    width: 100%;
    margin-top: clamp(12px, 3vw, 22px);
}

.acceptance-card {
    position: relative;
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 14px;
    align-items: start;
    width: 100%;
    padding: 20px 24px;
    border: 1.5px solid var(--cyan);
    border-radius: var(--radius);
    background: linear-gradient(120deg, rgba(63, 0, 107, 0.98), rgba(5, 0, 64, 0.98));
    box-shadow: 0 10px 20px rgba(5, 0, 35, 0.3);
    cursor: pointer;
}

.acceptance-card:focus-within {
    outline: 3px solid rgba(255, 241, 0, 0.55);
    outline-offset: 3px;
}

.acceptance-card__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.acceptance-card__box {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
    margin-top: 2px;
    border: 2px solid rgba(255, 255, 255, 0.95);
    border-radius: 4px;
    background: #ffffff;
    box-shadow: inset 0 0 0 2px rgba(53, 0, 100, 0.1);
}

.acceptance-card__input:checked + .acceptance-card__box {
    border-color: var(--yellow);
    background: var(--yellow);
}

.acceptance-card__input:checked + .acceptance-card__box::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 1px;
    width: 7px;
    height: 13px;
    border: solid #2c0060;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.acceptance-card__input:disabled + .acceptance-card__box,
.acceptance-card__input:disabled ~ .acceptance-card__copy {
    opacity: 0.55;
}

.acceptance-card__copy {
    font-size: clamp(0.9rem, 3.5vw, 1.05rem);
    line-height: 1.22;
}

.acceptance-card__copy strong {
    color: var(--yellow);
}

.image-button {
    position: relative;
    display: grid;
    place-items: center;
    width: min(84%, 390px);
    min-height: 76px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: var(--white);
    background: linear-gradient(180deg, #43cff1 0%, #0e93e3 72%, #0871d2 100%);
    box-shadow: 0 8px 0 rgba(4, 0, 42, 0.7), 0 13px 22px rgba(7, 0, 49, 0.45);
    cursor: pointer;
    isolation: isolate;
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.image-button img {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.image-button__fallback {
    position: absolute;
    z-index: 1;
    padding: 0 18px;
    font-size: clamp(1.35rem, 5.2vw, 1.85rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    text-shadow: 0 2px 0 rgba(0, 79, 143, 0.45);
}

.image-button:not(:disabled):hover {
    transform: translateY(-4px) scale(1.025);
    filter: brightness(1.08) saturate(1.08);
    box-shadow: 0 10px 0 rgba(4, 0, 42, 0.72), 0 18px 28px rgba(0, 224, 255, 0.28);
}

.image-button:not(:disabled):active {
    transform: translateY(3px) scale(0.99);
    box-shadow: 0 4px 0 rgba(4, 0, 42, 0.72), 0 8px 14px rgba(7, 0, 49, 0.4);
}

.image-button:focus-visible,
.understood-button:focus-visible,
.terms-link:focus-visible,
.modal-understood:focus-visible,
.terms-modal__close:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 4px;
}

.image-button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.38) brightness(0.8);
    opacity: 0.64;
    box-shadow: 0 5px 0 rgba(4, 0, 42, 0.6), 0 9px 16px rgba(7, 0, 49, 0.32);
}

.image-button.is-loading {
    animation: button-pulse 850ms ease-in-out infinite alternate;
}

@keyframes button-pulse {
    from { opacity: 0.62; }
    to { opacity: 0.9; }
}

.legal-footer {
    width: 100%;
    margin-top: clamp(28px, 7vw, 46px);
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: clamp(0.78rem, 3vw, 0.92rem);
}

.legal-footer p {
    margin: 0 0 10px;
    color: rgba(255, 255, 255, 0.82);
}

.terms-link {
    padding: 3px 4px;
    border: 0;
    color: var(--yellow);
    background: transparent;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.terms-link:hover {
    color: #ffffff;
}

.screen--final {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.final-banner {
    margin-bottom: 0;
}

.understood-button,
.modal-understood {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(180deg, #43cff1 0%, #0e93e3 72%, #0871d2 100%);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 7px 0 rgba(4, 0, 42, 0.72), 0 12px 20px rgba(7, 0, 49, 0.45);
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.understood-button {
    width: min(82%, 390px);
    min-height: 76px;
    margin-top: clamp(22px, 5vw, 38px);
    padding: 12px 22px;
    font-size: clamp(1.45rem, 6vw, 2rem);
}

.understood-button:hover,
.modal-understood:hover {
    transform: translateY(-3px);
    filter: brightness(1.09);
}

.understood-button:active,
.modal-understood:active {
    transform: translateY(2px);
    box-shadow: 0 3px 0 rgba(4, 0, 42, 0.72), 0 7px 12px rgba(7, 0, 49, 0.4);
}

.understood-button:disabled {
    opacity: 0.7;
}

.close-help {
    min-height: 1.2em;
    margin: 16px 8px 0;
    color: rgba(255, 255, 255, 0.88);
    font-family: Arial, sans-serif;
    font-size: 0.8rem;
    text-align: center;
}

.legal-footer--final {
    margin-top: 10px;
}

.terms-modal {
    width: min(92vw, 620px);
    max-height: min(84vh, 760px);
    padding: 0;
    border: 1.5px solid var(--cyan);
    border-radius: 24px;
    color: #ffffff;
    background: #220050;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
    overflow: hidden;
}

.terms-modal::backdrop {
    background: rgba(4, 0, 28, 0.8);
    backdrop-filter: blur(5px);
}

.terms-modal:not([open]) {
    display: none;
}

.terms-modal__panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: min(84vh, 760px);
}

.terms-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(0, 220, 255, 0.38);
    background: linear-gradient(100deg, #3d0072, #190043);
}

.terms-modal__header h2 {
    margin: 0;
    font-size: clamp(1.3rem, 5vw, 1.75rem);
}

.terms-modal__close {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.terms-modal__content {
    padding: 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
    font-family: Arial, sans-serif;
    font-size: 0.98rem;
    line-height: 1.5;
}

.terms-modal__content h3 {
    margin: 0 0 18px;
    color: var(--yellow);
    font-family: "Trebuchet MS", Arial, sans-serif;
    font-size: 1.2rem;
}

.terms-modal__content p {
    margin: 0 0 16px;
}

.terms-list {
    margin: 0;
    padding-left: 1.45rem;
}

.terms-list li {
    margin: 0 0 16px;
    padding-left: 0.25rem;
}

.terms-list li::marker {
    color: var(--yellow);
    font-weight: 800;
}

.terms-links {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.terms-links a {
    color: var(--cyan);
    overflow-wrap: anywhere;
    text-underline-offset: 3px;
}

.terms-links a:hover,
.terms-links a:focus-visible {
    color: #ffffff;
}

.terms-modal__footer {
    padding: 16px 22px 22px;
    background: #190043;
}

.modal-understood {
    width: 100%;
    min-height: 52px;
    padding: 10px 18px;
    font-size: 1rem;
}

@media (max-width: 430px) {
    .screen {
        --screen-gutter: 16px;
    }

    .acceptance-card {
        grid-template-columns: 24px 1fr;
        gap: 11px;
        padding: 17px 18px;
        border-radius: 24px;
    }

    .acceptance-card__box {
        width: 21px;
        height: 21px;
    }

    .acceptance-card__input:checked + .acceptance-card__box::after {
        left: 5px;
        width: 6px;
        height: 11px;
    }

    .image-button,
    .understood-button {
        min-height: 66px;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
