:root {
  --bg: #05060a;
  --bg-elevated: #10131a;
  --card: rgba(18, 22, 34, 0.55);
  --card-solid: rgba(18, 22, 34, 0.88);
  --card-border: rgba(255, 255, 255, 0.1);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --text: #f4f6fb;
  --muted: #939bb0;
  --purple: #8b74ff;
  --purple-2: #c084fc;
  --cyan: #56d1ff;
  --green: #3ecf8e;
  --gold: #f5c451;
  --orange: #ff9f43;
  --red: #ff6b7a;
  --radius: 16px;
  --radius-sm: 11px;
  --nav-h: 54px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow-deep: 0 10px 40px rgba(0, 0, 0, 0.45);
  /* Без Google Fonts CDN — только локальный стек (см. matbot-security). */
  font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

/* HTML hidden must win over component display:flex/grid (reply chip, gl-btn, …). */
[hidden] {
  display: none !important;
}

[data-color-scheme="light"] {
  color-scheme: light;
}
[data-color-scheme="light"] .aurora {
  opacity: 0.28;
}
[data-color-scheme="light"] .grain {
  opacity: 0.25;
}
[data-color-scheme="light"] .topbar {
  background: color-mix(in srgb, var(--bg) 72%, #ffffff);
}
[data-color-scheme="light"] .bottom-nav {
  background: color-mix(in srgb, var(--bg) 78%, #ffffff);
}
[data-color-scheme="light"] .brand {
  color: var(--text);
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(1000px 520px at 8% -12%, rgba(139, 116, 255, 0.22), transparent 58%),
    radial-gradient(720px 440px at 100% 0%, rgba(86, 209, 255, 0.1), transparent 50%),
    radial-gradient(640px 380px at 50% 110%, rgba(62, 207, 142, 0.07), transparent 55%),
    var(--bg);
}

/* MotionSites-inspired ambient orbs (Liquid Glass / Portal) */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
  will-change: transform;
}
.aurora-orb--a {
  width: 220px;
  height: 220px;
  left: -60px;
  top: 8%;
  background: radial-gradient(circle, rgba(139, 116, 255, 0.55), transparent 68%);
  animation: aurora-drift 14s ease-in-out infinite alternate;
}
.aurora-orb--b {
  width: 180px;
  height: 180px;
  right: -40px;
  top: 28%;
  background: radial-gradient(circle, rgba(86, 209, 255, 0.35), transparent 70%);
  animation: aurora-drift 18s ease-in-out infinite alternate-reverse;
}
.aurora-orb--c {
  width: 240px;
  height: 240px;
  left: 20%;
  bottom: 6%;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.28), transparent 72%);
  animation: aurora-drift 22s ease-in-out infinite alternate;
}
@keyframes aurora-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(18px, -24px, 0) scale(1.08); }
}
.spark {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(196, 181, 253, 0.9);
  opacity: 0;
  animation: spark-twinkle 4.8s ease-in-out infinite;
}
.spark--1 { left: 18%; top: 22%; animation-delay: 0.2s; }
.spark--2 { right: 16%; top: 38%; animation-delay: 1.4s; background: #56d1ff; }
.spark--3 { left: 42%; top: 62%; animation-delay: 2.1s; }
.spark--4 { right: 28%; bottom: 18%; animation-delay: 3.2s; background: #c4b5fd; }
@keyframes spark-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  40%, 60% { opacity: 0.9; transform: scale(1); }
}

/* Film grain / glass texture */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) {
  .aurora-orb,
  .spark { animation: none; }
  .spark { opacity: 0.35; }
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 4px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--card-border);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: var(--card);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
}

.topbar-title { flex: 1; min-width: 0; }
.brand {
  display: block;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.03em;
  color: var(--text);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand {
    background: linear-gradient(120deg, var(--text) 20%, var(--purple-2) 55%, var(--cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.brand-sub { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

.chat-pill {
  max-width: 38%;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.topbar-chat-btn,
.topbar-hub-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 11px;
}

.topbar-svg {
  width: 18px;
  height: 18px;
  display: block;
}

.topbar-hub-btn .chat-unread-badge,
.topbar-chat-btn .chat-unread-badge {
  position: absolute;
  top: -2px;
  right: -2px;
}

.notif-row .notif-ico {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.notif-row--unread {
  border-color: rgba(176, 107, 255, 0.35);
  background: rgba(124, 92, 255, 0.1);
}
.notif-row--archive {
  opacity: 0.72;
}
.notif-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 4px;
  border-radius: 50%;
  background: #b06bff;
  vertical-align: middle;
}
.notif-row .btn-play:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.menu-version-btn {
  display: block;
  margin: 18px auto 8px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.75;
  cursor: pointer;
}
.menu-version-btn:active {
  opacity: 1;
  color: var(--text);
}
.menu-version-btn #menu-version-num {
  font-weight: 700;
  color: rgba(200, 190, 255, 0.9);
}

.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
}
.changelog-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(18, 20, 32, 0.55));
}
.changelog-card--current {
  border-color: rgba(143, 107, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(143, 107, 255, 0.15), 0 8px 20px rgba(0, 0, 0, 0.2);
}
.changelog-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.changelog-head strong {
  font-size: 14px;
}
.changelog-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 999px;
  color: #c4b5fd;
  background: rgba(124, 92, 255, 0.22);
}
.changelog-date {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.changelog-title-line {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}
.changelog-ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
}

.mail-dialog-chat {
  display: block;
  font-size: 11px;
  line-height: 1.25;
  color: rgba(168, 196, 255, 0.65);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-thread-shared {
  margin: -6px 0 10px;
  padding: 0 2px;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(190, 190, 210, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-dialog-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff5a7d;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  flex-shrink: 0;
}

#mail-inbox-list.list.card {
  gap: 0;
  padding: 4px 0;
  overflow: hidden;
}

.mail-inbox-empty {
  padding: 16px;
  text-align: center;
  color: rgba(244, 246, 251, 0.72) !important;
}

/* button UA styles force dark text — set explicit colors */
button.mail-dialog-row,
.mail-dialog-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  background: transparent;
  color: #f4f6fb;
  text-align: left;
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.mail-dialog-row:last-child {
  border-bottom: none;
}

.mail-dialog-row:active {
  background: rgba(124, 92, 255, 0.12);
}

.mail-dialog-row--unread {
  background: rgba(124, 92, 255, 0.07);
}

.mail-dialog-row .mini-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.mail-dialog-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mail-dialog-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.mail-dialog-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 650;
  color: #9ed0ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-dialog-name--link {
  cursor: pointer;
  text-decoration: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  color: inherit;
  max-width: 100%;
}

.mail-dialog-name--link:hover,
.mail-dialog-name--link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.mail-dialog-avatar-hit {
  display: inline-flex;
  flex-shrink: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}

.mail-dialog-avatar-hit:focus-visible {
  outline: 2px solid rgba(158, 208, 255, 0.7);
  outline-offset: 2px;
}

.mail-dialog-time {
  flex-shrink: 0;
  font-size: 11px;
  color: rgba(244, 246, 251, 0.48);
}

.mail-dialog-preview {
  display: block;
  font-size: 12px;
  color: rgba(244, 246, 251, 0.78);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-dialog-chev {
  flex-shrink: 0;
  color: rgba(244, 246, 251, 0.35);
  font-size: 18px;
  line-height: 1;
}

#screen-mail-inbox .screen-title {
  color: #f4f6fb;
  margin: 0;
}

.mail-inbox-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.mail-inbox-head .muted {
  margin: 4px 0 0;
  color: rgba(244, 246, 251, 0.62) !important;
}

.mail-join-cta,
.mail-compose {
  margin-bottom: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.groups-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.groups-row:last-child {
  border-bottom: none;
}

.groups-row-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.groups-row-title {
  font-size: 0.95rem;
}

.groups-row-action {
  flex-shrink: 0;
}

.groups-badge {
  font-size: 0.72rem;
  opacity: 0.75;
}

.groups-badge--in {
  color: var(--accent, #7dd3a7);
}

.game-room-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(125, 211, 167, 0.15);
  color: #9fe3c0;
  vertical-align: middle;
}

.mail-compose .gc-input {
  width: 100%;
}

#screen-mail-inbox > .muted {
  color: rgba(244, 246, 251, 0.62) !important;
}

.chat-unread-badge {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff5a7d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.screens { padding: 8px 12px 6px; }
.screen { display: none; animation: screen-in 0.32s cubic-bezier(0.22, 1, 0.36, 1); }
.screen.active { display: block; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); filter: blur(2px); }
  to { opacity: 1; transform: none; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
}

.screen-title {
  margin: 2px 0 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.games-hint {
  margin: -4px 0 8px;
  font-size: 12px;
  line-height: 1.35;
}

.network-banner {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 107, 122, 0.45);
  background: linear-gradient(135deg, rgba(255, 107, 122, 0.15), rgba(20, 24, 34, 0.95));
  font-size: 12px;
  line-height: 1.4;
}
.network-banner strong { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.network-banner p { margin: 0 0 8px; color: var(--muted); }
.network-banner code { font-size: 11px; }
.network-banner button {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #8f6bff, #6240e8);
  cursor: pointer;
}

.penalty-banner {
  margin: 0 12px 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 159, 67, 0.45);
  background: linear-gradient(135deg, rgba(255, 159, 67, 0.16), rgba(20, 24, 34, 0.95));
  font-size: 12px;
}
.penalty-banner strong { display: block; margin-bottom: 2px; font-size: 13px; font-weight: 600; }
.penalty-banner p { margin: 0 0 6px; color: var(--text); line-height: 1.35; }
.penalty-banner button {
  /* uses .btn from markup */
}

.penalty-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border);
}
.penalty-item:last-child { border-bottom: 0; }
.penalty-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.penalty-item strong { display: block; font-size: 14px; }
.penalty-item span { font-size: 12px; color: var(--muted); }
.penalty-badge {
  flex-shrink: 0;
  font-size: 10px !important;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: #d8c9ff !important;
  background: rgba(124, 92, 255, 0.18);
  border: 1px solid rgba(176, 107, 255, 0.35);
}
.penalty-item--active {
  padding: 10px 12px;
  margin: 0 -4px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 170, 80, 0.4);
  background: linear-gradient(135deg, rgba(255, 170, 80, 0.14), rgba(124, 92, 255, 0.08));
}
.penalty-item--active .penalty-badge {
  color: #ffe0b8 !important;
  background: rgba(255, 170, 80, 0.22);
  border-color: rgba(255, 170, 80, 0.45);
}
.penalty-item--archive { opacity: 0.78; }
.penalty-when { display: block; margin-top: 4px; font-size: 11px !important; }

.uprof-card {
  border-color: rgba(176, 107, 255, 0.28) !important;
}
.uprof-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.uprof-head-text { min-width: 0; flex: 1; }
.uprof-mail-btn {
  flex-shrink: 0;
  padding: 6px 10px !important;
  font-size: 12px !important;
  border-radius: 10px !important;
  white-space: nowrap;
}
.uprof-panel-card {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.07), transparent 45%),
    linear-gradient(160deg, rgba(40, 36, 58, 0.85), rgba(16, 14, 28, 0.9)) !important;
  border-color: rgba(176, 107, 255, 0.18) !important;
}
.who-archive {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.who-archive-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(176, 107, 255, 0.22);
  background: rgba(124, 92, 255, 0.1);
}
.who-archive-row strong {
  font-size: 13px;
  font-weight: 650;
  min-width: 0;
}
.who-archive-row span {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.btn--xs {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.list-item.clickable { cursor: pointer; }
.list-item.clickable:active { transform: scale(0.99); }

.card {
  position: relative;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), transparent 42%),
    linear-gradient(160deg, rgba(28, 32, 48, 0.72), rgba(12, 14, 22, 0.78));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  box-shadow:
    var(--shadow-deep),
    inset 0 1px 0 var(--glass-edge),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.profile-hero--glow {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(125deg, rgba(139, 116, 255, 0.22), transparent 42%),
    linear-gradient(210deg, rgba(86, 209, 255, 0.1), transparent 40%),
    linear-gradient(160deg, rgba(28, 32, 48, 0.78), rgba(12, 14, 22, 0.88));
  border-color: rgba(139, 116, 255, 0.22);
}
.profile-hero--glow::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(139, 116, 255, 0.4), transparent 68%);
  pointer-events: none;
  animation: hero-glow 8s ease-in-out infinite alternate;
}
.profile-hero--glow::after {
  content: "";
  position: absolute;
  right: -30%;
  bottom: -45%;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(86, 209, 255, 0.22), transparent 70%);
  pointer-events: none;
}
@keyframes hero-glow {
  from { transform: translate(0, 0) scale(1); opacity: 0.85; }
  to { transform: translate(16px, 10px) scale(1.12); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .profile-hero--glow::before { animation: none; }
}

.card--tight {
  padding: 10px 12px;
  margin-bottom: 8px;
}
.card--tight .card-head {
  margin-bottom: 6px;
}
.card--tight .card-head h2 {
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.pf {
  padding: 0;
  margin-bottom: 8px;
  background: transparent;
  border: none;
  box-shadow: none;
}
.pf-hero {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}
.pf-hero-body {
  min-width: 0;
  flex: 1;
}
.pf-hero h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-tabs {
  margin: 12px 0 0;
  position: relative;
  z-index: 1;
}
.pf-panel[hidden] { display: none !important; }
.pf-panel { animation: pf-in 0.22s ease; }
@keyframes pf-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.pf-glance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
@media (max-width: 380px) {
  .pf-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pf-glance-item {
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.pf-glance-item strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.pf-glance-item span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: rgba(186, 170, 154, 0.72);
}
.xp-block--compact { margin-top: 8px; }
.xp-block--compact .xp-labels {
  font-size: 11px;
  margin-bottom: 4px;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.name-row h1 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.online-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  background: rgba(62, 207, 142, 0.12);
  border: 1px solid rgba(62, 207, 142, 0.28);
  border-radius: 999px;
  padding: 2px 7px;
}

.presence--online {
  color: var(--green, #3ecf8e) !important;
  font-weight: 600;
}
.presence--offline {
  color: var(--muted) !important;
}
.who-today-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px;
  justify-content: center;
}
.who-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(176, 107, 255, 0.35);
  background: rgba(124, 92, 255, 0.14);
  color: #e8dcff;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-social-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pf-title-badge {
  margin: 2px 0 0;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--accent, #f0c36a);
}
.pf-about-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 10px 12px;
}
.pf-about-row--static { cursor: default; }
.pf-about-ico { font-size: 18px; flex-shrink: 0; }
.pf-about-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pf-about-text strong {
  font-size: 13px;
  font-weight: 650;
}
.pf-about-text span {
  font-size: 12px;
  opacity: 0.85;
}
.pf-social-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 10px 12px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.pf-social-row--static { cursor: default; }
.pf-social-row:active:not(.pf-social-row--static) { transform: scale(0.99); }
.pf-social-ico { font-size: 18px; flex-shrink: 0; }
.pf-social-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pf-social-text strong {
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-social-text span {
  font-size: 11px;
  color: var(--muted);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }

.profile-hero {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.profile-hero--lg { align-items: flex-start; }

.avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.avatar--lg { width: 60px; height: 60px; border-radius: 18px; }
.avatar--xl { width: 72px; height: 72px; border-radius: 20px; }

.avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 18px;
  color: #fff;
  background: var(--avatar-gradient, linear-gradient(135deg, var(--purple), var(--purple-2)));
}

.avatar--lg .avatar-fallback { font-size: 22px; }
.avatar--xl .avatar-fallback { font-size: 26px; }

.avatar.has-photo .avatar-fallback { opacity: 0; }
.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid rgba(124, 92, 255, 0.55);
  pointer-events: none;
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.35);
}

.profile-hero h1 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pill {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
}
.profile-hero-body { min-width: 0; flex: 1; position: relative; z-index: 1; }

.pill-level {
  color: #e4d7ff;
  border-color: rgba(155, 132, 255, 0.28);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(255, 255, 255, 0.04));
}
.pill-karma {
  color: #8ff0c0;
  border-color: rgba(62, 207, 142, 0.28);
  background: linear-gradient(135deg, rgba(62, 207, 142, 0.18), rgba(255, 255, 255, 0.04));
}
.pill-chips {
  color: #ffd98a;
  border-color: rgba(245, 196, 81, 0.3);
  background: linear-gradient(135deg, rgba(245, 196, 81, 0.18), rgba(255, 255, 255, 0.04));
}

.profile-mail-btn {
  margin-top: 8px;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 64px;
  margin-bottom: 10px;
  padding-top: 2px;
}

.chart .bar {
  flex: 1;
  min-height: 6px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #b06bff 0%, #7c5cff 55%, #5a3fd6 100%);
  box-shadow: 0 4px 14px rgba(124, 92, 255, 0.35);
  opacity: 0.95;
}

.metric--bad span { color: #ff8a96; }
.metric--msg span { color: #7ecbff; }
.metric--rank span { color: #c4b5ff; }

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric {
  text-align: center;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.metric span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.1;
}

.metric span small.trend {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

.trend--up { color: var(--green); background: rgba(62, 207, 142, 0.12); }
.trend--down { color: var(--red); background: rgba(255, 107, 122, 0.12); }
.trend--flat { color: var(--muted); }

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

.metric label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 550;
  color: rgba(244, 246, 251, 0.88);
}

/* —— Unified buttons —— */
.btn,
.cta,
.secondary,
.gl-btn,
.buy-btn,
.profile-mail-btn,
.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.btn:active,
.cta:active,
.secondary:active,
.gl-btn:active,
.buy-btn:active {
  transform: scale(0.98);
}
.btn:disabled,
.cta:disabled,
.secondary:disabled,
.gl-btn:disabled,
.buy-btn:disabled,
.profile-mail-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--primary,
.cta,
.gl-btn--enter,
.buy-btn:not(:disabled),
.mf-btn-purple,
.cr-btn-green {
  position: relative;
  overflow: hidden;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #9b84ff 0%, #7460f4 48%, #5b45d6 100%);
  box-shadow:
    0 8px 22px rgba(109, 82, 240, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn--primary::after,
.cta::after,
.gl-btn--enter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.18) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
  pointer-events: none;
}
.btn--primary:hover::after,
.cta:hover::after,
.gl-btn--enter:hover::after {
  transform: translateX(120%);
}
.cta {
  width: 100%;
  margin-top: 4px;
  padding: 10px 14px;
}
.cr-btn-green {
  background: linear-gradient(135deg, #3ecf8e 0%, #2aad72 100%);
  box-shadow: 0 6px 16px rgba(46, 173, 114, 0.28);
}

.btn--ghost,
.secondary,
.gl-btn--muted,
.gl-btn--close,
.small-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
}
.btn--danger,
.gl-btn--close {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.1);
}
.btn--sm,
.small-btn,
.gl-btn--xs {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
}
.btn--block {
  width: 100%;
}
.btn--pill {
  border-radius: 999px;
}
.btn--ghost.btn--sm {
  color: rgba(244, 246, 251, 0.72);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.menu-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--card-border);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.05), transparent 42%),
    var(--card-solid);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 12px 12px 12px 10px;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s, background 0.15s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.menu-tile:active { transform: scale(0.985); }
.menu-tile-ico {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--menu-accent, linear-gradient(135deg, var(--purple), var(--purple-2)));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}
.menu-tile-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-tile-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.menu-tile-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.menu-tile-chevron {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  opacity: 0.7;
  flex-shrink: 0;
}
.menu-tile--purple { --menu-accent: linear-gradient(135deg, var(--purple), var(--purple-2)); }
.menu-tile--cyan { --menu-accent: linear-gradient(135deg, #4facfe, #00c6fb); }
.menu-tile--gold { --menu-accent: linear-gradient(135deg, #f5c451, #ff9f43); }
.menu-tile--green { --menu-accent: linear-gradient(135deg, #3ecf8e, #2eb872); }
.menu-tile--emerald { --menu-accent: linear-gradient(135deg, #43e97b, #38f9d7); }
.menu-tile--amber { --menu-accent: linear-gradient(135deg, #ffb347, #ffcc33); }
.menu-tile--orange { --menu-accent: linear-gradient(135deg, #ff9a56, #ff6a88); }
.menu-tile--slate { --menu-accent: linear-gradient(135deg, #667eea, #764ba2); }

.menu-card {
  border: 1px solid var(--card-border);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.05), transparent 40%),
    linear-gradient(155deg, rgba(26, 30, 44, 0.82), rgba(14, 16, 24, 0.88));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 14px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  min-height: 118px;
  transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.menu-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: var(--menu-accent, linear-gradient(90deg, var(--purple), var(--purple-2)));
  opacity: 0.85;
}
.menu-card:active { transform: scale(0.98); }
.menu-card .ico-wrap {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 10px;
  background: var(--menu-accent, linear-gradient(135deg, var(--purple), var(--purple-2)));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.menu-card h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.menu-card p { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.3; }

.menu-card--purple { --menu-accent: linear-gradient(135deg, #8f6bff, #6240e8); }
.menu-card--cyan { --menu-accent: linear-gradient(135deg, #4facfe, #00c6fb); }
.menu-card--gold { --menu-accent: linear-gradient(135deg, #f5c451, #ff9f43); }
.menu-card--green { --menu-accent: linear-gradient(135deg, #3ecf8e, #2eb872); }
.menu-card--emerald { --menu-accent: linear-gradient(135deg, #43e97b, #38f9d7); }
.menu-card--amber { --menu-accent: linear-gradient(135deg, #ffb347, #ffcc33); }
.menu-card--orange { --menu-accent: linear-gradient(135deg, #ff9a56, #ff6a88); }
.menu-card--slate { --menu-accent: linear-gradient(135deg, #667eea, #764ba2); }

.seg-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}
.seg-tabs::-webkit-scrollbar { display: none; }

.seg-tabs-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  min-width: 0;
}

.seg-tabs-shell .seg-tabs {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  padding-bottom: 2px;
  scroll-behavior: smooth;
}

.seg-tabs--scroll {
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}

.seg-tabs-shell[data-at-start="1"] .seg-tabs--scroll {
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 16px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 16px), transparent 100%);
}

.seg-tabs-shell[data-at-end="1"] .seg-tabs--scroll {
  mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 100%);
}

.seg-tabs-shell[data-at-start="1"][data-at-end="1"] .seg-tabs--scroll {
  mask-image: none;
  -webkit-mask-image: none;
}

.seg-tabs-nav {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-solid);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

.seg-tabs-nav:active {
  transform: scale(0.96);
}

.seg-tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.seg-tabs button.active {
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  border-color: transparent;
  color: #fff;
}

.seg-tabs--sm button { font-size: 12px; padding: 6px 12px; }

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

.list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--card-border);
}

.list-item.me {
  border-color: rgba(124, 92, 255, 0.45);
  background: rgba(124, 92, 255, 0.1);
}

.list-item .rank {
  width: 28px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}

.mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.mini-avatar .avatar-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 650;
  color: #fff;
}

.mini-avatar .avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mini-avatar.has-photo .avatar-fallback {
  opacity: 0;
}

.list-item.rank-1 { border-color: rgba(245, 196, 81, 0.45); background: linear-gradient(90deg, rgba(245, 196, 81, 0.12), rgba(20, 24, 34, 0.92)); }
.list-item.rank-2 { border-color: rgba(192, 192, 210, 0.35); }
.list-item.rank-3 { border-color: rgba(205, 127, 50, 0.35); }
.list-item .rank.gold { color: var(--gold); }
.list-item .rank.silver { color: #c8c8d8; }
.list-item .rank.bronze { color: #cd7f32; }

.list-item .info { flex: 1; min-width: 0; }
.list-item .info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item .info span { font-size: 11px; color: var(--muted); line-height: 1.3; }
.list-item .score { font-weight: 650; font-size: 13px; color: var(--purple-2); }

/* button UA styles force dark text on dark theme — same as mail rows */
button.list-item.social-pick,
.list-item.social-pick {
  color: var(--text);
  font: inherit;
  text-align: left;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  cursor: default;
}

.social-pick-user {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.social-pick-user .info strong {
  color: var(--text);
}

.social-pick-user:active .info strong {
  color: var(--purple-2);
}

.chat-feed-scroll-wrap {
  position: relative;
}

.chat-feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 54dvh;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-feed-fabs {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
  pointer-events: none;
}

.chat-feed-fab {
  pointer-events: auto;
  position: relative;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: rgba(28, 22, 48, 0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(168, 140, 255, 0.35);
}

.chat-feed-fab:active {
  transform: scale(0.96);
}

.chat-feed-fab-icon {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.chat-feed-fab--mention .chat-feed-fab-icon {
  font-size: 17px;
}

.chat-feed-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #6c5ce7;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.chat-feed-fab--down .chat-feed-fab-badge {
  background: #5b8cff;
}

.chat-feed-item--flash .chat-feed-bubble {
  outline: 2px solid rgba(168, 140, 255, 0.85);
  outline-offset: 1px;
  transition: outline-color 0.8s ease;
}

.chat-feed-mention {
  color: #9ec1ff;
  font-weight: 650;
}

.chat-feed-toolbar {
  display: flex;
  justify-content: flex-start;
  margin: 2px 0 6px;
}
.chat-feed-toolbar:not(:has(button:not([hidden]))) {
  display: none;
}

.chat-feed-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.chat-feed-item--compact {
  margin-top: -4px;
}

.chat-feed-item--mine {
  flex-direction: row-reverse;
}

.mini-avatar--ghost {
  opacity: 0;
  pointer-events: none;
}

.chat-feed-divider,
.chat-feed-unread-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 4px;
}

.chat-feed-divider::before,
.chat-feed-divider::after,
.chat-feed-unread-divider::before,
.chat-feed-unread-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.chat-feed-divider span,
.chat-feed-unread-divider span {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.chat-feed-unread-divider span {
  color: #d8c9ff;
}

.chat-feed-bubble {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(20, 24, 34, 0.55);
}

.chat-feed-item--mine .chat-feed-bubble {
  background: linear-gradient(140deg, rgba(124, 92, 255, 0.24), rgba(22, 26, 40, 0.86));
  border-color: rgba(124, 92, 255, 0.45);
}

.chat-feed-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.chat-feed-author {
  font-size: 12px;
  font-weight: 700;
  color: #d8c9ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-feed-author--ghost {
  visibility: hidden;
}

.chat-feed-time {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.chat-feed-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.36;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-feed-media-badge {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #d8c9ff;
  background: rgba(124, 92, 255, 0.16);
  border: 1px solid rgba(124, 92, 255, 0.3);
}
.chat-feed-media-badge--sticker {
  margin: 4px 0;
  color: #c4f0d4;
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.28);
}

.chat-feed-media {
  margin: 0 0 8px;
  max-width: min(100%, 280px);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}

/* Стикеры и GIF — ~40% от размера фото (280px). */
.chat-feed-media--sticker {
  max-width: min(40%, 112px);
  background: transparent;
  border-radius: 8px;
}

.chat-feed-media--note {
  max-width: 168px;
  border-radius: 50%;
  background: #000;
  aspect-ratio: 1;
}

.chat-feed-media-el {
  display: block;
  width: 100%;
  max-height: 320px;
  height: auto;
  object-fit: contain;
  background: transparent;
}
.chat-feed-media-el--sticker {
  max-height: 112px;
  background: transparent;
}
.chat-feed-lottie {
  width: 112px;
  height: 112px;
  max-width: 100%;
}
.chat-feed-lottie svg {
  width: 100% !important;
  height: 100% !important;
}

.chat-attach-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.chat-attach-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.chat-attach-btn--sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 15px;
}
.chat-send-btn--sm {
  min-width: 36px !important;
  width: 36px;
  height: 32px;
  padding: 0 !important;
  font-size: 16px;
}
.chat-compose-row--mail .gc-input {
  min-width: 0;
  flex: 1 1 auto;
}
.mail-plus-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.anon-tabs {
  margin: 0.5rem 0 0.75rem;
}
.anon-bubble {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  margin-bottom: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
}
.anon-bubble--mine {
  background: rgba(124, 92, 255, 0.18);
  margin-left: 1.5rem;
}
.anon-bubble--them {
  margin-right: 1.5rem;
}
.anon-thread-list {
  max-height: 50vh;
  overflow: auto;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.anon-thread-actions {
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.anon-row .info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
}
.draw-form {
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.draw-form .gc-input {
  min-height: 4.5rem;
  resize: vertical;
}
.draw-result {
  padding: 0.5rem;
  margin-bottom: 0.35rem;
  text-align: center;
}
.draw-result-img {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 12px;
}
.draw-result-figure {
  margin: 0 0 0.65rem;
}
.draw-result-figure figcaption {
  margin-top: 0.25rem;
  text-align: center;
}
.mail-sticker-panel {
  margin: 0.35rem 0 0.55rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.mail-sticker-panel[hidden] {
  display: none !important;
}
.mail-sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 0.4rem;
  max-height: 180px;
  overflow: auto;
  margin-top: 0.35rem;
}
.mail-sticker-cell {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  min-height: 64px;
  padding: 0.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.mail-sticker-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.mail-sticker-ph {
  font-size: 1.4rem;
}
.chat-feed-text--deleted {
  font-style: italic;
  opacity: 0.75;
}
.chat-feed-edited {
  margin-left: 0.35rem;
  font-size: 0.7rem;
  opacity: 0.65;
}
.mail-plus-item {
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #f4f6fb;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.mail-plus-item:active {
  background: rgba(124, 92, 255, 0.22);
}
.chat-attach-btn--rec {
  border-color: rgba(255, 90, 125, 0.7);
  background: rgba(255, 90, 125, 0.22);
  animation: mail-rec-pulse 1.1s ease-in-out infinite;
}
@keyframes mail-rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}
.mail-emoji-panel {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}
.mail-emoji-btn {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1.4;
  cursor: pointer;
  border-radius: 8px;
}
.mail-emoji-btn:active {
  background: rgba(124, 92, 255, 0.2);
}
.mail-voice-hint {
  margin: 6px 0 0;
}
.mail-media-shell {
  margin: 4px 0;
}
.mail-media-photo {
  max-width: min(100%, 240px);
  max-height: 280px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}
.mail-media-voice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0;
}
.mail-media-audio {
  width: min(100%, 240px);
  height: 36px;
}

.mail-msg-ticks {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  user-select: none;
}
.mail-msg-ticks--sent {
  color: var(--muted);
}
.mail-msg-ticks--read {
  color: #6eb6ff;
}
.mail-thread-title-btn {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease;
}
.mail-thread-title-btn:hover,
.mail-thread-title-btn:focus-visible {
  text-decoration-color: currentColor;
}

.game-room-row--mine {
  outline: 1px solid rgba(46, 204, 113, 0.35);
  background: rgba(46, 204, 113, 0.08);
  border-radius: 12px;
}
.game-room-you {
  font-size: 11px;
  font-weight: 700;
  color: #6ee7a8;
  text-transform: lowercase;
}

.chat-feed-media-el--gif {
  max-height: 112px;
  pointer-events: none;
}

.chat-feed-media-el--note {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}

.chat-feed-media-el--zoom {
  cursor: zoom-in;
}

.chat-feed-item--mine .chat-feed-media {
  margin-left: auto;
}

.chat-feed-reply-quote {
  margin: 0 0 6px;
  padding: 5px 8px 5px 9px;
  border-left: 3px solid rgba(124, 92, 255, 0.85);
  background: rgba(124, 92, 255, 0.12);
  border-radius: 0 8px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.chat-feed-reply-quote[data-reply-to] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chat-feed-reply-quote[data-reply-to]:active {
  opacity: 0.82;
}
.chat-feed-reply-author {
  font-size: 11px;
  font-weight: 700;
  color: #c4b5fd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-feed-reply-snippet {
  font-size: 11px;
  color: rgba(244, 246, 251, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-color-scheme="light"] .chat-feed-reply-quote {
  background: rgba(124, 92, 255, 0.08);
  border-left-color: rgba(107, 79, 216, 0.85);
}
[data-color-scheme="light"] .chat-feed-reply-author {
  color: #6b4fd8;
}
[data-color-scheme="light"] .chat-feed-reply-snippet {
  color: #5a6178;
}

.chat-feed-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.chat-feed-foot {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-msg-status {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.chat-msg-status--sending {
  color: #8fb1ff;
}

.chat-msg-status--failed {
  color: #ff9aa8;
}

.chat-msg-status--sent {
  color: #7fd8a8;
}

.chat-feed-reply-btn {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
}

.chat-feed-reply-btn:hover {
  color: #fff;
}

.chat-feed-retry-btn {
  border: 1px solid rgba(255, 107, 122, 0.35);
  background: rgba(255, 107, 122, 0.12);
  color: #ffd4db;
  font: inherit;
  font-size: 11px;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
}

.chat-feed-retry-btn:hover {
  filter: brightness(1.06);
}

.chat-reply-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #d8c9ff;
  border: 1px solid rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.12);
  border-radius: 10px;
  padding: 6px 8px;
}
.chat-reply-chip[hidden] {
  display: none !important;
}

#chat-feed-reply-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-feed-compose {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(29, 33, 47, 0.94), rgba(14, 16, 24, 0.92));
  border: 1px solid rgba(124, 92, 255, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.26);
}

.chat-compose-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-feed-compose .gc-input {
  background: rgba(7, 10, 16, 0.8);
  border-color: rgba(124, 92, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  color: #f4f6fb;
  -webkit-text-fill-color: #f4f6fb;
  caret-color: #f4f6fb;
}

.chat-feed-compose .gc-input::placeholder {
  color: #7f87a0;
  -webkit-text-fill-color: #7f87a0;
}

.chat-feed-compose .gc-input:focus {
  outline: none;
  border-color: rgba(176, 107, 255, 0.65);
  box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.24);
}

/* Светлая тема TG: поле ввода подстраивается, текст читаемый */
[data-color-scheme="light"] .chat-feed-compose {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(244, 246, 252, 0.94));
  border-color: rgba(124, 92, 255, 0.22);
  box-shadow: 0 8px 22px rgba(70, 60, 110, 0.1);
}

[data-color-scheme="light"] .chat-feed-compose .gc-input,
[data-color-scheme="light"] .gc-input {
  color-scheme: light;
  background: #ffffff;
  border-color: rgba(100, 90, 140, 0.28);
  color: #1a1d29;
  -webkit-text-fill-color: #1a1d29;
  caret-color: #1a1d29;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-color-scheme="light"] .chat-feed-compose .gc-input::placeholder,
[data-color-scheme="light"] .gc-input::placeholder {
  color: #7a8196;
  -webkit-text-fill-color: #7a8196;
}

[data-color-scheme="light"] .chat-feed-compose .gc-input:focus {
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.18);
}

[data-color-scheme="light"] .chat-feed-list.card {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.72), transparent 42%),
    linear-gradient(160deg, rgba(246, 247, 252, 0.92), rgba(236, 238, 246, 0.88));
  box-shadow: 0 6px 18px rgba(70, 60, 110, 0.08);
}

[data-color-scheme="light"] .chat-feed-bubble {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(100, 90, 140, 0.18);
}

[data-color-scheme="light"] .chat-feed-item--mine .chat-feed-bubble {
  background: rgba(124, 92, 255, 0.12);
  border-color: rgba(124, 92, 255, 0.28);
}

[data-color-scheme="light"] .chat-feed-author {
  color: #6b4fd8;
}

[data-color-scheme="light"] .chat-feed-text {
  color: #1a1d29;
}

[data-color-scheme="light"] .chat-feed-time {
  color: #7a8196;
}

.btn-play {
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #0a1a12;
  background: var(--green);
  cursor: pointer;
  flex-shrink: 0;
}

.btn-play--muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
}

.blitz-ai-card { margin-bottom: 12px; }

.blitz-ai-avatar {
  display: grid;
  place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(79, 172, 254, 0.2));
}

.blitz-members-empty {
  margin: 0;
  padding: 8px 4px 4px;
  text-align: center;
}

.blitz-stake-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 10px;
  flex-wrap: wrap;
}
.blitz-stake-row .seg-tabs { flex: 1; }

.xp-block { margin-top: 10px; }
.xp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.xp-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.xp-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--purple-2));
}

.achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ach {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
}
.stat-lines { display: flex; flex-direction: column; gap: 0; }
.stat-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.stat-line:last-child { border-bottom: 0; }
.stat-line .ico { width: 22px; text-align: center; font-size: 14px; }
.stat-line .label { flex: 1; font-size: 13px; color: var(--muted); }
.stat-line .val { font-weight: 700; font-size: 13px; }
.buy-btn {
  flex-shrink: 0;
  min-width: 72px;
}

.ach {
  font-size: 12px;
  color: var(--text);
}
.ach-label {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.25);
  font-size: 11px;
  font-weight: 600;
}
.ach .bubble {
  width: 52px;
  height: 52px;
  margin: 0 auto 6px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(79, 172, 254, 0.12));
  border: 2px solid rgba(124, 92, 255, 0.35);
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.2);
}

.game-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.25), rgba(176, 107, 255, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  flex-shrink: 0;
}
.game-icon__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-icon--blitz { background: linear-gradient(135deg, rgba(255, 159, 67, 0.35), rgba(255, 107, 122, 0.15)); }
.game-icon--role { background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(98, 64, 232, 0.2)); }
.game-icon--fun { background: linear-gradient(135deg, rgba(62, 207, 142, 0.3), rgba(79, 172, 254, 0.15)); }

.stat-lines { display: flex; flex-direction: column; gap: 0; }

.balance-card {
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.2), rgba(62, 207, 142, 0.1));
  border: 1px solid var(--card-border);
  font-weight: 700;
}

.shop-cat { margin-bottom: 16px; }
.shop-cat h3 { margin: 0 0 8px; font-size: 15px; }

.shop-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
}
.shop-item.disabled { opacity: 0.55; }
.shop-item .title { font-weight: 700; margin-bottom: 4px; }
.shop-item .desc { font-size: 12px; color: var(--muted); line-height: 1.35; }

.buy-btn {
  flex-shrink: 0;
  min-width: 72px;
  align-self: center;
}
.buy-btn:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  box-shadow: none;
}

.placeholder {
  text-align: center;
  padding: 32px 20px;
}
.placeholder .big { font-size: 48px; margin-bottom: 12px; }
.placeholder h2 { margin: 0 0 8px; }
.placeholder p { color: var(--muted); line-height: 1.5; }

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 6px 8px calc(6px + var(--safe-b));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: rgba(8, 10, 16, 0.62);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  z-index: 30;
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.18s ease;
}
.nav-item .nav-ico {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
  color: inherit;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.18s, color 0.18s;
}
.nav-svg {
  width: 16px;
  height: 16px;
  display: block;
}
.nav-item.active .nav-ico {
  color: #efe8ff;
  background: linear-gradient(145deg, rgba(155, 132, 255, 0.4), rgba(86, 209, 255, 0.12));
  border-color: rgba(155, 132, 255, 0.35);
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.28);
  transform: translateY(-1px);
}
.nav-item.active { color: #e6dcff; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(18, 21, 28, 0.96);
  border: 1px solid var(--card-border);
  z-index: 40;
  font-size: 14px;
  font-weight: 600;
}

.loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.55);
  z-index: 50;
}
.loader[hidden] {
  display: none !important;
}
.toast[hidden] {
  display: none !important;
}
.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--purple);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Portal loader (MotionSites-ish) */
.portal-loader {
  position: relative;
  width: 64px;
  height: 64px;
}
.portal-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}
.portal-ring--a {
  border-top-color: #c4b5fd;
  border-right-color: rgba(139, 116, 255, 0.35);
  animation: portal-spin 0.9s linear infinite;
  filter: drop-shadow(0 0 8px rgba(139, 116, 255, 0.45));
}
.portal-ring--b {
  inset: 8px;
  border-bottom-color: #56d1ff;
  border-left-color: rgba(86, 209, 255, 0.35);
  animation: portal-spin 1.25s linear infinite reverse;
}
.portal-core {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(139, 116, 255, 0.2) 55%, transparent 70%);
  animation: portal-pulse 1.1s ease-in-out infinite;
}
@keyframes portal-spin { to { transform: rotate(360deg); } }
@keyframes portal-pulse {
  0%, 100% { transform: scale(0.75); opacity: 0.55; }
  50% { transform: scale(1.15); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-ring,
  .portal-core { animation: none; }
}

.menu-text-lines p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.menu-view-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.owner-kind-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.owner-kind-lab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--card-bg, rgba(255,255,255,0.04));
}
.owner-kind-lab .owner-kind-count {
  margin-left: auto;
  opacity: 0.7;
}
.menu-input-wrap { margin-top: 10px; }
.menu-input-row { display: flex; gap: 8px; margin-top: 8px; }
.menu-input-row .gc-input { flex: 1; }
.menu-word-block { margin-top: 12px; }
.owner-pager { display: flex; gap: 8px; margin-top: 10px; }
.owner-pager button { flex: 1; }
.owner-member-row, .owner-shop-row { width: 100%; text-align: left; }
.owner-shop-row--edit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.owner-shop-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.owner-shop-controls { display: flex; align-items: center; gap: 6px; }
.owner-shop-price-input {
  width: 64px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-size: 13px;
}
.owner-shop-controls button { font-size: 12px; padding: 6px 10px; white-space: nowrap; }

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.admin-field:last-child { border-bottom: 0; }
.admin-field-label { font-size: 13px; color: var(--muted); }
.admin-field-val { font-size: 18px; font-weight: 700; }
.admin-step-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-step-row .btn {
  min-width: 44px;
  min-height: 40px;
}
.admin-step, .admin-toggle {
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.blitz-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  text-align: left;
  color: inherit;
  width: 100%;
  font: inherit;
}
.blitz-member--ai {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(79, 172, 254, 0.08));
  border-color: rgba(124, 92, 255, 0.35);
}
.blitz-member:active { transform: scale(0.99); }
.blitz-member .info { flex: 1; min-width: 0; }
.blitz-member .info strong { display: block; font-size: 14px; }
.blitz-member .info span { font-size: 12px; color: var(--muted); }
.blitz-member .chev { color: var(--muted); font-size: 20px; line-height: 1; }

.blitz-duel-players .mini-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.blitz-duel-players .mini-avatar .avatar-fallback {
  font-size: 18px;
}

.blitz-play-root { display: flex; flex-direction: column; gap: 12px; }
.blitz-duel-players > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  text-align: center;
}
.blitz-duel-players > div strong { font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blitz-duel-card {
  margin-bottom: 0;
  border: 1px solid var(--card-border);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.05), transparent 42%),
    var(--card-solid);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.blitz-duel-players {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
  padding: 8px 0 16px;
}
.blitz-vs { font-weight: 800; color: var(--muted); font-size: 14px; }
.blitz-dice {
  font-size: 56px;
  line-height: 1;
  text-align: center;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(20, 24, 34, 0.9));
  border: 1px solid var(--card-border);
}
.blitz-dice--cube {
  font-size: 74px;
  letter-spacing: 4px;
  text-shadow: 0 6px 20px rgba(124, 92, 255, 0.28);
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.16), rgba(20, 24, 34, 0.96));
}
.blitz-dice--reveal {
  animation: blitzPulse 0.9s ease-in-out infinite alternate;
}
.blitz-dice--shake {
  animation: blitzShake 0.82s cubic-bezier(.36,.07,.19,.97) infinite;
}
.blitz-dice--settled {
  animation: blitzSettleGlow 1.05s ease-out 1;
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, 0.35),
    0 0 20px rgba(124, 92, 255, 0.35),
    0 0 42px rgba(124, 92, 255, 0.22);
}
.blitz-reveal-item {
  display: inline-block;
  animation: blitzPopIn 0.35s ease-out;
}
.blitz-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.blitz-actions button {
  flex: 1 1 calc(50% - 8px);
  min-width: 120px;
  border: 0;
  border-radius: 12px;
  padding: 14px 10px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #8f6bff, #6240e8);
  cursor: pointer;
}
.blitz-actions button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--card-border);
}
.blitz-phrase {
  font-family: ui-monospace, monospace;
  font-size: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(124, 92, 255, 0.35);
  word-break: break-word;
}
.blitz-quiz-round {
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  margin: 0 0 4px;
}
.blitz-quiz-q {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.28);
  word-break: break-word;
  text-align: center;
}
.blitz-quiz-img-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 10px;
}
.blitz-quiz-img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 14px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(124, 92, 255, 0.28);
}
.owner-quiz-image-block {
  margin: 10px 0 12px;
}
.owner-quiz-image-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.owner-quiz-image-preview {
  margin-top: 10px;
}
.owner-quiz-image-preview img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 12px;
  object-fit: contain;
  border: 1px solid var(--card-border);
}
.blitz-quiz-sep {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 4px 0 2px;
}
.blitz-quiz-rules {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  padding: 4px 8px 8px;
  margin: 0;
}
.blitz-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}
.blitz-status { text-align: center; color: var(--muted); font-size: 13px; padding: 8px; }
.blitz-reveal-hint {
  color: #d8c9ff;
  font-weight: 700;
}
.blitz-result {
  text-align: center;
  font-weight: 800;
  font-size: 16px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(62, 207, 142, 0.15), rgba(124, 92, 255, 0.12));
}
.blitz-outcome-card {
  text-align: center;
  padding: 10px 12px;
  border: 1px solid rgba(124, 92, 255, 0.28);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.12), rgba(62, 207, 142, 0.08));
}
.blitz-outcome-title {
  margin: 0;
  font-weight: 800;
  font-size: 16px;
}
.blitz-result--hold {
  background: linear-gradient(135deg, rgba(255, 180, 92, 0.14), rgba(124, 92, 255, 0.12));
  border: 1px solid rgba(255, 180, 92, 0.3);
  animation: blitzPulse 0.9s ease-in-out infinite alternate;
}

@keyframes blitzPulse {
  from { transform: scale(1); opacity: 0.94; }
  to { transform: scale(1.02); opacity: 1; }
}

@keyframes blitzPopIn {
  from { transform: translateY(8px) scale(0.94); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes blitzShake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes blitzSettleGlow {
  0% {
    filter: brightness(1) drop-shadow(0 0 0 rgba(143, 107, 255, 0));
  }
  45% {
    filter: brightness(1.14) drop-shadow(0 0 16px rgba(143, 107, 255, 0.55));
  }
  100% {
    filter: brightness(1) drop-shadow(0 0 10px rgba(143, 107, 255, 0.35));
  }
}

/* —— Blitz FX arena (3D dice + sport tokens) —— */
.blitz-arena {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}
.blitz-arena-stage {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 18px 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(18, 20, 32, 0.72)),
    radial-gradient(circle at 20% 0%, rgba(143, 107, 255, 0.22), transparent 55%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 28px rgba(0, 0, 0, 0.28);
}
.blitz-arena-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(124, 92, 255, 0.28), transparent 65%);
  pointer-events: none;
  animation: blitzArenaGlow 4.5s ease-in-out infinite alternate;
}
.blitz-arena--rolling .blitz-arena-glow {
  animation-duration: 1.1s;
  opacity: 1;
}
.blitz-arena--settled .blitz-arena-stage {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(124, 92, 255, 0.35),
    0 0 28px rgba(124, 92, 255, 0.28);
}
.blitz-arena-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 8px;
  min-height: 108px;
}
.blitz-vs--arena {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 0 12px rgba(124, 92, 255, 0.45);
}

.b3d-slot {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  perspective: 720px;
}
.b3d-slot--ghost {
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.35);
  font-size: 28px;
  font-weight: 700;
  animation: blitzPulse 1.1s ease-in-out infinite alternate;
}

.b3d-cube {
  position: relative;
  width: 64px;
  height: 64px;
  transform-style: preserve-3d;
}
.b3d-cube-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.b3d-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(160deg, #f7f4ff 0%, #e8e0ff 45%, #d9d0f5 100%);
  border: 1px solid rgba(80, 60, 140, 0.25);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
  backface-visibility: hidden;
}
.b3d-pips {
  width: 70%;
  height: 70%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.b3d-pip {
  width: 9px;
  height: 9px;
  margin: auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a3a78, #1d1638 70%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.b3d-face--1 { transform: rotateY(0deg) translateZ(32px); }
.b3d-face--2 { transform: rotateY(90deg) translateZ(32px); }
.b3d-face--3 { transform: rotateY(180deg) translateZ(32px); }
.b3d-face--4 { transform: rotateY(-90deg) translateZ(32px); }
.b3d-face--5 { transform: rotateX(90deg) translateZ(32px); }
.b3d-face--6 { transform: rotateX(-90deg) translateZ(32px); }

/* Face orientation lives on the INNER — settle/roll animations on OUTER must not override it. */
.b3d-cube-inner.show-1 { transform: rotateX(-12deg) rotateY(18deg); }
.b3d-cube-inner.show-2 { transform: rotateX(-12deg) rotateY(-72deg); }
.b3d-cube-inner.show-3 { transform: rotateX(-12deg) rotateY(-162deg); }
.b3d-cube-inner.show-4 { transform: rotateX(-12deg) rotateY(108deg); }
.b3d-cube-inner.show-5 { transform: rotateX(-102deg) rotateY(18deg); }
.b3d-cube-inner.show-6 { transform: rotateX(78deg) rotateY(18deg); }

.b3d-cube.is-rolling .b3d-cube-inner {
  animation: b3dRoll 0.75s linear infinite;
}
.b3d-cube.is-settled {
  animation: blitzSettleGlow 0.9s ease-out 1;
  filter: drop-shadow(0 0 14px rgba(143, 107, 255, 0.55));
}
.b3d-face-badge {
  position: absolute;
  right: -6px;
  bottom: -8px;
  z-index: 2;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(20, 16, 36, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  font-variant-numeric: tabular-nums;
}
.b3d-cube.is-rolling .b3d-face-badge {
  opacity: 0.35;
}

.b-sport {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  isolation: isolate;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.b-sport-emoji { font-size: 34px; line-height: 1; z-index: 1; }
.b-sport-score {
  position: absolute;
  right: 8px;
  bottom: 6px;
  z-index: 2;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.b-sport-ring {
  position: absolute;
  inset: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  z-index: 0;
}
.b-sport--violet { background: linear-gradient(145deg, rgba(143, 107, 255, 0.4), rgba(20, 16, 40, 0.85)); }
.b-sport--rose { background: linear-gradient(145deg, rgba(255, 90, 140, 0.38), rgba(40, 12, 28, 0.85)); }
.b-sport--amber { background: linear-gradient(145deg, rgba(255, 170, 70, 0.4), rgba(40, 24, 8, 0.85)); }
.b-sport--green { background: linear-gradient(145deg, rgba(62, 207, 142, 0.38), rgba(10, 36, 28, 0.85)); }
.b-sport--sky { background: linear-gradient(145deg, rgba(86, 209, 255, 0.38), rgba(10, 28, 44, 0.85)); }
.b-sport--gold { background: linear-gradient(145deg, rgba(255, 210, 90, 0.42), rgba(40, 28, 8, 0.88)); }
.b-sport.is-rolling .b-sport-emoji {
  animation: bSportSpin 0.7s cubic-bezier(.36,.07,.19,.97) infinite;
}
.b-sport--basketball.is-rolling .b-sport-emoji { animation-name: bSportBounce; }
.b-sport--football.is-rolling .b-sport-emoji { animation-name: bSportKick; }
.b-sport--darts.is-rolling .b-sport-emoji { animation-name: bSportDart; }
.b-sport--bowling.is-rolling .b-sport-emoji { animation-name: bSportBowl; }
.b-sport--slot.is-rolling .b-sport-emoji { animation-name: bSportSlot; }
.b-sport.is-settled {
  animation: blitzSettleGlow 0.95s ease-out 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 24px rgba(143, 107, 255, 0.35);
}

.b-coin {
  width: 72px;
  height: 72px;
  position: relative;
  transform-style: preserve-3d;
  border-radius: 50%;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.b-coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  backface-visibility: hidden;
  background:
    radial-gradient(circle at 30% 25%, #ffe9a8, #d4a017 55%, #8a6508 100%);
  border: 2px solid rgba(255, 236, 170, 0.7);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.35), 0 8px 18px rgba(0, 0, 0, 0.35);
}
.b-coin-face--tails { transform: rotateY(180deg); }
.b-coin--heads { transform: rotateY(0deg); }
.b-coin--tails { transform: rotateY(180deg); }
.b-coin.is-rolling { animation: bCoinFlip 0.55s linear infinite; }
.b-coin.is-settled { animation: blitzSettleGlow 0.9s ease-out 1; }

.b-rps {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 36px;
  background: linear-gradient(145deg, rgba(143, 107, 255, 0.35), rgba(18, 16, 36, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}
.b-rps.is-rolling { animation: bRpsSlam 0.55s ease-in-out infinite; }
.b-rps.is-settled { animation: blitzPopIn 0.4s ease-out 1, blitzSettleGlow 0.9s ease-out 1; }

@keyframes blitzArenaGlow {
  from { opacity: 0.55; transform: translateY(0); }
  to { opacity: 0.95; transform: translateY(8px); }
}
@keyframes b3dRoll {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  25% { transform: rotateX(90deg) rotateY(45deg) rotateZ(20deg); }
  50% { transform: rotateX(180deg) rotateY(120deg) rotateZ(-10deg); }
  75% { transform: rotateX(270deg) rotateY(220deg) rotateZ(30deg); }
  100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(0deg); }
}
@keyframes bSportSpin {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  30% { transform: translate3d(-4px, -6px, 0) rotate(-18deg) scale(1.06); }
  60% { transform: translate3d(5px, 4px, 0) rotate(16deg) scale(0.96); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
}
@keyframes bSportBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-14px) scale(1.08); }
  70% { transform: translateY(4px) scale(0.94); }
}
@keyframes bSportKick {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  40% { transform: translateX(10px) rotate(28deg); }
  70% { transform: translateX(-6px) rotate(-12deg); }
}
@keyframes bSportDart {
  0%, 100% { transform: translate(0, 0) rotate(-12deg); }
  50% { transform: translate(8px, -10px) rotate(8deg) scale(1.05); }
}
@keyframes bSportBowl {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(12px) rotate(40deg); }
}
@keyframes bSportSlot {
  0%, 100% { transform: translateY(0); filter: hue-rotate(0deg); }
  50% { transform: translateY(-8px); filter: hue-rotate(40deg); }
}
@keyframes bCoinFlip {
  from { transform: rotateY(0deg) rotateX(12deg); }
  to { transform: rotateY(360deg) rotateX(12deg); }
}
@keyframes bRpsSlam {
  0%, 100% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(1.12) rotate(-8deg); }
  70% { transform: scale(0.94) rotate(6deg); }
}

@media (prefers-reduced-motion: reduce) {
  .b3d-cube.is-rolling .b3d-cube-inner,
  .b-sport.is-rolling .b-sport-emoji,
  .b-coin.is-rolling,
  .b-rps.is-rolling,
  .blitz-arena-glow,
  .b3d-slot--ghost {
    animation: none !important;
  }
}

/* —— Game landing (Мафия / Крокодил) —— */
.game-landing { padding-bottom: 6px; }
.game-landing-hero {
  padding: 2px 0 8px;
  position: relative;
}
.game-landing-badge {
  position: absolute;
  top: 2px;
  right: 0;
  margin: 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--green);
  background: rgba(62, 207, 142, 0.1);
  border: 1px solid rgba(62, 207, 142, 0.28);
  line-height: 1.3;
}
.game-landing--purple .game-landing-badge {
  color: #c9b8ff;
  background: rgba(124, 92, 255, 0.12);
  border-color: rgba(124, 92, 255, 0.28);
}
.game-landing-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 52px;
  text-align: left;
}
.game-landing-icon {
  font-size: 30px;
  line-height: 1;
  flex-shrink: 0;
}
.game-landing-head-text { min-width: 0; flex: 1; }
.game-landing-title {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.02em;
  margin: 0 0 2px;
  text-transform: none;
}
.game-landing-subtitle {
  font-size: 11px;
  margin: 0;
  line-height: 1.35;
}
.game-landing-status {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  text-align: left;
}
.game-stat-grid {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--card-border);
}
.game-stat-line {
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
}
.game-stat-sep {
  opacity: 0.45;
  user-select: none;
}
.game-lobby-name-row {
  display: flex;
  gap: 5px;
  align-items: center;
}
.game-lobby-name-row .cr-input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  padding: 6px 8px;
}
.gl-btn--xs {
  width: auto;
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 7px;
}
.gl-btn--enter {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
}
.game-landing--purple .gl-btn--enter {
  background: rgba(124, 92, 255, 0.35);
  border-color: rgba(124, 92, 255, 0.5);
}
.game-landing--green .gl-btn--enter {
  background: rgba(46, 204, 113, 0.35);
  border-color: rgba(46, 204, 113, 0.5);
}
.game-lobby-name-wrap {
  margin: 0 0 6px;
}
.game-room-round {
  font-weight: 500;
  color: var(--muted);
}
.game-stat-card {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 9px;
  background: var(--card);
  border: 1px solid var(--card-border);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}
.game-stat-ico { font-size: 13px; flex-shrink: 0; }
.game-landing-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}
.gl-btn {
  width: 100%;
  min-height: 32px;
}
.game-room-actions .gl-btn,
.gl-btn.gl-btn--xs {
  width: auto;
  flex: 0 0 auto;
}
.gl-btn--muted {
  color: var(--text);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
}
.gl-btn--sm {
  width: auto;
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 11px;
  border-radius: 8px;
}
.game-landing--purple .game-landing-create {
  background: linear-gradient(135deg, #7c5cff, #9a6bff);
}
.game-landing--green .game-landing-create {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}
.gl-btn--invite {
  color: #b8f5d0;
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.28);
  font-weight: 500;
}
.game-landing-btn-row {
  display: flex;
  gap: 5px;
}
.game-landing-btn-row .gl-btn { flex: 1; min-width: 0; }
.game-landing-card {
  padding: 8px 10px;
  margin-bottom: 6px;
  box-shadow: none;
}
.game-landing-card-head {
  margin-bottom: 4px;
}
.game-landing-card-head h2 {
  font-size: 12px;
  font-weight: 600;
}
.gl-list-head { margin-bottom: 6px; }
.gl-tabs {
  width: 100%;
  display: flex;
  gap: 5px;
}
.gl-tabs .gl-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.gl-tab-n {
  min-width: 16px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  line-height: 1.3;
}
.gl-tabs .gl-tab.active .gl-tab-n {
  background: rgba(255, 255, 255, 0.22);
}
.game-landing--green .gl-tabs .gl-tab.active {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  border-color: transparent;
  color: #fff;
}
.game-landing--purple .gl-tabs .gl-tab.active {
  background: linear-gradient(135deg, #7c5cff, #9a6bff);
  border-color: transparent;
  color: #fff;
}
.game-rooms-empty { margin: 4px 0 2px; text-align: center; }
.game-room-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  line-height: 1.3;
  color: var(--muted);
}
.game-room-players { font-weight: 500; }
.game-room-phase { font-weight: 500; }
.game-room-phase--live { color: var(--green); }
.game-landing--purple .game-room-phase--live { color: #c9b8ff; }
.game-room-phase--idle { color: var(--muted); }
.game-room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--card-border);
}
.game-room-row:last-child { border-bottom: 0; }
.game-room-info { min-width: 0; }
.game-room-info strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.25;
}
.game-room-info .small { font-size: 10px; line-height: 1.3; }
.game-room-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
}
.game-room-actions:empty { display: none; }
.game-steps { display: flex; flex-direction: column; gap: 6px; }
.game-step {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.game-step-num {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
}
.game-landing--purple .game-step-num {
  background: rgba(124, 92, 255, 0.25);
  color: #dccfff;
}
.game-landing--green .game-step-num {
  background: rgba(46, 204, 113, 0.22);
  color: #b8f5d0;
}
.game-step p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

/* —— Mafia noir landing —— */
.game-landing--noir {
  --noir-gold: #c49b66;
  --noir-gold-dim: #8e6a3e;
  --noir-gold-text: #d4b483;
  --noir-panel: #12100e;
  --noir-ink: #0a0806;
  background:
    radial-gradient(ellipse 130% 70% at 50% -15%, rgba(196, 155, 102, 0.1), transparent 58%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.012) 0 1px,
      transparent 1px 7px
    ),
    linear-gradient(180deg, #15110d 0%, var(--noir-ink) 100%);
  border-radius: 16px;
  padding: 4px 2px 8px;
}
.game-landing--noir .game-landing-hero {
  padding: 6px 4px 2px;
}
.game-landing--noir .game-landing-badge {
  color: #6ee7a8;
  background: rgba(62, 207, 142, 0.12);
  border-color: rgba(62, 207, 142, 0.35);
}
.game-landing--noir .game-landing-head {
  gap: 12px;
  padding-right: 48px;
}
.game-landing--noir .game-landing-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
  flex-shrink: 0;
  border: 2px solid rgba(196, 155, 102, 0.9);
  box-shadow:
    0 0 0 3px rgba(10, 8, 6, 1),
    0 0 0 4px rgba(196, 155, 102, 0.28),
    0 8px 20px rgba(0, 0, 0, 0.42);
}
.game-landing--noir .game-landing-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f2ebe2;
  line-height: 1.05;
}
.game-landing--noir .game-landing-subtitle {
  color: #9a8b78;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 4px;
}
.game-landing--noir .game-landing-status {
  color: var(--noir-gold-text);
  font-weight: 500;
  font-size: 12px;
  text-align: center;
  letter-spacing: 0.03em;
  margin: 10px 0 12px;
}
.game-landing--noir .game-landing-card {
  background: linear-gradient(165deg, #16120e 0%, #0e0c0a 100%);
  border: 1px solid rgba(196, 155, 102, 0.2);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.game-landing--noir .game-landing-card::before,
.game-landing--noir .game-landing-card::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
  z-index: 0;
  background: none;
  opacity: 0.75;
}
.game-landing--noir .game-landing-card::before {
  top: 6px;
  left: 6px;
  border-top: 2px solid rgba(196, 155, 102, 0.5);
  border-left: 2px solid rgba(196, 155, 102, 0.5);
  border-radius: 10px 0 0 0;
}
.game-landing--noir .game-landing-card::after {
  right: 6px;
  bottom: 6px;
  border-bottom: 2px solid rgba(196, 155, 102, 0.35);
  border-right: 2px solid rgba(196, 155, 102, 0.35);
  border-radius: 0 0 10px 0;
}
.game-landing--noir .game-landing-card > * {
  position: relative;
  z-index: 1;
}
.game-landing--noir .gl-tabs .gl-tab {
  color: #8f8272;
  border-color: rgba(196, 155, 102, 0.18);
  background: rgba(0, 0, 0, 0.22);
}
.game-landing--noir .gl-tabs .gl-tab.active {
  background: linear-gradient(180deg, var(--noir-gold), var(--noir-gold-dim));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(142, 106, 62, 0.28);
}
.game-landing--noir .game-room-row--noir {
  padding: 11px 12px;
  margin: 8px 0 0;
  border: 1px solid rgba(196, 155, 102, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
}
.game-landing--noir .game-room-row--noir:last-child {
  margin-bottom: 0;
}
.game-landing--noir .game-room-id {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #efe6d8;
}
.game-landing--noir .game-room-meta--noir {
  color: #8d8070;
  font-size: 11px;
  margin-top: 3px;
}
.game-landing--noir .gl-btn--enter {
  background: linear-gradient(180deg, var(--noir-gold), var(--noir-gold-dim));
  border-color: rgba(196, 155, 102, 0.55);
  color: #fff;
  font-weight: 650;
  padding: 7px 16px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(142, 106, 62, 0.22);
}
.game-landing--noir .gl-btn--gear {
  color: var(--noir-gold-text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(196, 155, 102, 0.28);
  padding: 5px 9px;
  line-height: 1;
  font-size: 14px;
  border-radius: 9px;
}
.game-landing--noir .gl-btn--icon {
  min-width: 34px;
  text-align: center;
}
.game-landing--noir .game-landing-create {
  background: linear-gradient(180deg, var(--noir-gold), var(--noir-gold-dim));
  border-color: rgba(196, 155, 102, 0.55);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(142, 106, 62, 0.28);
}
.game-landing--noir .game-howto .game-landing-card-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--noir-gold);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.game-landing--noir .game-step-num {
  border-radius: 50%;
  background: linear-gradient(180deg, var(--noir-gold), var(--noir-gold-dim));
  color: #1c1408;
  font-weight: 700;
  width: 22px;
  height: 22px;
  font-size: 11px;
}
.game-landing--noir .game-step p {
  color: #a89a88;
}
.game-landing--noir .game-howto-body {
  position: relative;
  overflow: hidden;
  min-height: 120px;
  padding-right: 92px;
}
.game-landing--noir .game-howto-deco {
  position: absolute;
  right: 2px;
  bottom: 0;
  width: 96px;
  height: auto;
  max-height: 88px;
  object-fit: contain;
  object-position: right bottom;
  opacity: 0.92;
  pointer-events: none;
}
.game-landing--noir .mafia-ai-card {
  border: 1px solid rgba(124, 92, 255, 0.42);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(124, 92, 255, 0.22), transparent 58%),
    linear-gradient(155deg, rgba(48, 32, 88, 0.55), rgba(14, 12, 18, 0.96));
  border-radius: 14px;
  box-shadow: 0 0 22px rgba(124, 92, 255, 0.14);
  position: relative;
  overflow: hidden;
}
.game-landing--noir .mafia-ai-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  position: relative;
  z-index: 1;
}
.game-landing--noir .mafia-ai-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.game-landing--noir .mafia-ai-btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  flex-shrink: 0;
  padding: 3px;
  background: rgba(18, 12, 36, 0.75);
  border: 1px solid rgba(124, 92, 255, 0.38);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}
.game-landing--noir .mafia-ai-btn-text {
  flex: 1;
  min-width: 0;
}
.game-landing--noir .mafia-ai-btn-text strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: #efe9ff;
}
.game-landing--noir .mafia-ai-btn-text .muted {
  color: #a89bc8 !important;
}
.game-landing--noir .mafia-ai-btn-chevron {
  font-size: 22px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.42);
  flex-shrink: 0;
}

/* —— In-game play screens —— */
.game-play { padding-bottom: 16px; }
.gp-header {
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.gp-header--purple { border-color: rgba(124, 92, 255, 0.35); }
.gp-header--green { border-color: rgba(46, 204, 113, 0.35); }
.gp-header-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.gp-game-icon { font-size: 36px; line-height: 1; }
.gp-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.gp-meta { margin: 2px 0 0; }
.gp-timer {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.gp-timer--green { color: #6ee7a8; }
.gp-phase { margin-bottom: 12px; }
.gp-phase-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.gp-player-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.gp-player-card {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
}
.gp-player-card--me { border-color: rgba(124, 92, 255, 0.45); }
.game-play--green .gp-player-card--me { border-color: rgba(46, 204, 113, 0.45); }
.gp-player-card--dead { opacity: 0.45; }
.gp-player-info { min-width: 0; }
.gp-player-info strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-player-num {
  font-size: 11px;
  color: var(--muted);
}
.gp-online, .gp-status {
  display: block;
  font-size: 11px;
  color: #6ee7a8;
}
.gp-status--lead { color: #fbbf24; }
.gp-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(124, 92, 255, 0.25);
  color: #dccfff;
  margin-top: 2px;
}
.gp-role-body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.gp-role-icon { font-size: 32px; }
.gp-stats-card .gp-stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.gp-vote-label {
  display: block;
  font-size: 13px;
  margin: 8px 0 6px;
  color: var(--muted);
}
.gp-select, .gp-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  margin-bottom: 8px;
}
.gp-guess-row {
  display: flex;
  gap: 8px;
}
.gp-guess-row .gp-input { margin-bottom: 0; flex: 1; }
.gp-guess-submit { flex-shrink: 0; padding-inline: 16px; }
.gp-guess-submit--green {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  border: none;
}
.gp-vote-submit { width: 100%; margin-top: 8px; }
.game-play--purple .gp-vote-submit {
  background: linear-gradient(135deg, #7c5cff, #b06bff);
  border: none;
}
.link-btn {
  background: none;
  border: none;
  color: #b06bff;
  font: inherit;
  font-size: 13px;
  padding: 0;
  cursor: pointer;
}
.gp-word-card { text-align: center; margin-bottom: 12px; }
.gp-word-card--green { border-color: rgba(46, 204, 113, 0.35); }
.gp-word {
  font-size: 28px;
  font-weight: 800;
  color: #6ee7a8;
  margin: 8px 0;
}
.gp-word-hint { font-size: 13px; color: var(--muted); }
.gp-leader-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* —— Mafia in-game UI —— */
.game-play--purple .mf-play-root { margin: -4px -2px 0; }
.mf-screen { display: flex; flex-direction: column; gap: 12px; }
.mf-top { padding: 4px 2px 0; }
.mf-brand { display: flex; gap: 10px; align-items: center; }
.mf-brand-ico { font-size: 36px; line-height: 1; }
.mf-brand-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
}
.mf-brand-meta { margin-top: 2px; }
.mf-lobby-wait { margin: 0; padding: 0 4px; line-height: 1.4; }
.mf-phase-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.25);
}
.mf-phase-ico { font-size: 18px; }
.mf-phase-name { flex: 1; font-weight: 600; font-size: 14px; }
.mf-phase-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #c4b5fd;
}
.mf-phase-timer-inline { font-weight: 700; color: #c4b5fd; }
.mf-ring-host { min-height: 280px; }
.mf-ring-wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  aspect-ratio: 1;
}
.mf-ring {
  position: absolute;
  inset: 0;
}
.mf-ring-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  text-align: center;
}
.mf-ring-seat--dim { opacity: 0.35; }
.mf-ring-seat--dead { opacity: 0.4; filter: grayscale(0.8); }
.mf-ring-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(124, 92, 255, 0.35);
  display: grid;
  place-items: center;
  font-size: 26px;
  position: relative;
}
.mf-ring-seat--me .mf-ring-avatar {
  border-color: #b06bff;
  box-shadow: 0 0 12px rgba(176, 107, 255, 0.45);
}
.mf-ring-name {
  font-size: 11px;
  font-weight: 600;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mf-host-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c5cff, #b06bff);
  color: #fff;
}
.mf-vote-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid #0f0f1a;
}
.mf-ring-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58%;
  text-align: center;
  z-index: 1;
  pointer-events: none;
}
.mf-ring-center-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}
.mf-ring-center-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.mf-ring-center-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.35;
}
.mf-ring-center--danger .mf-ring-center-title { color: #f87171; }
.mf-dead-avatar {
  font-size: 56px;
  opacity: 0.45;
  filter: grayscale(1);
  margin-bottom: 6px;
}
.mf-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px;
}
.mf-panel-title { margin: 0; font-size: 16px; font-weight: 700; }
.mf-panel-foot { margin: 0; text-align: center; }
.mf-pick-list { display: flex; flex-direction: column; gap: 8px; }
.mf-pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}
.mf-pick-row--on {
  border-color: rgba(124, 92, 255, 0.55);
  background: rgba(124, 92, 255, 0.1);
}
.mf-pick-user { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mf-pick-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  font-size: 22px;
}
.mf-pick-row input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #b06bff;
}
.mf-btn-purple {
  width: 100%;
  margin-top: 4px;
  background: linear-gradient(135deg, #7c5cff, #b06bff);
  border: none;
  font-weight: 700;
}
.mf-leave-btn { width: 100%; margin-top: 4px; }
.mf-end-btn {
  width: 100%;
  margin-top: 8px;
  border-color: rgba(248, 113, 113, 0.45) !important;
  color: #fecaca !important;
}
.mf-host-actions {
  margin-top: 10px;
}
.mf-lobby-card {
  border: 1px solid rgba(124, 92, 255, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), transparent 42%),
    linear-gradient(160deg, rgba(124, 92, 255, 0.1), rgba(18, 20, 31, 0.82));
  padding: 10px 12px;
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.mf-lobby-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.mf-lobby-players {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 2px;
}
.mf-lobby-player {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.03);
}
.mf-lobby-player--me {
  border-color: rgba(176, 107, 255, 0.58);
  background: rgba(124, 92, 255, 0.14);
}
.mf-lobby-player-emoji { font-size: 18px; }
.mf-lobby-player-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mf-lobby-player-role {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #d8c9ff;
}
.mf-lobby-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.mf-rules-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
.mf-rules-modal.hidden { display: none; }
.mf-rules-sheet {
  width: min(100%, 480px);
  max-height: 82vh;
  overflow: auto;
  padding: 14px 16px;
  border-radius: 16px 16px 12px 12px;
}
.mf-rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.mf-rules-head h3 { margin: 0; font-size: 16px; }
.mf-rules-close {
  border: none;
  background: transparent;
  color: var(--text-muted, #aaa);
  font-size: 18px;
  cursor: pointer;
}
.mf-rules-block { margin-bottom: 12px; }
.mf-rules-block h4 { margin: 0 0 6px; font-size: 13px; }
.mf-rules-block p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-muted, #bbb); }
.mf-rules-btn--inline { width: 100%; margin-top: 8px; }
.mf-ai-card {
  margin-top: 8px;
  border: 1px solid rgba(176, 107, 255, 0.3);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(95, 67, 210, 0.16), rgba(18, 20, 31, 0.9));
  padding: 10px 12px;
}
.mf-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mf-ai-badge {
  font-size: 10px;
  font-weight: 800;
  color: #e8ddff;
  border: 1px solid rgba(176, 107, 255, 0.5);
  background: rgba(124, 92, 255, 0.24);
  border-radius: 999px;
  padding: 3px 8px;
}
.mf-ai-counts {
  display: flex;
  gap: 6px;
  margin: 8px 0 10px;
}
.mf-ai-count {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.05);
  color: #f2eeff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 7px 8px;
}
.mf-ai-count--on {
  border-color: rgba(176, 107, 255, 0.7);
  background: rgba(124, 92, 255, 0.3);
}
.mf-ai-count:disabled {
  opacity: 0.45;
}
.mf-fill-ai-btn,
.mf-fill-quick-btn,
.mf-start-btn,
.mf-leave-btn {
  width: 100%;
  margin-top: 8px;
}
.mafia-ai-card {
  margin-bottom: 10px;
  padding: 0;
  overflow: hidden;
}
.mafia-ai-card .mafia-ai-btn {
  width: 100%;
  border: none;
  text-align: left;
  background: transparent;
  font: inherit;
  color: inherit;
}
.mf-ai-hero {
  margin-top: 8px;
  border: 1px solid rgba(176, 107, 255, 0.35);
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(79, 172, 254, 0.14), transparent 55%),
    linear-gradient(155deg, rgba(95, 67, 210, 0.22), rgba(18, 20, 31, 0.94));
  padding: 12px;
  box-shadow: 0 10px 28px rgba(8, 10, 24, 0.35);
}
.mf-ai-hero--off {
  opacity: 0.88;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}
.mf-ai-hero-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.mf-ai-hero-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.45), rgba(79, 172, 254, 0.25));
  flex-shrink: 0;
}
.mf-ai-hero-text { flex: 1; min-width: 0; }
.mf-ai-hero-text strong { display: block; font-size: 14px; }
.mf-ai-pill {
  font-size: 10px;
  font-weight: 800;
  color: #e8ddff;
  border: 1px solid rgba(176, 107, 255, 0.5);
  background: rgba(124, 92, 255, 0.24);
  border-radius: 999px;
  padding: 4px 8px;
  flex-shrink: 0;
}
.mf-lobby-progress { margin: 10px 0 8px; }
.mf-lobby-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.mf-lobby-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c5cff, #4facfe);
  transition: width 0.35s ease;
}
.mf-lobby-progress-label { margin: 6px 0 0; }
.mf-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 4px;
}
.mf-slot {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 6px;
  text-align: center;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.mf-slot--empty {
  border-style: dashed;
  opacity: 0.55;
  animation: mf-slot-pulse 2.4s ease-in-out infinite;
}
.mf-slot--me {
  border-color: rgba(124, 92, 255, 0.65);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.25);
}
.mf-slot--ai {
  background: linear-gradient(160deg, rgba(79, 172, 254, 0.12), rgba(124, 92, 255, 0.1));
}
.mf-slot-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.08);
}
.mf-slot-name {
  font-size: 10px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mf-slot-tag {
  font-size: 9px;
  font-weight: 700;
  color: #d8c9ff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mf-ring-seat--ai .mf-ring-avatar {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.35), rgba(124, 92, 255, 0.25));
}
.mf-insight-role {
  margin: 6px 0 0;
  font-size: 15px;
}
.mf-panel--wait {
  border-color: rgba(124, 92, 255, 0.22);
  background: rgba(124, 92, 255, 0.06);
}
.mf-wait-badge {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(124, 92, 255, 0.14);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.mf-pick-row--blocked { opacity: 0.45; pointer-events: none; }
.mf-pick-avatar .mini-avatar,
.mf-slot-avatar .mini-avatar,
.mf-ring-avatar .mini-avatar {
  width: 100%;
  height: 100%;
}
.mf-slot-avatar .mini-avatar,
.mf-ring-avatar .mini-avatar {
  width: 34px;
  height: 34px;
}
.mf-pick-avatar .mini-avatar {
  width: 40px;
  height: 40px;
}
.mf-ai-avatar-ico {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 18px;
}
.mf-team { margin-top: 8px; }
.mf-team-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.mf-team-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 100, 100, 0.2);
}
.mf-team-role {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #ffb4b4;
}
.mf-insight {
  margin-top: 8px;
  border-color: rgba(79, 172, 254, 0.35);
  background: rgba(79, 172, 254, 0.08);
}
.mf-ring-seat--mafia .mf-ring-avatar {
  box-shadow: 0 0 0 2px rgba(255, 100, 100, 0.45);
}
@keyframes mf-slot-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.75; }
}
.mf-settings { margin-top: 4px; }
.mf-settings summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
}
.mf-foot { margin-top: auto; }
.mf-chat-bar { margin-bottom: 6px; }
.mf-foot-status { margin: 0; font-size: 13px; }
.mf-role summary { cursor: pointer; font-weight: 600; }

.mf-game-over { text-align: center; }
.mf-result-stacks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: left;
  margin: 12px 0 16px;
}
.mf-result-stack {
  min-width: 0;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.mf-result-stack--win { border-color: rgba(80, 200, 120, 0.35); }
.mf-result-stack--lose { border-color: rgba(220, 90, 90, 0.28); }
.mf-result-stack-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.mf-result-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 42vh;
  overflow-y: auto;
  text-align: left;
}
.mf-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.mf-result-row--me { border-color: rgba(124, 92, 255, 0.55); }
.mf-result-avatar { font-size: 20px; }
.mf-result-name { font-weight: 600; flex: 1; }

.cr-game-over-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; }

/* —— Crocodile in-game UI —— */
.game-play--green .cr-play-root { margin: -4px -2px 0; }
.cr-play-chat-slot {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
}
.cr-play-chat-slot[hidden] {
  display: none !important;
}
.cr-play-chat-slot .gc-panel {
  margin-bottom: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  height: 100%;
  padding: 2px 0 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0;
  box-shadow: none;
  overflow: hidden;
}
.cr-play-chat-slot .gc-panel.card {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.cr-play-chat-slot .gc-title {
  display: block;
  margin: 0 0 2px;
  order: 0;
  flex-shrink: 0;
}
.game-play--green .cr-play-chat-slot .gc-msg {
  background: rgba(255, 255, 255, 0.05);
}
.game-play--green .cr-play-chat-slot .gc-msg--me {
  background: rgba(46, 204, 113, 0.12);
}
.game-play--green .cr-play-chat-slot .gc-msg--guess,
.game-play--green .cr-play-chat-slot .gc-msg--correct {
  background: rgba(46, 204, 113, 0.14);
  border-left-color: rgba(46, 204, 113, 0.6);
}
.game-play--green .cr-play-chat-slot .gc-msg--result {
  background: rgba(251, 191, 36, 0.1);
}
.game-play--green .cr-play-chat-slot .gc-msg--system {
  background: rgba(148, 163, 184, 0.08);
}
.game-play--green .cr-play-chat-slot .gc-send {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  border-color: transparent;
  color: #fff;
}
.cr-play-chat-slot .gc-form {
  order: 1;
  flex-shrink: 0;
}
.cr-play-chat-slot .gc-list {
  order: 2;
  flex: 1 1 auto;
  min-height: 120px;
  max-height: min(42vh, 320px) !important;
  overflow-y: auto;
}
#cr-play-shell,
.cr-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
}
.cr-play-fg {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
}
.cr-play-players {
  flex-shrink: 0;
}
.cr-play-players[hidden] {
  display: none !important;
}
.cr-play-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 4px;
}
.game-play-ui .cr-screen {
  min-height: 0;
  flex: 1 1 auto;
}
.cr-screen--lobby {
  min-height: min(56vh, 420px);
}
.cr-top {
  padding: 2px 2px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cr-phase-timer--top {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  color: #6ee7a8;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.22);
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.cr-phase-timer--warn {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.35);
}
.cr-phase-timer--critical {
  color: #f87171;
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.4);
  animation: cr-timer-pulse 1s ease-in-out infinite;
}
@keyframes cr-timer-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .cr-phase-timer--critical { animation: none; }
}
.cr-close-lobby {
  display: block;
  width: fit-content;
  margin: 0 auto 0 0;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
.cr-brand { display: flex; gap: 8px; align-items: center; min-width: 0; }
.cr-brand-ico { font-size: 26px; line-height: 1; }
.cr-brand-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text);
}
.cr-brand-meta { margin-top: 1px; font-size: 11px; }
.cr-lobby-wait { margin: 0; padding: 0 4px; line-height: 1.4; }
.cr-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 9px 12px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(46, 204, 113, 0.16), rgba(22, 101, 52, 0.12)),
    rgba(12, 22, 18, 0.55);
  border: 1px solid rgba(46, 204, 113, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.cr-status-strip--end {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  background: rgba(12, 18, 24, 0.45);
  border-color: rgba(251, 191, 36, 0.28);
}
.cr-status-strip--me {
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(46, 204, 113, 0.12)),
    rgba(12, 22, 18, 0.55);
  border-color: rgba(251, 191, 36, 0.4);
}
.cr-status-lead {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}
.cr-status-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.cr-status-hint {
  margin-left: auto;
  font-size: 11px;
  color: #6ee7a8;
  font-weight: 500;
}
.cr-status-strip--end .cr-chip {
  align-self: stretch;
  text-align: center;
}
.cr-phase-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 13px;
  color: #6ee7a8;
}
.cr-ring-host { min-height: 0; width: 100%; }
.cr-ring-host--strip { min-height: 0; }
.cr-ring-host--play {
  padding: 6px 6px 4px;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(46, 204, 113, 0.16), transparent 62%),
    linear-gradient(180deg, rgba(26, 61, 44, 0.4), rgba(12, 28, 20, 0.55));
  border: 1px solid rgba(46, 204, 113, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.cr-ring-host--compact { min-height: 200px; }
.cr-ring-host--compact .cr-ring-wrap { max-width: 300px; }
.cr-ring-host--compact .cr-ring-avatar { width: 40px; height: 40px; font-size: 14px; }
.cr-ring-host--compact .cr-ring-seat { width: 64px; }
.cr-ring-host--compact .cr-ring-center-title { font-size: 14px; font-weight: 600; }
.cr-seating { width: 100%; }
.cr-ring-wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  aspect-ratio: 1;
}
.cr-table-felt {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46%;
  height: 40%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 40% 35%, rgba(110, 231, 168, 0.22), transparent 55%),
    radial-gradient(ellipse at 50% 50%, #1a3d2c 0%, #0f2419 70%, #0a1812 100%);
  border: 2px solid rgba(46, 204, 113, 0.28);
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.45),
    0 8px 28px rgba(0, 0, 0, 0.35);
  z-index: 0;
  pointer-events: none;
}
.cr-ring { position: absolute; inset: 0; z-index: 2; }
.cr-ring-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 72px;
  text-align: center;
}
.cr-ring-seat--dim { opacity: 0.35; }
.cr-ring-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 20, 28, 0.85);
  border: 2px solid rgba(46, 204, 113, 0.4);
  display: grid;
  place-items: center;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}
.cr-ring-avatar .mini-avatar {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 50%;
}
.cr-ring-avatar .mini-avatar .avatar-fallback {
  font-size: 13px;
  font-weight: 700;
}
.cr-ring-seat--me .cr-ring-avatar {
  border-color: #2ecc71;
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.45);
}
.cr-ring-seat--leader .cr-ring-avatar {
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.35);
}
.cr-ring-seat--celebrate .cr-ring-avatar {
  overflow: visible;
  z-index: 4;
  border-color: #fbbf24;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.65);
  animation: cr-avatar-pop 0.45s ease-out;
}
.cr-salute {
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 0;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -70%);
  background:
    radial-gradient(circle at 50% 55%, #fbbf24 0 3px, transparent 4px),
    radial-gradient(circle at 22% 40%, #fb7185 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 78% 38%, #34d399 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 30% 70%, #60a5fa 0 2px, transparent 3px),
    radial-gradient(circle at 70% 72%, #c084fc 0 2px, transparent 3px),
    radial-gradient(circle at 50% 20%, #fde68a 0 2px, transparent 3px);
  animation: cr-salute-burst 2.6s ease-out forwards;
}
@keyframes cr-avatar-pop {
  0% { transform: scale(0.85); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes cr-salute-burst {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.4); }
  18% { opacity: 1; transform: translate(-50%, -75%) scale(1.15); }
  70% { opacity: 1; transform: translate(-50%, -90%) scale(1.35); }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(1.5); }
}
.cr-ring-name {
  font-size: 11px;
  font-weight: 600;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cr-host-tag, .cr-leader-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 999px;
  color: #fff;
}
.cr-host-tag { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.cr-leader-tag { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #111; }
.cr-score-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #2ecc71;
  color: #0a1a10;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid #0f0f1a;
  z-index: 2;
}
.cr-ring-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 42%;
  text-align: center;
  z-index: 1;
  pointer-events: none;
}
.cr-ring-center-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
}
.cr-ring-center-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cr-ring-center-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 0;
  line-height: 1.3;
}
.cr-ring-center--success .cr-ring-center-title { color: #6ee7a8; }

.cr-seating--bench {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}
.cr-bench-meta {
  text-align: center;
  padding: 2px 8px;
}
.cr-bench-meta--success .cr-ring-center-title { color: #6ee7a8; }
.cr-bench {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}
.cr-bench::-webkit-scrollbar { display: none; }
.cr-seating--bench .cr-ring-seat {
  position: relative;
  left: auto !important;
  top: auto !important;
  transform: none;
  width: 64px;
  flex: 0 0 auto;
  gap: 3px;
  min-height: 72px;
}
.cr-seating--bench .cr-ring-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.cr-seating--bench .cr-host-tag,
.cr-seating--bench .cr-leader-tag {
  font-size: 8px;
  padding: 1px 5px;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cr-seating--bench .cr-ring-name {
  max-width: 68px;
  font-size: 11px;
  line-height: 1.15;
}
.cr-ring-host--compact:has(.cr-seating--bench) {
  min-height: auto;
}
.cr-word-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(46, 204, 113, 0.08);
  border: 1px solid rgba(46, 204, 113, 0.2);
}
.cr-word-strip-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.cr-word-strip-text {
  font-size: 18px;
  font-weight: 650;
  color: #6ee7a8;
  word-break: break-word;
}
.cr-word-strip-hint { font-size: 11px; color: var(--muted); flex: 1 1 100%; }
.cr-leader-bar {
  display: flex;
  gap: 6px;
}
.cr-inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.cr-chip {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  white-space: nowrap;
}
.cr-chip--ok {
  color: #0a1a12;
  background: var(--green);
  border-color: transparent;
  font-weight: 600;
  min-width: 36px;
}
.cr-chip--primary {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.cr-chip--muted { color: var(--muted); }
.cr-chip--cancel {
  padding: 7px 9px;
  color: var(--muted);
}
.cr-chip--invite {
  width: 100%;
  margin-top: 2px;
  color: var(--muted);
  background: transparent;
  border-color: rgba(255, 255, 255, 0.1);
  font-weight: 500;
}
.cr-screen--lobby .cr-chip--invite {
  color: #b8f5d0;
  background: rgba(46, 204, 113, 0.1);
  border-color: rgba(46, 204, 113, 0.28);
}
.cr-leader-bar .cr-chip { flex: 1; }
.cr-round-end { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.cr-round-end-msg { margin: 0; font-size: 13px; font-weight: 500; text-align: center; }
.cr-round-end-msg--ok { color: #6ee7a8; }
.cr-round-end-msg--fail { color: #f87171; }
.cr-round-end-hint { margin: 0; text-align: center; }
.cr-panel { display: flex; flex-direction: column; gap: 8px; }
.cr-panel-title { margin: 0; font-size: 14px; font-weight: 600; }
.cr-panel-foot { margin: 0; text-align: center; }
.cr-guess-row { display: flex; gap: 8px; }
.cr-input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  min-width: 0;
}
.cr-btn-green {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.cr-btn-green:not(.cr-guess-row *) { width: 100%; }
.cr-stat { margin: 0; font-weight: 500; text-align: center; font-size: 13px; }
.cr-stat--ok { color: #6ee7a8; }
.cr-stat--fail { color: #f87171; }
.cr-settings summary { cursor: pointer; font-weight: 500; font-size: 13px; }
.cr-leave-btn { width: 100%; }

/* —— Game play layout + in-game chat —— */
.game-play-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}
.game-play--green .cr-play-root.game-play-layout {
  flex: 1 1 auto;
  min-height: 0;
}
.game-play-ui {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.game-play-chat-wrap {
  flex: 0 0 auto;
  width: 100%;
}
.game-play-chat-area {
  max-height: min(220px, 34vh);
}
.game-play--green .game-play-chat-area .game-chat-slot,
.game-play--purple .game-play-chat-area .game-chat-slot {
  display: block;
  height: 100%;
}
.game-chat-slot { margin-top: 0; }
.gc-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(220px, 34vh);
  margin-bottom: 8px;
  padding: 8px 10px;
  overflow: hidden;
}
.gc-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  flex-shrink: 0;
}
.gc-form {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  order: 1;
}
.gc-list {
  order: 2;
  flex: 1 1 auto;
  min-height: 64px;
  max-height: min(140px, 22vh);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
.gc-msg {
  font-size: 13px;
  line-height: 1.35;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}
.gc-msg--system {
  background: rgba(148, 163, 184, 0.12);
  border-left: 3px solid rgba(148, 163, 184, 0.55);
}
.gc-msg--system .gc-msg-author { color: #94a3b8; }
.gc-msg--result {
  background: rgba(251, 191, 36, 0.1);
  border-left: 3px solid rgba(251, 191, 36, 0.65);
}
.gc-msg--result .gc-msg-author { color: #fbbf24; }
.gc-msg--guess,
.gc-msg--correct {
  background: rgba(46, 204, 113, 0.14);
  border-left: 3px solid rgba(46, 204, 113, 0.75);
  position: relative;
}
.gc-msg--guess .gc-msg-author,
.gc-msg--correct .gc-msg-author { color: #6ee7b7; }
.gc-msg-badge {
  position: absolute;
  right: 8px;
  top: 6px;
  font-size: 12px;
  color: #34d399;
  font-weight: 700;
}
.gc-msg--ai {
  background: rgba(56, 189, 248, 0.1);
  border-left: 3px solid rgba(56, 189, 248, 0.6);
}
.gc-msg--ai .gc-msg-author { color: #38bdf8; }
.gc-msg--me { background: rgba(124, 92, 255, 0.12); }
.game-play--green .gc-msg--me { background: rgba(46, 204, 113, 0.12); }
.gc-msg-author {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
  color: #c4b5fd;
}
.game-play--green .gc-msg-author { color: #6ee7a8; }
.gc-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  font-size: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  font: inherit;
  color-scheme: dark;
}
.gc-input::placeholder {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  opacity: 1;
}
.gc-send {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  flex: 0 0 40px;
  border: 1px solid rgba(124, 92, 255, 0.45);
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  color: #efe9ff;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c5cff 0%, #9467ff 45%, #b06bff 100%);
  box-shadow: 0 6px 14px rgba(124, 92, 255, 0.28);
  cursor: pointer;
}
.gc-send.chat-send-btn {
  width: auto;
  min-width: 92px;
  flex: 0 0 auto;
  padding: 0 14px;
  font-size: 12px;
  box-shadow: 0 10px 20px rgba(124, 92, 255, 0.32);
}

.gc-send:hover {
  filter: brightness(1.06);
  border-color: rgba(176, 107, 255, 0.8);
}

.gc-send:active {
  transform: translateY(1px);
}

.gc-send:disabled,
.gc-send[disabled] {
  opacity: 0.5;
  filter: none;
  cursor: default;
  transform: none;
}

/* legacy croc chat slot (unused) */
.cr-chat-area {
  display: none;
}

/* --- Web login (Telegram Login Widget, browser access outside Telegram) --- */
#app.pre-auth .bottom-nav,
#app.pre-auth .topbar .chat-pill,
#app.pre-auth .topbar .topbar-actions,
#app.pre-auth .topbar .topbar-chat-btn,
#app.pre-auth .topbar .topbar-hub-btn,
#app.pre-auth #home-penalty-banner {
  display: none !important;
}
.login-card {
  margin-top: 18dvh;
  padding: 26px 20px;
  text-align: center;
}
.login-logo {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
}
.login-mark {
  width: 72px;
  height: 72px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 18px rgba(139, 116, 255, 0.45));
  animation: mark-float 4.5s ease-in-out infinite;
}
.login-mark-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(196, 181, 253, 0.35);
  box-shadow: 0 0 24px rgba(139, 116, 255, 0.25);
  animation: mark-ring 3.2s ease-in-out infinite;
}
@keyframes mark-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes mark-ring {
  0%, 100% { transform: scale(0.92); opacity: 0.45; }
  50% { transform: scale(1.05); opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
  .login-mark,
  .login-mark-ring { animation: none; }
}
.login-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.login-text {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.5;
}
.login-widget-wrap {
  display: flex;
  justify-content: center;
  min-height: 40px;
  margin-bottom: 14px;
}
.login-hint {
  margin: 0 0 8px;
}
.login-bot-btn {
  margin-top: 6px;
}
.login-link-status {
  margin: 10px 0 0;
  line-height: 1.45;
}
.login-footer {
  margin: 14px 0 0;
  font-size: 11px;
}
.mail-thread-load-older,
#mail-thread-load-older {
  margin-bottom: 6px;
}

/* —— Game chat (realtime) —— */

/* —— Social / Battle hubs —— */
.social-hint { margin: 0 0 10px; }
.social-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}
.social-card--empty { opacity: 0.85; }
.social-list { display: flex; flex-direction: column; gap: 8px; }
.social-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}
.social-row:last-child { border-bottom: 0; }
.social-row--me { color: #ffd28a; }
.social-howto {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}
.btl-stats { display: flex; flex-direction: column; gap: 8px; }
.btl-stat {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.btl-stat-ico { text-align: center; }
.btl-stat-label { color: rgba(255, 255, 255, 0.75); }
.game-icon--pvp { background: linear-gradient(135deg, rgba(255, 107, 122, 0.35), rgba(255, 159, 67, 0.18)); }
.pf-hubs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pf-hubs-row .btn { flex: 1 1 140px; }

.social-card--invite { border-color: rgba(255, 210, 138, 0.35); }
.stake-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.btl-field {
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.35;
  background: rgba(0,0,0,0.25);
  padding: 10px;
  border-radius: 10px;
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 10px;
}
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 280px;
  margin: 12px auto;
}
.ttt-board--5 {
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  max-width: 340px;
}
.ttt-board--5 .ttt-cell {
  font-size: 18px;
  border-radius: 10px;
}
.ttt-cell {
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.ttt-cell:disabled { opacity: 0.85; cursor: default; }
.ttt-cell:not(:disabled):hover { background: rgba(124, 92, 255, 0.2); }
.ttt-cell:not(:disabled):active { transform: scale(0.96); }
.ttt-size-caption { margin: 0 0 6px; }
.ttt-size-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.ttt-size-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ttt-size-btn.is-active {
  border-color: rgba(124, 92, 255, 0.55);
  background: rgba(124, 92, 255, 0.14);
}
.ttt-size-label { font-weight: 650; font-size: 15px; }
.ttt-size-hint { line-height: 1.2; }
.rp-actions { margin-top: 8px; }

/* —— Coffee-profile style hero (avatar as cover media) —— */
.hero-profile {
  position: relative;
  margin: -8px -12px 0;
  overflow: hidden;
  animation: heroReveal 1.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-profile--compact .hero-media { height: 240px; }
.hero-media {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  background: #0c0e16;
}
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.hero-photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 64px;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.85);
  background: var(--avatar-gradient, linear-gradient(135deg, var(--purple), var(--purple-2)));
  letter-spacing: -0.04em;
}
.hero-profile.has-hero-photo .hero-photo-fallback { opacity: 0; pointer-events: none; }
.hero-profile:not(.has-hero-photo) .hero-photo-fallback {
  color: transparent;
}
.hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 22%,
    rgba(5, 6, 10, 0.55) 58%,
    var(--bg) 100%
  );
  pointer-events: none;
  z-index: 1;
}
.home-avatar-float {
  position: absolute;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  z-index: 2;
  width: 84px;
  height: 84px;
  border-radius: 26px;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.hero-profile.has-hero-photo .home-avatar-float {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.92);
}
.hero-identity {
  position: relative;
  z-index: 2;
  margin-top: -88px;
  padding: 0 16px 4px;
  text-align: center;
  animation: fadeRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}
.hero-title-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 52px;
}
.hero-identity h1,
.hero-title-wrap h1,
.hero-title-wrap .name-row h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-name-row {
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
}
.hero-name-row h1 {
  flex: 0 1 auto;
}
.hero-sub {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.01em;
  color: rgba(244, 246, 251, 0.5);
}
.hero-sub--soft { margin-top: 2px; font-size: 12px; opacity: 0.85; }
.hero-pills {
  justify-content: center;
  margin-top: 12px;
}
.hero-identity .btn {
  margin-top: 10px;
}
.laurel {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 78px;
  opacity: 0.5;
  pointer-events: none;
  animation: fadeIn 0.8s ease-out 0.45s both;
}
.laurel--left {
  left: 0;
  transform: translateY(-52%);
}
.laurel--right {
  right: 0;
  transform: translateY(-52%);
}

.glass {
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28),
    0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px) saturate(1.25);
  -webkit-backdrop-filter: blur(10px) saturate(1.25);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.glass:active { transform: scale(0.97); }
.glass.pill {
  height: 48px;
  border-radius: 999px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 550;
}
.glass.circle {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 16px;
}
.home-mid-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 8px;
  align-items: stretch;
  margin: 10px 0 0;
  padding: 0 2px;
  animation: fadeRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}
.home-achievements {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  margin: 0;
  height: auto;
  min-height: 48px;
  border-radius: 16px;
  padding: 8px 10px;
  justify-content: flex-start;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
}
.home-achievements-ico { font-size: 14px; line-height: 1; display: grid; place-items: center; flex-shrink: 0; }
.home-achievements .home-svg {
  width: 15px;
  height: 15px;
}
.home-economy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  border-radius: 16px;
  padding: 7px 10px;
  cursor: pointer;
}
.home-economy-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}
.home-economy-ico {
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
}
.home-economy-row strong {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.home-economy-label {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.home-svg {
  width: 18px;
  height: 18px;
  display: block;
  color: var(--purple-2);
}
.stat-card-ico .home-svg {
  width: 22px;
  height: 22px;
  color: var(--text);
  opacity: 0.9;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 0 2px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  min-height: 112px;
  padding: 14px 8px 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: fadeRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.home-stats-grid .stat-card:nth-child(1) { animation-delay: 0.62s; }
.home-stats-grid .stat-card:nth-child(2) { animation-delay: 0.7s; }
.home-stats-grid .stat-card:nth-child(3) { animation-delay: 0.78s; }
.stat-card-ico {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}
.stat-card strong {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-card span {
  font-size: 11px;
  color: rgba(186, 170, 154, 0.72);
  line-height: 1.25;
  max-width: 9.5em;
}

.card--panel {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  margin-top: 10px;
  margin-bottom: 0;
}
.card--panel + .card--panel { margin-top: 10px; }
.card--panel .card-head h2 {
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: 13px;
  font-weight: 600;
  color: rgba(244, 246, 251, 0.72);
}
#screen-home .chart {
  height: 72px;
  margin-bottom: 2px;
}
#screen-home .chart .bar {
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, rgba(196, 181, 255, 0.95) 0%, rgba(124, 92, 255, 0.75) 100%);
  box-shadow: 0 6px 16px rgba(124, 92, 255, 0.22);
}

.seg-tabs--glass {
  margin: 12px 0 0;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  gap: 4px;
  overflow: hidden;
}
.seg-tabs--glass button {
  flex: 1 1 0;
  border: none;
  background: transparent;
  color: rgba(244, 246, 251, 0.55);
  box-shadow: none;
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 550;
}
.seg-tabs--glass button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 6px 16px rgba(0, 0, 0, 0.2);
}

.xp-block--glass {
  margin: 12px auto 0;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: left;
}
.xp-block--glass .xp-labels {
  color: rgba(244, 246, 251, 0.65);
}
.xp-block--glass .xp-bar {
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  overflow: hidden;
}

@keyframes heroReveal {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 0.5; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-profile,
  .hero-identity,
  .laurel,
  .home-mid-row,
  .home-achievements,
  .stat-card {
    animation: none !important;
  }
}

/* —— Group activity feed —— */
.home-activity-card { margin-top: 10px; }
.home-activity-empty { margin: 4px 0 0; }
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.activity-ico {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  font-size: 15px;
  color: var(--purple-2);
}
.activity-svg {
  width: 16px;
  height: 16px;
  display: block;
}
.activity-body { min-width: 0; flex: 1; }
.activity-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.activity-detail {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(244, 246, 251, 0.62);
  line-height: 1.35;
  word-break: break-word;
}
.activity-time {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(244, 246, 251, 0.4);
}
.activity-media {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.activity-media-arrow {
  color: rgba(244, 246, 251, 0.45);
  font-size: 14px;
}
.activity-thumb {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.activity-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.activity-thumb-ph {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(139, 116, 255, 0.25), rgba(86, 209, 255, 0.12));
}
.activity-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  background: rgba(5, 6, 10, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.activity-modal[hidden] { display: none !important; }
.activity-modal-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 14px;
  color: #fff;
  border: none;
  cursor: pointer;
}
.activity-modal-img {
  max-width: min(100%, 96vw);
  max-height: min(86vh, 720px);
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
.activity-modal-caption {
  margin: 0;
  font-size: 13px;
  color: rgba(244, 246, 251, 0.7);
}

.menu-media {
  margin: 0 0 10px;
  padding: 8px;
  border-radius: 14px;
  overflow: hidden;
  text-align: center;
}
.menu-media-img {
  display: block;
  max-width: 100%;
  max-height: min(52vh, 420px);
  margin: 0 auto;
  border-radius: 12px;
  object-fit: contain;
}
.menu-media-ph { margin: 12px 0; }

/* Battle / play chrome: align with home glass */
#screen-battle .card,
#screen-blitz-play .card,
#screen-game-play .card {
  backdrop-filter: blur(14px) saturate(1.12);
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
}

/* VIP gifts */
.pill-vip {
  color: #ffd98a;
  border-color: rgba(245, 196, 81, 0.45);
  background: linear-gradient(135deg, rgba(245, 196, 81, 0.28), rgba(124, 92, 255, 0.12));
  font-weight: 700;
  letter-spacing: 0.04em;
}
.pill-vip--off {
  background: rgba(120, 120, 130, 0.22);
  color: rgba(220, 220, 230, 0.75);
  border-color: rgba(140, 140, 150, 0.3);
  font-weight: 600;
  letter-spacing: 0;
}
.chat-gift-btn {
  flex: 0 0 auto;
  min-width: 44px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(245, 196, 81, 0.45);
  background: linear-gradient(135deg, rgba(245, 196, 81, 0.28), rgba(124, 92, 255, 0.16));
  color: #ffe7a8;
  font-size: 20px;
  line-height: 1;
  padding: 0 10px;
  cursor: pointer;
}
.chat-gift-btn--vip {
  box-shadow: 0 0 0 1px rgba(245, 196, 81, 0.25), 0 6px 16px rgba(245, 196, 81, 0.18);
}
.chat-feed-bubble--gift {
  min-width: min(78%, 280px);
}
.mail-gift-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 2px;
}
.mail-gift-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}
.mail-gift-emoji {
  font-size: 56px;
  line-height: 1;
}
.mail-gift-media {
  max-width: 140px;
  max-height: 140px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(245, 196, 81, 0.35);
}
.mail-gift-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mail-gift-title {
  font-size: 15px;
  color: #ffe7a8;
}
.mail-gift-who {
  font-size: 12px;
  color: rgba(230, 230, 245, 0.72);
}
.mail-gift-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.mail-gift-status--wait { color: #f0c36a; }
.mail-gift-status--ok { color: #7ddea0; }
.mail-gift-status--bad { color: #f0a0a0; }
.mail-gift-caption {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(245, 245, 255, 0.92);
  white-space: pre-wrap;
  word-break: break-word;
}
.owner-vip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.owner-set-row {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  align-items: center;
  width: 100%;
}
.owner-changelog-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.owner-changelog-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.owner-changelog-card-head .owner-cl-del {
  margin-left: auto;
}
.owner-changelog-card textarea.owner-cl-changes {
  min-height: 88px;
  resize: vertical;
  white-space: pre-wrap;
}
.owner-set-input {
  flex: 1;
  min-width: 0;
  width: auto;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.owner-meme-row,
.owner-rp-row,
.owner-bp-row {
  align-items: flex-start;
}
.owner-rp-add,
.owner-bp-add,
.owner-quiz-form {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.owner-quiz-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.owner-quiz-question {
  resize: vertical;
  min-height: 56px;
}
.owner-quiz-opts-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.owner-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.owner-quiz-opt-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.owner-quiz-opt-check {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted, #9aa3b5);
  cursor: pointer;
  user-select: none;
}
.owner-quiz-opt-check input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #4ade80;
  margin: 0;
}
.owner-quiz-opt-row.is-correct {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(74, 222, 128, 0.08);
}
.owner-quiz-opt-tools,
.owner-quiz-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.owner-quiz-row {
  align-items: flex-start;
}
.notif-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  align-items: stretch;
}
.notif-actions .btn-play {
  white-space: nowrap;
}
.gift-tabs {
  margin: 8px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}
.gift-pick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  cursor: pointer;
  text-align: center;
}
.gift-pick-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.gift-pick-card strong {
  font-size: 12px;
  line-height: 1.2;
}
.gift-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
}
.gift-thumb--sm {
  width: 40px;
  height: 40px;
}
.gift-emoji {
  font-size: 36px;
  line-height: 1;
}
.gift-price-hint {
  text-align: center;
  margin: 8px 0;
}
.gift-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
}
.gift-anon-lab {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted, #9aa3b5);
}
.gift-profile-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}
.gift-profile-head:empty {
  display: none;
  margin: 0;
}
.gift-wall {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.gift-wall-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.gift-wall-item:last-child {
  border-bottom: none;
}
.gift-wall-item--anon {
  align-items: center;
}
.gift-wall-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 28px;
}
.gift-wall-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
}
.gift-wall-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gift-wall-when {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted, #9aa3b5);
}
.gift-wall-msg {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  white-space: pre-wrap;
  word-break: break-word;
}
.owner-gift-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
}
.owner-gift-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.owner-gift-preview {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
}
.uprof-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.uprof-head .uprof-mail-btn,
.uprof-head #uprof-send-gift {
  flex: 0 0 auto;
}



/* Mail dialog actions + VIP gift modal */
.mail-thread-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}
.mail-thread-actions .is-active {
  color: #f0c14b;
}
.mail-thread-del {
  color: #ff8a8a;
}
.gift-pick-card--locked {
  opacity: 0.72;
  position: relative;
}
.gift-pick-card--locked::after {
  content: "VIP";
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(240, 193, 75, 0.22);
  color: #f5d98a;
  border: 1px solid rgba(240, 193, 75, 0.35);
}
.mat-sheet-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
.mat-sheet-modal[hidden] {
  display: none !important;
}
.mat-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 14, 0.72);
  backdrop-filter: blur(4px);
}
.mat-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 16px 20px;
  border-radius: 18px 18px 14px 14px;
  background: linear-gradient(165deg, rgba(36, 42, 64, 0.98), rgba(16, 18, 28, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
}
.mat-sheet h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
}
.mat-sheet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: var(--text-muted, #aaa);
  font-size: 18px;
  cursor: pointer;
}
.vip-gift-sheet {
  text-align: center;
  align-items: stretch;
}
.vip-gift-sheet-hero {
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 0 18px rgba(240, 193, 75, 0.45));
  animation: vip-gift-pulse 1.8s ease-in-out infinite;
}
@keyframes vip-gift-pulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.08); opacity: 1; }
}
.vip-gift-sheet #vip-gift-modal-buy {
  margin-top: 4px;
}
.owner-mail-restore-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
}
.owner-mail-restore-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pict-canvas-wrap {
  padding: 0.5rem;
  display: flex;
  justify-content: center;
}
#pict-canvas {
  width: 100%;
  max-width: 360px;
  height: auto;
  aspect-ratio: 1;
  background: #f7f4ef;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  touch-action: none;
}
.pict-word {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0.35rem 0;
}
.pict-open-lobby {
  margin: 0.5rem 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(46, 160, 67, 0.15);
  color: var(--text, #e8e6e3);
  font-weight: 600;
  font-size: 0.92rem;
}
.pict-guess {
  margin-top: 0.75rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.95rem;
  cursor: pointer;
}
.chip.active {
  background: rgba(88, 166, 255, 0.22);
  border-color: rgba(88, 166, 255, 0.55);
}

/* Бункер: превью картинок сообщений в панели создателя */
.bk-media-row {
  align-items: flex-start;
  gap: 0.65rem;
}
.bk-media-meta {
  flex: 1;
  min-width: 0;
}
.bk-media-actions {
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.bk-media-upload-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.bk-media-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}
.bk-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bk-media-thumb--empty {
  display: grid;
  place-items: center;
  cursor: default;
  opacity: 0.55;
  font-size: 1.2rem;
}
.bk-media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.bk-media-lightbox[hidden] {
  display: none !important;
}
.bk-media-lightbox__img {
  max-width: min(96vw, 720px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
}
.bk-media-lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
