/* ============================================================
   TUH Mystery Box · frontend
   Clean. Cinza + preto. Sem hover pulando, sem glow.
   ============================================================ */

.tmb-app, .tmb-app[data-tmb-app] {
  position: relative;
  font-family: inherit;
  color: #1a1a1a !important;
  background: #ffffff !important;
  padding: 24px 0 32px;
  margin: 16px 0;
}

/* ============================================================
   Header de cada estado
   ============================================================ */
.tmb-state { margin-bottom: 28px; }
.tmb-state__head {
  margin-bottom: 20px;
  background: #f4f4f5;
  border: 1px solid #e2e2e6;
  border-radius: 8px;
  padding: 22px 24px;
}
.tmb-state__head--center { text-align: center; }
.tmb-state--history .tmb-state__head { background: transparent; border: 0; padding: 0; margin-bottom: 14px; }

.tmb-app .tmb-eyebrow {
  display: inline-block;
  font-size: 11px; letter-spacing: .15em;
  font-weight: 700; text-transform: uppercase;
  color: #6b6e80 !important;
  margin-bottom: 6px;
}
.tmb-app .tmb-state__title {
  font-size: 22px; font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.25;
  color: #1a1a1a !important;
}
.tmb-app .tmb-state__desc {
  color: #555 !important;
  font-size: 14px;
  line-height: 1.55;
  max-width: 580px;
  margin: 0 auto;
}
.tmb-empty-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412 !important;
  font-size: 14px;
  font-weight: 700;
  padding: 14px 16px;
  text-align: center;
}

/* ============================================================
   Grids
   ============================================================ */
.tmb-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.tmb-grid--pending {
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  justify-content: center;
  align-items: stretch;
}

/* ============================================================
   Card padrão (pending OU vitrine de compra)
   ============================================================ */
.tmb-card {
  position: relative;
  background: #f4f4f5 !important;
  border: 1px solid #e2e2e6;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tmb-card.is-disabled { opacity: .55; }
.tmb-card--box {
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
}

.tmb-card__media {
  position: relative;
  display: block;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e2e2e6;
}
.tmb-card__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 1375;
  object-fit: cover;
}
.tmb-card--box .tmb-card__media {
  aspect-ratio: 1000 / 1375;
  max-height: 420px;
  overflow: hidden;
}
.tmb-card--box .tmb-card__media img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
}

.tmb-card__prices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin: 0 auto 8px;
}
.tmb-card__price {
  display: inline-block;
  background: #f97316;
  color: #ffffff !important;
  font-size: 13px; font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: .02em;
  line-height: 1.2;
}
.tmb-card__price-pix {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8f8f0;
  color: #14722e !important;
  border: 1px solid #b6e3c7;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.2;
}
.tmb-card__pix-label {
  background: #14722e;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 1px 5px;
  border-radius: 2px;
}

.tmb-card__body {
  display: flex;
  flex-direction: column;
  padding: 12px 14px 14px;
  text-align: center;
  gap: 4px;
}
.tmb-app .tmb-card__title {
  display: block;
  font-size: 14px; font-weight: 700;
  color: #1a1a1a !important;
  line-height: 1.25;
  margin: 0;
}
.tmb-app .tmb-card__sub {
  display: block;
  font-size: 11px;
  color: #6b6e80 !important;
  line-height: 1.3;
  margin: 0 0 8px;
}

/* ============================================================
   Buttons — SEM hover pulando
   ============================================================ */
.tmb-app .tmb-btn {
  display: inline-block;
  box-sizing: border-box;
  max-width: 100%;
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  text-transform: none;
  line-height: 1.2;
  text-align: center;
  appearance: none;
}
.tmb-app .tmb-btn:disabled,
.tmb-app .tmb-btn.is-disabled { cursor: not-allowed; opacity: .5; }

.tmb-app .tmb-btn--primary {
  background: #1a1a1a !important;
  color: #ffffff !important;
  border-color: #1a1a1a !important;
}
.tmb-app .tmb-btn--primary:hover {
  background: #000000 !important;
  border-color: #000000 !important;
}

.tmb-app .tmb-btn--secondary {
  background: #ffffff !important;
  color: #1a1a1a !important;
  border-color: #cfcfd4 !important;
}
.tmb-app .tmb-btn--secondary:hover {
  background: #f4f4f5 !important;
  border-color: #1a1a1a !important;
  color: #1a1a1a !important;
}

.tmb-btn--shine::before { display: none !important; }

/* ============================================================
   History list
   ============================================================ */
.tmb-history {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 10px;
}
.tmb-history__item {
  background: #f4f4f5 !important;
  border: 1px solid #e2e2e6;
  border-radius: 6px;
  padding: 12px 16px;
  color: #1a1a1a !important;
}
.tmb-history__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  color: #1a1a1a;
}
.tmb-history__when { color: #888 !important; font-size: 12px; }
.tmb-history__prizes { display: flex; gap: 8px; flex-wrap: wrap; }
.tmb-history__prize {
  display: flex; align-items: center; gap: 8px;
  background: #ffffff !important;
  border-radius: 4px;
  padding: 4px 10px 4px 4px;
  font-size: 12px;
  border: 1px solid #cfcfd4;
  color: #1a1a1a !important;
}
.tmb-history__prize span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.tmb-history__prize img {
  flex: 0 0 32px;
  width: 32px; height: 44px;
  object-fit: cover;
  border-radius: 3px;
}

/* ============================================================
   OVERLAY DA ANIMACAO (slot machine)
   Mantido escuro pq a animação é a estrela
   ============================================================ */
.tmb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,15,18,.96);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  overflow-y: auto;
  padding: 32px 16px;
  color: #fff;
}
.tmb-overlay.is-open { display: block; }
.tmb-overlay img { max-width: 100%; }

.tmb-overlay__inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.tmb-overlay__close {
  position: absolute;
  top: -8px; right: 0;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: none;
  line-height: 1;
}
.tmb-overlay__close:hover { background: rgba(255,255,255,.15); }
.tmb-overlay.is-revealing .tmb-overlay__close,
.tmb-overlay.is-finished  .tmb-overlay__close { display: block; }

/* spin status */
.tmb-spin-status { display: flex; justify-content: center; margin-bottom: 22px; }
.tmb-spin-status__line {
  display: flex; gap: 14px; align-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  padding: 8px 18px;
  border-radius: 999px;
}
.tmb-spin-status__label {
  font-size: 11px; letter-spacing: .2em; color: #fff; font-weight: 700;
}
.tmb-spin-status__num { font-size: 13px; font-weight: 800; color: #fff; }

/* tracks */
.tmb-tracks {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 0;
  margin: 0 auto;
}
.tmb-track {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
}
.tmb-track__row {
  display: flex; gap: 10px;
  height: 100%;
  padding: 8px;
  will-change: transform;
}
.tmb-card-game {
  flex: 0 0 150px;
  height: 164px;
  border-radius: 6px;
  background: #1a1a1a;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.08);
}
.tmb-card-game img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.tmb-card-game.tmb-rarity-blue   { border-color: rgba(74,158,255,.5); }
.tmb-card-game.tmb-rarity-purple { border-color: rgba(168,85,247,.55); }
.tmb-card-game.tmb-rarity-gold   { border-color: rgba(255,200,71,.65); }

.tmb-card-game__name {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 4px 8px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.92));
  font-size: 10px; font-weight: 700;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tmb-card-game.is-winner {
  border-color: #ffc847;
  box-shadow: 0 0 18px rgba(255,200,71,.55);
  z-index: 5;
}

.tmb-track__mask {
  position: absolute; top: 0; left: 0; right: 0; height: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(15,15,18,1) 0%, transparent 14%, transparent 86%, rgba(15,15,18,1) 100%);
  z-index: 3;
}
.tmb-track__pointer {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px;
  background: #ffc847;
  transform: translateX(-50%);
  z-index: 4;
}
.tmb-track__pointer::before, .tmb-track__pointer::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent;
}
.tmb-track__pointer::before { top: -2px; border-top: 8px solid #ffc847; }
.tmb-track__pointer::after  { bottom: -2px; border-bottom: 8px solid #ffc847; }

/* reveal */
.tmb-reveal { display: none; text-align: center; padding-bottom: 50px; }
.tmb-overlay.is-finished .tmb-reveal { display: block; }
.tmb-reveal__ribbon {
  display: inline-block;
  font-size: 11px; letter-spacing: .2em;
  background: #ffffff;
  color: #1a1a1a;
  padding: 5px 16px;
  border-radius: 4px;
  font-weight: 700;
  margin-bottom: 10px;
}
.tmb-reveal__title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  margin: 0 0 24px;
}
.tmb-reveal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  max-width: 900px;
  gap: 14px;
  margin: 0 auto 24px;
  padding: 0 12px;
}
.tmb-prize-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2e;
  border-radius: 8px;
  overflow: hidden;
  color: #fff;
}
.tmb-prize-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.tmb-prize-info { padding: 10px 12px; text-align: left; }
.tmb-prize-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff !important;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.tmb-prize-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tmb-tag {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .04em;
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.14);
}

.tmb-reveal__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tmb-reveal__actions .tmb-btn--primary {
  background: #ffffff !important;
  color: #1a1a1a !important;
  border-color: #ffffff !important;
}
.tmb-reveal__actions .tmb-btn--secondary {
  background: transparent !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.3) !important;
}

/* confetti — mantido sutil */
.tmb-confetti {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden;
}
.tmb-confetti__piece {
  position: absolute;
  width: 6px; height: 12px;
  top: -16px;
  animation: tmbConfettiFall linear forwards;
}
@keyframes tmbConfettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(120vh) rotate(720deg); opacity: 0; }
}

/* responsive */
@media (max-width: 720px) {
  .tmb-app { padding: 18px 16px 24px; }
  .tmb-grid--pending { grid-template-columns: minmax(0, 280px); }
  .tmb-card--box { max-width: 280px; }
  .tmb-card-game { flex: 0 0 110px; height: 122px; }
  .tmb-track { height: 138px; }
  .tmb-overlay { padding: 24px 10px; }
  .tmb-reveal__grid { grid-template-columns: minmax(0, 1fr); }
  .tmb-reveal__title { font-size: 28px; }
}
