/* Mobile-first public experience */
body { overflow-x: hidden; }
main { padding: 0 0 96px; }
.topbar { height: 56px; padding: 0 14px; }
.topbar .brand { font-size: 14px; }
.topbar .brand-heart { width: 30px; height: 30px; border-radius: 10px; }
.topbar .legend { gap: 9px; }
.topbar .legend span { font-size: 0; }
.topbar .dot { width: 12px; height: 12px; }

.raffle-wrap { width: min(100%, 520px); margin: 0 auto; }
.raffle-board {
  width: 100%;
  aspect-ratio: auto;
  overflow: hidden;
  border-radius: 0 0 22px 22px;
  background: #fff8e8;
  box-shadow: 0 18px 50px rgba(24,36,72,.13);
}
.mobile-art-top {
  width: 100%;
  aspect-ratio: 941 / 890;
  background: url("rifa-chaleira-mobile.png") center top / 100% auto no-repeat;
}
.mobile-art-bottom {
  width: 100%;
  aspect-ratio: 941 / 255;
  background: url("rifa-chaleira-mobile.png") center bottom / 100% auto no-repeat;
}
.grid-stage {
  position: relative;
  padding: 4px 12px 12px;
  background: linear-gradient(90deg, #fff8e8, #fffaf0 50%, #fff7e6);
}
.instruction { margin: 0 0 13px; text-align: center; }
.instruction strong { display: block; font-size: 25px; letter-spacing: -.04em; }
.instruction span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.availability-summary {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: #525b70;
  font-size: 10px;
  font-weight: 700;
}
.availability-summary span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.availability-summary .dot { width: 8px; height: 8px; }
.number-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 9px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(7,30,84,.08);
}
.number-tab {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  color: #566078;
  background: transparent;
  font-weight: 900;
}
.number-tab.active { color: white; background: var(--navy); box-shadow: 0 5px 14px rgba(7,30,84,.2); }
.number-overlay {
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(10, 52px);
  overflow: hidden;
  border: 2px solid var(--navy);
  border-radius: 14px;
  background: white;
  box-shadow: 0 8px 24px rgba(7,30,84,.09);
}
.number-button {
  min-width: 0;
  min-height: 52px;
  border: 0;
  border-right: 1px solid rgba(7,30,84,.3);
  border-bottom: 1px solid rgba(7,30,84,.3);
  border-radius: 0;
  color: var(--navy);
  background: rgba(255,255,255,.9);
  font-size: 18px;
  font-weight: 900;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.number-button:nth-child(5n) { border-right: 0; }
.number-button:nth-child(n+46) { border-bottom: 0; }
.number-button:hover:not(:disabled) { transform: none; outline: none; box-shadow: none; background: #fae0e9; }
.number-button:focus-visible { z-index: 2; outline: 3px solid white; box-shadow: inset 0 0 0 4px var(--pink); }
.number-button.selected { z-index: 1; color: white; outline: none; background: var(--pink); box-shadow: inset 0 0 0 3px rgba(255,255,255,.62); }
.number-button.reserved { color: #654b00; background: #f9d46e; }
.number-button.paid { color: white; background: var(--green); }
.number-button.reserved::after, .number-button.paid::after { top: 5px; right: 6px; }
.number-button.paid::after { font-size: 14px; }
.grid-hint { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: 11px; }
.board-loading { inset: 88px 12px 12px; border-radius: 14px; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(7,20,52,.52); backdrop-filter: blur(3px); }
.checkout.bottom-sheet {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  z-index: 70;
  width: min(100%, 520px);
  max-height: min(91dvh, 850px);
  margin: 0;
  padding: 28px 20px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -18px 55px rgba(7,30,84,.24);
  transform: translateX(-50%);
  overscroll-behavior: contain;
}
.sheet-handle { position: absolute; top: 9px; left: 50%; width: 44px; height: 5px; border-radius: 999px; background: #d8dbe2; transform: translateX(-50%); }
.close-sheet { position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%; color: #626b7e; background: #f0f2f5; font-size: 25px; line-height: 1; }
.checkout .eyebrow { margin: 8px 0 2px; color: var(--pink); font-size: 10px; letter-spacing: .14em; font-weight: 900; }
.checkout h2 { margin: 0 0 16px; font-size: 27px; }
.selected-summary strong { font-size: 20px; }
.selected-numbers { max-height: 82px; overflow-y: auto; }
.selected-numbers button { min-width: 42px; height: 38px; padding: 0 7px; display: flex; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 10px; color: white; background: var(--pink); font-size: 13px; font-weight: 900; }
.selected-numbers button i { font-style: normal; font-size: 15px; opacity: .75; }
.buyer-form label { margin-top: 14px; }
.primary-button { min-height: 50px; }
.pix-step { padding-top: 6px; }
.pix-qr { width: min(225px, 65vw); }

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 45;
  width: min(calc(100% - 20px), 500px);
  min-height: 68px;
  padding: 9px 9px 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 19px;
  color: white;
  background: rgba(7,30,84,.96);
  box-shadow: 0 13px 35px rgba(7,30,84,.32);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}
.selection-bar > div { display: flex; flex-direction: column; }
.selection-bar strong { font-size: 14px; }
.selection-bar > div span { margin-top: 1px; color: rgba(255,255,255,.72); font-size: 12px; }
.selection-bar button { min-width: 132px; min-height: 50px; border: 0; border-radius: 13px; color: white; background: var(--pink); font-weight: 900; }

.how-it-works { width: min(calc(100% - 24px), 496px); margin: 38px auto 35px; }
.how-it-works h2 { font-size: 25px; }
.steps { grid-template-columns: 1fr; gap: 10px; }
.steps article { display: grid; grid-template-columns: 40px 1fr; gap: 0 12px; padding: 16px; text-align: left; }
.steps article span { grid-row: 1 / 3; }
.steps h3 { margin: 0; }
.steps p { margin-top: 2px; }
footer { padding-bottom: 100px; }

@media (min-width: 521px) {
  main { padding-top: 18px; }
  .raffle-board { border-radius: 24px; }
}

@media (max-width: 350px) {
  .grid-stage { padding-left: 8px; padding-right: 8px; }
  .number-overlay { grid-template-rows: repeat(10, 49px); }
  .number-button { min-height: 49px; font-size: 16px; }
  .availability-summary { gap: 7px; font-size: 9px; }
}
