:root {
    --brand-blue: #0966b5;
    --brand-deep: #064986;
    --brand-navy: #03284d;
    --brand-yellow: #ffed00;
    --ink: #10243d;
    --muted: #66758a;
    --surface: #ffffff;
    --danger: #c93247;
    --shadow: 0 28px 80px rgba(0, 31, 76, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: #053764;
    -webkit-font-smoothing: antialiased;
}

body.modal-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

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

.app-shell,
.screen {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
}

.screen {
    display: none;
}

.screen.is-active {
    display: flex;
}

.wheel-screen {
    position: relative;
    isolation: isolate;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    padding: max(22px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 50% 42%, rgba(32, 145, 236, 0.42), transparent 42%),
        linear-gradient(145deg, #032646 0%, #064d87 48%, #042f58 100%);
}

.wheel-screen::before {
    position: absolute;
    inset: 0;
    z-index: -2;
    content: "";
    opacity: 0.28;
    background-image:
        radial-gradient(circle, rgba(255,255,255,.75) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(255,237,0,.75) 0 1px, transparent 1.5px);
    background-position: 0 0, 36px 52px;
    background-size: 94px 94px, 127px 127px;
    mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

.aurora {
    position: absolute;
    z-index: -1;
    width: min(58vw, 780px);
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.28;
    pointer-events: none;
}

.aurora-one {
    top: -34%;
    left: -18%;
    background: #00d5ff;
}

.aurora-two {
    right: -23%;
    bottom: -46%;
    background: #ffbf00;
}

.wheel-copy {
    z-index: 2;
    margin-bottom: 16px;
    color: #fff;
    text-align: center;
}

.wheel-brand {
    display: table;
    margin: 0 auto 14px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(0, 22, 55, 0.22);
}

.wheel-brand img {
    display: block;
    width: clamp(160px, 18vw, 205px);
    height: auto;
}

.eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--brand-yellow);
    font-size: clamp(0.72rem, 1.25vw, 0.9rem);
    font-weight: 800;
    letter-spacing: 0.18em;
}

.wheel-copy h1 {
    margin: 0;
    font-size: clamp(1.55rem, 3.4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.wheel-area {
    position: relative;
    z-index: 2;
    width: min(64vw, 61vh, 650px);
    aspect-ratio: 1;
    flex: 0 1 auto;
}

.wheel-frame {
    position: absolute;
    inset: 0;
    padding: clamp(7px, 1.2vw, 12px);
    border: clamp(5px, 0.8vw, 10px) solid #fff;
    border-radius: 50%;
    background: var(--brand-yellow);
    box-shadow:
        0 0 0 5px rgba(255, 237, 0, 0.5),
        0 18px 55px rgba(0, 10, 35, 0.5),
        0 0 72px rgba(44, 180, 255, 0.26);
}

.wheel-frame::after {
    position: absolute;
    inset: 5px;
    content: "";
    border: 2px solid rgba(255,255,255,.75);
    border-radius: 50%;
    pointer-events: none;
}

.wheel-rotator {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    will-change: transform;
}

#prize-wheel {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.wheel-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: clamp(62px, 12%, 90px);
    aspect-ratio: 1;
    place-items: center;
    transform: translate(-50%, -50%);
    border: clamp(4px, .7vw, 7px) solid #fff;
    border-radius: 50%;
    background: linear-gradient(145deg, #fffb33, #ffd500);
    box-shadow: 0 8px 25px rgba(0,0,0,.35), inset 0 3px 5px rgba(255,255,255,.65);
}

.hub-mark {
    color: var(--brand-blue);
    font-size: clamp(1.6rem, 4vw, 3rem);
    font-weight: 1000;
    font-style: italic;
    line-height: 1;
    transform: translateX(-1px);
}

.pointer {
    position: absolute;
    top: clamp(-17px, -2.1vw, -10px);
    left: 50%;
    z-index: 5;
    width: clamp(44px, 7vw, 66px);
    height: clamp(64px, 9vw, 90px);
    transform: translateX(-50%);
    filter: drop-shadow(0 6px 8px rgba(0, 18, 40, .45));
}

.pointer::before {
    position: absolute;
    top: 0;
    left: 50%;
    width: 100%;
    aspect-ratio: 1;
    content: "";
    transform: translateX(-50%);
    border: 5px solid #fff;
    border-radius: 50%;
    background: var(--brand-blue);
}

.pointer span {
    position: absolute;
    top: 36%;
    left: 50%;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-top: clamp(38px, 5.4vw, 55px) solid #fff;
    border-right: clamp(17px, 2.6vw, 26px) solid transparent;
    border-left: clamp(17px, 2.6vw, 26px) solid transparent;
}

.primary-button {
    position: relative;
    display: inline-flex;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 16px;
    color: #062c54;
    background: linear-gradient(180deg, #fff633, #ffdc00);
    box-shadow: 0 12px 28px rgba(0, 20, 55, 0.35), inset 0 1px 0 rgba(255,255,255,.8);
    cursor: pointer;
    font-weight: 900;
    letter-spacing: 0.035em;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(0, 20, 55, 0.42), inset 0 1px 0 rgba(255,255,255,.8);
    filter: saturate(1.06);
}

.primary-button:focus-visible,
input:focus-visible,
.modal-close:focus-visible {
    outline: 3px solid #ffed00;
    outline-offset: 3px;
}

.primary-button:active {
    transform: translateY(1px) scale(.99);
}

.primary-button:disabled {
    cursor: wait;
    filter: grayscale(.4);
    opacity: .72;
    transform: none;
}

.spin-button {
    z-index: 2;
    min-width: min(310px, 84vw);
    margin-top: 20px;
    padding: 0 28px;
}

.spin-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
    transform: rotate(90deg);
}

.spin-button.is-spinning svg {
    animation: button-spin .7s linear infinite;
}

.one-chance {
    z-index: 2;
    margin: 10px 0 0;
    color: rgba(255,255,255,.72);
    font-size: .83rem;
}

.flow-screen {
    position: relative;
    isolation: isolate;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 15% 10%, rgba(255,237,0,.26), transparent 28%),
        radial-gradient(circle at 90% 90%, rgba(41,175,255,.38), transparent 34%),
        linear-gradient(145deg, #04325f, #086bbb);
}

.flow-decoration {
    position: absolute;
    z-index: -1;
    width: min(44vw, 540px);
    aspect-ratio: 1;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
}

.flow-decoration::before,
.flow-decoration::after {
    position: absolute;
    content: "";
    border: 1px solid rgba(255,255,255,.11);
    border-radius: inherit;
}

.flow-decoration::before { inset: 14%; }
.flow-decoration::after { inset: 29%; }
.flow-decoration-one { top: -18%; left: -15%; }
.flow-decoration-two { right: -18%; bottom: -24%; }

.flow-card {
    width: min(100%, 520px);
    padding: clamp(26px, 5vw, 46px);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 30px;
    background: rgba(255,255,255,.97);
    box-shadow: var(--shadow);
}

.brand-logo {
    display: block;
    width: min(230px, 72%);
    height: auto;
    margin: 0 auto 32px;
}

.step-panel h2 {
    margin: 0;
    color: #073b6c;
    font-size: clamp(1.75rem, 5vw, 2.35rem);
    letter-spacing: -.035em;
    line-height: 1.13;
    text-align: center;
}

.step-kicker,
.success-label {
    display: table;
    margin: 0 auto 9px;
    padding: 5px 11px;
    border-radius: 999px;
    color: #075c9f;
    background: #e5f4ff;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .1em;
}

.step-intro {
    margin: 12px auto 26px;
    color: var(--muted);
    text-align: center;
}

form {
    display: grid;
}

label {
    margin: 0 0 7px;
    color: #253e59;
    font-size: .91rem;
    font-weight: 750;
}

input {
    width: 100%;
    height: 56px;
    margin: 0 0 19px;
    padding: 0 17px;
    border: 1.5px solid #d5dfeb;
    border-radius: 14px;
    color: var(--ink);
    background: #f9fbfd;
    font-size: 1rem;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input::placeholder {
    color: #9ca9b9;
}

input:hover {
    border-color: #a9bfd4;
}

input:focus {
    border-color: #1782d0;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(17,128,207,.11);
}

input[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(201,50,71,.09);
}

.field-hint {
    margin: -10px 0 19px;
    color: #7a899a;
    font-size: .82rem;
}

.form-error {
    margin: -5px 0 16px;
    padding: 11px 13px;
    border: 1px solid #f3bac3;
    border-radius: 12px;
    color: #9d2437;
    background: #fff2f4;
    font-size: .9rem;
}

.form-button {
    width: 100%;
    margin-top: 3px;
    color: #fff;
    background: linear-gradient(135deg, #0875c6, #064b8a);
    box-shadow: 0 12px 26px rgba(5, 81, 143, .24);
}

.privacy-note {
    margin: 14px 4px 0;
    color: #8a96a5;
    font-size: .76rem;
    line-height: 1.45;
    text-align: center;
}

.waiting-panel,
.success-panel {
    padding: 8px 0 2px;
    text-align: center;
}

.waiting-panel p,
.success-panel > p {
    max-width: 390px;
    margin: 13px auto 24px;
    color: var(--muted);
}

.loader {
    position: relative;
    display: flex;
    width: 88px;
    height: 88px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 auto 25px;
    border-radius: 50%;
    background: #eaf6ff;
    box-shadow: inset 0 0 0 1px #d6ecfb;
}

.loader::before {
    position: absolute;
    inset: -5px;
    content: "";
    border: 3px solid transparent;
    border-top-color: var(--brand-yellow);
    border-right-color: var(--brand-blue);
    border-radius: 50%;
    animation: loader-ring 1.2s linear infinite;
}

.loader span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-blue);
    animation: loader-dot 1.1s ease-in-out infinite;
}

.loader span:nth-child(2) { animation-delay: .13s; }
.loader span:nth-child(3) { animation-delay: .26s; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border: 1px solid #d7e8f5;
    border-radius: 999px;
    color: #42647f;
    background: #f4faff;
    font-size: .83rem;
    font-weight: 700;
}

.status-pill i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a66a;
    box-shadow: 0 0 0 5px rgba(22,166,106,.12);
    animation: status-pulse 1.7s ease-in-out infinite;
}

.success-icon {
    display: grid;
    width: 92px;
    aspect-ratio: 1;
    place-items: center;
    margin: 0 auto 20px;
    border: 1px solid #bde8d1;
    border-radius: 50%;
    background: linear-gradient(145deg, #ebfff4, #d9f8e8);
    box-shadow: 0 13px 30px rgba(19,143,85,.14);
}

.success-icon svg {
    width: 52px;
    fill: none;
    stroke: #11945d;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 6;
}

.success-label {
    margin-bottom: 10px;
    color: #0c8151;
    background: #e6f8ef;
}

.trip-summary,
.date-summary {
    display: flex;
    align-items: center;
    border: 1px solid #dce8f1;
    border-radius: 17px;
    background: #f8fbfd;
}

.trip-summary {
    gap: 15px;
    margin: 24px 0 12px;
    padding: 15px 18px;
    text-align: left;
}

.trip-flag {
    font-size: 2.25rem;
    line-height: 1;
}

.trip-summary div,
.date-summary div {
    display: grid;
    gap: 2px;
}

.trip-summary small,
.date-summary small {
    color: #7d8b9c;
    font-size: .75rem;
}

.trip-summary strong {
    color: #083e70;
    font-size: 1.12rem;
}

.date-summary {
    justify-content: space-between;
    padding: 13px 17px;
    text-align: left;
}

.date-summary > span {
    color: #7a91a5;
    font-size: 1.25rem;
}

.date-summary strong {
    color: #253e59;
    font-size: .93rem;
}

.application-id {
    margin: 24px 0 -12px;
    color: #9aa6b4;
    font-size: .75rem;
    text-align: center;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    padding: 20px;
    place-items: center;
    background: rgba(0, 24, 52, .72);
    backdrop-filter: blur(12px);
}

.modal-backdrop[hidden] {
    display: none;
}

.winner-modal {
    position: relative;
    width: min(100%, 500px);
    overflow: hidden;
    padding: clamp(32px, 6vw, 52px);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 34px 100px rgba(0, 21, 51, .52);
    text-align: center;
    animation: modal-enter .48s cubic-bezier(.18,.89,.32,1.22) both;
}

.winner-modal::before {
    position: absolute;
    top: -130px;
    left: 50%;
    width: 360px;
    aspect-ratio: 1;
    content: "";
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,237,0,.28), transparent 68%);
    pointer-events: none;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #6d7d8d;
    background: #eef4f8;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.winner-flag {
    position: relative;
    display: block;
    margin: 0 auto 13px;
    font-size: clamp(4rem, 14vw, 6rem);
    line-height: 1;
    filter: drop-shadow(0 10px 12px rgba(0, 28, 62, .16));
}

.winner-kicker {
    display: block;
    color: #0c77c4;
    font-size: .8rem;
    font-weight: 900;
    letter-spacing: .16em;
}

.winner-modal h2 {
    margin: 8px 0 10px;
    color: #073b6c;
    font-size: clamp(1.75rem, 6vw, 2.45rem);
    letter-spacing: -.04em;
    line-height: 1.12;
}

.winner-modal p {
    margin: 0 auto 26px;
    color: var(--muted);
}

.winner-modal p strong {
    color: #075fa3;
}

.modal-button {
    width: 100%;
    color: #fff;
    background: linear-gradient(135deg, #0877c9, #064986);
    box-shadow: 0 12px 28px rgba(5, 80, 141, .24);
}

.confetti {
    position: fixed;
    top: -18px;
    left: var(--x);
    z-index: 80;
    width: var(--size);
    height: calc(var(--size) * 1.7);
    border-radius: 2px;
    background: var(--color);
    pointer-events: none;
    animation: confetti-fall var(--duration) var(--delay) cubic-bezier(.2,.7,.2,1) forwards;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 100;
    max-width: min(410px, calc(100vw - 36px));
    padding: 13px 16px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 13px;
    color: #fff;
    background: rgba(4, 36, 70, .96);
    box-shadow: 0 14px 35px rgba(0,0,0,.26);
    font-size: .9rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    padding: 0;
    margin: -1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes button-spin {
    to { transform: rotate(450deg); }
}

@keyframes loader-ring {
    to { transform: rotate(360deg); }
}

@keyframes loader-dot {
    0%, 70%, 100% { transform: translateY(0); opacity: .55; }
    35% { transform: translateY(-7px); opacity: 1; }
}

@keyframes status-pulse {
    0%, 100% { opacity: .65; }
    50% { opacity: 1; box-shadow: 0 0 0 8px rgba(22,166,106,.08); }
}

@keyframes modal-enter {
    from { opacity: 0; transform: translateY(24px) scale(.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes confetti-fall {
    0% { transform: translate3d(0, -20px, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate3d(var(--drift), 108vh, 0) rotate(var(--spin)); opacity: .2; }
}

@media (max-width: 680px) {
    .wheel-screen {
        justify-content: center;
        padding-right: 12px;
        padding-left: 12px;
    }

    .wheel-copy {
        margin-bottom: 13px;
    }

    .wheel-brand {
        margin-bottom: 11px;
        padding: 7px 11px;
        border-radius: 12px;
    }

    .wheel-brand img {
        width: clamp(145px, 43vw, 175px);
    }

    .wheel-area {
        width: min(91vw, 57vh, 520px);
    }

    .spin-button {
        min-height: 52px;
        margin-top: 19px;
        border-radius: 14px;
        font-size: .94rem;
    }

    .one-chance {
        font-size: .76rem;
    }

    .flow-card {
        border-radius: 24px;
    }

    .brand-logo {
        margin-bottom: 27px;
    }
}

@media (max-height: 720px) and (min-width: 681px) {
    .wheel-copy { margin-bottom: 9px; }
    .wheel-brand { margin-bottom: 8px; padding: 6px 10px; }
    .wheel-brand img { width: 155px; }
    .wheel-copy h1 { font-size: 1.7rem; }
    .wheel-area { width: min(52vw, 55vh, 520px); }
    .spin-button { min-height: 48px; margin-top: 13px; }
    .one-chance { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }

    .loader::before,
    .loader span,
    .status-pill i {
        animation-duration: 2.4s;
    }

    .winner-modal {
        animation: none;
    }

    .confetti {
        display: none;
    }
}
