/* Sticker picker screen: title, card preview, and sticker grid. */
.br-title-them-sticker {
  top: 107px;
  width: 824px;
  height: 89px;
  background: url("../../images/title-them-sticker.png") center / contain no-repeat;
}

.br-preview-card {
  position: absolute;
  left: 191px;
  top: 211px;
  width: 390px;
  height: 520px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 26px;
  /* The card artwork is a plain rectangle now (no baked-in rounded corners),
     so clip it to this same border-radius. */
  overflow: hidden;
  /* outline (not border) - this card's photo/sticker slots are positioned in
     pixels tuned against its unpadded box (see inc/bootstrap.php's
     CARD_PHOTO_BOX/CARD_STICKER_SLOTS), so a real border would shrink that
     box and knock every slot out of alignment. outline-offset pulls the ring
     inward without touching the box model. */
  outline: 1px solid transparent;
  outline-offset: -1px;
  filter: drop-shadow(0px 0px 6.27219px rgba(0, 49, 197, 0.3));
}
.br-preview-card.br-is-editable {
  cursor: pointer;
}
#screen-stickers[data-color="pink"]   .br-preview-card { outline-color: #FF81C7; }
#screen-stickers[data-color="orange"] .br-preview-card { outline-color: #F19646; }
#screen-stickers[data-color="green"]  .br-preview-card { outline-color: #00B231; }
#screen-stickers[data-color="purple"] .br-preview-card { outline-color: #7B50FF; }
#screen-stickers[data-color="blue"]   .br-preview-card { outline-color: #1A92F8; }

.br-sticker-rail-wrap {
  position: static;
}
.br-sticker-arrow {
  display: none;
}
/* Higher specificity than the mobile/tablet `display: block` overrides below,
   so an arrow with nothing left to scroll to (see br_updateStickerArrows())
   disappears instead of sitting there doing nothing. */
.br-sticker-arrow:disabled {
  display: none;
}

.br-sticker-grid {
  position: absolute;
  left: 660px;
  top: 243px;
  width: 550px;
  height: 380px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 12px;
}
.br-sticker-cell {
  background: #f0f3f9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  border: 2px solid transparent;
}
.br-sticker-cell:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(0,49,197,0.15);
}
.br-sticker-cell.br-is-selected {
  border-color: #0070ff;
  background: #dbeafe;
}
.br-sticker-cell.br-is-match {
  border-color: rgba(0,49,197,0.35);
}
#screen-stickers[data-color="pink"]   .br-sticker-cell.br-is-match { border-color: #FF86D9; }
#screen-stickers[data-color="orange"] .br-sticker-cell.br-is-match { border-color: #FFBA79; }
#screen-stickers[data-color="green"]  .br-sticker-cell.br-is-match { border-color: #67C684; }
#screen-stickers[data-color="purple"] .br-sticker-cell.br-is-match { border-color: #4D56E2; }
#screen-stickers[data-color="blue"]   .br-sticker-cell.br-is-match { border-color: #30AEFF; }
#screen-stickers[data-color="pink"]   .br-sticker-cell.br-is-selected { border-color: #FF86D9; background: #ffe3f4; }
#screen-stickers[data-color="orange"] .br-sticker-cell.br-is-selected { border-color: #FFBA79; background: #fff1e0; }
#screen-stickers[data-color="green"]  .br-sticker-cell.br-is-selected { border-color: #67C684; background: #e5f6e9; }
#screen-stickers[data-color="purple"] .br-sticker-cell.br-is-selected { border-color: #4D56E2; background: #e6e7fb; }
#screen-stickers[data-color="blue"]   .br-sticker-cell.br-is-selected { border-color: #30AEFF; background: #e2f4ff; }
.br-sticker-cell img {
  max-width: 70%;
  max-height: 70%;
  object-fit: contain;
  pointer-events: none;
}
.br-sticker-cell {
  position: relative;
}
.br-sticker-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 999px;
  background: #0070ff;
  color: #fff;
  font-family: "Maison Neue Extended", "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,49,197,0.35);
  pointer-events: none;
}
.br-sticker-badge:empty {
  display: none;
}
#screen-stickers[data-color="pink"]   .br-sticker-badge { background: #FF86D9; }
#screen-stickers[data-color="orange"] .br-sticker-badge { background: #FFBA79; }
#screen-stickers[data-color="green"]  .br-sticker-badge { background: #67C684; }
#screen-stickers[data-color="purple"] .br-sticker-badge { background: #4D56E2; }
#screen-stickers[data-color="blue"]   .br-sticker-badge { background: #30AEFF; }

@media (max-width: 720px) {
  .br-title-them-sticker-mobile {
    width: 255px;
    max-width: 71%;
    aspect-ratio: 227 / 81;
    margin: 8px auto 16px;
    background-image: url("../../images/title-them-sticker-mobile.png");
  }
  .br-preview-card {
    position: relative;
    left: auto; top: auto;
    margin: 0 auto 14px;
    width: 222px;
    height: 296px;
    border-radius: 15px;
  }
  .br-sticker-rail-wrap {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }
  .br-sticker-grid {
    position: static;
    left: auto; top: auto;
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: grid;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 42px) / 4);
    gap: 14px;
    padding: 4px 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 4px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .br-sticker-grid::-webkit-scrollbar { display: none; }
  .br-sticker-cell {
    aspect-ratio: 1;
  }
  /* Only the first column of every 4-column (8-cell, 2-row) group is a snap
     point, so a swipe advances a whole slide at once instead of resting
     partway through one - every other column would split a color pair
     (see br_applyStickerHighlights()) across two views. */
  .br-sticker-cell:nth-child(8n + 1) {
    scroll-snap-align: start;
  }
  .br-sticker-cell img { max-width: 72%; max-height: 72%; }
  .br-sticker-arrow {
    display: block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: transparent;
    background-color: #ffffff;
    filter: drop-shadow(0 1px 3px rgba(0,49,197,0.45));
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 14px 23px;
    mask-size: 14px 23px;
    border: 0;
    padding: 0;
    cursor: pointer;
    z-index: 2;
  }
  .br-sticker-arrow.br-prev {
    left: 2px;
    -webkit-mask-image: url("../../images/arrow-left.svg");
    mask-image: url("../../images/arrow-left.svg");
  }
  .br-sticker-arrow.br-next {
    right: 2px;
    -webkit-mask-image: url("../../images/arrow-right.svg");
    mask-image: url("../../images/arrow-right.svg");
  }
}

/* Tablet: same swipeable 4-per-view rail as mobile, but still living inside the
   fixed 1440x850 design canvas (stage.js only drops that canvas below 720px), so
   it keeps the desktop grid's absolute position/size instead of reflowing. */
@media (min-width: 721px) and (max-width: 1024px) {
  .br-sticker-rail-wrap {
    position: absolute;
    left: 660px;
    top: 243px;
    width: 550px;
    height: 380px;
  }
  .br-sticker-grid {
    position: static;
    left: auto; top: auto;
    width: 100%;
    height: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: none;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 42px) / 4);
    gap: 14px;
    padding: 4px 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 4px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .br-sticker-grid::-webkit-scrollbar { display: none; }
  .br-sticker-cell:nth-child(8n + 1) { scroll-snap-align: start; }
  .br-sticker-arrow {
    display: block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: transparent;
    background-color: #ffffff;
    filter: drop-shadow(0 1px 3px rgba(0,49,197,0.45));
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 16px 26px;
    mask-size: 16px 26px;
    border: 0;
    padding: 0;
    cursor: pointer;
    z-index: 2;
  }
  .br-sticker-arrow.br-prev {
    left: 2px;
    -webkit-mask-image: url("../../images/arrow-left.svg");
    mask-image: url("../../images/arrow-left.svg");
  }
  .br-sticker-arrow.br-next {
    right: 2px;
    -webkit-mask-image: url("../../images/arrow-right.svg");
    mask-image: url("../../images/arrow-right.svg");
  }
}
