/* Sandbox Coffee Co. installed app home (/app). Builds on site.css tokens and reuses the game styles in bonus.css. */
.app-page { scroll-padding-top: calc(60px + env(safe-area-inset-top)); background: var(--black); }
.app-page body { background: var(--sand-light); min-height: 100vh; }
.app-locked { overflow: hidden; }
.app main { max-width: 640px; margin: 0 auto; }
.app-page .app-pad, .app-view > .app-today, .app-view > .app-card, .app-view > .app-links, .app-view > .app-game, .app-view > .app-quick, .app-view > .app-open, .app-view > .app-loyal-mini, .app-view > .app-photo, .app-view > .app-walkin {
  margin-left: max(16px, env(safe-area-inset-left)); margin-right: max(16px, env(safe-area-inset-right));
}

[tabindex="-1"]:focus { outline: none; }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 6px;
  background: var(--black); color: var(--white);
  padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  min-height: calc(58px + env(safe-area-inset-top));
}
.app-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; min-height: 48px; }
.app-brand img { width: 40px; height: 40px; border-radius: 10px; background: #fff; object-fit: cover; }
.app-brand span { font-weight: 800; font-size: 1rem; letter-spacing: .01em; }
.app-hbtn {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; border: 0; background: transparent;
  color: var(--white); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.app-hbtn svg { width: 24px; height: 24px; }
.app-hbtn:active { background: rgba(255, 255, 255, .1); }

/* Banners */
.app-offline { background: #5b1d12; color: #fff; text-align: center; font-size: .88rem; font-weight: 600; padding: 10px 16px; }
.app-install {
  display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 12px;
  margin: 12px max(16px, env(safe-area-inset-left)) 0; padding: 12px 8px 12px 12px; border-radius: 16px; background: var(--white);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}
.app-install[hidden] { display: none; }
.app-install img { border-radius: 10px; }
.app-install strong { display: block; font-size: .92rem; line-height: 1.3; }
.app-install p { margin: 2px 0 0; font-size: .82rem; color: var(--muted); line-height: 1.35; }
.app-x { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 10px; }

/* Daily game card */
.app-eyebrow { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 8px; }
.app-eyebrow--dark { color: var(--gold-dark); }
.app-game {
  position: relative; overflow: hidden; margin-top: 14px; padding: 22px 20px 20px; border-radius: 24px; color: var(--white);
  background: radial-gradient(120% 90% at 100% 0%, rgba(192, 134, 42, .38) 0%, transparent 55%), linear-gradient(160deg, #2a1d12 0%, #120d09 70%);
  box-shadow: 0 14px 34px rgba(42, 29, 18, .28);
}
.app-game h1, .app-game h2 { font-size: clamp(1.55rem, 6.6vw, 2rem); line-height: 1.12; margin: 0 0 8px; color: var(--white); max-width: 16ch; }
.app-game-sub { color: #e2d6c4; margin: 0 0 14px; font-size: .98rem; line-height: 1.45; }
.app-status { min-height: 32px; }
.app-status p { margin: 8px 0 0; color: #e2d6c4; font-size: .93rem; line-height: 1.45; }
.app-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 800;
  background: rgba(255, 255, 255, .12); color: var(--white); margin: 0 6px 4px 0;
}
.app-pill.is-ready { background: #2f6b3a; color: #fff; }
a.app-pill { text-decoration: none; min-height: 32px; }
a.app-pill:active { filter: brightness(1.15); }
.app-pill.is-ready::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #9de3a8; box-shadow: 0 0 0 0 rgba(157, 227, 168, .7); animation: app-pulse 2s infinite; }
.app-pill.is-done { background: var(--gold); color: var(--black); }
.app-pill.is-closed { background: #3a3129; }
.app-pill.is-warn { background: #7a3b12; }
.app-pill.is-demo { background: transparent; border: 1px dashed rgba(255, 255, 255, .45); font-weight: 700; }
.app-pill.is-loading { opacity: .8; }
.app-card .app-pill.is-ready { background: #e3f1e5; color: #1f5a2b; }
.app-card .app-pill.is-warn { background: #fbe9dc; color: #7a3b12; }
@keyframes app-pulse { 70% { box-shadow: 0 0 0 7px rgba(157, 227, 168, 0); } 100% { box-shadow: 0 0 0 0 rgba(157, 227, 168, 0); } }
.app-odds b, .app-streak { color: var(--gold-light); }
.app-streak { margin: 8px 0 0; font-weight: 700; font-size: .93rem; }
.app-prize {
  margin: 10px 0 4px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(224, 169, 78, .35);
  display: grid; gap: 4px; text-align: center;
}
.app-prize span { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: #cfc7bb; font-weight: 700; }
.app-prize strong { font-size: 1.25rem; line-height: 1.2; }
.app-prize code {
  font: 800 1.45rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; color: var(--black);
  background: var(--gold-light); border-radius: 10px; padding: 8px 10px; margin: 6px auto 2px; word-break: break-all;
}
.app-prize small { color: #e2d6c4; font-size: .85rem; line-height: 1.4; }
.app-tomorrow { font-weight: 600; }
.app-cta { width: 100%; margin-top: 16px; min-height: 54px; font-size: 1.05rem; }
.app-cta[hidden] { display: none; }

/* Quick actions */
.app-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.app-action {
  display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; min-height: 118px; border-radius: 20px; text-decoration: none;
  transition: transform .15s var(--ease); -webkit-tap-highlight-color: transparent;
}
.app-action:active { transform: scale(.97); }
.app-action svg { width: 32px; height: 32px; }
.app-action strong { display: block; font-size: 1.05rem; line-height: 1.2; }
.app-action small { display: block; font-size: .8rem; margin-top: 3px; line-height: 1.3; }
.app-action--order { background: var(--gold); color: var(--black); }
.app-action--order small { color: #3b2a12; }
.app-action--rc { background: var(--black); color: var(--white); }
.app-action--rc svg { color: var(--gold-light); }
.app-action--rc small { color: #cfc7bb; }
.app-open { margin-top: 12px; margin-bottom: 0; text-align: center; font-size: .88rem; color: var(--muted); font-weight: 600; }

/* Loyalty shortcut */
.app-loyal-mini {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 14px; border-radius: 18px; background: var(--white);
  text-decoration: none; box-shadow: 0 4px 16px rgba(0, 0, 0, .05); min-height: 64px;
}
.app-loyal-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sand); color: var(--gold-dark); font-size: 1.2rem; flex: none; }
.app-loyal-mini strong { display: block; font-size: 1rem; }
.app-loyal-mini small { display: block; font-size: .84rem; color: var(--muted); }
.app-chev { margin-left: auto; font-size: 1.6rem; color: var(--concrete); }

.app-photo { margin-top: 14px; margin-bottom: 0; border-radius: 20px; overflow: hidden; position: relative; }
.app-photo img { width: 100%; height: 170px; object-fit: cover; }
.app-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px; color: #fff; font-size: .85rem; font-weight: 600;
  background: linear-gradient(transparent, rgba(0, 0, 0, .72));
}
.app-photo a { color: var(--gold-light); }
.app-walkin { text-align: center; font-size: .82rem; color: var(--muted); margin-top: 10px; margin-bottom: 18px; }

/* Play view: the website's game section, made compact */
.app-play .hbb { padding: 18px 0 24px; }
.app-play .hbb .wrap { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
.app-play .hbb-head { margin-bottom: 14px; }
.app-play .hbb-head h2 { font-size: 1.7rem; margin: .1em 0 .2em; }
.app-play .hbb-head .lead { font-size: .95rem; }
/* The prize panel (play button, reward code) comes first so today's status is visible without scrolling; the board
   follows and bonus.js scrolls it into view while the prize animates. Loyalty has its own tab in the app. */
.app-play .hbb-head .lead, .app-play .hbb-tagline, .app-play .hbb-photo, .app-play .hbb-loyal, .app-play .hbb-merch { display: none; }
.app-play .hbb-grid { display: flex; flex-direction: column; gap: 16px; }
.app-play .hbb-side { order: -1; }
.app-play .hbb-fine { margin-top: 16px; }

/* Loyalty view */
.app-loyalty .app-pad { padding: 20px 0 8px; }
.app-loyalty h1 { font-size: 1.8rem; margin-bottom: 14px; }
.app-card { background: var(--white); border-radius: 20px; padding: 18px; margin-bottom: 14px; box-shadow: 0 4px 16px rgba(0, 0, 0, .05); }
.app-card h2 { font-size: 1.15rem; margin-bottom: 8px; }
.app-card p { margin-bottom: 10px; }
.app-card--plain { background: transparent; box-shadow: none; border: 1px solid #e3d8c6; }
.app-card--member { background: linear-gradient(160deg, #2a1d12, #120d09); color: var(--white); }
.app-card--member p { color: #e2d6c4; }
.app-card--member .app-fine { color: #cfc7bb; }
.app-card--member .app-fine a { color: var(--gold-light); }
.app-streak-big { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 6px; }
.app-streak-big strong { font-size: 3rem; line-height: 1; color: var(--gold-light); }
.app-streak-big span { font-weight: 700; color: #e2d6c4; }
.app-bar { margin: 4px 0 12px; }
.app-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.app-btns .btn { flex: 1 1 180px; }
.btn--outline-dark { border: 2px solid var(--black); background: transparent; color: var(--black); }
.app-fine { font-size: .8rem; color: var(--muted); line-height: 1.45; margin: 10px 0 0; }
.app-form label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 6px; }
.app-form-row { display: flex; gap: 8px; }
.app-form input {
  flex: 1; min-width: 0; min-height: 50px; padding: 0 14px; border: 2px solid #d9cdb9; border-radius: 12px; font: inherit; font-size: 16px; background: #fff;
}
.app-form input:focus { border-color: var(--gold); outline: none; }

/* More sheet */
.app-sheet { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .5); display: flex; align-items: flex-end; justify-content: center; }
.app-sheet[hidden] { display: none; }
.app-sheet-inner {
  width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; background: var(--white); border-radius: 22px 22px 0 0;
  padding: 10px max(18px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  animation: app-up .22s var(--ease);
}
@keyframes app-up { from { transform: translateY(30px); opacity: .4; } }
.app-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.app-sheet-head h2 { font-size: 1.1rem; margin: 0; }
.app-more-list { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.app-more-list a { display: flex; align-items: center; min-height: 48px; text-decoration: none; font-weight: 600; font-size: .95rem; border-bottom: 1px solid #efe7da; }
.app-site-link { display: block; text-align: center; padding: 14px; font-weight: 700; color: var(--gold-dark); }
@media (max-width: 359px) { .app-more-list { grid-template-columns: 1fr; } .app-brand span { font-size: .9rem; } }

/* Landscape phones: keep the game card and actions side by side so nothing hides under the nav */
@media (orientation: landscape) and (max-height: 500px) {
  .app main { max-width: 900px; }
  .app-view[data-view="home"]:not([hidden]) { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 4px; align-items: start; }
  .app-view[data-view="home"] > .app-game { grid-row: span 4; }
  .app-view[data-view="home"] > .app-photo { display: none; }
  .app-quick { margin-top: 14px; }
  .app-header { min-height: calc(48px + env(safe-area-inset-top)); }
  .app-brand img { width: 34px; height: 34px; }
  .app-game { padding: 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-pill.is-ready::before, .app-sheet-inner { animation: none; }
  .app-action { transition: none; }
}

/* Show My Reward: home banner and the reward screen */
.app-reward-banner {
  display: flex; align-items: center; gap: 12px; margin: 12px max(16px, env(safe-area-inset-left)) 0; padding: 12px 14px; border-radius: 16px;
  background: var(--gold); color: var(--black); text-decoration: none; box-shadow: 0 6px 18px rgba(192, 134, 42, .35); min-height: 60px;
}
.app-reward-banner[hidden] { display: none; }
.app-reward-banner > span:first-child { font-size: 1.6rem; }
.app-reward-banner strong { display: block; font-size: 1.05rem; }
.app-reward-banner small { display: block; font-size: .84rem; color: #3b2a12; }
.app-reward-banner .app-chev { color: var(--black); }
.app-reward .app-pad { padding: 18px 0 8px; }
.app-reward h1 { font-size: 1.6rem; margin-bottom: 12px; }
.app-ticket {
  position: relative; text-align: center; color: var(--white); border-radius: 22px; padding: 22px 18px 18px; margin-bottom: 14px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(192, 134, 42, .35), transparent 60%), linear-gradient(160deg, #2a1d12, #120d09);
  box-shadow: 0 14px 34px rgba(42, 29, 18, .28);
}
.app-ticket::before, .app-ticket::after { content: ''; position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: var(--sand-light); transform: translateY(-50%); }
.app-ticket::before { left: -11px; } .app-ticket::after { right: -11px; }
.app-ticket-kicker { display: block; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #cfc7bb; }
.app-ticket-prize { display: block; font-size: 1.7rem; line-height: 1.15; margin: 4px 0 14px; }
.app-full-house { margin: 0 0 6px; font-weight: 800; letter-spacing: .12em; color: var(--gold-light); }
.app-ticket-code {
  background: var(--gold-light); color: var(--black); border-radius: 14px; padding: 14px 10px; margin: 0 auto 12px;
  font: 800 clamp(1.7rem, 9vw, 2.4rem)/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; word-break: break-all;
  user-select: all; -webkit-user-select: all;
}
.app-ticket-code.is-used { background: rgba(255, 255, 255, .12); color: #cfc7bb; text-decoration: line-through; }
.app-copy { min-width: 160px; background: rgba(255, 255, 255, .12); }
.app-valid { margin: 14px 0 2px; font-weight: 800; letter-spacing: .04em; color: var(--gold-light); }
.app-left { margin: 0; font-size: .9rem; color: #e2d6c4; }
.app-ticket.is-used p { color: #e2d6c4; margin: 0; }
.app-demo-note { background: #fff3cd; color: #3b2a12; border-radius: 10px; padding: 8px 10px; font-size: .82rem; margin: 0 0 12px; }
.app-steps { margin: 0 0 8px; padding-left: 1.2em; }
.app-steps li { margin-bottom: 6px; }
[data-app-view="reward"] .app-reward-banner, [data-app-view="play"] .app-reward-banner { display: none; }

/* Your Sandbox Today (home) */
.app-today { padding-top: 16px; }
.app-today h1 { font-size: clamp(1.45rem, 6vw, 1.8rem); line-height: 1.15; margin: 0 0 4px; }
.app-today p { margin: 0; font-size: .9rem; color: var(--muted); font-weight: 600; }
.app-view > .app-card { margin-top: 14px; margin-bottom: 0; }
.app-card h3 { font-size: .95rem; margin: 4px 0 8px; }
.app-favs ul { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.app-favs a {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: var(--sand); color: var(--black); font-weight: 700; font-size: .9rem; text-decoration: none;
}
.app-rc { background: linear-gradient(160deg, #1c1c1c, #0b0b0b); color: var(--white); }
.app-rc h2 { color: var(--white); }
.app-rc-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.app-rc-facts span { padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: .82rem; font-weight: 700; }
.app-rc-sub { color: #cfc7bb; font-size: .9rem; line-height: 1.45; }
.app-rc .btn { width: 100%; }
.app-sip-body { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.app-sip-art { flex: none; width: 84px; height: 104px; aspect-ratio: auto; border-radius: 14px; overflow: hidden; }
.app-sip-art svg { width: 44px; height: 44px; }
.app-sip h2 { margin: 2px 0 4px; }
.app-sip p { margin-bottom: 6px; font-size: .93rem; }
.app-sip-pair { color: var(--muted); }
.app-sip-pair a { color: var(--gold-dark); font-weight: 700; }
.app-events .events { margin: 0 0 8px; }
.app-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 18px; font-size: .9rem; }
.app-links a { color: var(--black); font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.app-sip-art img, .app-sip-art picture { display: block; width: 100%; height: 100%; object-fit: cover; }
