/* =========================================================
   Coca-Cola Spin & Win — tablet portrait (locked 800x1280)
   ========================================================= */

@font-face {
    font-family: 'Dress Code Bold';
    src: url('../font/Dress Code Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

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

html, body {
    width: 100%;
    height: 100%;
    background: #111;
    font-family: 'Arial', 'Helvetica', sans-serif;
    color: #fff;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; cursor: pointer; }

/* ---------- Device frame: fills actual viewport ---------- */
.device-frame {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;               /* respect dynamic browser chrome */
    background: #e30613;          /* Coca-Cola red */
    overflow: hidden;
}

.screen {
    position: absolute;
    inset: 0;
    background: #e30613;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bottom-logo {
    position: absolute;
    bottom: 3vh;
    left: 50%;
    transform: translateX(-50%);
    width: 50vw;
    max-width: 400px;
    height: auto;
    z-index: 10;            /* always on top, never covered by anything */
    pointer-events: none;
    display: block;
    opacity: 1;
}

.bottom-logo-sec {
    position: absolute;
    bottom: 17vh;
    left: 50%;
    transform: translateX(-50%);
    width: 60vw;
    max-width: 440px;
    height: auto;
    z-index: 10;            /* always on top, never covered by anything */
    pointer-events: none;
    display: block;
    opacity: 1;
}

/* ====================== SCREEN 0 : LOGIN ====================== */
.screen-login {
    justify-content: flex-start;
    padding-top: 10vh;
    padding-bottom: 2vh;
    font-family: 'Dress Code Bold', 'Arial', sans-serif;
}
.screen-login .login-form {
    width: 80vw;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.screen-login .login-title {
    text-align: center;
    color: #fff;
    font-size: clamp(24px, 4vw, 36px);
    letter-spacing: 2px;
    margin-bottom: 5vh;
    font-family: 'Dress Code Bold', 'Arial', sans-serif;
}
.screen-login .field input,
.screen-login .field label {
    font-family: 'Dress Code Bold', 'Arial', sans-serif;
}
.screen-login .login-err {
    color: #fff;
    background: rgba(0, 0, 0, .35);
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 2vh;
    text-align: center;
    font-size: 14px;
    font-family: 'Arial', sans-serif;
}
.screen-login .inline-logo {
    display: block;
    width: 45vw;
    max-width: 360px;
    height: auto;
    margin: 4vh auto 0;
    align-self: center;
}

/* ====================== SCREEN 1 : REGISTRATION ====================== */
.screen-reg {
    justify-content: flex-start;   /* form anchored near top, like approved */
    padding-top: 9vh;
    padding-bottom: 2vh;
    font-family: 'Dress Code Bold', 'Arial', sans-serif;
}
/* Apply Dress Code Bold to reg-screen inputs and labels only — NOT the consent text */
.screen-reg .field input,
.screen-reg .field label {
    font-family: 'Dress Code Bold', 'Arial', sans-serif;
}
/* Consent (T&C) keeps the default Arial */
.screen-reg .consent,
.screen-reg .consent span {
    font-family: 'Arial', 'Helvetica', sans-serif;
}

.screen-reg .inline-logo {
    display: block;
    width: 45vw;
    max-width: 360px;
    height: auto;
    margin: 4vh auto 0;            /* tight to consent */
    align-self: center;
}   

.screen-reg .reg-form {
    width: 80vw;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.field {
    width: 100%;
    margin-bottom: 3vh;            /* generous gap between field groups (approved) */
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.field input {
    width: 100%;
    height: 6vh;
    min-height: 50px;
    max-height: 80px;
    border: none;
    border-radius: 25px;
    background: #fff;
    padding: 0 30px;
    font-size: clamp(20px, 4.2vw, 30px);
    font-weight: 700;
    text-transform: uppercase;
    color: #222;
    outline: none;
    text-align: center;
}

.field label {
    margin-top: 1vh;
    font-size: clamp(18px, 3vw, 30px);
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #fff;
    text-align: center;
}

.submit-btn {
    width: 14vh;
    height: 14vh;
    max-width: 150px;
    max-height: 150px;
    margin: 1vh auto 0;            /* tight to last field */
    border: none;
    background: url('../img/SUBMIT.png') center/contain no-repeat transparent;
    cursor: pointer;
    transition: transform .1s;
    flex-shrink: 0;
}
.submit-btn:active:not(:disabled) { transform: scale(0.95); }
.submit-btn:disabled { opacity: .5; cursor: not-allowed; }

.consent {
    margin: 3.2vh auto 0;          /* tight to submit */
    width: 70vw;
    max-width: 560px;
    display: flex;
    align-items: flex-start;
    font-size: clamp(11px, 1.8vw, 15px);
    line-height: 1.35;
    color: #fff;
    gap: 8px;
}
.consent input[type="checkbox"] {
    width: 16px; height: 16px; margin-top: 3px; flex-shrink: 0;
}

/* ====================== SCREEN 2 : WHEEL ====================== */
.screen-wheel {
    padding-top: 5vh;
    padding-bottom: 14vh;          /* keep clear of bottom logo */
    justify-content: flex-start;
}

.wheel-wrap {
    position: relative;
    width: min(92vw, 56vh);
    height: min(92vw, 56vh);
}

.wheel {
    position: absolute;
    inset: 0;
    transition: transform 5s cubic-bezier(0.17, 0.67, 0.21, 1);
    transform-origin: 50% 50%;
}

.wheel-base {
    position: absolute;
    width: 100%; height: 100%;
    top: 0; left: 0;
    display: block;
}

/* Wedge overlay — anchored at center, rotated, content offset outward */
.wedge {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    transform-origin: 0 0;
    pointer-events: none;
}
/* Items sit at the geometric middle of each wedge (50% of radius). */
.wedge img {
    position: absolute;
    width: 12.5vh;
    height: 11.5vh;
    object-fit: contain;
    left: -3.45vh;
    top: calc(-1 * (min(92vw, 56vh) / 2) * 0.65);
    transform: translateY(-50%);
}
.wedge.tryagain img {
    width: 10vh;
    height: 10vh;
    left: -2vh;
    top: calc(-1 * (min(92vw, 56vh) / 2) * 0.65);
}

.wheel-center {
    position: absolute;
    width: 16vh;
    height: 16vh;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
}

/* Spin button sits directly below the wheel — pointed top touches the rim */
.spin-btn {
    position: relative;
    margin-top: -1vh;             /* overlap slightly so the teardrop point kisses the wheel */
    background: transparent;
    border: none;
    padding: 0;
    width: 11vh;
    height: 13vh;
    max-width: 130px;
    max-height: 160px;
    transition: transform .1s;
    z-index: 1;                   /* below bottom-logo so it doesn't cover it */
}
.spin-btn img { width: 100%; height: 100%; object-fit: contain; }
.spin-btn:active:not(:disabled) { transform: scale(0.95); }
.spin-btn:disabled { opacity: .7; cursor: not-allowed; }

/* ====================== SCREEN 3/4 : RESULT ====================== */
.screen-result {
    padding-top: 18vh;
    padding-bottom: 14vh;          /* keep clear of bottom logo */
    justify-content: flex-start;
}

.result-emoji {
    width: min(50vw, 380px);
    height: auto;
    object-fit: contain;
    margin-bottom: -6vh;
    z-index: 9999;
}

/* Box uses the asset's natural 977:555 aspect ratio so the red border
   stays a clean rounded rectangle (no stretching). */
.result-box {
    position: relative;
    width: min(78vw, 600px);
    aspect-ratio: 977 / 555;
    background: url('../img/WIN & LOST BOX.png') center/contain no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3vw;
    padding: 4% 6%;
}

/* WIN: text on left, prize on right — both inside the box */
.result-text {
    height: 45%;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}
.result-prize {
    height: 75%;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

/* LOSE: single self-contained badge (box + border + text in one image) */
.lost-badge {
    width: min(78vw, 600px);
    height: auto;
    object-fit: contain;
    display: block;
}

/* ====================== Reset hint ====================== */
.reset-hint {
    position: fixed;
    top: 10px; right: 10px;
    z-index: 9999;
}
.reset-hint button {
    background: rgba(0,0,0,.55);
    color: #fff;
    border: 1px solid #fff;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    letter-spacing: 1px;
}

