:root {
  --bg-1: #0f1a15;
  --bg-2: #1b2b23;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #f3efe6;
  --muted: #a9b6ae;
  --accent: #f0b93f;
  --accent-dark: #b9821b;
  --danger: #e0644f;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #2a4a3a 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
  background-attachment: fixed;
}

.hidden {
  display: none !important;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.btn {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  min-width: 120px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.96);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn.primary {
  background: linear-gradient(180deg, #ffd06a, var(--accent));
  border-color: var(--accent-dark);
  color: #2e1e04;
  box-shadow: 0 4px 14px rgba(240, 185, 63, 0.25);
}

.btn.primary:disabled {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--card-border);
  color: var(--muted);
  box-shadow: none;
  opacity: 0.7;
}

.btn.primary.ready {
  animation: ready-pulse 1.2s ease-in-out infinite;
}

.btn.big {
  width: 100%;
  font-size: 18px;
  padding: 14px 20px;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: #f2a596;
  border-color: rgba(224, 100, 79, 0.5);
  min-width: 100px;
  padding: 8px 16px;
  font-size: 14px;
}

.btn.danger.confirm {
  background: var(--danger);
  color: #fff;
}
.connection.tappable {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 8px;
}

@keyframes ready-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(240, 185, 63, 0.55);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(240, 185, 63, 0);
  }
}

.lang-switch {
  position: fixed;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 40;
  font-family: 'Vazirmatn', system-ui, sans-serif;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(6px);
}

/* ------------------------------------------------------------------ */
/* Screens                                                             */
/* ------------------------------------------------------------------ */

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 22px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.logo {
  width: 120px;
  height: 80px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}

h1 {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 800;
}

.wordmark {
  font-family: 'Poppins', 'Vazirmatn', system-ui, sans-serif;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.wordmark .cash {
  color: #f6f1e4;
}

.wordmark .gammon {
  background: linear-gradient(180deg, #ffe08a 0%, #f0b93f 55%, #c98a1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0 0 10px;
  color: var(--muted);
}

label {
  align-self: stretch;
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  padding: 13px 14px;
  font-size: 17px;
  font-family: inherit;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  text-align: center;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 185, 63, 0.2);
}

.hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Waiting */
.waiting-title {
  font-size: 18px;
  font-weight: 600;
  margin: 8px 0 0;
}

.dice-spinner {
  display: flex;
  gap: 14px;
  height: 60px;
  align-items: center;
}

.dice-spinner span {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(180deg, #fff, #e2dccd);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
  animation: tumble 1.1s ease-in-out infinite;
}

.dice-spinner span:last-child {
  background: linear-gradient(180deg, #ffd06a, var(--accent));
  animation-delay: 0.18s;
}

@keyframes tumble {
  0% {
    transform: translateY(0) rotate(0);
  }
  40% {
    transform: translateY(-16px) rotate(140deg);
  }
  70% {
    transform: translateY(0) rotate(270deg);
  }
  100% {
    transform: translateY(0) rotate(360deg);
  }
}

/* ------------------------------------------------------------------ */
/* Game                                                                */
/* ------------------------------------------------------------------ */

.screen.game {
  justify-content: flex-start;
  gap: 8px;
  padding: 46px 8px 16px;
}

.player-card {
  width: 100%;
  max-width: 780px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.player-card.active {
  border-color: rgba(240, 185, 63, 0.8);
  box-shadow: 0 0 0 3px rgba(240, 185, 63, 0.15);
}

.avatar {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.avatar.white {
  background: radial-gradient(circle at 35% 30%, #fff, #e9e2d2 50%, #c4baa4);
  color: #3a3328;
}

.avatar.black {
  background: radial-gradient(circle at 35% 30%, #6a6a6a, #2c2c2c 45%, #0b0b0b);
  color: #f1ece0;
}

.info {
  min-width: 0;
  flex: 1;
}

.player-card .name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card .status {
  font-size: 12px;
  color: var(--muted);
}

.player-card .status.offline {
  color: #f2a596;
}

.side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.pips {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.timer {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer .track {
  width: 72px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.timer .fill {
  height: 100%;
  background: linear-gradient(90deg, #5fd38d, #3fb56f);
  transition: width 0.2s linear;
}

.timer .secs {
  font-size: 12px;
  min-width: 20px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.timer.low .fill {
  background: linear-gradient(90deg, #ff8a6b, var(--danger));
}

.timer.low .secs {
  color: #ff9c86;
  font-weight: 700;
}

.board-wrap {
  width: 100%;
  max-width: 780px;
}

#board {
  width: 100%;
  height: auto;
  display: block;
  touch-action: manipulation;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

#board .pulse {
  animation: pulse 1.3s ease-in-out infinite;
}

#board .pulse-soft {
  animation: pulse-soft 1.3s ease-in-out infinite;
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

#board .flying {
  transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.3, 1);
}

#board .dice-roll {
  transform-box: fill-box;
  transform-origin: center;
  animation: dice-roll 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes dice-roll {
  0% {
    transform: rotate(-35deg) scale(0.4);
    opacity: 0;
  }
  70% {
    transform: rotate(8deg) scale(1.08);
    opacity: 1;
  }
  100% {
    transform: rotate(0) scale(1);
  }
}

#board .roll-button {
  transform-box: fill-box;
  transform-origin: center;
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.controls {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.message {
  margin: 0;
  min-height: 24px;
  text-align: center;
  font-size: 15px;
}

.buttons {
  display: flex;
  gap: 12px;
}

/* ------------------------------------------------------------------ */
/* Overlay & toast                                                     */
/* ------------------------------------------------------------------ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 10, 8, 0.7);
  backdrop-filter: blur(4px);
  animation: fade-in 0.25s ease;
}

.overlay-box {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 22px;
  text-align: center;
  background: linear-gradient(180deg, #24372d, #18251f);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  animation: pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.overlay-box.won {
  border-color: rgba(240, 185, 63, 0.6);
}

.overlay-box h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
}

.overlay-box p {
  margin: 0;
  color: var(--muted);
}

.points-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(240, 185, 63, 0.15);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
}

.toast {
  position: fixed;
  top: 52px;
  left: 50%;
  z-index: 60;
  max-width: min(92vw, 460px);
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(10, 14, 12, 0.92);
  border: 1px solid var(--card-border);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.connection {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 70;
  padding: 8px;
  text-align: center;
  font-size: 14px;
  background: var(--danger);
  color: #fff;
}

/* ------------------------------------------------------------------ */
/* Admin notices                                                       */
/* ------------------------------------------------------------------ */

.announcement {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 35;
  padding: 9px 110px 9px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

[dir='rtl'] .announcement {
  padding: 9px 16px 9px 110px;
}

.announcement.info {
  background: #24507a;
}

.announcement.warning {
  background: #8a5a14;
}

.announcement.success {
  background: #1f6b48;
}

body.has-announcement .screen.game {
  padding-top: 84px;
}

body.has-announcement .screen {
  padding-top: 64px;
}

.update-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 65;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(94vw, 480px);
  padding: 10px 12px 10px 16px;
  border-radius: 14px;
  background: #12261c;
  border: 1px solid rgba(240, 185, 63, 0.6);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  font-size: 14px;
}

.update-bar span {
  flex: 1;
}

.update-bar .btn {
  flex: none;
}

.btn.small {
  min-width: 0;
  padding: 8px 14px;
  font-size: 14px;
}

.maintenance-box {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(231, 166, 58, 0.14);
  border: 1px solid rgba(231, 166, 58, 0.45);
  color: #ffd28a;
  text-align: center;
}

.maintenance-box p {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 14px;
}

.notes-text {
  white-space: pre-line;
  text-align: start;
  line-height: 1.8;
  color: var(--text) !important;
  max-height: 50vh;
  overflow-y: auto;
  align-self: stretch;
}

/* ------------------------------------------------------------------ */
/* Telegram & invites                                                  */
/* ------------------------------------------------------------------ */

.name-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tg-greeting {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.tg-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
}

.btn.big + .btn.big {
  margin-top: -2px;
}

.invite-icon {
  font-size: 44px;
}

.invite-title {
  margin: 0;
  font-size: 22px;
}

.invite-code-label {
  margin-top: 6px;
}

.invite-code {
  font-family: 'Poppins', ui-monospace, monospace;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--accent);
}

.invite-link {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: var(--muted);
  text-align: center;
  user-select: all;
  -webkit-user-select: all;
}

.dice-spinner.small {
  height: 36px;
  gap: 10px;
}

.dice-spinner.small span {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

/* Inside Telegram the language button sits below Telegram's own header */
body.in-telegram .lang-switch {
  top: 8px;
}

/* ================================================================== */
/* Menu screens: home, free, paid                                      */
/* ================================================================== */

:root {
  --free: #3fb56f;
  --free-light: #7fe0b1;
  --gold: #f0b93f;
  --gold-light: #ffd978;
}

.app-screen {
  justify-content: flex-start;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 18px 16px calc(112px + env(safe-area-inset-bottom));
}

.theme-free {
  background: radial-gradient(700px 360px at 50% -12%, rgba(63, 181, 111, 0.22), transparent 70%);
}

body:has(#screen-paid:not(.hidden)),
body:has(.app-screen.theme-paid:not(.hidden)) {
  background:
    radial-gradient(1000px 520px at 50% -10%, #4a3a12 0%, transparent 60%),
    linear-gradient(180deg, #1d170b, #120f08);
  background-attachment: fixed;
}

.small {
  font-size: 12.5px;
}

.muted {
  color: var(--muted);
}

/* Top bar on home */
.top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline-end: 74px; /* room for the language button */
}

.avatar-big {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 800;
  font-size: 18px;
  color: #10261a;
  background: linear-gradient(135deg, var(--free-light), var(--free));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.avatar-big img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.who-name {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.balances {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--card-border);
}

.chips-pill {
  color: var(--free-light);
  border-color: rgba(63, 181, 111, 0.35);
}

.usd-pill {
  color: var(--gold-light);
  border-color: rgba(240, 185, 63, 0.35);
  opacity: 0.75;
}

.age-pill {
  color: var(--gold-light);
  border-color: rgba(240, 185, 63, 0.4);
}

.coin-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c8ffe2, var(--free) 60%, #1f7a45);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.brand-block {
  text-align: center;
  margin-top: 6px;
}

.brand-block .wordmark {
  margin: 0;
  font-size: 38px;
}

.brand-block p {
  margin: 6px 0 0;
}

.app-screen .name-block input {
  text-align: start;
}

/* Free / paid cards */
.mode-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mode-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 18px;
  text-align: start;
  font-family: inherit;
  color: var(--text);
  border-radius: 22px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.mode-card:active {
  transform: scale(0.98);
}

.mode-card::after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  inset-inline-end: -70px;
  top: -90px;
  border-radius: 50%;
  opacity: 0.35;
  pointer-events: none;
}

.mode-card.free {
  background: linear-gradient(150deg, rgba(63, 181, 111, 0.26), rgba(20, 48, 33, 0.85));
  border: 1px solid rgba(127, 224, 177, 0.35);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.mode-card.free::after {
  background: radial-gradient(circle, var(--free-light), transparent 65%);
}

.mode-card.paid {
  background: linear-gradient(150deg, rgba(240, 185, 63, 0.26), rgba(48, 36, 12, 0.9));
  border: 1px solid rgba(255, 217, 120, 0.38);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.mode-card.paid::after {
  background: radial-gradient(circle, var(--gold-light), transparent 65%);
}

@media (hover: hover) {
  .mode-card:hover {
    transform: translateY(-2px);
  }
  .mode-card.free:hover {
    box-shadow: 0 18px 40px rgba(63, 181, 111, 0.22);
  }
  .mode-card.paid:hover {
    box-shadow: 0 18px 40px rgba(240, 185, 63, 0.22);
  }
}

.mode-top,
.mode-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mode-bottom {
  margin-top: 6px;
}

.mode-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.free .mode-icon {
  color: #0f2a1b;
  background: linear-gradient(135deg, var(--free-light), var(--free));
}

.paid .mode-icon {
  color: #2e1e04;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.mode-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
}

.free .mode-tag {
  color: var(--free-light);
}

.paid .mode-tag {
  color: var(--gold-light);
}

.mode-title {
  font-size: 24px;
  font-weight: 800;
  margin-top: 6px;
}

.mode-desc {
  color: #d6ddd8;
  font-size: 14px;
  line-height: 1.6;
}

.mode-enter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 15px;
}

.free .mode-enter {
  color: var(--free-light);
}

.paid .mode-enter {
  color: var(--gold-light);
}

/* Arrow that points "forward" in both RTL and LTR */
.chev {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-top: 2.5px solid currentColor;
  border-inline-end: 2.5px solid currentColor;
  transform: rotate(45deg);
}

[dir='rtl'] .chev {
  transform: rotate(-45deg);
}

.chev.back {
  transform: rotate(-135deg);
}

[dir='rtl'] .chev.back {
  transform: rotate(135deg);
}

.online-line {
  text-align: center;
  margin: 0;
}

.online-dot,
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--free);
  box-shadow: 0 0 0 0 rgba(63, 181, 111, 0.6);
  animation: online-pulse 1.8s ease-out infinite;
  vertical-align: middle;
}

@keyframes online-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(63, 181, 111, 0.6);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(63, 181, 111, 0);
  }
}

/* Section header (free / paid) */
.section-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline-end: 74px;
}

.section-bar h1 {
  flex: 1;
  margin: 0;
  font-size: 22px;
}

.back-btn {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

/* Quick play */
.quick-play {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  font-family: inherit;
  text-align: start;
  color: #0f2a1b;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--free-light), var(--free));
  box-shadow: 0 12px 30px rgba(63, 181, 111, 0.3);
  transition: transform 0.12s ease;
}

.quick-play:active {
  transform: scale(0.98);
}

.quick-icon {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(15, 42, 27, 0.9);
  color: var(--free-light);
}

.quick-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-title {
  font-size: 20px;
  font-weight: 800;
}

.quick-desc {
  font-size: 13px;
  opacity: 0.8;
}

/* Tiles */
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tiles.one-col {
  grid-template-columns: 1fr 1fr;
}

.tiles:empty {
  display: none;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px;
  min-height: 118px;
  font-family: inherit;
  text-align: start;
  color: var(--text);
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: var(--card);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease;
}

.tile:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .tile:hover {
    border-color: rgba(255, 255, 255, 0.22);
  }
}

.tile.soon {
  opacity: 0.6;
}

.tile.glow {
  border-color: rgba(255, 143, 177, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 143, 177, 0.12);
}

.tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 6px;
}

.tile-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.tile-icon.green {
  color: var(--free-light);
  background: rgba(63, 181, 111, 0.16);
}

.tile-icon.blue {
  color: #8cc4ff;
  background: rgba(80, 150, 255, 0.16);
}

.tile-icon.gold {
  color: var(--gold-light);
  background: rgba(240, 185, 63, 0.16);
}

.tile-icon.pink {
  color: #ff9fbf;
  background: rgba(255, 120, 165, 0.16);
}

.tile-title {
  font-weight: 800;
  font-size: 15.5px;
}

.tile-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.badge-new,
.badge-soon {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.badge-new {
  color: #0f2a1b;
  background: var(--free-light);
}

.badge-soon {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.1);
}

/* Table lists */
.table-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-head h2 {
  margin: 0;
  font-size: 18px;
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
}

.theme-paid .table-row {
  border-color: rgba(240, 185, 63, 0.18);
}

.table-row.locked {
  opacity: 0.6;
}

.cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cell-label {
  font-size: 11px;
  color: var(--muted);
}

.cell-value {
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
}

.cell-value.prize {
  color: var(--free-light);
}

.theme-paid .cell-value.prize {
  color: var(--gold-light);
}

.cell.live {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.sit-btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  color: #0f2a1b;
  background: linear-gradient(180deg, var(--free-light), var(--free));
}

.theme-paid .sit-btn {
  color: #2e1e04;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
}

.sit-btn:disabled {
  cursor: default;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

/* Paid: balance card */
.balance-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(240, 185, 63, 0.22), rgba(48, 36, 12, 0.85));
  border: 1px solid rgba(255, 217, 120, 0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.balance-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.balance-value {
  font-family: 'Poppins', 'Vazirmatn', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--gold-light);
}

.balance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn.gold {
  min-width: 0;
  color: #2e1e04;
  border-color: #b9821b;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
}

.btn.gold-outline {
  min-width: 0;
  color: var(--gold-light);
  border-color: rgba(255, 217, 120, 0.5);
  background: transparent;
}

.soon-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #f3dfae;
  background: rgba(240, 185, 63, 0.1);
  border: 1px dashed rgba(240, 185, 63, 0.4);
}

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(10, 16, 13, 0.88);
  border-top: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
}

.bottom-nav button {
  flex: 1;
  max-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.bottom-nav button.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.bottom-nav button.active[data-go='free'] {
  color: var(--free-light);
}

.bottom-nav button.active[data-go='paid'] {
  color: var(--gold-light);
}

/* Maintenance: play buttons look disabled */
body.maintenance .quick-play,
body.maintenance .sit-btn,
body.maintenance .tile {
  opacity: 0.45;
  pointer-events: none;
}

/* Waiting: table name */
.waiting-table {
  margin: 0;
  font-weight: 800;
  color: var(--free-light);
}

.waiting-table:empty {
  display: none;
}

/* Game: table and prize line */
.table-info {
  width: 100%;
  max-width: 520px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.table-info.free {
  color: var(--free-light);
  background: rgba(63, 181, 111, 0.12);
}

.table-info.paid {
  color: var(--gold-light);
  background: rgba(240, 185, 63, 0.12);
}

/* Result: chips won / lost */
.result-chips {
  font-size: 22px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.result-chips.win {
  color: var(--free-light);
  background: rgba(63, 181, 111, 0.15);
}

.result-chips.loss {
  color: #f2a596;
  background: rgba(224, 100, 79, 0.13);
}

@media (max-width: 370px) {
  .table-row {
    grid-template-columns: 1fr 1fr auto;
  }
  .cell.live {
    display: none;
  }
  .tile {
    min-height: 104px;
  }
}

/* Private message from the admin: above everything, including the game result */
#msg-overlay {
  z-index: 80;
}

.msg-icon {
  font-size: 42px;
  line-height: 1;
}

/* ================================================================== */
/* Game screen layout: as big a board as the screen allows             */
/* ================================================================== */

/* Board drawing is 760 × 600 → width = height × 1.2667 */
.screen.game {
  --safe-top: calc(env(safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tg-safe-area-inset-bottom, 0px));
  --chrome: 236px; /* everything that is not the board, in portrait */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'info'
    'opp'
    'board'
    'me'
    'ctrl';
  align-content: center;
  justify-items: center;
  gap: 6px;
  min-height: var(--app-h, 100vh);
  padding: calc(8px + var(--safe-top)) 6px calc(10px + var(--safe-bottom));
}

body.has-announcement .screen.game {
  padding-top: calc(52px + var(--safe-top));
  --chrome: 280px;
}

/* No language button during a game (it covered the opponent's card) */
body.in-game .lang-switch {
  display: none;
}

#table-info {
  grid-area: info;
  margin: 0;
}

#card-opponent {
  grid-area: opp;
}

#card-me {
  grid-area: me;
}

.screen.game .board-wrap {
  grid-area: board;
  width: min(100%, 900px, max(300px, calc((var(--app-h, 100vh) - var(--chrome)) * 1.2667)));
  max-width: none;
}

#board {
  border-radius: 12px;
}

.screen.game .player-card {
  width: min(100%, 900px, max(300px, calc((var(--app-h, 100vh) - var(--chrome)) * 1.2667)));
  max-width: none;
}

.screen.game .controls {
  grid-area: ctrl;
  margin-top: 2px;
  gap: 8px;
}

.tool-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px 14px;
  font-size: 14px;
}

.rotate-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--free-light);
  background: rgba(63, 181, 111, 0.12);
  border: 1px solid rgba(63, 181, 111, 0.3);
}

.rotate-icon {
  display: grid;
  animation: rotate-phone 2.4s ease-in-out infinite;
}

@keyframes rotate-phone {
  0%,
  35% {
    transform: rotate(0);
  }
  55%,
  85% {
    transform: rotate(-90deg);
  }
  100% {
    transform: rotate(0);
  }
}

.rotate-close {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
}

/* ---------------- Phones held upright: slim bars, full-width board ---------------- */
/* (was @media (max-width: 600px) and (orientation: portrait) — now switched by app.js so it also works when the game turns the screen itself) */
body.layout-phone-portrait .screen.game {
  padding-inline: 3px;
  gap: 5px;
}
body.layout-phone-portrait .screen.game .board-wrap,
body.layout-phone-portrait .screen.game .player-card {
  width: 100%;
}
body.layout-phone-portrait #board {
  border-radius: 8px;
}
body.layout-phone-portrait .screen.game .player-card {
  padding: 6px 10px;
  border-radius: 12px;
  gap: 8px;
}
body.layout-phone-portrait .screen.game .avatar {
  width: 32px;
  height: 32px;
  font-size: 15px;
}
body.layout-phone-portrait .screen.game .player-card .name {
  font-size: 14.5px;
}
body.layout-phone-portrait .screen.game .message {
  font-size: 14.5px;
  min-height: 22px;
}
body.layout-phone-portrait .screen.game .buttons .btn {
  min-width: 132px;
  padding: 12px 18px;
}

/* ---------------- Phones / small tablets held sideways ---------------- */
/* (was @media (orientation: landscape) and (max-height: 640px) — now switched by app.js so it also works when the game turns the screen itself) */
body.layout-landscape .screen.game {
  --side: clamp(170px, calc(var(--app-w, 100vw) * 0.26), 250px);
  --board-w: min(calc((var(--app-h, 100vh) - var(--safe-top) - var(--safe-bottom) - 12px) * 1.2667), calc(var(--app-w, 100vw) - var(--side) - 30px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  grid-template-columns: var(--board-w) var(--side);
  grid-template-rows: auto auto 1fr auto;
  grid-template-areas:
    'board info'
    'board opp'
    'board ctrl'
    'board me';
  justify-content: center;
  align-content: center;
  align-items: center;
  column-gap: 12px;
  row-gap: 6px;
  min-height: 0;
  height: var(--app-h, 100vh);
  padding: calc(6px + var(--safe-top)) calc(8px + env(safe-area-inset-right, 0px)) calc(6px + var(--safe-bottom)) calc(8px + env(safe-area-inset-left, 0px));
}
body.layout-landscape.has-announcement .screen.game {
  padding-top: calc(46px + var(--safe-top));
  --board-w: min(calc((var(--app-h, 100vh) - var(--safe-top) - var(--safe-bottom) - 52px) * 1.2667), calc(var(--app-w, 100vw) - var(--side) - 30px));
}
body.layout-landscape .screen.game .board-wrap {
  width: var(--board-w);
  align-self: center;
}
body.layout-landscape #board {
  border-radius: 10px;
}
body.layout-landscape .screen.game .player-card {
  width: 100%;
  padding: 6px 8px;
  gap: 8px;
}
body.layout-landscape .screen.game .avatar {
  width: 30px;
  height: 30px;
  font-size: 14px;
}
body.layout-landscape .screen.game .player-card .name {
  font-size: 13.5px;
}
body.layout-landscape .screen.game .side {
  gap: 2px;
}
body.layout-landscape .screen.game .timer .track {
  width: 48px;
}
body.layout-landscape .screen.game .controls {
  width: 100%;
  align-self: center;
  gap: 6px;
}
body.layout-landscape .screen.game .message {
  font-size: 13.5px;
  min-height: 0;
}
body.layout-landscape .screen.game .buttons {
  flex-direction: column;
  width: 100%;
  gap: 6px;
}
body.layout-landscape .screen.game .buttons .btn {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
}
body.layout-landscape .screen.game .tool-row {
  flex-direction: column;
  width: 100%;
  gap: 6px;
}
body.layout-landscape .screen.game .tool-row .btn {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
}
body.layout-landscape .table-info {
  font-size: 12px;
  padding: 4px 8px;
}
body.layout-landscape .rotate-hint {
  display: none;
}
body.layout-landscape /* The update bar must not cover the board */
body.in-game .update-bar {
  left: auto;
  right: 8px;
  transform: none;
  width: var(--side, 240px);
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  bottom: 8px;
}

/* Very short landscape (small phones): hide the second line of the cards */
/* (was @media (orientation: landscape) and (max-height: 380px) — now switched by app.js so it also works when the game turns the screen itself) */
body.layout-landscape.layout-short .screen.game .player-card .status {
  display: none;
}
body.layout-landscape.layout-short .screen.game .tool-row .btn span {
  display: none;
}

/* Tall (turned) board on phones held upright: 600 × 760 → width = height × 0.7895 */
body.board-tall .screen.game .board-wrap,
body.board-tall .screen.game .player-card {
  width: min(100%, 620px, max(280px, calc((var(--app-h, 100vh) - var(--chrome)) * 0.7895)));
}

/* (was @media (max-width: 600px) and (orientation: portrait) — now switched by app.js so it also works when the game turns the screen itself) */
body.layout-phone-portrait.board-tall .screen.game {
  --chrome: 232px;
}
body.layout-phone-portrait.board-tall .screen.game .board-wrap,
body.layout-phone-portrait.board-tall .screen.game .player-card {
  width: min(100%, calc((var(--app-h, 100vh) - var(--chrome) - var(--safe-top) - var(--safe-bottom)) * 0.7895));
}

/* ================================================================== */
/* Game drawer: arrow handle, quick chat, options                      */
/* ================================================================== */

.drawer-handle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px 7px 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  cursor: pointer;
}

.handle-arrow {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #10261a;
  background: linear-gradient(135deg, var(--free-light), var(--free));
  transition: transform 0.25s ease;
}

.drawer-handle.open .handle-arrow {
  transform: rotate(180deg);
}

.handle-chat {
  font-size: 14px;
  opacity: 0.85;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(0, 0, 0, 0.35);
}

.game-drawer {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: 0;
  width: min(100%, 520px);
  max-height: 72%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 14px calc(14px + env(safe-area-inset-bottom, 0px) + var(--tg-safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #1b2c23, #121d17);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, 105%);
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.3, 0.8, 0.3, 1), visibility 0s linear 0.28s;
}

.game-drawer.open {
  transform: translate(-50%, 0);
  visibility: visible;
  transition: transform 0.28s cubic-bezier(0.3, 0.8, 0.3, 1), visibility 0s;
}

.drawer-grip {
  align-self: center;
  width: 42px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 15px;
}

.mini-toggle {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--free-light);
  background: rgba(63, 181, 111, 0.12);
  border: 1px solid rgba(63, 181, 111, 0.35);
}

.mini-toggle.off {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--card-border);
}

.chat-phrases {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chat-chip {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-emojis {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.chat-emoji {
  font-size: 24px;
  line-height: 1;
  padding: 8px 0;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
}

.chat-chip:active,
.chat-emoji:active {
  transform: scale(0.94);
}

@media (hover: hover) {
  .chat-chip:hover,
  .chat-emoji:hover {
    border-color: rgba(127, 224, 177, 0.5);
  }
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  white-space: nowrap;
}

.drawer-action.danger {
  color: #f2a596;
  border-color: rgba(224, 100, 79, 0.45);
}

.drawer-action.danger.confirm {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

/* Chat bubbles next to each player's card */
.player-card {
  position: relative;
}

.chat-bubble {
  position: absolute;
  z-index: 6;
  inset-inline-start: 46px;
  max-width: 75%;
  padding: 7px 14px;
  font-size: 14.5px;
  font-weight: 700;
  color: #10261a;
  background: #eafff3;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  pointer-events: none;
}

.chat-bubble.emoji {
  font-size: 30px;
  padding: 4px 10px;
  line-height: 1.1;
}

#card-opponent .chat-bubble {
  top: calc(100% + 6px);
  border-start-start-radius: 4px;
}

#card-me .chat-bubble {
  bottom: calc(100% + 6px);
  border-end-start-radius: 4px;
}

.chat-bubble.pop {
  animation: bubble-pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes bubble-pop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Phones held sideways: the drawer opens over the side column, not over the board */
/* (was @media (orientation: landscape) and (max-height: 640px) — now switched by app.js so it also works when the game turns the screen itself) */
body.layout-landscape .game-drawer {
  left: auto;
  inset-inline-end: 0;
  top: 0;
  bottom: 0;
  width: min(330px, calc(var(--app-w, 100vw) * 0.46));
  max-height: none;
  border-radius: 0;
  border: none;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.1);
  padding: calc(10px + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)) 12px 12px;
  transform: translateX(105%);
}
[dir='rtl'] body.layout-landscape .game-drawer {
  transform: translateX(-105%);
}
body.layout-landscape .game-drawer.open,
[dir='rtl'] body.layout-landscape .game-drawer.open {
  transform: translateX(0);
}
body.layout-landscape .drawer-grip {
  display: none;
}
body.layout-landscape .chat-emojis {
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
body.layout-landscape .chat-emoji {
  font-size: 19px;
  padding: 6px 0;
}
body.layout-landscape .game-drawer {
  gap: 10px;
}
body.layout-landscape .drawer-actions {
  padding-top: 8px;
}
body.layout-landscape .chat-chip {
  font-size: 13px;
  padding: 8px 6px;
}
body.layout-landscape .drawer-action {
  font-size: 13px;
  padding: 9px 8px;
}
body.layout-landscape .drawer-handle {
  width: 100%;
  justify-content: center;
}
body.layout-landscape .chat-bubble {
  max-width: none;
}

/* ================================================================== */
/* Menus on phones held sideways: wider, two cards side by side         */
/* ================================================================== */

/* (was @media (orientation: landscape) and (max-height: 560px) — now switched by app.js so the keyboard cannot trigger it) */
body.menu-landscape .app-screen {
    max-width: 880px;
    gap: 10px;
    padding: 10px 24px calc(64px + env(safe-area-inset-bottom, 0px));
  }
body.menu-landscape .top-bar,
body.menu-landscape .section-bar {
    padding-inline-end: 96px;
  }
body.menu-landscape .brand-block {
    margin-top: 0;
  }
body.menu-landscape .brand-block .wordmark {
    font-size: 26px;
  }
body.menu-landscape .brand-block p {
    margin-top: 2px;
    font-size: 13px;
  }
body.menu-landscape .mode-cards {
    flex-direction: row;
  }
body.menu-landscape .mode-card {
    flex: 1;
    padding: 14px 16px;
  }
body.menu-landscape .mode-icon {
    width: 40px;
    height: 40px;
  }
body.menu-landscape .mode-title {
    font-size: 19px;
    margin-top: 2px;
  }
body.menu-landscape .mode-desc {
    font-size: 13px;
    line-height: 1.5;
  }
body.menu-landscape .quick-play {
    padding: 12px 16px;
  }
body.menu-landscape .quick-icon {
    width: 44px;
    height: 44px;
  }
body.menu-landscape .quick-title {
    font-size: 18px;
  }
body.menu-landscape .tiles,
body.menu-landscape .tiles.one-col {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
body.menu-landscape .tile {
    min-height: 0;
    padding: 12px;
  }
body.menu-landscape .tile-icon {
    width: 36px;
    height: 36px;
  }
body.menu-landscape .rows {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
body.menu-landscape .balance-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
body.menu-landscape .balance-actions {
    min-width: 260px;
  }
body.menu-landscape .bottom-nav {
    padding: 4px 12px calc(4px + env(safe-area-inset-bottom, 0px));
  }
body.menu-landscape .bottom-nav button {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
  }
body.menu-landscape .bottom-nav svg {
    width: 20px;
    height: 20px;
  }

/* ================================================================== */
/* The game turns the page itself when Telegram keeps it upright        */
/* ================================================================== */

html {
  background: #0f1a15;
}

body.force-rotate {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--app-w);
  height: var(--app-h);
  min-height: 0;
  overflow: hidden;
  transform-origin: 0 0;
}

body.force-rotate.rot-cw {
  transform: rotate(90deg) translateY(-100%);
}

body.force-rotate.rot-ccw {
  transform: rotate(-90deg) translateX(-100%);
}

/* ================================================================== */
/* Turn message and timer                                              */
/* ================================================================== */

.message.my-turn {
  color: var(--free-light);
  font-weight: 700;
}

/* Sideways: the turn message is a clear pill, the timer is a ring around the avatar */
body.layout-landscape .screen.game .message {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
}

body.layout-landscape .screen.game .message.my-turn {
  color: #0f2a1b;
  font-weight: 800;
  background: linear-gradient(135deg, var(--free-light), var(--free));
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(63, 181, 111, 0.3);
}

body.layout-landscape .screen.game .message.empty {
  display: none;
}

body.layout-landscape .screen.game .timer .track {
  display: none;
}

body.layout-landscape .screen.game .timer .secs {
  font-size: 15px;
  font-weight: 800;
  color: var(--free-light);
  min-width: 0;
}

body.layout-landscape .screen.game .timer.low .secs {
  color: #ff9c86;
}

body.layout-landscape .screen.game .avatar {
  position: relative;
  width: 36px;
  height: 36px;
}

body.layout-landscape .screen.game .player-card.ticking .avatar::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(#5fd38d calc(var(--t, 1) * 360deg), rgba(255, 255, 255, 0.12) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
}

body.layout-landscape .screen.game .player-card.ticking.low .avatar::before {
  background: conic-gradient(#ff7a5c calc(var(--t, 1) * 360deg), rgba(255, 255, 255, 0.12) 0);
  animation: ring-blink 0.8s ease-in-out infinite;
}

@keyframes ring-blink {
  50% {
    opacity: 0.45;
  }
}

body.layout-landscape .screen.game .player-card {
  padding: 8px 10px 8px 8px;
}

body.layout-landscape .screen.game .player-card.active {
  background: linear-gradient(135deg, rgba(63, 181, 111, 0.16), var(--card));
  border-color: rgba(127, 224, 177, 0.6);
  box-shadow: 0 0 0 3px rgba(63, 181, 111, 0.12);
}

/* ================================================================== */
/* Drawer tabs and typed chat                                          */
/* ================================================================== */

.drawer-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
}

.drawer-tab {
  position: relative;
  padding: 9px 8px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 11px;
  cursor: pointer;
}

.drawer-tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

.drawer-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.unread-dot {
  position: absolute;
  top: 6px;
  inset-inline-end: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff6b6b;
  box-shadow: 0 0 0 2px #1b2c23;
}

.handle-chat {
  position: relative;
}

.handle-chat .unread-dot {
  top: -3px;
  inset-inline-end: -5px;
  animation: online-pulse 1.4s ease-out infinite;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 116px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  user-select: text;
  -webkit-user-select: text;
}

.chat-empty {
  margin: auto;
  font-size: 13px;
  color: var(--muted);
}

.chat-line {
  max-width: 82%;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.6;
  border-radius: 14px;
  overflow-wrap: anywhere;
}

/* "mine" sits on the reading-start side, like messengers */
.chat-line.mine {
  align-self: flex-start;
  color: #10261a;
  background: linear-gradient(135deg, var(--free-light), #5fd38d);
  border-end-start-radius: 4px;
}

.chat-line.theirs {
  align-self: flex-end;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border-end-end-radius: 4px;
}

.chat-line.emoji {
  font-size: 24px;
  padding: 2px 6px;
  background: none;
}

.chat-form {
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.chat-input:focus {
  border-color: rgba(127, 224, 177, 0.6);
}

.chat-send {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #10261a;
  background: linear-gradient(135deg, var(--free-light), var(--free));
}

[dir='rtl'] .chat-send svg {
  transform: scaleX(-1);
}

.chat-off-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Quick phrases: one row you can swipe sideways */
.chat-phrases {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.chat-phrases::-webkit-scrollbar {
  display: none;
}

.chat-chip {
  flex: none;
  padding: 8px 14px;
  font-size: 13.5px;
  border-radius: 999px;
}

.drawer-action.wide {
  grid-column: 1 / -1;
}

.drawer-action.off {
  color: var(--muted);
}

.action-emoji {
  font-size: 18px;
  line-height: 1;
}

/* Typed messages in the bubble over the board can wrap */
.chat-bubble.long {
  white-space: normal;
  max-width: min(78%, 300px);
  font-size: 14px;
  line-height: 1.55;
}

/* Sideways: the chat log uses the free height */
body.layout-landscape .game-drawer .drawer-panel[data-panel='chat'] {
  flex: 1;
}

body.layout-landscape .chat-log {
  flex: 1;
  height: auto;
  min-height: 70px;
}

body.layout-landscape .drawer-tab {
  padding: 7px 6px;
  font-size: 13.5px;
}

body.layout-landscape .chat-send {
  width: 40px;
  height: 40px;
}

body.layout-landscape .chat-input {
  padding: 8px 12px;
  font-size: 14px;
}

/* Page turned by the game: the system keyboard opens at the phone's real bottom edge,
   so the drawer (with the chat box) goes to the real TOP edge to stay visible above it. */
[dir] body.force-rotate.rot-cw .game-drawer {
  left: 0;
  right: auto;
  transform: translateX(-105%);
}

[dir] body.force-rotate.rot-ccw .game-drawer {
  left: auto;
  right: 0;
  transform: translateX(105%);
}

[dir] body.force-rotate.rot-cw .game-drawer.open,
[dir] body.force-rotate.rot-ccw .game-drawer.open {
  transform: translateX(0);
}

/* Full screen in Telegram: keep clear of Telegram's floating buttons and the phone's notch */
:root {
  --top-safe: calc(env(safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
}

.app-screen {
  padding-top: calc(18px + var(--top-safe));
}

.lang-switch,
body.in-telegram .lang-switch {
  top: calc(8px + var(--top-safe));
}

.announcement {
  padding-top: calc(9px + var(--top-safe));
}

/* Arrow (menu & chat) + Portrait/Landscape switch, side by side under the board */
.control-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.orient-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
}

.orient-switch button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

.orient-switch button.active {
  color: #10261a;
  background: linear-gradient(135deg, var(--free-light), var(--free));
}

body.layout-landscape .control-row {
  width: 100%;
  flex-direction: column;
  gap: 6px;
}

body.layout-landscape .orient-switch {
  width: 100%;
}

body.layout-landscape .orient-switch button {
  flex: 1;
  justify-content: center;
  padding: 6px 6px;
}

/* ================================================================== */
/* Full-screen button next to the Portrait/Landscape switch            */
/* ================================================================== */

.fs-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
}

.fs-btn span {
  display: none;
}

.fs-btn.active {
  color: #10261a;
  background: linear-gradient(135deg, var(--free-light), var(--free));
  border-color: transparent;
}

body.layout-landscape .fs-btn {
  width: 100%;
  height: auto;
  display: inline-flex;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
}

body.layout-landscape .fs-btn span {
  display: inline;
}

/* ================================================================== */
/* Drawer: quick chat + resign / report on one page                    */
/* ================================================================== */

.game-drawer .chat-phrases {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: visible;
}

.game-drawer .chat-chip {
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 14px;
}

.drawer-actions .drawer-action.small {
  padding: 8px;
  font-size: 13px;
}

.drawer-action.warn {
  color: #ffd27a;
  border-color: rgba(240, 185, 63, 0.45);
}

.report-box {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 20px 16px;
  background: #16241c;
  border-radius: inherit;
}

.report-title {
  margin: 0 0 4px;
  font-weight: 800;
  text-align: center;
}

.report-reason {
  padding: 13px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  cursor: pointer;
}

.report-cancel {
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
}

body.layout-landscape .game-drawer .chat-phrases {
  grid-template-columns: 1fr 1fr;
}

body.layout-landscape .game-drawer .chat-chip {
  padding: 7px 6px;
  font-size: 12.5px;
}

/* ================================================================== */
/* Create game, open tables list, match score                          */
/* ================================================================== */

.create-play {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 16px;
  font-family: inherit;
  text-align: start;
  color: var(--free-light);
  background: rgba(63, 181, 111, 0.1);
  border: 1.5px dashed rgba(127, 224, 177, 0.55);
  border-radius: 20px;
  cursor: pointer;
}

.create-icon {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0f2a1b;
  background: linear-gradient(135deg, var(--free-light), var(--free));
}

.create-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.screen-intro {
  margin: -4px 0 0;
  line-height: 1.7;
}

.open-tables {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.open-table {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
}

.open-table.mine {
  border-color: rgba(127, 224, 177, 0.5);
}

.ot-avatar {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
  color: #10261a;
  background: linear-gradient(135deg, var(--free-light), var(--free));
}

.ot-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ot-host {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ot-length,
.ot-stake {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}

.ot-length {
  color: #10261a;
  background: var(--free-light);
}

.ot-stake {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.ot-mine {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--free-light);
}

.empty-tables {
  text-align: center;
  padding: 28px 12px;
  border-radius: 18px;
  border: 1px dashed var(--card-border);
}

.empty-tables p {
  margin: 6px 0 0;
}

.empty-icon {
  font-size: 40px;
}

.create-inline {
  align-self: center;
}

/* Create form */
.form-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-label {
  margin: 0;
  font-size: 16px;
}

.choice-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  cursor: pointer;
}

.choice strong {
  font-size: 16px;
}

.choice.length strong {
  font-size: 24px;
  line-height: 1.2;
}

.choice.active {
  border-color: var(--free);
  background: rgba(63, 181, 111, 0.16);
  box-shadow: 0 0 0 3px rgba(63, 181, 111, 0.15);
}

.choice:disabled {
  opacity: 0.4;
  cursor: default;
}

#btn-create-go {
  margin-top: 4px;
}

/* Match score next to each player */
.match-score {
  display: flex;
  align-items: baseline;
  gap: 1px;
  padding: 3px 10px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
  background: rgba(240, 185, 63, 0.14);
  border: 1px solid rgba(240, 185, 63, 0.35);
  color: var(--gold-light);
}

.match-score strong {
  font-size: 18px;
}

.match-score span {
  font-size: 12px;
  opacity: 0.8;
}

/* Between two games of a match: card over the board */
.board-wrap {
  position: relative;
}

.between-games {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(86%, 340px);
  padding: 18px 16px;
  text-align: center;
  border-radius: 20px;
  background: rgba(12, 26, 19, 0.94);
  border: 1px solid rgba(127, 224, 177, 0.5);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  animation: bubble-pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.between-games.lost {
  border-color: rgba(255, 255, 255, 0.18);
}

.bg-title {
  font-weight: 800;
  font-size: 17px;
  color: var(--free-light);
}

.between-games.lost .bg-title {
  color: var(--text);
}

.bg-score {
  margin: 8px 0 4px;
  font-family: 'Poppins', 'Vazirmatn', sans-serif;
  font-size: 40px;
  font-weight: 800;
  color: var(--gold-light);
}

.bg-next {
  font-size: 13px;
  color: var(--muted);
}

body.layout-landscape .open-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

body.layout-landscape .screen.game .match-score strong {
  font-size: 15px;
}

.table-info .part {
  unicode-bidi: isolate;
}

.table-info .sep {
  margin: 0 6px;
  opacity: 0.6;
}

/* ================================================================== */
/* Profile button (home) and profile sheet                             */
/* ================================================================== */

/* Language now lives in the profile (and in the game drawer) */
.lang-switch {
  display: none !important;
}

.top-bar,
.section-bar {
  padding-inline-end: 0;
}

.profile-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 4px;
  font-family: inherit;
  text-align: start;
  color: var(--text);
  background: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

.profile-btn:active {
  background: rgba(255, 255, 255, 0.06);
}

.avatar-wrap {
  position: relative;
  flex: none;
}

.avatar-wrap .unread-dot {
  top: 0;
  inset-inline-end: 0;
  width: 12px;
  height: 12px;
  animation: online-pulse 1.4s ease-out infinite;
}

.avatar-gear {
  position: absolute;
  bottom: -2px;
  inset-inline-start: -2px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  background: #22362b;
  border: 2px solid #0f1a15;
}

.profile-sheet {
  z-index: 47;
}

#profile-backdrop {
  z-index: 46;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-head .avatar-big {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

.profile-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.profile-who .who-name {
  font-size: 18px;
}

.sheet-close {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  font-size: 15px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: none;
  cursor: pointer;
}

.profile-title {
  margin: 4px 2px -4px;
  font-size: 14px;
  color: var(--muted);
}

.profile-group {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  text-align: start;
  color: var(--text);
  background: none;
  border: none;
}

.profile-row + .profile-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-row.action {
  cursor: pointer;
}

.profile-row.action:active {
  background: rgba(255, 255, 255, 0.05);
}

.profile-row.soon {
  opacity: 0.6;
}

.row-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}

.row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.row-text strong {
  font-size: 15px;
}

.row-side {
  white-space: nowrap;
}

.row-cta {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 999px;
  color: #10261a;
  background: linear-gradient(135deg, #ffb3cb, #ff8fb1);
  white-space: nowrap;
}

/* Two-way switch (language, board view) */
.seg-switch {
  display: inline-flex;
  flex: none;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
}

.seg-switch button {
  padding: 6px 11px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

.seg-switch button.active {
  color: #10261a;
  background: linear-gradient(135deg, var(--free-light), var(--free));
}

/* On/off switch */
.switch-ui {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s ease;
}

.switch-ui span {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: inset-inline-start 0.2s ease;
}

.switch-ui.on {
  background: var(--free);
}

.switch-ui.on span {
  inset-inline-start: 23px;
}

/* ================================================================== */
/* Profile sheet: list + pages                                         */
/* ================================================================== */

.profile-sheet {
  max-height: 88%;
}

.sheet-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-view.hidden {
  display: none;
}

.row-chev {
  opacity: 0.45;
}

/* the list's arrows point "forward" */
.profile-row .chev {
  width: 8px;
  height: 8px;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-head h2 {
  flex: 1;
  margin: 0;
  font-size: 19px;
}

.page-head .back-btn {
  width: 36px;
  height: 36px;
}

.page-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page-body.hidden {
  display: none;
}

.page-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 6px 0;
}

.hero-avatar {
  width: 76px !important;
  height: 76px !important;
  font-size: 30px !important;
}

.hero-name {
  font-size: 19px;
}

.hero-emoji {
  font-size: 46px;
  line-height: 1;
}

.center {
  text-align: center;
  margin: 0;
}

.mono {
  font-family: ui-monospace, Menlo, monospace;
}

.badge-id {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
}

.badge-id.verified {
  color: #8cc4ff;
  background: rgba(80, 150, 255, 0.14);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
}

.stat-box strong {
  font-size: 20px;
}

.chips-big {
  font-size: 18px;
  color: var(--free-light);
}

.wallet-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wallet-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
}

.wallet-card strong {
  font-size: 24px;
  font-family: 'Poppins', 'Vazirmatn', sans-serif;
}

.wallet-card.chips {
  background: linear-gradient(150deg, rgba(63, 181, 111, 0.24), rgba(20, 48, 33, 0.8));
  border: 1px solid rgba(127, 224, 177, 0.35);
}

.wallet-card.chips strong {
  color: var(--free-light);
}

.wallet-card.usd {
  background: linear-gradient(150deg, rgba(240, 185, 63, 0.22), rgba(48, 36, 12, 0.85));
  border: 1px solid rgba(255, 217, 120, 0.35);
}

.wallet-card.usd strong {
  color: var(--gold-light);
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wallet-actions .btn {
  min-width: 0;
}

.tx-amount {
  font-size: 15px;
  white-space: nowrap;
}

.tx-amount.plus {
  color: var(--free-light);
}

.tx-amount.minus {
  color: #f2a596;
}

.link-box {
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
}

.link-input {
  width: 100%;
  padding: 10px 12px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  color: var(--text);
  background: none;
  border: none;
  outline: none;
  user-select: all;
  -webkit-user-select: all;
}

.steps {
  margin: 0;
  padding-inline-start: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.7;
}

.bonus-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
}

.bonus-card.ready {
  border-color: rgba(255, 143, 177, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 143, 177, 0.12);
}

.done-mark {
  font-weight: 800;
  color: var(--free-light);
}

.faq {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
}

.faq-item summary {
  font-weight: 700;
  cursor: pointer;
}

.faq-item p {
  margin: 8px 0 0;
  line-height: 1.8;
}

.soon-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 16px;
  text-align: center;
  border-radius: 18px;
  border: 1px dashed var(--card-border);
}

.soon-block p {
  margin: 0;
}

.soon-icon {
  font-size: 44px;
}

/* ================================================================== */
/* Support chat (Profile → Support)                                    */
/* ================================================================== */

.count-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.support-chat {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--card-border);
  overflow: hidden;
}

.support-messages {
  height: min(46vh, 420px);
  min-height: 200px;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}

.support-loading {
  margin: auto;
}

.support-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  gap: 3px;
}

/* In RTL "start" is the right side: my messages on the start side, support on the other. */
.support-msg.mine {
  align-self: flex-start;
  align-items: flex-start;
}

.support-msg.theirs {
  align-self: flex-end;
  align-items: flex-end;
}

.support-bubble {
  padding: 9px 13px;
  border-radius: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
}

.support-msg.mine .support-bubble {
  background: linear-gradient(180deg, #2f7d55, #23603f);
  color: #f2fff7;
  border-start-start-radius: 6px;
}

.support-msg.theirs .support-bubble {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  border-start-end-radius: 6px;
}

.support-from {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  padding: 0 4px;
}

.support-time {
  font-size: 10.5px;
  color: var(--muted);
  padding: 0 4px;
}

.support-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
}

.support-composer textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 14px;
  border-radius: 21px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px: iOS does not zoom in on focus */
  line-height: 1.5;
  outline: none;
}

.support-composer textarea:focus {
  border-color: rgba(240, 185, 63, 0.55);
}

.support-send {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-light, #ffd978), var(--accent));
  color: #1b1405;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* the arrow points the way text flows */
[dir='rtl'] .support-send span {
  transform: scaleX(-1);
  display: inline-block;
}

.support-send:active {
  transform: scale(0.94);
}

/* Optional email on "My profile" */
.email-edit {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
  align-items: center;
}

.email-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  text-align: left;
}

.email-input:focus {
  border-color: rgba(240, 185, 63, 0.55);
}

.email-edit .btn.small {
  height: 42px;
  padding: 0 14px;
}

/* ================================================================== */
/* Leaderboards (Profile → Leaderboard)                                */
/* ================================================================== */

.lb-loading {
  text-align: center;
  padding: 40px 0;
}

.lb-currency {
  align-self: center;
  margin: 0 auto 10px;
  display: flex;
  width: fit-content;
}

.lb-boards {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin: 0 -2px;
  scrollbar-width: none;
}

.lb-boards::-webkit-scrollbar {
  display: none;
}

.lb-board {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.lb-board.active {
  background: linear-gradient(135deg, rgba(255, 217, 120, 0.22), rgba(240, 185, 63, 0.12));
  border-color: rgba(240, 185, 63, 0.6);
  color: var(--gold-light);
}

.lb-board-icon {
  font-size: 16px;
}

.lb-periods {
  display: flex;
  width: fit-content;
  margin: 4px auto 6px;
}

.lb-desc {
  text-align: center;
  margin: 4px 0 10px;
}

.lb-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  margin-bottom: 10px;
  text-align: center;
}

.lb-prizes {
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(240, 185, 63, 0.16), rgba(240, 185, 63, 0.05));
  border: 1px solid rgba(240, 185, 63, 0.35);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-prize-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lb-prize {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
}

.lb-row.top1 {
  background: linear-gradient(135deg, rgba(255, 217, 120, 0.2), rgba(240, 185, 63, 0.06));
  border-color: rgba(240, 185, 63, 0.5);
}

.lb-row.top2 {
  background: linear-gradient(135deg, rgba(210, 220, 230, 0.14), rgba(255, 255, 255, 0.04));
}

.lb-row.top3 {
  background: linear-gradient(135deg, rgba(205, 140, 80, 0.16), rgba(255, 255, 255, 0.04));
}

.lb-row.me {
  border-color: var(--free-light);
  box-shadow: 0 0 0 1px rgba(127, 224, 177, 0.35) inset;
}

.lb-rank {
  width: 28px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--muted);
  flex: none;
}

.lb-row.top .lb-rank {
  font-size: 20px;
}

.lb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
}

.lb-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lb-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-you {
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(127, 224, 177, 0.18);
  color: var(--free-light);
  flex: none;
}

.lb-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
  font-size: 14px;
}

.lb-row-prize {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold-light);
}

.lb-empty {
  text-align: center;
  padding: 26px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.lb-mine {
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #24513a, #1b3d2c);
  border: 1px solid rgba(127, 224, 177, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.lb-mine.none {
  background: linear-gradient(180deg, #2b2f2c, #222624);
  border-color: var(--card-border);
}

.lb-mine-icon {
  font-size: 20px;
}

.lb-last {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-last-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-rules {
  text-align: center;
  margin-top: 12px;
}

/* Badge next to a name (top 3 of the last period) */
.name-badge {
  font-size: 0.9em;
  white-space: nowrap;
  flex: none;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.hero-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(240, 185, 63, 0.14);
  border: 1px solid rgba(240, 185, 63, 0.35);
  color: var(--gold-light);
}

/* Prize popup */
.award-box {
  text-align: center;
  align-items: center;
}

.award-icon {
  font-size: 54px;
  animation: award-pop 0.6s ease-out;
}

.award-prize {
  font-size: 24px;
  color: var(--gold-light);
}

@keyframes award-pop {
  0% {
    transform: scale(0.3) rotate(-20deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.15) rotate(6deg);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

/* ================================================================== */
/* Home page (news): blocks managed by the admin                       */
/* ================================================================== */

.home-brand .wordmark {
  font-size: 30px;
}

.home-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 12px;
}

.home-block {
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 14px;
}

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

.home-head h2 {
  margin: 0;
  font-size: 16px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--gold-light);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.home-empty {
  text-align: center;
  padding: 30px 0;
}

/* Banners: swipe between slides */
.banner-block {
  padding: 0;
  overflow: hidden;
  border: none;
  background: none;
}

.banner-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 18px;
}

.banner-track::-webkit-scrollbar {
  display: none;
}

.banner-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-height: 168px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(135deg, #2c6a4a, #173a2a 60%, #3a3016);
  background-size: cover;
  background-position: center;
  position: relative;
}

.banner-slide.has-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.25) 55%, rgba(0, 0, 0, 0.05) 100%);
}

.banner-text {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px;
  width: 100%;
}

.banner-title {
  font-size: 19px;
  line-height: 1.4;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.banner-body {
  font-size: 13px;
  color: #e7efe9;
  line-height: 1.6;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.banner-btn {
  margin-top: 6px;
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-top: 8px;
}

.banner-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: width 0.2s;
}

.banner-dots span.on {
  width: 18px;
  border-radius: 3px;
  background: var(--gold-light);
}

/* Live numbers */
.stats-block {
  display: flex;
  gap: 10px;
  padding: 10px;
}

.stat-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 15px;
}

/* Small leaderboard */
.lb-block-tabs {
  display: flex;
  width: fit-content;
  margin: 0 auto 8px;
}

.lb-mini-timer {
  text-align: center;
  margin-bottom: 8px;
}

.lb-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-mini-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.lb-mini-row.me {
  box-shadow: inset 0 0 0 1px var(--free-light);
}

.lb-mini-medal {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.lb-mini-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-mini-value {
  font-size: 13px;
  font-weight: 700;
}

.lb-mini-empty {
  text-align: center;
  margin: 6px 0;
}

.lb-mini-me {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(127, 224, 177, 0.1);
  border: 1px solid rgba(127, 224, 177, 0.25);
  font-size: 13px;
  font-weight: 700;
}

/* Daily gift */
.daily-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.daily-block.ready {
  background: linear-gradient(135deg, rgba(240, 185, 63, 0.2), rgba(240, 185, 63, 0.05));
  border-color: rgba(240, 185, 63, 0.45);
}

.daily-gift {
  font-size: 30px;
}

.daily-block.ready .daily-gift {
  animation: gift-wiggle 2.4s ease-in-out infinite;
}

.daily-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@keyframes gift-wiggle {
  0%,
  80%,
  100% {
    transform: rotate(0);
  }
  85% {
    transform: rotate(-12deg);
  }
  90% {
    transform: rotate(12deg);
  }
  95% {
    transform: rotate(-6deg);
  }
}

/* News */
.news-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-block .home-head {
  margin-bottom: 0;
}

.news-card {
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
}

.news-card.pinned {
  border-color: rgba(240, 185, 63, 0.45);
}

.news-image {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.news-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-new {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
}

.news-title {
  font-size: 15px;
  line-height: 1.5;
}

.news-body {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: #dfe7e2;
  white-space: pre-line;
  cursor: pointer;
}

.news-body.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Red dot on a bottom tab */
.bottom-nav button {
  position: relative;
}

.nav-dot {
  position: absolute;
  top: 4px;
  inset-inline-end: calc(50% - 18px);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(10, 16, 13, 0.9);
}

/* ================================================================== */
/* Invite friends (referrals)                                          */
/* ================================================================== */

.ref-link-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.ref-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ref-code {
  font: inherit;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(240, 185, 63, 0.6);
  background: rgba(240, 185, 63, 0.1);
  color: var(--gold-light);
  cursor: pointer;
}

.ref-share-card {
  margin: 12px 0;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(240, 185, 63, 0.16), rgba(240, 185, 63, 0.04));
  border: 1px solid rgba(240, 185, 63, 0.4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref-share-card p {
  margin: 0;
}

.ref-share-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ref-percent {
  font-size: 30px;
  font-weight: 900;
  color: var(--gold-light);
  min-width: 70px;
  text-align: center;
}

.ref-personal {
  font-weight: 700;
  color: var(--gold-light);
  font-size: 13px;
}

.ref-tiers {
  display: flex;
  gap: 8px;
}

.ref-tier {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--card-border);
  opacity: 0.7;
  text-align: center;
}

.ref-tier.done {
  opacity: 0.9;
}

.ref-tier.current {
  opacity: 1;
  border-color: var(--gold-light);
  box-shadow: 0 0 0 1px rgba(255, 217, 120, 0.4) inset;
}

.ref-tier-icon {
  font-size: 20px;
}

.ref-next {
  font-weight: 700;
  font-size: 13px;
}

.ref-how,
.ref-friends {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ref-how p {
  margin: 0;
}

.ref-friend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--card-border);
}

.ref-friend-name {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ref-state {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.ref-state.active {
  background: rgba(127, 224, 177, 0.15);
  color: var(--free-light);
}

.ref-state.review {
  background: rgba(240, 185, 63, 0.15);
  color: var(--gold-light);
}

.center {
  text-align: center;
}

/* Done / Undo on the board */
#board .board-action > g {
  transition: opacity 0.2s;
}
#board .board-action.pop {
  transform-box: fill-box;
  transform-origin: center;
  animation: ba-pop 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.35);
}
#board .ba-done.just-ready {
  transform-box: fill-box;
  transform-origin: center;
  animation: ba-ready 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
#board .board-action:active {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.92);
}
#board .ba-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: ba-ring 1.6s ease-out infinite;
  pointer-events: none;
}
#board .ba-ring2 {
  animation-delay: 0.8s;
}
@keyframes ba-pop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes ba-ready {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes ba-ring {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.55); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #board .board-action.pop, #board .ba-done.just-ready, #board .ba-ring { animation: none; }
}

/* ================================================================== */
/* Bonuses: 7-day calendar, missions, win streak, cups               */
/* ================================================================== */

/* Cups for the first three places */
.cup {
  display: inline-flex;
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}
.cup svg {
  width: 100%;
  height: 100%;
}
.cup1 {
  width: 30px;
  height: 30px;
  animation: cup-shine 3.2s ease-in-out infinite;
}
@keyframes cup-shine {
  0%, 100% { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
  50% { filter: drop-shadow(0 0 8px rgba(255, 205, 90, 0.75)); }
}
.lb-mini-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  font-weight: 800;
  color: var(--muted);
}
.lb-mini-row.top1 {
  background: linear-gradient(90deg, rgba(245, 192, 74, 0.22), rgba(245, 192, 74, 0.04));
  box-shadow: inset 0 0 0 1px rgba(245, 192, 74, 0.35);
}
.lb-mini-row.top2 {
  background: linear-gradient(90deg, rgba(207, 214, 223, 0.16), rgba(207, 214, 223, 0.03));
  box-shadow: inset 0 0 0 1px rgba(207, 214, 223, 0.22);
}
.lb-mini-row.top3 {
  background: linear-gradient(90deg, rgba(208, 138, 76, 0.18), rgba(208, 138, 76, 0.03));
  box-shadow: inset 0 0 0 1px rgba(208, 138, 76, 0.25);
}
[dir='rtl'] .lb-mini-row.top1 {
  background: linear-gradient(270deg, rgba(245, 192, 74, 0.22), rgba(245, 192, 74, 0.04));
}
[dir='rtl'] .lb-mini-row.top2 {
  background: linear-gradient(270deg, rgba(207, 214, 223, 0.16), rgba(207, 214, 223, 0.03));
}
[dir='rtl'] .lb-mini-row.top3 {
  background: linear-gradient(270deg, rgba(208, 138, 76, 0.18), rgba(208, 138, 76, 0.03));
}
[dir='rtl'] .mis-row.done:not(.claimed) {
  background: linear-gradient(270deg, rgba(240, 185, 63, 0.16), rgba(0, 0, 0, 0.18));
}
.lb-mini-row.top1 .lb-mini-name {
  color: #ffe7a3;
}
.lb-mini-row.me.top1,
.lb-mini-row.me.top2,
.lb-mini-row.me.top3 {
  box-shadow: inset 0 0 0 1.5px var(--free-light);
}

/* 7-day calendar */
.cal-block {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(240, 185, 63, 0.16), transparent 60%),
    var(--card);
  border-color: rgba(240, 185, 63, 0.28);
}
.cal-block .home-head {
  flex-wrap: wrap;
  row-gap: 2px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 7px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.2s;
}
.cal-day-n {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.cal-day-icon {
  font-size: 20px;
  line-height: 1.2;
}
.cal-day-amount {
  font-size: 13px;
  color: var(--gold-light, #ffd36b);
}
.cal-day.big {
  grid-column: span 2;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(240, 185, 63, 0.28), rgba(140, 80, 10, 0.25));
  border-color: rgba(240, 185, 63, 0.45);
}
.cal-day.big .cal-day-icon {
  font-size: 30px;
}
.cal-day.big .cal-day-amount {
  font-size: 17px;
}
.cal-day.claimed {
  background: rgba(46, 160, 105, 0.16);
  border-color: rgba(93, 220, 160, 0.3);
}
.cal-day.claimed .cal-day-icon {
  color: #7fe0b1;
  font-weight: 900;
}
.cal-day.claimed .cal-day-amount {
  color: #9fe8c5;
  opacity: 0.8;
}
.cal-day.today {
  background: linear-gradient(160deg, #ffd56b, #e2a733);
  border-color: #fff0b0;
  box-shadow: 0 0 0 3px rgba(240, 185, 63, 0.25), 0 8px 20px rgba(240, 185, 63, 0.3);
  animation: cal-today 1.8s ease-in-out infinite;
}
.cal-day.today .cal-day-n,
.cal-day.today .cal-day-amount {
  color: #3b2606;
}
@keyframes cal-today {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.cal-status {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 13px;
}
.cal-status.need {
  background: rgba(240, 185, 63, 0.1);
  border: 1px dashed rgba(240, 185, 63, 0.4);
}
.cal-claim {
  width: 100%;
  margin-top: 10px;
  animation: ready-pulse 1.2s ease-in-out infinite;
}
.cal-missed {
  margin: 0 0 8px;
  color: #ffcf8a;
}

/* Missions */
.mis-block .home-head .muted {
  white-space: nowrap;
}
.mis-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mis-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.mis-icon {
  font-size: 22px;
  width: 30px;
  text-align: center;
}
.mis-main {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 5px;
}
.mis-text {
  font-size: 13.5px;
}
.mis-main > .muted:not(.mis-progress) {
  grid-column: 1 / -1;
}
.mis-progress {
  grid-row: 1;
  grid-column: 2;
  font-weight: 700;
}
.mis-bar,
.streak-bar {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}
.mis-bar span,
.streak-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2fb37a, #7fe0b1);
  transition: width 0.5s ease;
}
.mis-reward {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--gold-light, #ffd36b);
  white-space: nowrap;
}
.mis-row.done:not(.claimed) {
  border-color: rgba(240, 185, 63, 0.5);
  background: linear-gradient(90deg, rgba(240, 185, 63, 0.16), rgba(0, 0, 0, 0.18));
}
.mis-row.done .mis-bar span {
  background: linear-gradient(90deg, #f0b93f, #ffe08a);
}
.mis-row.claimed {
  opacity: 0.62;
}
.mis-row.claimed .mis-text {
  text-decoration: line-through;
  text-decoration-color: rgba(127, 224, 177, 0.6);
}
.mis-claim {
  min-width: 64px;
  animation: ready-pulse 1.2s ease-in-out infinite;
}
.mis-check {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(46, 160, 105, 0.25);
  color: #7fe0b1;
  font-weight: 900;
}
.mis-all {
  background: linear-gradient(135deg, rgba(240, 185, 63, 0.12), rgba(0, 0, 0, 0.2));
  border-style: dashed;
  border-color: rgba(240, 185, 63, 0.35);
}
.mis-all .mis-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}
.mis-rules {
  margin: 8px 2px 0;
  font-size: 11.5px;
}

/* Win streak */
.streak-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.streak-box.hot {
  background: linear-gradient(135deg, rgba(255, 110, 40, 0.18), rgba(0, 0, 0, 0.2));
  border-color: rgba(255, 140, 60, 0.4);
}
.streak-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}
.streak-flame {
  font-size: 28px;
  filter: grayscale(0.8);
}
.streak-box.hot .streak-flame {
  filter: none;
  animation: flame 1.1s ease-in-out infinite alternate;
}
@keyframes flame {
  from { transform: scale(1) rotate(-4deg); }
  to { transform: scale(1.12) rotate(4deg); }
}
.streak-title {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.streak-best {
  color: var(--muted);
  white-space: nowrap;
}
.streak-box .streak-bar span {
  background: linear-gradient(90deg, #ff7a2f, #ffcf5a);
}
.streak-steps {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 9px;
}
.streak-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 2px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11.5px;
  color: var(--muted);
}
.streak-step strong {
  font-size: 13px;
  color: var(--text);
}
.streak-step.next {
  box-shadow: inset 0 0 0 1px rgba(255, 170, 70, 0.6);
  color: #ffcf8a;
}
.streak-step.reached {
  background: rgba(255, 140, 60, 0.25);
  color: #ffe0b0;
}

/* Bonus popup */
.award-box.bonus-award .award-prize {
  font-size: 30px;
  text-shadow: 0 0 18px rgba(240, 185, 63, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .cal-day.today, .cal-claim, .mis-claim, .streak-box.hot .streak-flame, .cup1 { animation: none; }
}

/* ================================================================== */
/* Demo bots (bot vs bot, always marked 🤖)                           */
/* ================================================================== */
.demo-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  color: #b9d7ff;
  background: rgba(90, 150, 255, 0.14);
  border: 1px solid rgba(120, 170, 255, 0.3);
  white-space: nowrap;
}
.live-list {
  margin-top: 14px;
}
.live-list h2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.live-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'names watch' 'meta watch';
  align-items: center;
  gap: 2px 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.live-row:active {
  transform: scale(0.99);
}
.live-names {
  grid-area: names;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13.5px;
}
.bot-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 38%;
}
.live-score {
  padding: 1px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 12.5px;
}
.live-meta {
  grid-area: meta;
}
.live-watch {
  grid-area: watch;
  font-size: 12.5px;
  font-weight: 700;
  color: #b9d7ff;
}
.demo-pill {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* Watching a demo game */
.watch-box {
  width: min(560px, 96vw);
  max-height: 94vh;
  overflow: auto;
  padding: 12px;
  gap: 8px;
}
.watch-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.watch-table {
  flex: 1;
  font-size: 14px;
}
.watch-players {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.watch-player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
  max-width: 42%;
}
.watch-player .watch-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.watch-player.turn {
  border-color: rgba(240, 185, 63, 0.6);
  box-shadow: 0 0 12px rgba(240, 185, 63, 0.25);
}
.watch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}
.watch-dot.white {
  background: radial-gradient(circle at 35% 30%, #fff, #c4baa4);
}
.watch-dot.black {
  background: radial-gradient(circle at 35% 30%, #6a6a6a, #0b0b0b);
  border: 1px solid #555;
}
.watch-score {
  font-size: 18px;
}
.watch-bubble {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-start: 4px;
  z-index: 3;
  padding: 4px 9px;
  border-radius: 10px;
  background: #fff;
  color: #222;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  animation: award-pop 0.35s ease-out;
}
.watch-board-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}
.watch-head #btn-watch-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  flex: none;
}
.bot-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex: none;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}
.bot-avatar-badge {
  position: absolute;
  bottom: -3px;
  inset-inline-end: -4px;
  font-size: 10px;
  line-height: 1;
  background: var(--bg-1);
  border-radius: 50%;
  padding: 1px;
}
.watch-player .watch-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.live-names .bot-name {
  max-width: 30%;
}

/* Watching a demo game on the game screen */
.watch-exit {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 99px;
  border: 1px solid rgba(255, 120, 100, 0.55);
  background: linear-gradient(180deg, #ef6a55, #c9382a);
  color: #fff;
  box-shadow: 0 4px 14px rgba(201, 56, 42, 0.35);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
body.spectating .watch-exit {
  display: inline-flex;
}
body.spectating #btn-drawer,
body.spectating #btn-fullscreen {
  display: none !important;
}
.table-info .part.demo {
  color: #b9d7ff;
  font-weight: 800;
}
.avatar.bot {
  position: relative;
  color: #fff;
  font-size: 22px;
  text-shadow: none;
}
.avatar.bot .bot-avatar-badge {
  font-size: 11px;
}
.live-more {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(120, 170, 255, 0.35);
  background: transparent;
  color: #b9d7ff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.online-pill {
  flex-wrap: wrap;
}
.online-split {
  flex-basis: 100%;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.live-list {
  margin: 14px 0;
}
.live-list .list-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ot-bot {
  margin-inline-start: 6px;
  vertical-align: middle;
}

/* Newcomer move hint */
.hint-bar {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 12px;
  margin-bottom: 6px;
  border-radius: 12px;
  color: #d8f3ff;
  background: rgba(79, 195, 247, 0.14);
  border: 1px solid rgba(79, 195, 247, 0.45);
}
.hint-bar .hint-icon { font-size: 18px; }
.hint-bar strong { color: #4fc3f7; }
body.layout-landscape .hint-bar { font-size: 12px; padding: 4px 8px; }

/* ================================================================== */
/* Bottom bar: free (green) · home (raised, centre) · paid (gold)       */
/* ================================================================== */
.bottom-nav {
  align-items: flex-end;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  overflow: visible;
}
.bottom-nav .nav-free { order: 1; }
.bottom-nav .nav-home { order: 2; }
.bottom-nav .nav-paid { order: 3; }
.bottom-nav button svg { width: 24px; height: 24px; }
.bottom-nav .nav-label { font-size: 13px; font-weight: 800; }

.bottom-nav .nav-free,
.bottom-nav .nav-paid {
  position: relative;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
  max-width: 160px;
  min-height: 50px;
  padding: 10px 6px;
  border-radius: 16px;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.bottom-nav .nav-free {
  color: var(--free-light);
  background: rgba(63, 181, 111, 0.12);
  border: 1.5px solid rgba(127, 224, 177, 0.35);
}
.bottom-nav .nav-paid {
  color: var(--gold-light);
  background: rgba(240, 185, 63, 0.12);
  border: 1.5px solid rgba(255, 217, 120, 0.4);
}
.bottom-nav .nav-free.active {
  color: #0f2a1b;
  background: linear-gradient(135deg, var(--free-light), var(--free));
  border-color: transparent;
  box-shadow: 0 6px 22px rgba(63, 181, 111, 0.45);
}
.bottom-nav .nav-paid.active {
  color: #2a1c05;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-color: transparent;
  box-shadow: 0 6px 22px rgba(240, 185, 63, 0.45);
}
.bottom-nav .nav-free:active,
.bottom-nav .nav-paid:active { transform: scale(0.96); }

/* Home: a round button lifted above the bar */
.bottom-nav .nav-home {
  flex: none;
  width: 76px;
  max-width: 76px;
  gap: 2px;
  padding: 0;
  margin-top: -30px;
  color: var(--muted);
  background: none;
}
.bottom-nav .nav-home svg {
  width: 62px;
  height: 62px;
  padding: 17px;
  border-radius: 50%;
  color: var(--text);
  background: radial-gradient(circle at 35% 30%, #2f4a3c, #15221b 75%);
  border: 2px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), 0 0 0 5px rgba(10, 16, 13, 0.88);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.bottom-nav .nav-home .nav-label { font-size: 12px; }
.bottom-nav .nav-home.active { color: var(--text); background: none; }
.bottom-nav .nav-home.active svg {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), 0 0 0 5px rgba(10, 16, 13, 0.88), 0 0 18px rgba(255, 255, 255, 0.18);
}
.bottom-nav .nav-home:active svg { transform: scale(0.94); }
.bottom-nav .nav-home .nav-dot { top: 0; inset-inline-end: 10px; }

body.menu-landscape .bottom-nav .nav-home { margin-top: -18px; }
body.menu-landscape .bottom-nav .nav-home svg { width: 48px; height: 48px; padding: 12px; }
body.menu-landscape .bottom-nav .nav-free,
body.menu-landscape .bottom-nav .nav-paid { min-height: 40px; padding: 6px; }

/* Paid section: gold versions of "quick game" and "create game" */
.quick-play.gold {
  color: #2a1c05;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 12px 30px rgba(240, 185, 63, 0.28);
}
.quick-play.gold .quick-icon { background: rgba(42, 28, 5, 0.9); color: var(--gold-light); }
.create-play.gold {
  color: var(--gold-light);
  background: rgba(240, 185, 63, 0.08);
  border-color: rgba(255, 217, 120, 0.55);
}
.create-play.gold .create-icon { color: #2a1c05; background: linear-gradient(135deg, var(--gold-light), var(--gold)); }
.pill-group { display: inline-flex; gap: 6px; align-items: center; }
button.usd-pill { font: inherit; cursor: pointer; opacity: 1; display: inline-flex; align-items: center; gap: 6px; }
.dollar-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  color: #2a1c05;
  background: radial-gradient(circle at 35% 35%, #fff1c4, var(--gold) 65%, #a8781c);
}

/* Quick game / create game opened from the paid section: gold instead of green */
.theme-paid .choice.active {
  border-color: var(--gold);
  background: rgba(240, 185, 63, 0.14);
  box-shadow: 0 0 0 3px rgba(240, 185, 63, 0.15);
}
.theme-paid .create-inline,
.theme-paid #btn-create-go { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: #2a1c05; }
.bottom-nav button.nav-paid.active { color: #2a1c05; }
.bottom-nav button.nav-free.active { color: #0f2a1b; }

/* Waiting tables on the free / paid menus */
.list-head.row-head { flex-direction: row; align-items: center; justify-content: space-between; }
.see-all { font: inherit; font-size: 13px; font-weight: 700; color: var(--free-light); background: none; border: 0; cursor: pointer; padding: 4px 0; }
.theme-paid .see-all { color: var(--gold-light); }
.ot-botonly { font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 10px; border-radius: 10px; border: 1px dashed var(--card-border); white-space: nowrap; }
.ot-stake span[dir='ltr'] { unicode-bidi: isolate; }

/* "Live games" and "waiting tables" pages: filters and endless list */
.list-filters { display: flex; flex-direction: column; gap: 8px; }
.filter-row { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-label { flex: none; min-width: 46px; font-size: 12px; font-weight: 700; color: var(--muted); }
.filter-chip { flex: none; font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--card-border); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.filter-chip.active { color: #0f2a1b; background: linear-gradient(135deg, var(--free-light), var(--free)); border-color: transparent; }
.theme-paid .filter-chip.active { color: #2a1c05; background: linear-gradient(135deg, var(--gold-light), var(--gold)); }
.list-count { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.list-more { display: flex; justify-content: center; min-height: 8px; }
.list-more-btn { width: 100%; }
.list-loading { text-align: center; padding: 24px; color: var(--muted); }
.mini-spinner { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: currentColor; animation: mini-spin 0.8s linear infinite; vertical-align: middle; }
@keyframes mini-spin { to { transform: rotate(360deg); } }

/* Long bot names (user_city_car88) never squeeze the score */
.live-score { flex: none; white-space: nowrap; }
.live-names { min-width: 0; }
.live-names .bot-name { min-width: 0; flex: 1 1 0; max-width: none; }

/* Wide screens: lists stay one under another (two columns mixed the order and left gaps) */
body.menu-landscape .rows,
body.menu-landscape .open-tables,
body.layout-landscape .open-tables {
  display: flex;
  flex-direction: column;
}

/* ===================== Dollar wallet ===================== */
.w-testbar { text-align: center; font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 10px; color: #ffd978; background: rgba(240, 185, 63, 0.12); border: 1px dashed rgba(255, 217, 120, 0.5); }
.w-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); }
.w-tab { font: inherit; font-size: 13.5px; font-weight: 800; color: var(--muted); background: none; border: 0; border-radius: 10px; padding: 9px 4px; cursor: pointer; }
.w-tab.active { color: #2a1c05; background: linear-gradient(135deg, var(--gold-light), var(--gold)); }
.w-body { display: flex; flex-direction: column; gap: 12px; }
.w-methods { display: flex; gap: 8px; overflow-x: auto; }
.w-method { flex: 1; min-width: 92px; font: inherit; color: var(--text); cursor: pointer; padding: 10px 8px; border-radius: 14px; border: 1px solid var(--card-border); background: rgba(255, 255, 255, 0.05); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.w-method.active { border-color: var(--gold); background: rgba(240, 185, 63, 0.12); box-shadow: 0 0 0 3px rgba(240, 185, 63, 0.12); }
.w-field { display: flex; flex-direction: column; gap: 6px; }
.w-row { display: flex; gap: 8px; align-items: center; }
.w-row .input { flex: 1; min-width: 0; }
.w-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--card-border); }
.w-copy { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); }
.w-copy code { flex: 1; min-width: 0; font-size: 12.5px; word-break: break-all; color: #ffe7a8; }
.w-copy.memo code { font-size: 15px; font-weight: 800; color: #fff; }
.w-warn { margin: 0; font-size: 12.5px; color: #ffd978; line-height: 1.7; }
.w-warn.red { color: #ff9b8a; }
.w-wait { margin: 0; font-size: 12.5px; color: var(--muted); }
.w-test { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; border: 1px dashed rgba(255, 217, 120, 0.5); }
.w-preview { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: rgba(240, 185, 63, 0.08); }
.w-preview > div { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.w-preview > div.big strong { font-size: 18px; color: var(--gold-light); }
.btn.big { width: 100%; padding: 14px; font-size: 15px; }

/* Wallet: 18+ gate, break and hold notices */
.w-adult { border-color: rgba(240, 185, 63, 0.5); }
.w-break { color: #f3cf8f; background: rgba(231, 166, 58, 0.1); }
.w-tabs { grid-template-columns: repeat(4, 1fr); }
.w-tab { white-space: nowrap; font-size: 13px; }
.w-box .w-methods { display: grid; grid-template-columns: repeat(4, 1fr); }
.ot-test { color: #f3cf8f; background: rgba(231, 166, 58, 0.14); }
