/* Consistent spacing, soft depth and a rectangular playing surface. */
#recoveryCodeValue {
  width: 100%;
  padding: 16px;
  background: #0c2454;
  color: #9defff;
  font: 600 17px/1.6 monospace;
  letter-spacing: 1px;
  border: 0;
  border-radius: 16px;
  resize: none;
}
#notificationSettings input[type='checkbox'] {
  appearance: none;
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  border-radius: 14px;
  background: #102657;
  box-shadow:
    inset 0 2px 5px #0007,
    0 0 0 1px #7db9ff33;
  transition: background 0.15s;
}
#notificationSettings input[type='checkbox']::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: linear-gradient(#f4fbff, #aacbef);
  box-shadow: 0 2px 4px #001a4c66;
  transition: transform 0.15s;
}
#notificationSettings input[type='checkbox']:checked {
  background: #21b9df;
}
#notificationSettings input[type='checkbox']:checked::after {
  transform: translateX(18px);
}
#scorePill {
  align-items: center;
  max-width: calc(100% - 24px);
}
#scorePill .score-pop {
  position: static;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding: 0 0 0 6px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  animation: score-inline 1.8s ease-out forwards;
}
#scorePill .score-pop small {
  max-width: 52px;
  font-size: 10px;
}
#scorePill .score-pop b {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1.2;
}
@keyframes score-inline {
  0% {
    opacity: 0;
  }
  15%,
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@media (max-width: 400px) {
  #scorePill .score-pop small {
    display: none;
  }
}

/* Seats have their own row above the felt, including in four-player games.
   Keep the board viewport and tile size unchanged. */
#players .opponent-tray {
  position: absolute;
  top: 107px;
  left: 8px;
  right: 8px;
  height: 40px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  pointer-events: none;
}
#app[data-count='2'] #players .opponent-tray {
  left: 22%;
  right: 22%;
}
#players .opponent-tray .player {
  position: relative;
  inset: auto;
  transform: none;
  width: 100%;
  height: 40px;
  min-width: 0;
  max-width: none;
  padding: 3px 5px;
  display: flex;
  flex-direction: row;
  gap: 5px;
  border-radius: 14px;
  text-align: left;
}
#players .opponent-tray .seat-west,
#players .opponent-tray .seat-northwest {
  order: 0;
}
#players .opponent-tray .seat-north {
  order: 1;
}
#players .opponent-tray .seat-east,
#players .opponent-tray .seat-northeast {
  order: 2;
}
#players .opponent-tray .portrait {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  margin: 0;
}
#players .opponent-tray .player-text {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  column-gap: 3px;
  align-items: center;
  min-width: 0;
  flex: 1;
}
#players .opponent-tray .role,
#players .opponent-tray .name {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
}
#players .opponent-tray .role {
  display: none;
}
#players .opponent-tray [data-relation='partner'] .role {
  display: block;
  font-size: 6.5px;
  line-height: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}
#players .opponent-tray .name {
  font-size: 12px;
  line-height: 15px;
}
#players .opponent-tray [data-relation='partner'] .name {
  color: #8af2ff;
}
#players .opponent-tray small {
  display: block;
  grid-column: 2;
  grid-row: 2;
  font-size: 9px;
  line-height: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#players .opponent-tray .opponent-backs {
  grid-column: 1;
  grid-row: 2;
  width: 8px;
  height: 12px;
  margin: 0;
}
#players .opponent-tray [data-relation='partner'] :is(small, .opponent-backs) {
  grid-row: 3;
}
#players .opponent-tray .opponent-backs .domino-back {
  width: 7px;
  height: 12px;
}
#players .opponent-tray .opponent-backs .domino-back ~ .domino-back {
  display: none;
}
#players .seat-south {
  left: 14px;
  bottom: calc(158px + var(--hand-extra));
  height: 50px;
  max-width: calc(100% - 142px);
  padding: 4px 8px;
  gap: 7px;
}
#players .seat-south .portrait {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  margin: 0;
}
#players .seat-south .player-text {
  min-width: 0;
}
#players .seat-south .name {
  max-width: 100%;
  font-size: 16px;
  line-height: 19px;
}
#players .seat-south small {
  font-size: 9px;
  line-height: 11px;
}
#gameUI #opponentHand {
  display: none;
}
#app #gameUI #stock {
  top: 51px;
  left: auto;
  right: 12px;
  bottom: auto;
  transform: none;
  height: 18px;
  gap: 3px;
}
#gameUI #stock > .art {
  width: 9px;
  height: 18px;
}
#gameUI #stock small {
  padding: 2px 4px;
  font-size: 8px;
  line-height: 12px;
}
.discovery-grid,
.home-cards {
  gap: 12px;
}
#homePage .discovery-card,
#homePage .home-cards .image-card {
  display: grid;
  grid-template-rows: 88px 24px 42px;
  align-content: start;
  justify-items: center;
  gap: 5px;
  padding: 12px 10px;
  height: 188px;
  min-height: 188px;
  text-align: center;
  border-radius: 23px;
  background: linear-gradient(145deg, #254caa, #172e73);
}
#homePage .discovery-card .item-art,
#homePage .home-cards .image-card > .art {
  position: static;
  width: 118px;
  max-width: 100%;
  height: 88px;
  aspect-ratio: auto;
  margin: 0;
  object-fit: contain;
}
#homePage .home-cards .image-card > .art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#homePage .discovery-card b,
#homePage .home-cards .image-card b {
  padding: 0;
  font-size: 17px;
  line-height: 1.25;
  text-align: center;
}
#homePage .discovery-card small,
#homePage .home-cards .image-card small {
  display: block;
  font-size: 11px;
  line-height: 14px;
  overflow-wrap: anywhere;
  color: #c4d9ff;
  margin: 0;
}
#homePage .home-cards .circle-arrow {
  display: none;
}
#homePage .sticker-store-banner {
  width: 100%;
  margin: 12px 0;
}
.podium-label {
  background: transparent;
  box-shadow: none;
  border: 0;
  text-shadow:
    0 2px 3px #051645,
    0 0 7px #062458;
}
.podium-label b {
  color: #fff;
}
.reward-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  margin: 12px 0;
  width: 100%;
  text-align: left;
}
.reward-shortcut img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.reward-shortcut > span {
  flex: 1;
  font-weight: 900;
  font-size: 14px;
}
.reward-shortcut > small {
  font-size: 11px;
  color: #c2dbff;
}
#bottomNav {
  --menu-safe-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(74px + var(--menu-safe-bottom));
  padding: 4px 12px calc(4px + var(--menu-safe-bottom));
  gap: 8px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
#bottomNav button,
#bottomNav button.active {
  background: transparent;
  box-shadow: none;
  border: 0;
  padding: 4px 0;
  gap: 3px;
}
#bottomNav .active .art {
  filter: drop-shadow(0 0 7px #40dfff);
}
#bottomNav .active {
  color: #6de8ff;
}
#pages {
  height: calc(100% - 74px - env(safe-area-inset-bottom, 0px));
}
/* Native body already reserves the system navigation/gesture area once. */
html.native-app #bottomNav {
  --menu-safe-bottom: 0px;
}
html.native-app #pages {
  height: calc(100% - 74px);
}
#styleCards {
  padding: 8px 6px 18px;
  gap: 16px;
}
.style-card.previewing {
  border: 0;
  box-shadow:
    inset 0 0 0 3px #81f2ff,
    inset 0 0 24px #33cfff42,
    0 0 18px #36cfff7a;
}
.style-card.selected {
  border: 0;
}
.style-card.previewing::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  box-shadow: inset 0 1px 5px #e2feff;
  pointer-events: none;
}
#eventBody {
  padding: 6px 7px 16px;
  scrollbar-gutter: stable;
}
.album-catalog {
  padding: 6px;
  gap: 14px;
}
.album-collection {
  align-self: stretch;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
}
#clubSearch,
#clubSearch:focus {
  background: transparent;
  box-shadow: none;
  border: 0;
  outline: none;
  width: 100%;
  min-width: 0;
  padding: 7px 0;
}
.search:focus-within {
  box-shadow:
    inset 0 0 0 2px #61deff,
    0 0 15px #1cbaff30;
}
#accountOpen {
  display: block;
  width: calc(100% - 32px);
  margin: 16px;
  padding: 16px 20px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(150deg, #3289f5, #1b42a0);
  box-shadow:
    inset 0 2px 2px #c8f5ff70,
    0 5px 0 #112b76,
    0 8px 20px #020a3444;
  font-size: 16px;
  font-weight: 900;
}
.discovery-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 14px 16px;
  min-height: 166px;
  text-align: center;
  gap: 7px;
}
.discovery-card .item-art {
  position: static;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  margin: 0 auto 3px;
  object-fit: contain;
}
.discovery-card b {
  font-size: 17px;
  line-height: 1.25;
}
.discovery-card small {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}
.game-select-native {
  display: none !important;
}
.game-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 18px;
  padding: 11px 16px;
  color: #e7f7ff;
  font: inherit;
  font-weight: 800;
  border-radius: 15px;
  background: linear-gradient(145deg, #284d9b, #182f70);
  box-shadow:
    inset 0 1px 1px #a5dfff55,
    0 5px 12px #020b2b40;
}
.game-select-trigger::after {
  content: '⌄';
  color: #6ee7ff;
  font-size: 22px;
}
#languageChoice + .game-select-trigger {
  width: 100%;
}
.room-filters .game-select-trigger {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}
.game-select-sheet {
  width: min(400px, calc(100vw - 32px));
}
.game-select-options {
  display: grid;
  gap: 10px;
  overflow: auto;
  max-height: 55dvh;
  padding: 8px 6px 14px;
}
.game-select-option {
  min-height: 48px;
  border-radius: 16px;
  padding: 12px 16px;
  text-align: left;
  color: #dfedff;
  font: inherit;
  font-weight: 800;
  background: linear-gradient(145deg, #294884, #152c60);
  box-shadow:
    inset 0 1px 0 #c3e7ff33,
    0 4px 10px #040e2e44;
}
.game-select-option.chosen {
  color: #052b58;
  background: linear-gradient(#8ff8ff, #28c3ee);
  box-shadow:
    inset 0 1px 2px #fff9,
    0 0 16px #20cfff44;
}
#toast,
#app[data-screen='game'] #toast {
  position: fixed;
  inset: auto;
  left: 50%;
  top: max(20px, env(safe-area-inset-top));
  bottom: auto;
  right: auto;
  width: calc(100vw - 48px);
  max-width: 414px;
  max-height: 140px;
  margin: 0;
  padding: 14px 18px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 18px;
  background: linear-gradient(145deg, #204c91fa, #10275afa);
  box-shadow:
    inset 0 0 0 2px #6edfff99,
    inset 0 3px 3px #d4fcff33,
    0 10px 30px #010a30b0,
    0 0 20px #21aeff33;
  color: #f1f9ff;
  text-shadow: none;
  font:
    800 13px/1.5 Nunito,
    sans-serif;
  text-align: center;
  pointer-events: none;
  z-index: 10000;
}
#toast:not(.show) {
  display: none;
}
#toast.show {
  transform: translateX(-50%);
}
#toast::backdrop {
  background: transparent;
  pointer-events: none;
}
#tableBackdrop {
  left: 0;
  right: 0;
  top: 153px;
  bottom: calc(215px + var(--hand-extra));
  border-radius: 26px;
  background: var(--table-art) center/100% 100% no-repeat !important;
  transform: none;
  isolation: isolate;
  overflow: hidden;
  box-shadow:
    0 12px 28px #020c35a6,
    0 0 25px #178fff22;
}
#tableBackdrop::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 19px;
  background:
    repeating-linear-gradient(0deg, #ffffff02 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 32% 15%, #ffffff13, transparent 65%),
    linear-gradient(135deg, transparent, #00000025), var(--felt, #0c438f);
  box-shadow:
    inset 0 9px 18px #00000055,
    inset 0 -3px 12px #86baff15,
    0 0 0 2px #97dcffbb,
    0 -2px 0 4px #205eab,
    0 4px 0 4px #071b4a,
    0 0 0 6px #0a2b5c,
    0 8px 14px #0007;
}
#tableBackdrop::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 24px;
  box-shadow:
    inset 0 2px 2px #dbf7ff99,
    inset 0 -2px 3px #83a9e433;
  pointer-events: none;
}
.panel,
.room-code,
.lobby-seat,
.player,
.rank-row,
.member-row,
.achievement,
.style-card,
.frame-shop-card,
.album-collection,
.sticker-pack-card,
.gift-card,
.daily-day,
.quest-card,
.season-milestone {
  border: 0;
  box-shadow:
    inset 0 1px 0 #bce8ff20,
    0 7px 18px #020a2b45;
}
:is(button, input, select, textarea) {
  border-width: 0;
}
:is(button, input, select, textarea):focus-visible {
  outline: 3px solid #72e9ff;
  outline-offset: 3px;
}
.player.active,
.frame-shop-card.selected,
.album-collection.selected,
.style-card.selected,
.daily-day.active {
  box-shadow:
    inset 0 1px 0 #bcf8ff66,
    0 0 0 2px #54dcff88,
    0 6px 20px #02113966,
    0 0 19px #3fb6ff3d;
}
#profilePage,
#collectionPage {
  padding-bottom: 24px;
}
#profileFramesOpen {
  width: calc(100% - 32px);
  margin: 18px 16px 28px;
}
/* Section spacing belongs to the layout, including dynamically rendered content. */
#clubContent {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
#clubContent > * {
  min-width: 0;
  margin-block: 0;
}
.create-club,
.club-about {
  display: grid;
  gap: 14px;
}
.create-club > *,
.club-about > *,
.club-about > .text-button {
  margin-block: 0;
}
.club-result:last-child {
  border-bottom: 0;
}
.member-list {
  display: grid;
  gap: 10px;
}
.member-list > .member-row,
.member-list > .club-invite {
  margin-block: 0;
}
#shopDialog .sheet-scroll {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#shopDialog .sheet-scroll > * {
  flex-shrink: 0;
  min-width: 0;
  margin-block: 0;
}
.sticker-pack-card,
.frame-shop-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sticker-pack-card > h3,
.sticker-pack-card > .sticker-pack-preview {
  margin-block: 0;
}
.sticker-pack-card > button {
  margin-top: auto;
}
.frame-shop-card > :is(h3, small, p, button) {
  margin-block: 0;
}
.frame-shop-card > button:last-child {
  margin-top: auto;
}
.sheet-scroll {
  padding: 4px 4px 20px;
}
.sheet-scroll > p,
.sheet-scroll > h3 {
  margin-top: 14px;
  margin-bottom: 14px;
}
.shop-tabs,
.shop-balances {
  margin-bottom: 18px;
}
.frame-shop-grid {
  gap: 14px;
}
.frame-shop-card {
  padding: 14px 10px;
}
.sticker-store-banner {
  margin: 14px 16px;
  width: calc(100% - 32px);
}
.album-stage {
  padding: 20px 16px;
}
.daily-day {
  padding: 10px 4px;
}
.quest-card {
  padding: 14px;
}
#accountHeader > .portrait {
  width: 56px;
  height: 56px;
  margin: 5px;
}
#accountHeader .account-info {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
#accountHeader .account-tags {
  gap: 8px;
  align-items: center;
}
#accountHeader .account-tags .tag {
  min-height: 30px;
  padding: 6px 10px;
  column-gap: 6px;
  line-height: 18px;
}
#accountHeader .tag :is(.star, .mini-bars) {
  flex-shrink: 0;
  line-height: 18px;
}
.profile-portrait .portrait {
  width: 86px;
  height: 86px;
}
.portrait.has-avatar-frame {
  background-color: transparent;
  background-size: 84% 84%;
  border: 0;
  box-shadow: none;
}
.portrait.custom-avatar {
  background-position: center;
  background-size: cover;
}
.portrait.has-avatar-frame.custom-avatar {
  background-size: 84% 84%;
  background-repeat: no-repeat;
}
.player .portrait {
  width: 40px;
  height: 40px;
}
.seat-west .portrait,
.seat-east .portrait {
  width: 28px;
  height: 28px;
}
.seat-north .portrait,
.seat-northwest .portrait {
  width: 34px;
  height: 34px;
}
.seat-northeast .portrait {
  width: 30px;
  height: 30px;
}
.player .portrait.has-avatar-frame {
  margin: 5px;
}
.player .name {
  max-width: 94px;
}
.seat-west .name,
.seat-east .name {
  max-width: 44px;
}
.avatar-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  margin: 16px 0;
  border-radius: 22px;
  background: #0e245c70;
  box-shadow:
    inset 0 1px 0 #b2d9ff22,
    0 7px 18px #020b2d40;
}
.avatar-upload .fine {
  margin: 4px 0;
  line-height: 1.5;
}
.uploaded-avatar-preview {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow:
    0 0 0 4px #77e7ff33,
    0 7px 20px #0005;
}
#avatarChoice {
  gap: 12px;
  padding: 12px 4px;
  margin: 12px 0 18px;
}
#editProfile {
  padding-bottom: 36px;
}
.skin-showcase-art,
.skin-card-art {
  object-fit: contain !important;
  max-width: 100%;
}
.skin-card-art {
  height: 145px;
}
.mini-domino {
  aspect-ratio: 1/2;
  height: auto;
  min-height: 54px;
  max-width: 29px;
  box-sizing: border-box;
}
.opponent-backs .domino-back,
#opponentHand > .domino-back {
  object-fit: contain;
  flex-shrink: 0;
}
#stock .art > .domino-back {
  object-fit: contain;
}
.test-ad-preview {
  padding: 16px;
  margin: 18px 0;
  border-radius: 18px;
  background: #182f66;
  box-shadow:
    inset 0 1px 0 #d4edff22,
    0 6px 16px #0003;
}
.test-ad-preview p {
  font-size: 12px;
  line-height: 1.5;
  color: #bdd4f5;
  margin: 10px 0 0;
}
@media (max-width: 370px) {
  .player {
    padding: 5px;
  }
  .seat-west,
  .seat-east {
    max-width: 50px;
  }
  .player .name {
    font-size: 12px;
  }
  .seat-west .name,
  .seat-east .name {
    font-size: 9px;
  }
  .frame-shop-grid {
    gap: 10px;
  }
}
