.tb-skeleton {
  display: block;
  border-radius: 6px;
  background: rgb(30 42 54);
  animation: tb-pulse 1.1s ease-in-out infinite;
}

.tb-skeleton--shimmer {
  background: linear-gradient(
    90deg,
    rgb(30 42 54) 0%,
    rgb(42 58 74) 45%,
    rgb(30 42 54) 90%
  );
  background-size: 200% 100%;
  animation: tb-shimmer 1.35s ease-in-out infinite;
}

@keyframes tb-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes tb-loader-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

@keyframes tb-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.tb-skeleton--circle {
  border-radius: 999px;
}

.chat-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 12px;
}

.chat-skeleton-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
}

.chat-skeleton-row .tb-skeleton--user {
  width: 64px;
  height: 12px;
  flex-shrink: 0;
}

.chat-skeleton-row .tb-skeleton--line {
  flex: 1;
  height: 12px;
  max-width: 100%;
}

.chat-skeleton-row .tb-skeleton--line.short {
  max-width: 55%;
}

.chat-skeleton-row:nth-child(odd) .tb-skeleton--line {
  max-width: 78%;
}

.site-chat-column.is-chat-ready .chat-skeleton {
  display: none;
}

.topbar-skeleton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topbar-skeleton .tb-skeleton {
  height: 40px;
}

.topbar-skeleton .tb-skeleton--pill {
  width: 120px;
  border-radius: 8px;
}

.topbar-skeleton .tb-skeleton--btn {
  width: 88px;
  border-radius: 8px;
}

html.site-shell-ready .topbar-skeleton {
  display: none !important;
}

/* Games grid skeleton */
.games-grid.is-grid-loading {
  pointer-events: none;
}

.game-card-skeleton {
  position: relative;
  min-height: 172px;
  padding: 16px;
  border-radius: 14px;
  background: rgb(18 23 49);
  border: 1px solid rgba(148, 163, 184, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
}

.game-card-skeleton__art {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 52px;
  height: 52px;
  border-radius: 10px;
}

.game-card-skeleton__title {
  height: 18px;
  width: 72%;
}

.game-card-skeleton__meta {
  height: 12px;
  width: 55%;
}

/* Game shell skeleton overlay — content stays in layout; overlay covers it */
.is-game-loading > *:not(.tb-game-skeleton-overlay) {
  opacity: 0;
  pointer-events: none;
}


.tb-game-skeleton-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: rgb(12 16 43 / 0.96);
  border-radius: inherit;
  opacity: 1;
  transition: opacity 0.26s ease;
}

.tb-game-skeleton-overlay.is-game-overlay-out {
  opacity: 0;
  pointer-events: none;
}

.fs-game-skeleton {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
}

@media (min-width: 720px) {
  .fs-game-skeleton {
    flex-direction: row;
    align-items: stretch;
  }
}

.fs-game-skeleton__panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 min(100%, 280px);
  padding: 12px;
  border-radius: 12px;
  background: rgb(18 23 49);
}

.fs-game-skeleton__label {
  height: 10px;
  width: 40%;
}

.fs-game-skeleton__input {
  height: 40px;
  width: 100%;
}

.fs-game-skeleton__btn {
  height: 44px;
  width: 100%;
  margin-top: 8px;
}

.fs-game-skeleton__stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgb(15 20 44);
  min-height: 200px;
}

.fs-game-skeleton__stage-main {
  flex: 1;
  min-height: 140px;
  border-radius: 10px;
}

.fs-game-skeleton__stage-row {
  display: flex;
  gap: 6px;
}

.fs-game-skeleton__stage-row .tb-skeleton {
  flex: 1;
  height: 28px;
  border-radius: 6px;
}

.tb-game-skeleton-bar {
  height: 3px;
  border-radius: 999px;
  background: rgb(30 42 54);
  overflow: hidden;
  margin-top: 8px;
}

.tb-game-skeleton-bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--tb-accent, #2563eb);
  animation: tb-loader-slide 0.85s ease-in-out infinite;
}

/* Wallet picker */
.currency-picker.is-wallet-loading .currency-picker__trigger,
.currency-picker.is-wallet-loading .currency-picker__menu {
  display: none !important;
}

.currency-picker-skeleton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
}

.currency-picker-skeleton__icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
}

.currency-picker-skeleton__text {
  width: 88px;
  height: 14px;
}

.currency-picker:not(.is-wallet-loading) .currency-picker-skeleton {
  display: none;
}

/* Settings */
.settings-skeleton {
  display: grid;
  gap: 20px;
  padding: 8px 0 32px;
}

.settings-skeleton__hero {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-skeleton__avatar {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.settings-skeleton__lines {
  flex: 1;
  display: grid;
  gap: 10px;
}

.settings-skeleton__lines .tb-skeleton:first-child {
  height: 22px;
  width: 55%;
}

.settings-skeleton__lines .tb-skeleton.short {
  height: 14px;
  width: 38%;
}

.settings-skeleton__block {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 12px;
  background: rgb(18 23 49);
}

.settings-skeleton__block .tb-skeleton {
  height: 14px;
  width: 70%;
}

.settings-skeleton__block .tb-skeleton.wide {
  height: 40px;
  width: 100%;
}

#settings-loading:not([hidden]) ~ #settings-gate,
#settings-loading:not([hidden]) ~ #settings-panel {
  display: none !important;
}

.site-content-skeleton {
  padding: 24px 0;
  display: grid;
  gap: 12px;
}

.site-content-skeleton .tb-skeleton.title {
  height: 28px;
  width: 45%;
}

.site-content-skeleton .tb-skeleton.line {
  height: 14px;
  width: 100%;
}

.site-content-skeleton .tb-skeleton.line.short {
  width: 62%;
}
