/* gacha.css — ตู้กาชา · ตั๋วสุ่ม · ตู้ของแต่ง · ร้านประจำสัปดาห์ (รวมเศษตัวละคร) · คู่กับ gacha.js */
.pg-body:has(.gc-wrap) {
  padding-bottom: calc(var(--u) * 0.6);
}
.gc-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.gc-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: none;
}
.gc-tabs .catbtn {
  margin: 0;
}
.gc-note {
  font-size: 12px;
  color: #ffe9a8;
  background: #0006;
  padding: 3px 10px;
  border-radius: 99px;
}
.gc-main {
  flex: 1;
  min-height: 0;
  display: flex;
}
.gc-main.inv {
  overflow: auto;
  display: block;
}
.gc-stage {
  flex: 1;
  display: flex;
  gap: 10px;
  min-height: 0;
  min-width: 0;
}
.gc-show {
  flex: 1 1 62%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.gc-ban {
  display: flex;
  flex-direction: column;
  background: linear-gradient(90deg, #000a, #0000);
  padding: 4px 12px;
  border-left: 4px solid #ffd978;
  color: #fff;
}
.gc-ban b {
  font-size: clamp(15px, 3.2vw, 24px);
  font-weight: 800;
  text-shadow: 0 2px 4px #000;
}
.gc-ban small {
  color: #ffe9a8;
  font-size: 11px;
}
.gc-feats {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.gc-f {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(160deg, #4a3a6aee, #1c1633ee);
  border: 2px solid #fff3;
  transform: skewX(-3deg);
}
.gc-f.legendary {
  border-color: #ffc83d;
  box-shadow: 0 0 16px #ffc83d88;
  background: linear-gradient(160deg, #7a5a1aee, #2a1d08ee);
}
.gc-f.epic {
  border-color: #a45be8;
  background: linear-gradient(160deg, #5a2a8aee, #1c1033ee);
}
.gc-f.rare {
  border-color: #4f9be8;
}
.gc-fi {
  position: absolute;
  inset: 0 0 34px 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform: skewX(3deg);
}
.gc-fi img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px #000a);
}
.gc-fi .pv-ch,
.gc-fi .pv-back,
.gc-fi .pv-table,
.gc-fi .pv-bg {
  width: 70%;
  height: 70%;
  margin-bottom: 8%;
}
.gc-fn {
  position: relative;
  z-index: 1;
  padding: 3px 6px;
  background: #000b;
  color: #fff;
  transform: skewX(3deg);
  text-align: left;
}
.gc-fn b {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gc-st {
  color: #ffd978;
  font-size: 12px;
  letter-spacing: 1px;
}
.gc-fn small {
  display: block;
  font-size: 10px;
  opacity: 0.85;
}
.gc-sub {
  display: flex;
  gap: 6px;
  flex: none;
  flex-wrap: wrap;
}
.gc-mini {
  border: 2px solid #cdbcff66;
  border-radius: 99px;
  background: #000a;
  color: #fff;
  font:
    700 12px Sarabun,
    sans-serif;
  padding: 4px 12px;
  cursor: pointer;
}
.gc-mini.on {
  background: #ffd978;
  color: #3a2a00;
  border-color: #ffd978;
}
.gc-side {
  flex: 1 1 38%;
  min-width: 0;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: flex-end;
  background: linear-gradient(#0008, #000b);
  border-radius: 12px;
  padding: 8px;
  color: #fff;
  border: 2px solid #fff2;
}
.gc-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.gc-r {
  font:
    700 11px Sarabun,
    sans-serif;
  padding: 2px 8px;
  border-radius: 99px;
  background: #0007;
}
.gc-r.legendary {
  color: #ffd978;
}
.gc-r.epic {
  color: #d9a8ff;
}
.gc-r.rare {
  color: #8fc8ff;
}
.gc-pity {
  font-size: 12px;
}
.gc-bar {
  height: 7px;
  border-radius: 4px;
  background: #ffffff2a;
  margin: 3px 0;
  overflow: hidden;
}
.gc-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(#ffd978, #f0a020);
}
.gc-tip {
  font-size: 10.5px;
  color: #cfd3ff;
  line-height: 1.35;
}
.gc-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.gc-go {
  border: 0;
  border-radius: 10px;
  padding: 6px 4px;
  color: #fff;
  font-family: Sarabun, sans-serif;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  box-shadow: 0 3px 0 #0006;
}
.gc-go b {
  font-size: 14px;
}
.gc-go span {
  font-size: 13px;
  font-weight: 700;
}
.gc-go.coins {
  background: linear-gradient(#ffb23d, #d9780a);
}
.gc-go.mcash {
  background: linear-gradient(#6fd6ff, #1c8fd1);
}
.gc-go:disabled {
  filter: grayscale(0.8);
  opacity: 0.55;
}
.gc-i {
  position: relative;
  border: 2px solid transparent;
  border-radius: 12px;
}
.gc-i.rare {
  border-color: #4f9be8;
}
.gc-i.epic {
  border-color: #a45be8;
}
.gc-i.legendary {
  border-color: #ffc83d;
  box-shadow: 0 0 12px #ffc83d66;
}
.gc-i small {
  display: block;
  font-size: 11px;
  opacity: 0.85;
}
.gc-ph {
  height: 60px;
}
.gc-modal {
  position: fixed;
  inset: 0;
  z-index: 99995;
  background: #000c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Sarabun, sans-serif;
  padding: 12px;
}
.gc-box {
  background: #241a4a;
  color: #fff;
  border-radius: 18px;
  padding: 14px;
  max-width: min(94vw, 640px);
  max-height: 92vh;
  overflow: auto;
  text-align: center;
  border: 2px solid #cdbcff66;
}
.gc-box h3 {
  margin: 0 0 8px;
}
.gc-top4 {
  box-shadow: 0 0 40px #ffc83daa;
  border-color: #ffc83d;
}
.gc-top3 {
  box-shadow: 0 0 30px #a45be8aa;
}
.gc-res {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.gc-res.n1 {
  grid-template-columns: 1fr;
  max-width: 180px;
  margin: auto;
}
.gc-card {
  position: relative;
  border-radius: 10px;
  padding: 6px 4px;
  background: #0006;
  border: 2px solid #fff3;
  font-size: 11px;
  opacity: 0;
  transform: scale(0.6) rotate(-6deg);
  animation: gcPop 0.45s ease-out forwards;
}
.gc-card b {
  display: block;
  font-size: 12px;
  margin-top: 3px;
}
.gc-card.rare {
  border-color: #4f9be8;
}
.gc-card.epic {
  border-color: #a45be8;
}
.gc-card.legendary {
  border-color: #ffc83d;
  box-shadow: 0 0 14px #ffc83d;
}
.gc-new,
.gc-dup {
  position: absolute;
  top: -6px;
  right: -4px;
  font-style: normal;
  font:
    800 10px Sarabun,
    sans-serif;
  padding: 2px 6px;
  border-radius: 8px;
}
.gc-new {
  background: #e8383d;
}
.gc-dup {
  background: #3a6a52;
}
.gc-sum {
  font-size: 13px;
  color: #cfd3ff;
}
@keyframes gcPop {
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 520px) {
  .gc-res {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 640px) and (orientation: portrait) {
  .gc-stage {
    flex-direction: column;
  }
  .gc-side {
    max-width: none;
  }
  .gc-feats {
    min-height: 150px;
  }
}
/* ---- 0.7.0 ตั๋วสุ่ม · ตู้ของแต่ง · ร้านประจำสัปดาห์ ---- */
.gc-tabs {
  flex-wrap: wrap;
  row-gap: 4px;
}
.gc-go.ticket {
  background: linear-gradient(#5fc8ff, #1f7fd0);
}
.gc-go.ticket.ticket-r {
  background: linear-gradient(#ff6a7a, #c3203a);
}
.gc-go.ask {
  background: linear-gradient(#ffd34d, #e08a00);
  animation: gcAsk 0.5s ease-in-out infinite alternate;
}
@keyframes gcAsk {
  to {
    transform: scale(1.04);
  }
}
.gc-go span {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: center;
}
.gc-go .gc-tki {
  width: 20px;
  height: 20px;
}
.gc-tki {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: none;
}
.gc-tkrow {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff14;
  border-radius: 10px;
  padding: 4px 6px;
}
.gc-tkrow span {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.gc-tkrow b {
  font-size: 13px;
}
.gc-tkrow small {
  font-size: 11px;
  opacity: 0.8;
}
.gc-tkrow .gc-mini {
  flex: none;
  margin: 0;
}
.gc-tks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.gc-tk {
  flex: 1 1 220px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  color: #fff;
  text-align: center;
  background: linear-gradient(#1f5f9cdd, #0d2f55ee);
  border: 2px solid #8fd6ff88;
}
.gc-tk.ticket-r {
  background: linear-gradient(#9c1f35dd, #4f0d1aee);
  border-color: #ff9fae88;
}
.gc-tkbig {
  width: 84px;
  height: 84px;
  object-fit: contain;
}
.gc-tk small {
  opacity: 0.85;
}
.gc-tkb {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.gc-tkb .wbtn {
  margin: 0;
}
.gc-wk-h b {
  color: #ffe08a;
}
@media (max-height: 500px) {
  .gc-tkbig {
    width: 56px;
    height: 56px;
  }
  .gc-tk {
    padding: 8px;
  }
  .gc-tki {
    width: 24px;
    height: 24px;
  }
  .gc-tkrow small {
    font-size: 10px;
  }
}
.gc-wk-h {
  display: block;
  width: fit-content;
  max-width: 100%;
}
@media (max-height: 500px) and (orientation: landscape) {
  .grid.gc-week {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 6px;
  }
  .gc-week .item2 b {
    font-size: 11px;
  }
  .gc-week .item2 small {
    font-size: 9.5px;
  }
  .gc-week .wbtn {
    font-size: 11px;
    padding: 3px 4px;
  }
  .gc-res.n10 {
    gap: 5px;
  }
  .gc-box:has(.gc-res.n10) {
    padding: 8px 12px;
  }
  .gc-res.n10 .gc-card b {
    font-size: 10px;
  }
  .gc-res.n10 .gc-card small {
    font-size: 9px;
  }
  .gc-res.n10 em {
    font-size: 9px;
  }
}
/* 0.8.0 เศษตัวละครในร้านประจำสัปดาห์ */
.gc-wk-t {
  margin: 8px 0 6px;
  color: #fff;
  font:
    800 14px Sarabun,
    sans-serif;
  text-shadow: 0 1px 2px #0008;
}
.gc-wk-t small {
  font-weight: 600;
  opacity: 0.8;
  font-size: 11px;
}
.gc-shs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.gc-sh {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px;
  border-radius: 14px;
  background: linear-gradient(#2a4f86ee, #152a4dee);
  color: #fff;
  text-align: center;
  border: 2px solid #8fd6ff66;
}
.gc-sh.epic {
  background: linear-gradient(#6b2a86ee, #33154dee);
  border-color: #e3b24c99;
}
.gc-sh > img {
  height: 96px;
  max-width: 100%;
  object-fit: contain;
}
.gc-sh span {
  font-size: 40px;
}
.gc-sh b {
  font-size: 13px;
}
.gc-sh small {
  font-size: 11px;
  opacity: 0.85;
}
.gc-sh .wbtn {
  margin: 2px 0 0;
}
.gc-sh .wbtn.ask {
  background: linear-gradient(#ffd34d, #e08a00);
}
.gc-sh .wbtn {
  flex: none;
  width: auto;
  min-height: 0;
  height: auto;
  padding: 5px 16px;
  font-size: 13px;
}
@media (max-height: 500px) and (orientation: landscape) {
  .gc-sh {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 6px;
    row-gap: 1px;
    text-align: left;
    padding: 5px 8px;
    align-items: center;
  }
  .gc-sh > img {
    grid-row: 1/4;
    height: 58px;
  }
  .gc-sh b {
    font-size: 12px;
  }
  .gc-sh small {
    font-size: 10px;
  }
  .gc-sh .wbtn {
    justify-self: start;
    padding: 3px 12px;
    font-size: 12px;
  }
}
.gc-ci {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 3px;
}
.gc-shb {
  border: 0;
  border-radius: 99px;
  padding: 5px 16px;
  font:
    800 13px Sarabun,
    sans-serif;
  background: linear-gradient(#ffe08a, #e6a92a);
  color: #4a2f10;
  box-shadow: 0 2px 0 #9a6a1a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
}
.gc-shb.ask {
  background: linear-gradient(#ffd34d, #e08a00);
  animation: gcAsk 0.5s ease-in-out infinite alternate;
}
.gc-shb.got {
  background: #ffffff33;
  color: #fff;
  box-shadow: none;
}
.gc-shb:disabled {
  opacity: 0.6;
  cursor: default;
}
@media (max-height: 500px) and (orientation: landscape) {
  .gc-shb {
    justify-self: start;
    padding: 3px 12px;
    font-size: 12px;
  }
}
