.live-screen {
  width: min(100%, 420px);
  margin: 0 auto;
  min-height: calc(var(--tg-viewport-height, 100dvh) - 40px);
  display: flex;
  flex-direction: column;
}

.live-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.live-top__meta {
  text-align: center;
}

.live-heading {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.live-countdown {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #ffd54a;
}

.live-countdown[hidden] {
  display: none !important;
}

.live-preview-wrap {
  margin: 0 auto 12px;
  text-align: center;
}

.live-preview {
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.live-preview canvas,
.live-preview svg,
.live-preview img,
.live-preview tgs-player {
  width: 100%;
  height: 100%;
  display: block;
}

.live-outcome {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 800;
  color: #ffd54a;
}

.live-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.live-tab {
  appearance: none;
  border: 1px solid #ffffff18;
  background: #ffffff0a;
  color: #ffffffaa;
  border-radius: 12px;
  padding: 10px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.live-tab.is-active {
  background: #ffffff18;
  color: #fff;
  border-color: #ffffff33;
}

.live-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.live-panel[hidden] {
  display: none !important;
}

.live-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.live-room-head__title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff99;
}

.live-room-head__count {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff66;
}

.live-room {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #ffffff12;
}

.live-room-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.live-room-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #ffffff10;
}

.live-room-item__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.live-room-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.live-room-item__name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-room-item__bet {
  font-size: 12px;
  color: #ffffff99;
}

.live-room-item__amount {
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.live-room-empty {
  margin: 0 0 10px;
  text-align: center;
  font-size: 13px;
  color: #ffffff66;
}

.live-bets {
  flex-shrink: 0;
}

.live-bets__amount {
  margin-bottom: 14px;
}

.live-bets__label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffffb3;
}

.live-bets__amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff10;
  border: 1px solid #ffffff18;
}

.live-bets__amount-row .star-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.live-bets__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.live-bets__input::-webkit-outer-spin-button,
.live-bets__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.live-bets__input:disabled {
  opacity: 0.5;
}

.live-bets__max {
  appearance: none;
  border: 1px solid #ffffff22;
  background: #ffffff12;
  color: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.live-bets__max:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.live-bets__hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #ffffff88;
}

.live-bets__hint [data-live-win-preview] {
  color: #ffd54a;
  font-weight: 800;
}

.live-bets__title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffffb3;
}

.live-bets__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.live-bet-btn {
  appearance: none;
  border: 1px solid #ffffff18;
  background: linear-gradient(180deg, #ffffff16, #ffffff08);
  color: #fff;
  border-radius: 14px;
  padding: 12px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.live-bet-btn.is-active {
  border-color: #ffd54a88;
  background: linear-gradient(180deg, #ffd54a33, #ffd54a18);
}

.live-bet-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.live-wins {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.live-wins__list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.live-wins__empty {
  margin: 0;
  text-align: center;
  font-size: 11px;
  color: #ffffff55;
}

.live-win-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  background: #00000033;
  border: 1px solid #ffffff10;
}

.live-win-item__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.live-win-item__body {
  flex: 1;
  min-width: 0;
}

.live-win-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.live-win-item__name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-win-item__payout {
  font-size: 12px;
  font-weight: 800;
  color: #ffd54a;
  flex-shrink: 0;
}

.live-win-item__bet {
  margin-top: 2px;
  font-size: 10px;
  color: #ffffff88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-win-item__payout .star-icon {
  width: 11px;
  height: 11px;
}

.live-bets__hint .star-icon {
  width: 12px;
  height: 12px;
}

.live-bet-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.live-bet-modal[hidden] {
  display: none !important;
}

.live-bet-modal__backdrop {
  position: absolute;
  inset: 0;
  background: #000000aa;
}

.live-bet-modal__card {
  position: relative;
  width: min(100%, 320px);
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #6b4fa8, #3a2662);
  border: 1px solid #ffffff22;
  box-shadow: 0 12px 40px #00000055;
}

.live-bet-modal__text {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  color: #fff;
}

.live-bet-modal__text .star-icon {
  width: 14px;
  height: 14px;
}

.live-bet-modal__win {
  display: inline-block;
  margin-top: 6px;
  color: #ffd54a;
}

.live-bet-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.live-bet-modal__btn {
  appearance: none;
  border: 1px solid #ffffff22;
  background: #ffffff12;
  color: #fff;
  border-radius: 12px;
  padding: 11px 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.live-bet-modal__btn--ok {
  border-color: #ffd54a66;
  background: linear-gradient(180deg, #ffd54a33, #ffd54a18);
  color: #fff;
}

.live-history {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.live-history-empty {
  margin: 8px 0 0;
  text-align: center;
  color: #ffffff66;
  font-size: 12px;
}

.live-history-item {
  padding: 8px 10px;
  border-radius: 12px;
  background: #ffffff10;
}

.live-history-item__check {
  margin-top: 6px;
  padding: 5px 8px !important;
  font-size: 10px !important;
  border-radius: 10px !important;
}

.live-history-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.live-history-item__outcome {
  font-size: 13px;
  font-weight: 800;
}

.live-history-item__time {
  font-size: 10px;
  color: #ffffff77;
  flex-shrink: 0;
}

.live-history-item__bet {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.3;
  color: #cfe0ff;
}

.app-scroll.is-live {
  background: radial-gradient(163% 82% at 50% 50%, rgb(196, 162, 245), rgb(58, 38, 98) 100%);
}

.live-bets__title .star-icon,
.live-room-item__amount .star-icon,
.live-history-item .star-icon {
  width: 12px;
  height: 12px;
}
