.roulette-screen {
  width: 100%;
  margin: 0 auto;
  min-height: calc(var(--tg-viewport-height, 100dvh) - 40px);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 8px;
}

.roulette-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.roulette-spins {
  margin: 8px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.rwheel-wrap {
  position: relative;
  width: 275px;
  height: 282px;
  margin: 0 auto 12px;
  flex-shrink: 0;
}

.rwheel-rim {
  position: absolute;
  left: 10px;
  top: 0;
  width: 280px;
  height: 280px;
  max-width: none;
  border-radius: 50%;
  border: 1.25px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.rwheel {
  position: absolute;
  left: 28px;
  top: 18px;
  width: 244px;
  height: 244px;
  overflow: hidden;
  border-radius: 50%;
  will-change: transform;
}

.rwheel__slices {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from -11.25deg,
      transparent 0 22.35deg,
      rgba(255, 255, 255, 0.22) 22.35deg 22.5deg
    ),
    conic-gradient(
      from -11.25deg,
      rgba(245, 245, 247, 0.95) 0 22.5deg,
      rgba(107, 107, 115, 0.9) 22.5deg 45deg,
      rgba(245, 245, 247, 0.95) 45deg 67.5deg,
      rgba(107, 107, 115, 0.9) 67.5deg 90deg,
      rgba(245, 245, 247, 0.95) 90deg 112.5deg,
      rgba(107, 107, 115, 0.9) 112.5deg 135deg,
      rgba(245, 245, 247, 0.95) 135deg 157.5deg,
      rgba(107, 107, 115, 0.9) 157.5deg 180deg,
      rgba(245, 245, 247, 0.95) 180deg 202.5deg,
      rgba(107, 107, 115, 0.9) 202.5deg 225deg,
      rgba(245, 245, 247, 0.95) 225deg 247.5deg,
      rgba(107, 107, 115, 0.9) 247.5deg 270deg,
      rgba(245, 245, 247, 0.95) 270deg 292.5deg,
      rgba(107, 107, 115, 0.9) 292.5deg 315deg,
      rgba(245, 245, 247, 0.95) 315deg 337.5deg,
      rgba(107, 107, 115, 0.9) 337.5deg 360deg
    );
}

.rwheel__icons {
  position: absolute;
  inset: 0;
}

.rwheel__prize {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  object-fit: contain;
  transform: rotate(var(--a)) translateY(-98px);
  pointer-events: none;
  user-select: none;
}

.rwheel__prize--nft {
  object-fit: cover;
  border-radius: 30px;
  background: rgba(0, 0, 0, 0.2);
}

.rwheel__hub {
  position: absolute;
  left: 107px;
  top: 97px;
  z-index: 1;
  width: 86px;
  height: 86px;
  overflow: hidden;
  border-radius: 50%;
  border: 1.25px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  box-shadow:
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.22),
    inset 8px 12px 18px rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.rwheel__hub-cap {
  position: absolute;
  left: 129px;
  top: 119px;
  z-index: 1;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px) saturate(140%);
  -webkit-backdrop-filter: blur(4px) saturate(140%);
  box-shadow:
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.28),
    inset 6px 8px 12px rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.rwheel-pointer {
  position: absolute;
  left: 139px;
  top: 9px;
  width: 22px;
  height: 16px;
  z-index: 2;
  pointer-events: none;
  display: block;
}

.roulette-screen > .mines-btn,
.roulette-screen [data-roulette-spin] {
  width: 100%;
  height: 52px;
  margin: 0;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  font-size: 17px;
  font-weight: 600;
  flex-shrink: 0;
}

.roulette-screen [data-roulette-buy] {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.roulette-screen [data-roulette-buy] .star-icon {
  width: 15px;
  height: 15px;
}

.roulette-progress {
  width: 100%;
  margin-top: 8px;
  padding: 10px 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(40px) saturate(120%);
  -webkit-backdrop-filter: blur(40px) saturate(120%);
  box-sizing: border-box;
}

.roulette-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  height: 16px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.roulette-progress__meta [data-roulette-spent],
.roulette-progress__meta span:last-child {
  color: #ffbf32;
  font-weight: 600;
}

.roulette-progress__meta .star-icon,
.roulette-progress__hint .star-icon {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
  margin-left: 2px;
}

.roulette-progress__bar {
  width: 100%;
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.1);
}

.roulette-progress__fill {
  display: block;
  height: 8px;
  width: 0%;
  border-radius: 100px;
  background: #f5f5f7;
  transition: width 0.35s ease;
}

.roulette-progress__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 8px 0 0;
  height: 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 400;
  text-align: center;
}

.rfeed {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff10;
  border-radius: 18px;
  padding: 12px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.rfeed__title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff99;
  margin: 0 0 10px;
}

.rfeed__list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.rfeed__item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff12;
  border-radius: 14px;
  padding: 8px 10px;
  flex-shrink: 0;
}

.rfeed__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff22;
  flex-shrink: 0;
}

.rfeed__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rfeed__nick {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rfeed__prize {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.rfeed__prize-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.rfeed__prize-img--nft {
  object-fit: cover;
  border-radius: 30px;
}

.rfeed__prize-name {
  font-size: 13px;
  font-weight: 700;
  color: #cfe0ff;
  white-space: nowrap;
}

.rfeed__empty {
  margin: 8px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff66;
}

.roulette-screen .rfeed {
  width: 100%;
  margin-top: 8px;
  padding: 10px 8px 8px;
  min-height: 180px;
  max-height: 222px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(40px) saturate(120%);
  -webkit-backdrop-filter: blur(40px) saturate(120%);
  box-sizing: border-box;
}

.roulette-screen .rfeed__title {
  height: 20px;
  padding: 0 4px;
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}

.roulette-screen .rfeed__list {
  gap: 0;
}

.roulette-screen .rfeed__item {
  height: 44px;
  padding: 6px 4px;
  background: transparent;
  border-radius: 0;
}

.roulette-screen .rfeed__avatar {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
}

.roulette-screen .rfeed__nick {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
  line-height: 18px;
}

.roulette-screen .rfeed__prize-name {
  display: none;
}

.roulette-screen .rfeed__empty {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.4);
}

.roulette-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.roulette-modal[hidden] {
  display: none !important;
}

.roulette-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.roulette-modal__card {
  position: relative;
  width: min(100%, 340px);
  background: #1a1d22;
  border-radius: 24px;
  padding: 24px 20px 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.roulette-modal__art {
  width: 160px;
  height: 160px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
}

.roulette-modal__art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.roulette-modal__art--nft img {
  border-radius: 30px;
  object-fit: cover;
}

.roulette-modal__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
}

.roulette-modal__sub {
  margin: 0 0 18px;
  font-size: 14px;
  color: #ffffff99;
}

.app-scroll.is-roulette {
  background: #141414;
}

.screen-game.is-roulette {
  padding: 16px var(--app-gutter) 0;
}

.app-scroll.is-mines {
  background: #141414;
}

@media (max-width: 360px) {
  .rwheel-wrap {
    transform: scale(0.9);
    transform-origin: top center;
    margin-bottom: 0;
  }
}
