:root {
    --ink: #163c4d;
    --muted: #647385;
    --paper: #f4f3ee;
    --card: #fff;
    --navy: #2c9880;
    --navy-deep: #1f6f61;
    --navy-soft: #1f82c0;
    --gold: #1f82c0;
    --gold-deep: #176897;
    --blue: #1f82c0;
    --blue-deep: #1f6f61;
    --green: #2c9880;
    --red: #bd3b43;
    --line: #d7dce1;
    --shadow: 0 20px 50px rgba(44, 152, 128, 0.16);
}

* {
    box-sizing: border-box;
}

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

body {
    color: black;
    font-family: Arial, Helvetica, sans-serif;
}

body:not([data-page='ruffle']) {
    background: var(--paper);
}

body[data-page='register'] {
    background: url("img/2_Ipad_bg.png");
    background-size: cover;
}

body.is-prize-zooming {
    overflow: hidden;
}

body.is-wheel-page {
    background: var(--paper);
}

body.display-lock-pending > #game-display,
body.display-lock-pending > .wheel-only {
    visibility: hidden;
    pointer-events: none;
}

.display-lock-screen {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 32px;
    background: var(--paper);
    color: var(--ink);
    text-align: center;
}

.display-lock-screen.hidden {
    display: none;
}

.display-lock-card {
    width: min(680px, 100%);
    padding: clamp(28px, 5vw, 64px);
    border: 1px solid var(--line);
    border-top: 8px solid var(--navy);
    background: var(--card);
    box-shadow: var(--shadow);
}

.display-lock-card h1 {
    margin-bottom: 18px;
    color: var(--ink);
    font-size: clamp(2rem, 5vw, 4.5rem);
}

.display-lock-card p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.3rem);
    line-height: 1.5;
}

video {
    display: block;
    width: 100%;
    height: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

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

a {
    color: var(--blue);
}

.screen {
    width: 100%;
    min-height: 100%;
    margin: 0 0;
    padding: 0;
}

.ruffle-screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(18px, 2.5vw, 34px);
    transform-origin: 0 0;
    transition: transform 1800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ruffle-screen.is-prize-zooming {
    transform: translate(var(--page-zoom-x, 0px), var(--page-zoom-y, 0px)) scale(var(--page-zoom-scale, 1));
}

.ruffle-screen.is-prize-zooming .door-frame.is-revealing .door-reveal {
    opacity: 1;
    filter: blur(0);
}

.ruffle-screen > section {
    width: 100%;
}

.screen-narrow {
    width: min(760px, calc(100% - 36px));
    margin: 0 auto;
}

.game-display.is-wheel-active {
    width: 100%;
    max-width: none;
    padding: 0;
    background: #000000;
}

.game-display.is-wheel-active .topbar {
    display: none;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--gold-deep);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 860px;
    margin-bottom: 22px;
    font-size: clamp(2.8rem, 7vw, 6.3rem);
    line-height: 0.92;
    letter-spacing: -0.055em;
}

h2 {
    margin-bottom: 12px;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    letter-spacing: -0.035em;
}

.lead {
    max-width: 720px;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.55;
}

.topbar,
.action-row,
.status-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar {
    justify-content: space-between;
    min-height: 62px;
    margin-bottom: 86px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: var(--navy);
    box-shadow: 0 0 0 5px rgba(31, 130, 192, 0.16);
    font-size: 1.45rem;
    line-height: 1;
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-copy strong {
    font-size: 0.96rem;
    letter-spacing: 0.11em;
}

.brand-copy small {
    color: #fff;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.2em;
}

.top-link {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.top-link:hover {
    color: var(--gold);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: 64px;
    align-items: end;
}

.info-card,
.form-card,
.game-card,
.admin-card {
    border: 1px solid var(--line);
    border-top: 5px solid var(--gold);
    border-radius: 4px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.info-card {
    padding: 32px;
}

.info-card h2 {
    font-size: 1.35rem;
}

.info-card ul {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    line-height: 1.45;
}

.info-card li {
    display: flex;
    gap: 12px;
}

.info-card li::before {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    margin-top: 7px;
    border-radius: 0;
    background: var(--gold);
    content: "";
}

.button {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    padding: 0 26px;
    border: 0;
    border-radius: 2px;
    color: #fff;
    background: var(--gold);
    box-shadow: 0 8px 0 rgba(44, 152, 128, 0.2);
    cursor: pointer;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover:not(:disabled),
.button:focus-visible:not(:disabled) {
    color: #fff;
    background: var(--navy-deep);
    box-shadow: 0 5px 0 rgba(44, 152, 128, 0.24);
    transform: translateY(3px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.button-secondary {
    color: var(--navy);
    background: #fff;
    border: 1px solid var(--navy);
    box-shadow: none;
}

.button-secondary:hover:not(:disabled),
.button-secondary:focus-visible:not(:disabled) {
    color: #fff;
    background: var(--navy);
    box-shadow: none;
}

.button-gold {
    color: #fff;
    background: var(--gold);
    box-shadow: 0 8px 0 rgba(44, 152, 128, 0.2);
}

.form-card {
    padding: clamp(26px, 5vw, 54px);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
}

.form-card h1 {
    font-size: clamp(2.6rem, 7vw, 4.5rem);
}

.registration-step h2 {
    margin: 0 0 24px;
    color: var(--navy);
    font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.registration-step-label {
    margin: 0 0 8px;
    color: var(--gold-deep);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.registration-step-hint {
    margin: -8px 0 24px;
    line-height: 1.45;
}

.player-type-key {
    display: grid;
    grid-template-columns: auto;
    gap: 4px 14px;
    align-items: center;
    margin: 22px 0 0;
    padding: 16px 18px;
    border: 2px solid var(--line);
    border-radius: 4px;
}

.player-type-key-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.player-type-key strong {
    font-size: 1.5rem;
    letter-spacing: 0.08em;
    text-align: center;
}

.player-type-key-note {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.9rem;
}

.player-type-key.is-gold {
    border-color: #d4a72c;
    background: #fff8dd;
}

.player-type-key.is-gold strong {
    color: #8a6500;
}

.player-type-key.is-diamond {
    border-color: var(--blue);
    background: #eaf5ff;
}

.player-type-key.is-diamond strong {
    color: var(--gold-deep);
}

.registration-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    margin-top: 28px;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 22px;
}

.field label {
    font-weight: 800;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 54px;
    padding: 12px 15px;
    border: 1px solid #b7c1cc;
    border-radius: 2px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

.field textarea {
    min-height: 125px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--gold-deep);
    box-shadow: 0 0 0 4px rgba(31, 130, 192, 0.2);
}

.field-hint {
    color: var(--muted);
    font-size: 0.82rem;
}

.input-with-suffix {
    position: relative;
}

.input-with-suffix input {
    padding-right: 62px;
}

.input-with-suffix span {
    position: absolute;
    top: 50%;
    right: 16px;
    color: var(--muted);
    font-weight: 800;
    transform: translateY(-50%);
}

.status {
    min-height: 28px;
    margin: 18px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.status.is-error {
    color: var(--red);
}

.status.is-success {
    color: var(--green);
}

.form-check-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.form-check-field input {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin: 1px 0 0;
}

.doors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: clamp(12px, 2vw, 24px);
    margin: 34px 0;
}

.ruffle-screen .doors {
    width: 100%;
    max-width: 1840px;
    height: min(72vh, 720px);
    margin: 0 auto;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: clamp(8px, 0.8vw, 14px);
}

.door-frame {
    position: relative;
    min-height: clamp(190px, 28vw, 330px);
}

.ruffle-screen .door-frame {
    height: 100%;
    min-height: 0;
}

.door {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: clamp(190px, 28vw, 330px);
    overflow: hidden;
    border: 0;
    border-radius: 6px 6px 2px 2px;
    color: #fff;
    background: var(--navy);
    box-shadow: inset 0 -13px 0 rgba(0, 0, 0, 0.16), 0 18px 28px rgba(44, 152, 128, 0.24);
    cursor: default;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.ruffle-screen .door {
    height: 100%;
    min-height: 0;
}

.door::before {
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(31, 130, 192, 0.46);
    border-radius: 3px;
    content: "";
}

.door::after {
    position: absolute;
    top: 50%;
    right: 24px;
    width: 16px;
    height: 16px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.14);
    content: "";
    transform: translateY(-50%);
    transition: opacity 120ms ease, visibility 120ms ease;
}

.door-number {
    position: absolute;
    z-index: 3;
    top: 24px;
    left: 50%;
    color: rgba(255, 255, 255, 0.94);
    font-size: 1.05rem;
    font-weight: 900;
    transform: translateX(-50%);
    transition: opacity 120ms ease, visibility 120ms ease;
}

.door-reveal {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: block;
    overflow: hidden;
    border-radius: 3px;
    background: #fff;
    opacity: 0;
    transform: scale(0.9);
    filter: blur(18px);
    transition: opacity 260ms ease, transform 520ms ease, filter 720ms ease;
}

.door-reveal-image {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: inherit;
    object-fit: contain;
}

.door-reveal-name {
    position: absolute;
    z-index: 2;
    right: 8%;
    bottom: 8%;
    left: 8%;
    max-width: 92%;
    color: var(--navy);
    font-size: clamp(0.85rem, 1.6vw, 1.15rem);
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
}

.door.is-opening {
    animation: door-opening 720ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transform-origin: 0 50%;
    z-index: 40;
}

.door-frame.is-revealing {
    z-index: 30;
}

.door.is-open,
.door.is-zoom-opening {
    z-index: 40;
}

.door.is-zoom-opening {
    animation: door-zoom-opening 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    transform-origin: 0 50%;
}

.door-frame.is-revealing .door-reveal {
    opacity: 0.94;
    transform: scale(1);
    filter: blur(7px);
}

.door-frame.is-revealing .door-reveal-name {
    opacity: 0;
    visibility: hidden;
}

@keyframes door-opening {
    0% {
        transform: perspective(1000px) rotateY(0deg) translateY(0);
    }

    55% {
        transform: perspective(1000px) rotateY(-80deg) translateY(0);
    }

    100% {
        transform: perspective(1000px) rotateY(-75deg) translateY(0);
    }
}

@keyframes door-zoom-opening {
    0% {
        transform: perspective(1000px) rotateY(-75deg) translateY(0);
    }

    100% {
        transform: perspective(1000px) rotateY(-120deg) translateY(0);
    }
}

.door.is-lit {
    filter: saturate(1.4);
    box-shadow: inset 0 -13px 0 rgba(0, 0, 0, 0.12), 0 0 0 5px rgba(31, 130, 192, 0.62), 0 0 40px rgba(31, 130, 192, 0.82);
    transform: translateY(-7px);
}

.door.is-open {
    color: var(--ink);
    background: var(--gold);
    box-shadow: inset 0 -13px 0 rgba(44, 152, 128, 0.14), 0 22px 38px rgba(44, 152, 128, 0.26);
    transform: perspective(1000px) rotateY(-75deg) translateY(0);
}

.door.is-open::before {
    border-color: rgba(44, 152, 128, 0.32);
}

.door.is-open .door-number {
    color: #fff;
}

.door.is-opening .door-number,
.door.is-opening::after,
.door.is-zoom-opening .door-number,
.door.is-zoom-opening::after,
.door.is-open .door-number,
.door.is-open::after {
    opacity: 0;
    visibility: hidden;
}

.ruffle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1840px;
    margin: 0 auto clamp(18px, 3vw, 34px);
}

.ruffle-header-label {
    color: var(--gold);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.prize-reveal {
    position: fixed;
    z-index: 20;
    inset: 0;
    overflow: hidden;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 280ms ease;
}

.prize-reveal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.prize-reveal-label,
.prize-reveal-title,
.prize-reveal-name {
    position: fixed;
    z-index: 3;
    left: 50%;
    width: min(92vw, 900px);
    margin: 0;
    text-align: center;
    opacity: 0;
    text-shadow: 0 2px 12px rgba(255, 255, 255, 0.9);
    transform: translateX(-50%) translateY(12px);
    transition: opacity 450ms ease, transform 450ms ease;
}

.prize-reveal-label {
    top: 11%;
    width: auto;
    max-width: 90vw;
    padding: 8px 16px;
    border-radius: 999px;
    color: #fff;
    background: var(--gold);
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-shadow: none;
    text-transform: uppercase;
}

.prize-reveal-title {
    top: 15%;
    width: auto;
    max-width: 92vw;
    padding: 12px 24px 14px;
    border-radius: 3px;
    color: #fff;
    background: rgba(44, 152, 128, 0.96);
    font-size: clamp(1.9rem, 5vw, 4.4rem);
    line-height: 1;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

.prize-reveal-name {
    top: var(--name-top, calc(42% + min(29vh, 250px)));
    width: auto;
    max-width: 90vw;
    padding: 8px 20px 10px;
    border-radius: 3px;
    color: #fff;
    background: rgba(44, 152, 128, 0.96);
    font-size: clamp(1.35rem, 3vw, 2.5rem);
    font-weight: 900;
    line-height: 1.15;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

.prize-reveal.is-text-only .prize-reveal-name {
    top: 50%;
    font-size: clamp(1.8rem, 5vw, 4rem);
}

.prize-reveal.is-zoomed .prize-reveal-label,
.prize-reveal.is-zoomed .prize-reveal-title,
.prize-reveal.is-zoomed .prize-reveal-name {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.prize-reveal.is-zoomed .prize-reveal-label {
    transition-delay: 350ms;
}

.prize-reveal.is-zoomed .prize-reveal-title {
    transition-delay: 450ms;
}

.prize-reveal.is-zoomed .prize-reveal-name {
    transition-delay: 850ms;
}

.hidden {
    display: none !important;
}

@media (max-width: 820px) {
    .screen {
        width: min(100% - 28px, 680px);
        padding-top: 24px;
    }

    .ruffle-screen {
        padding: 24px 14px;
    }

    .topbar {
        margin-bottom: 52px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    h1 {
        font-size: clamp(2.6rem, 14vw, 5rem);
    }

    .doors {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ruffle-screen .doors {
        height: auto;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: auto;
    }

    .door {
        min-height: 190px;
    }

    .ruffle-screen .door {
        height: auto;
        min-height: 140px;
    }

    .ruffle-screen .door-frame {
        height: auto;
        min-height: 140px;
    }
}

@media (max-width: 430px) {
    .topbar {
        align-items: flex-start;
    }

    .top-link {
        display: none;
    }

    .doors {
        gap: 10px;
    }

    .ruffle-screen .doors {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .door {
        min-height: 165px;
        border-radius: 18px 18px 8px 8px;
    }

    .ruffle-screen .door {
        min-height: 165px;
    }

    .ruffle-screen .door-frame {
        min-height: 165px;
    }
}
