/* Gift Battle · разметка комнаты и ставки подарком */

.rubiker-bt {
  --s1: #1e2233;
  --s2: #282d47;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: #303650;
  --surface-3: #282d47;
  --surface-active: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.12);
  --line-btn: #4b5278;
  --text-2: #b9c1dc;
  --text-3: #8b93b0;
  --white: #edf0ff;
  --primary-text: #c5baff;
  --primary-fill: linear-gradient(100deg, #5267e0 0%, #7952ca 100%);
  --primary-solid: #7b5cf0;
  --win: #a9b4ff;
  --win-soft: rgba(169, 180, 255, 0.14);
  --on-primary: #fff;
  width: 100%;
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--white);
  -webkit-overflow-scrolling: touch;
}

.home-block {
  margin-top: 18px;
}

.home-block .home-lead {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted, #b9c1dc);
}

.home-battle-room {
  padding: 4px 12px 12px;
}

.home-battle-room[hidden] {
  display: none !important;
}

.rubiker-bt--inline {
  width: 100%;
  max-height: none;
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 8px 0 0;
}

.bt-rhead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.bt-rhead__t {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--white);
}

.bt-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line-btn);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 18px;
  cursor: pointer;
}

.bt-back:hover {
  color: var(--white);
  background: var(--surface-active);
}

.bt-wait__msg {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--win-soft);
  color: var(--win);
  font-size: 13px;
  font-weight: 600;
}

.bt-wait__msg[hidden] {
  display: none !important;
}

.bt-seats {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 14px;
}

.bt-seat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--s2);
  border: 1px solid var(--line-btn);
}

.bt-seat--me {
  border-color: color-mix(in srgb, var(--primary-solid) 45%, var(--line-btn));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-solid) 25%, transparent);
}

.bt-seat__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bt-ava {
  --sz: 32px;
  flex: none;
  width: var(--sz);
  height: var(--sz);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface-active);
  color: var(--white);
}

.bt-ava--me {
  background: var(--primary-fill);
  color: var(--on-primary);
}

.bt-ava--empty {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-3);
  border: 1.5px dashed var(--line-btn);
}

.bt-name__t {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-seat__gift {
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-seat__gift--nft {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bt-seat__nft-thumb {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--s1);
  box-shadow: inset 0 0 0 1px var(--line-btn);
}

.bt-seat__nft-thumb .gift-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bt-seat__nft-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-seat__gift--wait,
.bt-seat__gift--empty {
  color: var(--text-3);
}

.bt-seat--ready {
  border-color: color-mix(in srgb, var(--pc) 35%, var(--line-btn));
}

.bt-ava--gift {
  visibility: hidden;
  width: 0;
  height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

.bt-vs {
  flex: none;
  align-self: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.rubiker-gk .gk-panel--side {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

@media (min-width: 768px) {
  .rubiker-gk .gk-panel--side {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 16px 20px;
  }
}

.tk-wbox {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 12px 10px 14px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.tk-wbox__stage {
  position: relative;
  width: min(300px, 100%);
  overflow: visible;
}

.rb-battle-wheel .tk-wbox {
  overflow: visible;
}

.rubiker-bt .wheel-wrap {
  width: 100%;
  margin: 0 auto;
}

.rubiker-bt .wheel-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-2);
}

.rubiker-bt .leg-you b {
  color: var(--white);
}

.rubiker-bt .leg-opp b {
  color: var(--accent-pink);
}

.gg-prod-picker {
  min-width: 0;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.gg-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.gg-picker-head .block-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
}

.bt-textbtn {
  border: none;
  background: none;
  color: var(--primary-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}

.bt-textbtn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.bt-name__sub {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-2, #b9c1dc);
  margin-top: 2px;
}

.gg-prod-picker .gg-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding: 2px;
  align-content: start;
}

@media (max-width: 899.98px) {
  .gg-prod-picker .gg-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 86px;
    gap: 6px;
    max-height: 178px;
    scroll-snap-type: y mandatory;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .gg-prod-picker .gg-list::-webkit-scrollbar {
    display: none;
  }

  .gg-prod-picker .gg-card {
    box-sizing: border-box;
    height: 86px;
    scroll-snap-align: start;
    padding: 6px 4px 7px;
    gap: 2px;
    border-radius: 12px;
  }

  .gg-prod-picker .gg-card .gift-img {
    width: 40px;
    height: 40px;
  }

  .gg-prod-picker .gg-card .gg-thumb {
    width: 44px;
    height: 44px;
  }

  .gg-prod-picker .gg-card b {
    font-size: 12px;
    line-height: 1.25;
  }

  .gg-prod-picker .gg-card strong {
    font-size: 12px;
    line-height: 1.2;
  }
}

.gg-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 9px;
  border-radius: 16px;
  border: 1px solid var(--line-btn);
  background: #303650;
  color: var(--white);
  cursor: pointer;
  text-align: center;
  min-height: 44px;
  font-family: inherit;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.gg-card:hover {
  border-color: #60679c;
}

.gg-card.is-selected {
  border-color: #a297ff;
  background: #3d3862;
  box-shadow: 0 0 0 1px color-mix(in srgb, #a297ff 40%, transparent);
}

.gg-card .gg-thumb {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gg-card .gift-img {
  width: 52px;
  height: 52px;
}

.gg-card b {
  font-size: 11.5px;
  line-height: 1.2;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gg-card strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
}

.gg-status.empty[hidden] {
  display: none !important;
}

.gg-status.empty {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
  text-align: center;
}

.gg-status.empty code {
  font-size: 11px;
  color: var(--accent-cyan);
}

.rb-battle-wheel {
  width: 100%;
}

.rb-battle-wheel .rb-chance-legend {
  margin: 0 0 12px;
  font-weight: 600;
}

.rb-battle-wheel .rb-chance-legend b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.wheel-wrap--gift {
  width: min(300px, 92vw);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: visible;
}

.wheel-wrap--gift .wheel-disc {
  display: grid;
  place-items: center;
}

.wheel-stake-preview {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30%;
  max-width: 96px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface-2, #282d47) 0%, var(--surface, #1e2233) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 6px 14px rgba(0, 0, 0, 0.32);
  padding: 4px;
}

.wheel-stake-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.rb-battle-result {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-btn);
  background: var(--surface-3, #282d47);
  text-align: center;
  animation: rb-result-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.rb-battle-result[hidden] {
  display: none !important;
}

.rb-battle-result.is-win {
  border-color: color-mix(in srgb, var(--primary-solid, #7b5cf0) 45%, var(--line-btn));
  background: color-mix(in srgb, var(--win-soft, rgba(169, 180, 255, 0.14)) 65%, var(--surface-3));
}

.rb-battle-result.is-lose {
  border-color: color-mix(in srgb, #ff4fa3 35%, var(--line-btn));
  background: color-mix(in srgb, rgba(255, 79, 163, 0.1) 50%, var(--surface-3));
}

.rb-battle-result__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--white);
}

.rb-battle-result.is-lose .rb-battle-result__title {
  color: #ffb8d4;
}

.rb-battle-result.is-win .rb-battle-result__title {
  color: var(--win, #a9b4ff);
}

.rb-battle-result__gift {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.rb-battle-result__gift[hidden] {
  display: none !important;
}

.rb-battle-result__thumb {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.rb-battle-result__thumb img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.rb-battle-result__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #edf0ff);
  text-align: left;
  line-height: 1.3;
}

@keyframes rb-result-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.rb-battle-wheel.is-win .rb-battle-result.is-win {
  box-shadow: 0 0 24px rgba(169, 180, 255, 0.15);
}
