/* ==========================================================================
   Guest menu — mobile first. Everything here assumes a phone held one-handed
   in bright sunlight; the desktop rules are the afterthought.
   ========================================================================== */

.page {
    max-width: 30rem;
    margin: 0 auto;
    /* Pad for the notch and the rounded screen corners in landscape. */
    padding:
        calc(var(--safe-top) + 1rem)
        calc(var(--safe-right) + 1rem)
        0
        calc(var(--safe-left) + 1rem);
    /* Reserve room for the sticky bar so the last card is never covered.
       --orderbar-h is kept in sync by a ResizeObserver in menu.js. */
    padding-bottom: calc(var(--orderbar-h, 0px) + var(--safe-bottom) + 1.5rem);
}

/* --- Masthead: the felt sign over the entrance ---------------------------- */
.masthead {
    text-align: center;
    padding: 1.75rem 1.1rem 1.6rem;
    margin-bottom: 1.25rem;
}

.masthead-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.4rem;
}

.masthead h1 {
    font-size: clamp(1.7rem, 8.5vw, 2.3rem);
    margin-bottom: 0.35rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.masthead-tagline {
    color: rgba(255, 255, 255, 0.82);
    font-style: italic;
}

.queue-hint {
    margin-top: 0.9rem;
    background: rgba(3, 34, 22, 0.55);
    border: 1px solid var(--gold-deep);
    color: var(--gold-bright);
}

/* --- Name field ---------------------------------------------------------- */
.guest-name {
    margin-bottom: 1.5rem;
}

.guest-name-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    /* On the backdrop, not on a card — so it has to be light. */
    color: var(--gold-bright);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    margin-bottom: 0.4rem;
    padding-left: 0.3rem;
}

.guest-name input {
    width: 100%;
    min-height: var(--tap);
    padding: 0.7rem 1.1rem;
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--surface-strong);
    box-shadow: var(--shadow-sm);
    /* MUST stay >= 16px — anything smaller makes iOS auto-zoom on focus. */
    font-size: 1rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.guest-name input::placeholder {
    color: var(--ink-faint);
}

.guest-name input:focus {
    outline: none;
    border-color: var(--gold-deep);
    box-shadow: var(--shadow);
}

/* --- Sections & drink cards ---------------------------------------------- */
.menu-section {
    margin-bottom: 1.75rem;
}

.loading {
    text-align: center;
    color: var(--foam);
    padding: 2rem 0;
}

.drink {
    position: relative;
    overflow: hidden;
    margin-bottom: 0.7rem;
    background: var(--surface-strong);
    /* The selected state is drawn with an inset ring so selecting a card never
       changes its size and never shifts the cards below it. */
    box-shadow: var(--shadow-sm), inset 0 0 0 0 transparent;
    transition: box-shadow 0.2s ease, transform 0.12s ease, background 0.2s ease;
}

/* The whole upper half of the card is one real <button>: "add one of these".
   Not a role="button" wrapper — that would nest the stepper buttons inside it. */
.drink-body {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    width: 100%;
    text-align: left;
    padding: 0.95rem 1rem 0.85rem;
    color: inherit;
}

.drink-emoji {
    font-size: 1.5rem;
    line-height: 1;
}

/* These are spans, not block elements: only phrasing content is allowed
   inside a <button>, so the display types are set here instead. */
.drink-text {
    display: block;
    flex: 1;
    min-width: 0;
    padding-top: 0.15rem;
}

.drink-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.2;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

.drink-desc {
    display: block;
    font-size: 0.88rem;
    color: var(--ink-soft);
    line-height: 1.45;
}

.house-badge {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold), var(--gold-deep));
    color: #33240a;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.drink.selected {
    background: #fff;
    box-shadow: var(--shadow), inset 0 0 0 2px var(--gold-deep);
}

.drink-body:active {
    transform: scale(0.99);
}

@media (hover: hover) and (pointer: fine) {
    .drink:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow), inset 0 0 0 0 transparent;
    }

    .drink.selected:hover {
        box-shadow: var(--shadow), inset 0 0 0 2px var(--gold-deep);
    }
}

/* --- Quantity stepper ---------------------------------------------------- */
/* Always visible and always starting at 0. It used to appear on tap already
   showing 1, which read as "we added one for you". */
.qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    margin: 0 1rem;
    padding: 0.6rem 0 0.75rem;
    border-top: 1px solid var(--surface-line);
}

.qty-btn {
    /* 48px, up from the old 40px — under 44px is below the Apple/WCAG floor. */
    width: var(--tap);
    height: var(--tap);
    border-radius: 50%;
    background: var(--sand);
    color: var(--felt-deep);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(156, 112, 24, 0.35);
    transition: transform 0.12s ease, background 0.16s ease, opacity 0.16s ease;
}

.qty-btn:active {
    transform: scale(0.9);
    background: var(--sand-deep);
}

.qty-btn:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
}

.qty-btn[data-act='inc'] {
    background: linear-gradient(160deg, var(--gold), var(--gold-deep));
    color: #33240a;
}

.qty-val {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    min-width: 2.4rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Zero is deliberately quiet, so a card with a real quantity stands out. */
.drink:not(.selected) .qty-val {
    color: var(--ink-faint);
}

@media (hover: hover) and (pointer: fine) {
    .qty-btn:hover:not(:disabled) {
        background: var(--chip-red);
        color: #fff;
    }

    .qty-btn[data-act='inc']:hover {
        background: linear-gradient(160deg, var(--gold-bright), var(--gold));
        color: #33240a;
    }
}

/* --- Live tickets: each one is a playing card ---------------------------- */
.tickets {
    margin-bottom: 1.5rem;
}

.ticket {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    margin-bottom: 0.6rem;
    background: var(--surface-strong);
    border-radius: var(--radius);
    border: 1px solid var(--surface-line);
    box-shadow: var(--shadow-sm);
}

.ticket-num {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3.9rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(165deg, var(--felt-light), var(--felt-deep));
    border: 1px solid var(--gold);
    color: var(--gold-bright);
    font-weight: 800;
    font-family: var(--font-display);
    line-height: 1;
    font-size: 1.05rem;
    box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.ticket-num small {
    display: block;
    font-size: 0.52rem;
    letter-spacing: 0.1em;
    opacity: 0.8;
    font-weight: 600;
}

.ticket-info {
    flex: 1;
    min-width: 0;
}

.ticket-drinks {
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.ticket-status {
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ticket-status::before {
    content: '';
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: currentColor;
}

.ticket[data-status='pending'] .ticket-status {
    color: var(--ink-soft);
}

.ticket[data-status='preparing'] .ticket-status {
    color: var(--chip-red-deep);
}

.ticket[data-status='preparing'] .ticket-status::before {
    animation: pulse 1.1s ease-in-out infinite;
}

.ticket[data-status='completed'] {
    background: linear-gradient(135deg, #f6fff8, #fff);
    box-shadow: var(--shadow), inset 0 0 0 2px var(--gold);
}

.ticket[data-status='completed'] .ticket-status {
    color: var(--felt);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(1.35); }
}

/* --- Sticky order bar ---------------------------------------------------- */
.orderbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding:
        0.75rem
        calc(var(--safe-right) + 1rem)
        calc(var(--safe-bottom) + 0.75rem)
        calc(var(--safe-left) + 1rem);
    background: rgba(6, 64, 43, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 2px solid var(--gold-deep);
    box-shadow: 0 -8px 28px rgba(3, 42, 28, 0.4);
    color: var(--foam);
}

.orderbar :focus-visible {
    outline-color: var(--gold-bright);
}

/* Centre the bar's contents on wide screens without unpinning it. */
.orderbar > * {
    width: 100%;
    max-width: 28rem;
    margin-inline: auto;
}

.orderbar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.2rem;
    font-weight: 700;
    color: var(--gold-bright);
}

.orderbar-toggle .chevron {
    transition: transform 0.2s ease;
    color: var(--gold);
}

.orderbar-toggle[aria-expanded='true'] .chevron {
    transform: rotate(180deg);
}

.orderbar-list {
    max-height: 34vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.orderbar-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.orderbar-row:last-child {
    border-bottom: none;
}

.orderbar-row span:last-child {
    font-weight: 700;
    color: var(--gold-bright);
    font-variant-numeric: tabular-nums;
}

.orderbar-submit {
    min-height: 3.25rem;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

/* --- Splash: a shower of chips on a placed bet --------------------------- */
.splash {
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
    opacity: 0;
}

.splash.go {
    opacity: 1;
}

.splash span {
    position: absolute;
    bottom: -3rem;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.9);
    background: radial-gradient(circle, #fff 0 45%, var(--chip-red) 46%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.55);
    opacity: 0;
}

.splash.go span {
    animation: rise 1.5s ease-out forwards;
}

@keyframes rise {
    0%   { opacity: 0; transform: translateY(0) scale(0.6) rotate(0deg); }
    18%  { opacity: 0.95; }
    100% { opacity: 0; transform: translateY(-105vh) scale(1.4) rotate(220deg); }
}

.splash span:nth-child(1)  { left:  6%; animation-delay: 0.00s; }
.splash span:nth-child(2)  { left: 14%; animation-delay: 0.16s; width: 1.35rem; height: 1.35rem; }
.splash span:nth-child(3)  { left: 23%; animation-delay: 0.05s; }
.splash span:nth-child(4)  { left: 31%; animation-delay: 0.28s; width: 0.85rem; height: 0.85rem; }
.splash span:nth-child(5)  { left: 40%; animation-delay: 0.10s; width: 1.25rem; height: 1.25rem; }
.splash span:nth-child(6)  { left: 48%; animation-delay: 0.34s; }
.splash span:nth-child(7)  { left: 56%; animation-delay: 0.02s; width: 0.9rem; height: 0.9rem; }
.splash span:nth-child(8)  { left: 64%; animation-delay: 0.22s; width: 1.4rem; height: 1.4rem; }
.splash span:nth-child(9)  { left: 72%; animation-delay: 0.12s; }
.splash span:nth-child(10) { left: 80%; animation-delay: 0.30s; width: 0.85rem; height: 0.85rem; }
.splash span:nth-child(11) { left: 88%; animation-delay: 0.07s; width: 1.2rem; height: 1.2rem; }
.splash span:nth-child(12) { left: 94%; animation-delay: 0.26s; }

/* Chip colours: red, gold and felt, like a real rack. */
.splash span:nth-child(3n+2) { background: radial-gradient(circle, #fff 0 45%, var(--gold-deep) 46%); }
.splash span:nth-child(3n)   { background: radial-gradient(circle, #fff 0 45%, var(--felt) 46%); }

/* --- Toast --------------------------------------------------------------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--orderbar-h, 0px) + var(--safe-bottom) + 1rem);
    transform: translateX(-50%);
    z-index: 70;
    max-width: min(22rem, calc(100vw - 2rem));
    padding: 0.75rem 1.1rem;
    border-radius: var(--radius-pill);
    background: var(--felt-deep);
    border: 1px solid var(--gold);
    color: var(--gold-bright);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.footer-note {
    text-align: center;
    font-size: 0.82rem;
    color: var(--foam);
    opacity: 0.85;
    padding: 0.5rem 0 1rem;
}

/* --- Wider screens ------------------------------------------------------- */
@media (min-width: 48rem) {
    .page {
        max-width: 34rem;
        padding-top: calc(var(--safe-top) + 2rem);
    }

    .masthead {
        padding: 2.25rem 1.5rem 2rem;
    }
}
