/* =====================================================================
   DAMEO design system
   Tokens → base → layout → components → pages → board → motion
   ===================================================================== */
:root {
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 64px;
  --bottom-h: 64px;
  --gutter: 16px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

/* ---- LIGHT ---- */
:root,
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f2f5fb;
  --bg-2: #e8edf7;
  --surface: #ffffff;
  --surface-2: #f6f8fd;
  --border: #dbe2ef;
  --border-strong: #c4cee3;
  --text: #0e1830;
  --muted: #566383;
  --accent: #2459e6;
  --accent-hover: #1a46c4;
  --accent-soft: #e4ecff;
  --on-accent: #ffffff;
  --gold: #b98310;
  --gold-soft: #fbf1d6;
  --silver: #8793a8;
  --bronze: #a8693a;
  --ok: #12855a;
  --ok-soft: #dcf5ea;
  --danger: #d12f48;
  --danger-soft: #fde6ea;
  --warn: #a96a00;
  --warn-soft: #fff1d3;
  --shadow-sm: 0 1px 2px rgba(15, 30, 70, 0.06), 0 1px 1px rgba(15, 30, 70, 0.04);
  --shadow: 0 8px 28px rgba(15, 30, 70, 0.08), 0 2px 6px rgba(15, 30, 70, 0.05);
  --shadow-lg: 0 24px 60px rgba(15, 30, 70, 0.18);
  --sq-light: #e9effc;
  --sq-dark: #4f74c8;
  --board-edge: #243b78;
  --piece-w-1: #ffffff;
  --piece-w-2: #dfe7f6;
  --piece-w-3: #b9c6e0;
  --piece-w-ring: rgba(60, 85, 150, 0.35);
  --piece-b-1: #55638a;
  --piece-b-2: #1c2542;
  --piece-b-3: #0c1226;
  --piece-b-ring: rgba(150, 175, 240, 0.55);
  --ambient-1: rgba(36, 89, 230, 0.1);
  --ambient-2: rgba(185, 131, 16, 0.07);
}

/* ---- DARK ---- */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0a1020;
  --bg-2: #0e1730;
  --surface: #121b33;
  --surface-2: #18233f;
  --border: #243152;
  --border-strong: #324269;
  --text: #e7ecf9;
  --muted: #93a1c4;
  --accent: #4d8dff;
  --accent-hover: #6aa0ff;
  --accent-soft: #172a57;
  --on-accent: #06122e;
  --gold: #e8bb4d;
  --gold-soft: #35290c;
  --silver: #b4bfd6;
  --bronze: #d58d57;
  --ok: #3dd598;
  --ok-soft: #0f3326;
  --danger: #ff6b82;
  --danger-soft: #3b1420;
  --warn: #f2b54a;
  --warn-soft: #352707;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);
  --sq-light: #31426d;
  --sq-dark: #19284a;
  --board-edge: #070c1a;
  --piece-w-1: #ffffff;
  --piece-w-2: #e3eafa;
  --piece-w-3: #aebbd9;
  --piece-w-ring: rgba(90, 120, 200, 0.4);
  --piece-b-1: #4b5a84;
  --piece-b-2: #151c34;
  --piece-b-3: #080c1a;
  --piece-b-ring: rgba(140, 170, 250, 0.7);
  --ambient-1: rgba(77, 141, 255, 0.14);
  --ambient-2: rgba(232, 187, 77, 0.06);
}

/* smooth theme switch (class is only present while switching) */
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, fill 0.35s ease, stroke 0.35s ease, box-shadow 0.35s ease !important;
}

/* ---------------------------------------------------------------- base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll {
  overflow: hidden;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}
h2 {
  font-size: 1.15rem;
}
.h1 {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.05rem);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}
p {
  margin: 0 0 8px;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
}
input {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.8125rem;
}
.mt {
  margin-top: 16px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 14px;
  border-radius: 8px;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 10px;
}
.spin {
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* -------------------------------------------------------------- layout */
.app {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(900px 500px at 85% -5%, var(--ambient-1), transparent 60%), radial-gradient(700px 420px at -5% 30%, var(--ambient-2), transparent 60%);
}
.main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  outline: none;
}
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.page-narrow {
  max-width: 760px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head p {
  margin: 6px 0 0;
}
.page-enter {
  animation: pageIn 0.28s var(--ease);
}
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 20px var(--gutter) 28px;
  font-size: 0.8125rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid-2.wide-left {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}
.grid-2 > *,
.grid-3 > *,
.page > * {
  min-width: 0;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* -------------------------------------------------------------- header */
.header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  border-radius: 10px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  display: block;
  filter: drop-shadow(0 3px 6px rgba(36, 89, 230, 0.3));
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}
.logo-tag {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 3px;
}
.nav-desktop {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.925rem;
  color: var(--muted);
  transition: color 0.15s, background-color 0.15s;
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav-link.nav-active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}
.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}
.icon-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}
.icon-btn:active:not(:disabled) {
  transform: scale(0.94);
}
.icon-btn:disabled {
  opacity: 0.4;
}
.icon-btn-sm {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}
.icon-btn-text {
  width: auto;
  padding: 0 10px;
  grid-auto-flow: column;
  gap: 6px;
}
.icon-btn-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.theme-toggle {
  overflow: hidden;
}
.theme-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: rotate(-70deg) scale(0.5);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
.theme-icon.is-on {
  opacity: 1;
  transform: none;
}
.notif-count {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.user-btn {
  border: 0;
  background: none;
  padding: 2px;
  border-radius: 50%;
}

/* ------------------------------------------------------------ popover */
.popover {
  position: relative;
}
.popover-panel {
  position: absolute;
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  animation: pop 0.16s var(--ease);
}
.popover-right {
  right: 0;
}
.popover-left {
  left: 0;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}
.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.menu-user {
  padding: 0;
}
.menu-head {
  display: flex;
  flex-direction: column;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: none;
  border-radius: 9px;
  text-align: left;
  font-size: 0.925rem;
  justify-content: space-between;
}
.menu-user .menu-item {
  justify-content: flex-start;
}
.menu-item:hover {
  background: var(--surface-2);
}
.notif-panel {
  width: min(340px, calc(100vw - 32px));
  padding: 6px;
}
.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px 10px;
}
.notif-empty {
  padding: 10px 8px 14px;
  margin: 0;
}
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow: auto;
}
.notif-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 0.875rem;
}
.notif-list li.unread {
  background: var(--accent-soft);
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.875rem;
}
.link-btn:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.925rem;
  white-space: nowrap;
  transition: transform 0.12s var(--ease), background-color 0.15s, border-color 0.15s, box-shadow 0.2s, opacity 0.15s;
}
.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}
.btn:disabled {
  opacity: 0.5;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 38%, transparent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}
.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.85rem;
  border-radius: 10px;
}
.btn-lg {
  min-height: 52px;
  padding: 0 26px;
  font-size: 1rem;
  border-radius: 14px;
}
.btn-block {
  width: 100%;
}
.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.row-actions.center {
  justify-content: center;
}

/* --------------------------------------------------------- primitives */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.badge-demo {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}
.badge-free {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}
.badge-you {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  margin-left: 6px;
}
.badge-lg {
  padding: 6px 14px;
  font-size: 0.75rem;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  font-size: 0.875rem;
  margin: 12px 0;
}
.notice svg {
  flex: none;
  margin-top: 2px;
}
.page > .notice {
  margin: 0;
}
.notice-warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--warn);
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: middle;
}
.dot-on {
  background: var(--ok);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent);
  animation: ping 2.2s infinite;
}
.dot-off {
  background: var(--border-strong);
}
@keyframes ping {
  70% {
    box-shadow: 0 0 0 6px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
}
.chip-on {
  color: var(--ok);
}
.chip-level {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}
.level-master {
  color: var(--gold);
  background: var(--gold-soft);
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.delta-up {
  color: var(--ok);
}
.delta-down {
  color: var(--danger);
}
.delta-0 {
  color: var(--muted);
}
.result-chip {
  display: inline-grid;
  place-items: center;
  min-width: 78px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
}
.result-win {
  background: var(--ok-soft);
  color: var(--ok);
}
.result-loss {
  background: var(--danger-soft);
  color: var(--danger);
}
.result-draw {
  background: var(--surface-2);
  color: var(--muted);
}

/* lists / rows */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 12px;
  transition: background-color 0.15s;
}
a.row:hover,
.row-link:hover {
  background: var(--surface-2);
}
.row-static {
  cursor: default;
}
.row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  border-radius: 12px;
  padding: 2px;
}
.row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.row-title .badge {
  margin-left: 6px;
}
.row-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-sub {
  font-size: 0.78rem;
  color: var(--muted);
}
.row-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
}
.row-actions-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.live-icon {
  color: var(--danger);
  font-size: 1.1rem;
}
.online-now {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.foot {
  margin: 10px 0 0;
}
.rank-chip {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--surface-2);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.rank-1 {
  background: linear-gradient(135deg, #ffe08a, #e2a826);
  color: #4a3400;
}
.rank-2 {
  background: linear-gradient(135deg, #f1f4fa, #aab4c8);
  color: #2e3a52;
}
.rank-3 {
  background: linear-gradient(135deg, #f0c09a, #b9703c);
  color: #4a2509;
}

/* states */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
}
.state-icon {
  font-size: 1.8rem;
  opacity: 0.7;
}
.state-error {
  color: var(--danger);
}
.state-title {
  color: var(--text);
  font-weight: 600;
  font-family: var(--font-display);
}
.state-text {
  max-width: 420px;
}
.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.splash {
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  background: var(--bg);
}
.splash-mark {
  animation: breathe 1.6s ease-in-out infinite;
}
.splash-bar {
  width: 120px;
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.splash-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--accent);
  border-radius: 3px;
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(260%);
  }
}
@keyframes breathe {
  50% {
    transform: scale(1.06);
  }
}

/* toasts */
.toasts {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom));
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: toastIn 0.25s var(--ease);
  font-size: 0.9rem;
}
.toast-text {
  flex: 1;
}
.toast-icon {
  display: grid;
  font-size: 1.2rem;
}
.toast-success .toast-icon {
  color: var(--ok);
}
.toast-error {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}
.toast-error .toast-icon {
  color: var(--danger);
}
.toast-info .toast-icon {
  color: var(--accent);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 10, 25, 0.55);
  backdrop-filter: blur(4px);
  animation: fade 0.18s ease;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100svh - 32px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  animation: modalIn 0.24s var(--ease);
  outline: none;
}
.modal-wide {
  width: min(600px, 100%);
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.rules-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* forms */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.input,
.input-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  min-height: 44px;
  padding: 0 14px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.input-wrap input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  min-height: 42px;
  color: var(--text);
}
.input:focus,
.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  outline: none;
}
.input-code {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.25em;
  font-weight: 700;
}
.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
}
.fieldset {
  border: 0;
  padding: 0;
  margin: 18px 0;
}
.fieldset legend {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 8px;
  padding: 0;
}
.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  background: none;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.875rem;
}
.seg-on {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.radio-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.radio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s;
}
.radio-card:hover {
  border-color: var(--accent);
}
.radio-card input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.radio-card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.radio-card-on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  background: linear-gradient(135deg, hsl(var(--h) 80% 60%), hsl(calc(var(--h) + 40) 75% 42%));
  box-shadow: 0 0 0 1px var(--border-strong);
}
.swatch-on {
  box-shadow: 0 0 0 2px var(--accent);
}
.edit-preview {
  display: grid;
  place-items: center;
}
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 46px;
  height: 26px;
  flex: none;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease);
}
.switch:checked {
  background: var(--accent);
}
.switch:checked::after {
  transform: translateX(20px);
}

/* tabs / toolbar */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  align-self: flex-start;
  max-width: 100%;
  overflow-x: auto;
}
.tabs-sm {
  margin-bottom: 14px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  background: none;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.tab:hover {
  color: var(--text);
}
.tab-active {
  background: var(--accent);
  color: var(--on-accent);
}
.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.72rem;
  background: color-mix(in srgb, currentColor 16%, transparent);
}
.tab-count-alert {
  background: var(--danger);
  color: #fff;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  min-width: min(280px, 100%);
  flex: 0 1 320px;
}
.search-wide {
  flex: 1;
  width: 100%;
  min-width: 0;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--text);
}

/* ----------------------------------------------------------- avatar */
.avatar {
  --h: 212;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  background: linear-gradient(135deg, hsl(var(--h) 80% 60%), hsl(calc(var(--h) + 40) 75% 42%));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25), 0 3px 8px rgba(10, 20, 50, 0.25);
  overflow: visible;
}
.avatar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: shine 6s ease-in-out infinite;
}
@keyframes shine {
  0%,
  60% {
    background-position: 160% 0;
  }
  100% {
    background-position: -60% 0;
  }
}
.avatar-face {
  position: relative;
}
.avatar .dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 28%;
  height: 28%;
  min-width: 9px;
  min-height: 9px;
  border: 2px solid var(--surface);
  box-sizing: content-box;
}
.avatar-gold {
  box-shadow: 0 0 0 3px var(--gold), 0 0 24px color-mix(in srgb, var(--gold) 45%, transparent);
}
.avatar-silver {
  box-shadow: 0 0 0 3px var(--silver);
}
.avatar-bronze {
  box-shadow: 0 0 0 3px var(--bronze);
}

/* ================================================================ HOME */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 32px;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(2rem, 1.2rem + 3vw, 3.1rem);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 14px;
}
.lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 52ch;
  margin-bottom: 22px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.hero-stats {
  display: flex;
  gap: 26px;
  align-items: center;
  flex-wrap: wrap;
}
.hero-stats > div {
  display: flex;
  flex-direction: column;
}
.hero-stat-v {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}
.hero-stat-l {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hero-board {
  position: relative;
  display: grid;
  place-items: center;
  perspective: 900px;
}
.hero-glow {
  position: absolute;
  width: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 40%, transparent), transparent 65%);
  filter: blur(30px);
  opacity: 0.55;
}
.board-mini {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border-radius: 14px;
  overflow: hidden;
  border: 3px solid var(--board-edge);
  box-shadow: var(--shadow-lg);
  transform: rotateX(14deg) rotateZ(-5deg);
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty {
  50% {
    transform: rotateX(10deg) rotateZ(-3deg) translateY(-6px);
  }
}
.hero-mover {
  animation: heroMove 5.5s ease-in-out infinite;
}
@keyframes heroMove {
  0%,
  35% {
    transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%));
  }
  50%,
  85% {
    transform: translate(calc((var(--x) + 1) * 100%), calc((var(--y) - 1) * 100%));
  }
}
.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.mode-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s;
}
.mode-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.mode-card-accent {
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000));
  border-color: transparent;
  color: var(--on-accent);
}
.mode-card-accent .mode-desc {
  color: color-mix(in srgb, var(--on-accent) 82%, transparent);
}
.mode-card-accent .mode-icon {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}
.mode-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.3rem;
  flex: none;
}
.mode-title {
  font-family: var(--font-display);
  font-weight: 700;
}
.mode-desc {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ================================================================ PLAY */
.play-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.mode-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mode-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.mode-tab:hover {
  border-color: var(--accent);
}
.mode-tab-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.mode-tab-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.play-panel {
  min-height: 360px;
  min-width: 0;
}
/* a long name never widens a list row: the name shrinks with "…", the button keeps its size */
.row > .btn {
  flex: none;
}
.match-stage {
  display: grid;
  place-items: center;
  min-height: 260px;
}
.searching,
.found {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.search-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.radar {
  position: relative;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
}
.radar span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: radar 2.4s ease-out infinite;
}
.radar span:nth-child(2) {
  animation-delay: 0.8s;
}
.radar span:nth-child(3) {
  animation-delay: 1.6s;
}
@keyframes radar {
  from {
    transform: scale(0.35);
    opacity: 0.8;
  }
  to {
    transform: scale(1);
    opacity: 0;
  }
}
.vs {
  display: flex;
  align-items: center;
  gap: 20px;
}
.vs-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: pageIn 0.5s var(--ease) both;
}
.vs-badge {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--gold);
  font-size: 1.3rem;
}
.split-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.option-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}
.disabled-card {
  opacity: 0.65;
  border-style: dashed;
}
.room-code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px dashed var(--accent);
  color: var(--accent);
}

/* ============================================================ LEADERBOARD */
.updated {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 700;
  font-size: 0.75rem;
}
.live-pill-off {
  background: var(--surface-2);
  color: var(--muted);
}
.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.podium-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 10px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
  min-width: 0;
}
.podium-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.podium-1 {
  padding-top: 26px;
  padding-bottom: 22px;
  background: linear-gradient(180deg, var(--gold-soft), var(--surface) 70%);
  border-color: color-mix(in srgb, var(--gold) 50%, var(--border));
}
.podium-2 {
  background: linear-gradient(180deg, color-mix(in srgb, var(--silver) 14%, var(--surface)), var(--surface) 70%);
}
.podium-3 {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bronze) 14%, var(--surface)), var(--surface) 70%);
}
.podium-crown {
  height: 22px;
  color: var(--gold);
  font-size: 1.4rem;
  display: grid;
  place-items: center;
}
.podium-name {
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-rating {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}
.podium-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8rem;
}
.podium-1 .podium-rank {
  background: linear-gradient(135deg, #ffe08a, #e2a826);
  color: #4a3400;
}
.podium-2 .podium-rank {
  background: linear-gradient(135deg, #f1f4fa, #aab4c8);
  color: #2e3a52;
}
.podium-3 .podium-rank {
  background: linear-gradient(135deg, #f0c09a, #b9703c);
  color: #4a2509;
}
.lb-head,
.lb-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 110px 70px 70px 70px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}
.lb-head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: -10px;
}
.r {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: opacity 0.2s;
}
.lb-list.is-loading {
  opacity: 0.55;
}
.lb-row {
  min-height: 60px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s;
  animation: rowIn 0.3s var(--ease) both;
}
@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.lb-row:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}
.lb-me {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.lb-player {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.lb-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
/* level badge on the second line, so the name keeps its room */
.lb-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.lb-sub .level-badge { flex: none; }
.lb-rating {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.my-pos {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* ============================================================== PROFILE */
.profile-head {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
}
.profile-id {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.profile-rating {
  display: flex;
  gap: 26px;
}
.pr-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.pr-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pr-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 4px 0;
}
.profile-edit {
  align-self: flex-start;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.stat {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
}
.stat-win .stat-value {
  color: var(--ok);
}
.stat-loss .stat-value {
  color: var(--danger);
}
.stat-gold .stat-value {
  color: var(--gold);
}
.chart {
  margin: 0;
}
.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}
.chart-grid {
  stroke: var(--border);
  stroke-dasharray: 3 4;
}
.chart-label {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font-body);
}
.chart-area {
  fill: color-mix(in srgb, var(--accent) 14%, transparent);
}
.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart-dot {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}
.chart-dot-last {
  fill: var(--accent);
}
.how {
  margin-top: 10px;
}
.how summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.875rem;
}
.ach-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ach {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-areas: 'i n' 'i d' 'b b';
  column-gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  opacity: 0.8;
}
.ach-on {
  opacity: 1;
  border-color: color-mix(in srgb, var(--gold) 50%, var(--border));
  background: linear-gradient(135deg, var(--gold-soft), var(--surface));
}
.ach-icon {
  grid-area: i;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 1.2rem;
}
.ach-on .ach-icon {
  color: var(--gold);
  background: var(--gold-soft);
}
.ach-name {
  grid-area: n;
  font-weight: 700;
  font-size: 0.875rem;
}
.ach-desc {
  grid-area: d;
  font-size: 0.75rem;
  color: var(--muted);
}
.ach-bar {
  grid-area: b;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin-top: 8px;
  overflow: hidden;
}
.ach-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* ============================================================ TOURNAMENTS */
.tour-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.tour-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.tour-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.tour-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.tour-top h3 {
  font-size: 1.05rem;
}
.tour-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.875rem;
}
.tour-meta li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.meter {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff));
}
.tour-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.winner {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
}
.winner strong {
  color: var(--text);
}

/* ============================================================== SETTINGS */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.settings-section .h3 + .setting {
  border-top: 0;
}
.setting-col {
  flex-direction: column;
  align-items: flex-start;
}
.setting p {
  margin: 2px 0 0;
}
.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ================================================================== GAME */
.game-page {
  gap: 12px;
}
.back-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}
.game-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.board-wrap {
  width: min(100%, 640px, calc(100svh - 300px));
  min-width: min(100%, 300px);
}
.player-bar {
  width: min(100%, 640px, calc(100svh - 300px));
  min-width: min(100%, 300px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.player-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.player-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.player-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.mini-piece {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  vertical-align: -1px;
  border: 1px solid var(--piece-w-ring);
}
.mini-w {
  background: radial-gradient(circle at 35% 30%, var(--piece-w-1), var(--piece-w-3));
}
.mini-b {
  background: radial-gradient(circle at 35% 30%, var(--piece-b-1), var(--piece-b-3));
  border-color: var(--piece-b-ring);
}
.msg-line {
  min-height: 24px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  animation: fade 0.2s;
}
.msg-error {
  color: var(--danger);
  font-weight: 600;
}
.game-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.turn-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.turn-over {
  background: var(--surface-2);
  color: var(--muted);
}
.side-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.history {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 220px;
  min-height: 80px;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
.history li {
  display: grid;
  grid-template-columns: 30px 1fr 1fr;
  padding: 3px 6px;
  border-radius: 6px;
}
.history li:nth-child(even) {
  background: color-mix(in srgb, var(--border) 35%, transparent);
}
.hn {
  color: var(--muted);
}
.hm {
  font-weight: 600;
}
.history-empty {
  display: block !important;
}
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.controls .btn {
  padding: 0 10px;
  font-size: 0.85rem;
}

/* ------------------------------------------------------------- board */
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  aspect-ratio: 1;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 4px solid var(--board-edge);
  box-shadow: var(--shadow-lg);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.board-shake {
  animation: shake 0.32s ease;
}
@keyframes shake {
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}
.board-disabled .sq {
  cursor: default;
}
.sq {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  min-width: 0;
  min-height: 0;
}
.sq-light {
  background: var(--sq-light);
}
.sq-dark {
  background: var(--sq-dark);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 55%);
}
button.sq {
  cursor: pointer;
}
button.sq:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
  border-radius: 0;
  z-index: 3;
}
.sq-last::after {
  content: '';
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--hl, var(--gold)) 28%, transparent);
}
.sq-selected {
  box-shadow: inset 0 0 0 3px var(--hl, var(--gold));
  z-index: 1;
}
.sq-must {
  animation: mustPulse 1.6s ease-in-out infinite;
}
@keyframes mustPulse {
  50% {
    box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--hl, var(--gold)) 80%, transparent);
  }
}
.sq-hint {
  box-shadow: inset 0 0 0 3px var(--ok);
}
.mark {
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: color-mix(in srgb, var(--hl, var(--gold)) 85%, #fff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--hl, var(--gold)) 30%, transparent);
  animation: markIn 0.18s var(--ease);
  z-index: 2;
}
.mark-path {
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 30%, transparent);
}
@keyframes markIn {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
}
.pieces {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.piece {
  position: absolute;
  left: 0;
  top: 0;
  width: 12.5%;
  height: 12.5%;
  display: grid;
  place-items: center;
  transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%));
  transition: transform 0.3s var(--ease);
  will-change: transform;
}
.piece-disc {
  position: relative;
  display: grid;
  place-items: center;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28), 0 6px 10px rgba(0, 0, 0, 0.3), inset 0 0 0 2px var(--ring-c);
  transition: transform 0.2s var(--ease);
}
.piece-disc::after {
  content: '';
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--ring-c);
  opacity: 0.8;
}
.piece-w .piece-disc {
  --ring-c: var(--piece-w-ring);
  background: radial-gradient(circle at 34% 28%, var(--piece-w-1), var(--piece-w-2) 55%, var(--piece-w-3));
}
.piece-b .piece-disc {
  --ring-c: var(--piece-b-ring);
  background: radial-gradient(circle at 34% 28%, var(--piece-b-1), var(--piece-b-2) 55%, var(--piece-b-3));
}
.piece-selected .piece-disc {
  transform: translateY(-3px) scale(1.07);
}
.piece-crown {
  position: relative;
  z-index: 1;
  width: 46%;
  height: 46%;
  color: var(--gold);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}
.piece-w .piece-crown {
  color: #b27a00;
}
.coord {
  position: absolute;
  font-size: clamp(8px, 1.6vw, 11px);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
  color: color-mix(in srgb, var(--text) 55%, var(--sq-light));
  opacity: 0.8;
}
.coord-file {
  bottom: 3px;
  right: 4px;
}
.coord-rank {
  top: 3px;
  left: 4px;
}

/* ------------------------------------------------------------ result */
.result {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding-top: 4px;
}
.result-crown {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 2.4rem;
  margin-bottom: 6px;
}
.result-crown-win {
  background: var(--gold-soft);
  color: var(--gold);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 18%, transparent), 0 0 40px color-mix(in srgb, var(--gold) 35%, transparent);
  animation: crownPop 0.7s var(--ease);
}
@keyframes crownPop {
  0% {
    transform: scale(0.4) rotate(-12deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.12) rotate(4deg);
    opacity: 1;
  }
}
.rating-change {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 8px 0 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.rc-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.6rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.rc-delta {
  font-weight: 800;
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
  animation: fade 0.5s 0.6s both;
}
.confetti {
  position: absolute;
  inset: -20px -22px auto;
  height: 360px;
  overflow: hidden;
  pointer-events: none;
}
.confetti span {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti linear forwards;
}
@keyframes confetti {
  0% {
    opacity: 1;
    translate: 0 0;
  }
  100% {
    opacity: 0;
    translate: 40px 380px;
    rotate: 540deg;
  }
}

/* ============================================================ NAV (mobile) */
.bottom-nav {
  display: none;
}

/* ============================================================ RESPONSIVE */
@media (max-width: 1000px) {
  .nav-desktop {
    display: none;
  }
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
  }
  .bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    min-width: 0;
    position: relative;
    transition: color 0.15s;
  }
  .bn-item svg {
    font-size: 1.45rem;
  }
  .bn-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
  }
  .bn-active {
    color: var(--accent);
  }
  .bn-active::before {
    content: '';
    position: absolute;
    top: 0;
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--accent);
  }
  .main {
    padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  }
  .footer {
    padding-bottom: calc(var(--bottom-h) + 24px + env(safe-area-inset-bottom));
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 22px;
  }
  .hero-board {
    order: -1;
    max-height: 250px;
    overflow: visible;
  }
  .board-mini {
    width: min(70%, 250px);
  }
  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .play-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .mode-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .game-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .game-side {
    position: static;
  }
  .board-wrap,
  .player-bar {
    width: min(100%, 560px);
  }
  .profile-head {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .profile-rating {
    grid-column: 1 / -1;
  }
  .grid-2.wide-left {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-grid .stat:last-child {
    grid-column: 1 / -1;
  }
  .radio-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .split-actions {
    grid-template-columns: minmax(0, 1fr);
  }
  .mode-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .mode-tab {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }
  .mode-tab .mode-desc {
    display: none;
  }
  .hide-sm {
    display: none !important;
  }
  .lb-head,
  .lb-row {
    grid-template-columns: 34px minmax(0, 1fr) 84px 52px;
    padding: 0 10px;
  }
  .ach-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 480px) {
  .header-inner {
    gap: 8px;
  }
  .logo-word {
    font-size: 1.1rem;
  }
  .header-tools {
    gap: 2px;
  }
  .icon-btn {
    width: 38px;
  }
  .icon-btn-text {
    width: auto;
    padding: 0 8px;
  }
  .hero {
    padding: 16px;
    border-radius: 20px;
  }
  .hero-actions .btn {
    flex: 1;
    padding: 0 14px;
  }
  .card {
    padding: 16px;
  }
  .podium {
    gap: 8px;
  }
  .podium-card {
    padding-left: 6px;
    padding-right: 6px;
  }
  .podium-rating {
    font-size: 1.05rem;
  }
  .podium-card .avatar {
    width: 52px !important;
    height: 52px !important;
    font-size: 22px !important;
  }
  .podium-1 .avatar {
    width: 60px !important;
    height: 60px !important;
  }
  .podium-name {
    font-size: 0.8rem;
  }
  .vs {
    gap: 10px;
  }
  .controls {
    grid-template-columns: 1fr 1fr;
  }
  .modal {
    padding: 18px;
  }
  .tour-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .profile-head {
    gap: 14px;
  }
  .pr-value {
    font-size: 1.6rem;
  }
}

/* --------------------------------------------------------- accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .confetti {
    display: none;
  }
}

.notif-link {
  color: var(--accent);
  font-weight: 600;
}

/* =====================================================================
   LIQUID GLASS layer — translucent, refractive surfaces for the chrome
   (header, floating tab bar, tabs, segmented controls, mode cards,
   player bars, primary buttons, dialogs). Content cards stay solid
   so the board and text keep full contrast.
   ===================================================================== */
:root,
:root[data-theme='light'] {
  --glass-fill: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42));
  --glass-fill-strong: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.6));
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-edge-soft: rgba(30, 60, 140, 0.12);
  --glass-hi: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 10px 30px rgba(20, 40, 100, 0.14), 0 1px 2px rgba(20, 40, 100, 0.08);
  --glass-blur: blur(22px) saturate(185%);
  --blob-1: rgba(36, 89, 230, 0.22);
  --blob-2: rgba(124, 92, 255, 0.16);
  --blob-3: rgba(232, 170, 40, 0.14);
}
:root[data-theme='dark'] {
  --glass-fill: linear-gradient(135deg, rgba(120, 150, 255, 0.16), rgba(60, 80, 160, 0.06));
  --glass-fill-strong: linear-gradient(135deg, rgba(120, 150, 255, 0.22), rgba(40, 60, 130, 0.12));
  --glass-edge: rgba(170, 195, 255, 0.28);
  --glass-edge-soft: rgba(170, 195, 255, 0.1);
  --glass-hi: rgba(220, 230, 255, 0.35);
  --glass-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);
  --glass-blur: blur(24px) saturate(170%);
  --blob-1: rgba(77, 141, 255, 0.28);
  --blob-2: rgba(140, 100, 255, 0.2);
  --blob-3: rgba(232, 187, 77, 0.1);
}

/* living background that the glass refracts */
.ambient {
  background: radial-gradient(42vmax 42vmax at 88% -8%, var(--blob-1), transparent 62%),
    radial-gradient(38vmax 38vmax at -10% 38%, var(--blob-2), transparent 60%),
    radial-gradient(30vmax 30vmax at 70% 105%, var(--blob-3), transparent 60%);
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
  to {
    transform: translate3d(-2%, 2%, 0) scale(1.04);
  }
}

/* shared glass recipe */
.header,
.bottom-nav,
.tabs,
.seg,
.mode-card,
.mode-tab,
.player-bar,
.turn-pill,
.modal,
.toast,
.popover-panel,
.search,
.hero {
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-color: var(--glass-edge-soft);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-edge-soft), var(--glass-shadow);
}
.modal,
.popover-panel,
.toast {
  background: var(--glass-fill-strong);
}
.header {
  border-bottom: 1px solid var(--glass-edge-soft);
  box-shadow: inset 0 -1px 0 var(--glass-edge-soft), 0 6px 24px rgba(0, 0, 0, 0.08);
}

/* specular sheen that follows the top edge */
.mode-card,
.player-bar,
.hero,
.modal {
  position: relative;
  isolation: isolate;
}
.mode-card::before,
.player-bar::before,
.hero::before,
.modal::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(180deg, var(--glass-hi), transparent 38%);
  opacity: 0.35;
}

/* liquid primary buttons: gradient body, top highlight, soft glow */
.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff) 0%, var(--accent) 52%, color-mix(in srgb, var(--accent) 78%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 6px rgba(0, 0, 0, 0.18), 0 8px 22px color-mix(in srgb, var(--accent) 40%, transparent);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-hover) 80%, #fff) 0%, var(--accent-hover) 55%, color-mix(in srgb, var(--accent-hover) 78%, #000) 100%);
}
.btn-secondary,
.btn-ghost:hover:not(:disabled) {
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.mode-card-accent {
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 88%, #fff) 0%, var(--accent) 45%, color-mix(in srgb, var(--accent) 60%, #2a1a7a) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 14px 34px color-mix(in srgb, var(--accent) 35%, transparent);
}
.tab-active,
.seg-on {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent));
  color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* floating liquid tab bar on phones */
@media (max-width: 1000px) {
  .bottom-nav {
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom) + var(--tg-bottom, 0px));
    height: 68px;
    padding: 6px;
    border-radius: 24px;
    border: 1px solid var(--glass-edge-soft);
  }
  .bn-item {
    border-radius: 18px;
    transition: background-color 0.2s, color 0.2s, transform 0.2s var(--ease);
  }
  .bn-active {
    background: var(--glass-fill-strong);
    box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--glass-edge-soft);
  }
  .bn-active::before {
    display: none;
  }
  .bn-item:active {
    transform: scale(0.94);
  }
  .main {
    padding-bottom: calc(var(--bottom-h) + 28px + env(safe-area-inset-bottom) + var(--tg-bottom, 0px));
  }
}

/* board sits on a glass plinth */
.board {
  box-shadow: 0 0 0 1px var(--glass-edge-soft), 0 24px 60px rgba(0, 0, 0, 0.35);
}

/* ------------------------------------------------ Telegram Mini App */
html.in-telegram .header {
  padding-top: var(--tg-top, 0px);
}
html.in-telegram .header-inner {
  /* Telegram draws its own close / menu buttons in fullscreen; keep our controls clear of them */
  padding-left: max(var(--gutter), 12px);
  padding-right: max(var(--gutter), 12px);
}
html.in-telegram .footer {
  display: none;
}
html.in-telegram .skip-link {
  display: none;
}
html.in-telegram body {
  overscroll-behavior: none;
}

@media (prefers-reduced-motion: reduce) {
  .ambient {
    animation: none;
  }
}
.radio-cards.radio-cards-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 720px) {
  .radio-cards.radio-cards-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* photo avatars */
.avatar-photo {
  background: var(--surface-2);
}
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  position: relative;
}
.avatar-photo::before {
  z-index: 1;
}

/* level badges: blue → violet → pink → gold → emerald → ruby → diamond → legend (lt-1 … lt-8) */
.level-badge {
  --lb-a: #6f9bff;
  --lb-b: #2f5be0;
  --lb-edge: rgba(255, 255, 255, 0.55);
  --lb-ink: #fff;
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 2px 8px 2px 7px;
  border-radius: 999px;
  line-height: 1.15;
  white-space: nowrap;
  vertical-align: middle;
  color: var(--lb-ink);
  background: linear-gradient(160deg, var(--lb-a), var(--lb-b));
  box-shadow: inset 0 1px 0 var(--lb-edge), inset 0 -1px 0 rgba(0, 0, 0, 0.18), 0 1px 3px rgba(10, 20, 50, 0.25);
  overflow: hidden;
  isolation: isolate;
}
.level-badge .lb-lv {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}
.level-badge .lb-n {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}
.level-badge.lt-2 { --lb-a: #a487ff; --lb-b: #5b3fd6; }
.level-badge.lt-3 { --lb-a: #ff8db5; --lb-b: #c9367a; }
.level-badge.lt-4 { --lb-a: #fff0b0; --lb-b: #d99b14; --lb-ink: #3d2a00; --lb-edge: rgba(255, 255, 255, 0.9); }
.level-badge.lt-4 .lb-n { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55); }
.level-badge.lt-5 { --lb-a: #6ff0b4; --lb-b: #0f9a64; }
.level-badge.lt-6 { --lb-a: #ff6b7d; --lb-b: #b0122e; }
.level-badge.lt-7 { --lb-a: #e9fbff; --lb-b: #58b8e8; --lb-ink: #06324a; --lb-edge: #fff; }
.level-badge.lt-7 .lb-n { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }
.level-badge.lt-8 {
  --lb-ink: #fff7d6;
  background: linear-gradient(120deg, #2a0f4d, #6b1fb1 35%, #c2185b 65%, #2a0f4d);
  box-shadow: inset 0 0 0 1px #ffd34d, inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 8px rgba(255, 196, 60, 0.55);
}
.level-badge.lt-8 .lb-n { color: #ffd34d; text-shadow: 0 0 6px rgba(255, 211, 77, 0.75); }
/* a soft light sweep on the higher badges */
.level-badge.lt-4::after,
.level-badge.lt-5::after,
.level-badge.lt-6::after,
.level-badge.lt-7::after,
.level-badge.lt-8::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 62%);
  background-size: 260% 100%;
  animation: shine 5s ease-in-out 2; /* a couple of sweeps, then still (lists hold many badges) */
  pointer-events: none;
}
.row-title .level-badge,
.player-name .level-badge {
  margin-left: 6px;
}
.level-card {
  display: flex;
  align-items: center;
  gap: 14px;
}
.level-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
}
.level-bar {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.level-bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--gold)));
  transition: width 0.6s var(--ease);
}
.edit-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.edit-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.file-btn {
  position: relative;
  overflow: hidden;
}
.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.tg-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.tg-login svg.tg-logo {
  width: 64px;
  height: 64px;
}

/* ------------------------------------------------ lobby & challenges */
.lobby {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lobby-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.lobby-head h3 {
  font-size: 1rem;
}
.lobby-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.lobby-empty {
  padding: 8px 2px;
}
.lobby .notice {
  align-items: center;
}
.lobby .notice span {
  flex: 1;
}
.countdown {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}
.countdown svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.cd-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 3;
}
.cd-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 97.4;
  transition: stroke-dashoffset 0.9s linear;
}
.challenge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.challenge-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

/* ---------------------------------------------------------------- game clocks */
.clock {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  opacity: 0.75;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}
.clock-main {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.clock-move {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.8;
}
.clock-active {
  opacity: 1;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent, #fff);
}
.clock-warn {
  background: var(--danger, #d64545);
  border-color: var(--danger, #d64545);
  color: #fff;
  animation: clock-pulse 1s ease-in-out infinite;
  will-change: transform;   /* the pulse is composited, the text is not re-rendered every frame */
}
@keyframes clock-pulse {
  50% { transform: scale(1.05); }
}
html.calm .clock-warn { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .clock-warn { animation: none; }
}

/* ------------------------------------------------------- time control picker */
.tc-pick {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
  text-align: center;
}
.tc-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 360px);
}
.tc-option {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 14px 6px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.2s, box-shadow 0.2s;
}
.tc-option strong {
  font-size: 1.6rem;
  line-height: 1;
}
.tc-option span {
  font-size: 0.8rem;
  opacity: 0.75;
}
.tc-option:hover,
.tc-option:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.tc-option:active {
  transform: scale(0.96);
}
.tc-last {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
}
.tc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ------------------------------------------- header dropdowns (user / language / notifications)
   The panels sit inside .header, whose own backdrop-filter makes it the "backdrop root": a nested
   backdrop-filter cannot blur the page behind the header, so the 12–22 % glass fill let the page
   (titles, podium cards…) show straight through the menu. Give the glass an opaque base instead,
   keep it inside the screen, and let a long panel scroll rather than run under the tab bar. */
.popover-panel {
  background: var(--glass-fill-strong), var(--surface);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  max-width: calc(100vw - 2 * var(--gutter));
  max-height: calc(100dvh - var(--header-h) - var(--tg-top, 0px) - env(safe-area-inset-top, 0px) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* notifications panel on phones: the bell is not at the screen edge, so anchor the (wide) panel to the
   header's right edge instead of the bell, otherwise it ran 20–24 px off the left side at 360–390 px */
@media (max-width: 520px) {
  .popover-notif {
    position: static;
  }
  .popover-notif > .popover-panel {
    right: max(var(--gutter), 12px);
    top: calc(100% + 4px);
  }
}

/* ===================================================== DAMEO Weekly Tournament */
.wk {
  display: grid;
  gap: 16px;
  margin-bottom: 28px;
}
.wk-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 24px;
  color: #f4f6ff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(232, 187, 77, 0.28), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(77, 141, 255, 0.35), transparent 60%),
    linear-gradient(160deg, #0d1a3f 0%, #0a1230 55%, #070c22 100%);
  border: 1px solid rgba(232, 187, 77, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 48px rgba(4, 10, 35, 0.45);
}
.wk-hero::after {
  /* faint diagonal "arena" stripes */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 14px);
  pointer-events: none;
}
.wk-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.wk-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
  background: rgba(226, 60, 80, 0.22);
  border: 1px solid rgba(255, 110, 125, 0.5);
}
.wk-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d5e;
  box-shadow: 0 0 0 0 rgba(255, 77, 94, 0.6);
  animation: wk-pulse 1.6s infinite;
  display: inline-block;
}
@keyframes wk-pulse {
  70% { box-shadow: 0 0 0 8px rgba(255, 77, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 94, 0); }
}
.wk-season {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #e8bb4d;
  text-transform: uppercase;
}
.wk-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.wk-trophy {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  font-size: 1.8rem;
  color: #2a1a00;
  background: linear-gradient(160deg, #ffe08a, #e8bb4d 45%, #b98310);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 24px rgba(232, 187, 77, 0.35);
}
.wk-title {
  margin: 0;
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.05;
  color: #fff;
}
.wk-title span {
  background: linear-gradient(180deg, #ffe08a, #e8bb4d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wk-sub {
  margin: 4px 0 0;
  color: rgba(230, 236, 255, 0.72);
  font-size: 0.9rem;
}
.wk-countdown {
  display: grid;
  gap: 8px;
}
.wk-cd-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(230, 236, 255, 0.7);
}
.wk-cd-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.wk-cd-tile {
  display: grid;
  justify-items: center;
  padding: 10px 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.wk-cd-tile strong {
  font-size: clamp(1.4rem, 7vw, 2rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: #ffe08a;
}
.wk-cd-tile span {
  font-size: 0.7rem;
  color: rgba(230, 236, 255, 0.65);
}
.wk-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  color: rgba(230, 236, 255, 0.8);
}
.wk-meta li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wk-meta svg {
  color: #e8bb4d;
  flex: none;
}
.wk-join {
  color: #2a1a00;
  font-weight: 800;
  border: 0;
  background: linear-gradient(180deg, #ffe08a 0%, #e8bb4d 55%, #c9951c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -2px 6px rgba(0, 0, 0, 0.15), 0 10px 26px rgba(232, 187, 77, 0.35);
}
.wk-join:hover:not(:disabled) {
  filter: brightness(1.05);
}
.wk-me {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(232, 187, 77, 0.12);
  border: 1px solid rgba(232, 187, 77, 0.4);
}
.wk-me > div {
  display: grid;
  flex: 1;
  min-width: 0;
}
.wk-me .muted {
  color: rgba(230, 236, 255, 0.75);
}
.wk-me-check {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #2a1a00;
  background: #e8bb4d;
  flex: none;
}

/* prizes */
.wk-prizes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.wk-prize {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  padding: 12px 6px 10px;
  border-radius: 16px;
  text-align: center;
  background: var(--glass-fill-strong), var(--surface);
  border: 1px solid var(--border);
}
.wk-prize-1 {
  border-color: rgba(232, 187, 77, 0.7);
  box-shadow: 0 0 0 1px rgba(232, 187, 77, 0.25), 0 10px 28px rgba(232, 187, 77, 0.18);
}
.wk-prize-2 {
  border-color: rgba(200, 210, 230, 0.6);
}
.wk-prize-3 {
  border-color: rgba(205, 127, 50, 0.6);
}
.wk-prize-place {
  font-size: 0.72rem;
  font-weight: 900;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
}
.wk-prize-1 .wk-prize-place { background: linear-gradient(160deg, #ffe08a, #e8bb4d); color: #2a1a00; }
.wk-prize-2 .wk-prize-place { background: linear-gradient(160deg, #f1f4fa, #aeb8cc); color: #1b2235; }
.wk-prize-3 .wk-prize-place { background: linear-gradient(160deg, #f0b27a, #cd7f32); color: #2a1300; }
.wk-prize-icon {
  font-size: 1.5rem;
  line-height: 1.2;
}
.wk-prize-name {
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
}
@media (max-width: 520px) {
  .wk-prizes {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .wk-prize-1 { grid-column: span 6; grid-template-columns: auto auto 1fr; justify-items: start; align-items: center; gap: 10px; padding: 12px 14px; text-align: left; }
  .wk-prize-1 .wk-prize-name { font-size: 0.9rem; }
  .wk-prize-2 { grid-column: span 6; grid-template-columns: auto auto 1fr; justify-items: start; align-items: center; gap: 10px; padding: 10px 14px; text-align: left; }
  .wk-prize-2 .wk-prize-name { font-size: 0.85rem; }
  .wk-prize-3, .wk-prize-4, .wk-prize-5 { grid-column: span 2; }
}

/* rules */
.wk-rules summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.wk-rules summary::-webkit-details-marker { display: none; }
.wk-rules summary svg { color: var(--gold); }
.wk-rules ul {
  margin: 12px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* standings */
.wk-table-card {
  padding: 16px 12px;
  overflow: hidden;
}
.wk-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 4px 10px;
}
.wk-table-head h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wk-table-head h3 svg { color: var(--gold); }
.wk-updated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wk-updated .wk-dot { width: 6px; height: 6px; }
.wk-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
  font-size: 0.9rem;
}
.wk-table th {
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 0 6px 4px;
}
.wk-table td {
  padding: 8px 6px;
  background: var(--surface-2);
  vertical-align: middle;
}
.wk-table td:first-child { border-radius: 12px 0 0 12px; width: 36px; text-align: center; }
.wk-table td:last-child { border-radius: 0 12px 12px 0; }
.wk-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk-table th.num { text-align: right; }
.wk-row-prize td { background: color-mix(in srgb, var(--gold) 10%, var(--surface-2)); }
.wk-row-1 td { background: color-mix(in srgb, var(--gold) 20%, var(--surface-2)); }
.wk-row-me td { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.wk-row-me td:first-child { box-shadow: inset 1px 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.wk-row-me td:last-child { box-shadow: inset -1px 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.wk-rank-badge {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 4px;
  border-radius: 9px;
  font-weight: 900;
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
}
.wk-rank-1 { background: linear-gradient(160deg, #ffe08a, #e8bb4d); color: #2a1a00; border: 0; }
.wk-rank-2 { background: linear-gradient(160deg, #f1f4fa, #aeb8cc); color: #1b2235; border: 0; }
.wk-rank-3 { background: linear-gradient(160deg, #f0b27a, #cd7f32); color: #2a1300; border: 0; }
.wk-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.wk-player-name {
  display: grid;
  min-width: 0;
  font-weight: 700;
}
.wk-player-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34vw;
}
.wk-player-sub {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
}
.wk-points {
  font-weight: 900;
}
.wk-wld {
  color: var(--muted);
  font-size: 0.82rem;
}
.wk-empty {
  text-align: center;
  padding: 18px 0;
}
.wk-foot {
  margin: 10px 4px 0;
}
@media (max-width: 480px) {
  .wk-hide-sm { display: none; }
  .wk-table { font-size: 0.85rem; }
  .wk-table td { padding: 7px 4px; }
}

/* last week + results */
.wk-prev {
  display: grid;
  gap: 12px;
}
.wk-winners {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.wk-winner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface-2);
}
.wk-winner-1 { background: color-mix(in srgb, var(--gold) 18%, var(--surface-2)); }
.wk-winner-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wk-winner-prize { font-size: 1.15rem; }
.wk-results {
  position: relative;
  display: grid;
  gap: 14px;
  text-align: center;
}
.wk-results-name {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.wk-congrats {
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  font-weight: 800;
  color: var(--gold);
  background: var(--gold-soft);
}
.wk-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 210px;
}
.wk-pod {
  display: grid;
  justify-items: center;
  gap: 4px;
  animation: wk-rise 0.7s var(--ease) both;
}
.wk-pod-crown {
  color: var(--gold);
  font-size: 1.6rem;
  animation: wk-bob 2s ease-in-out infinite;
}
.wk-pod-name {
  font-weight: 800;
  font-size: 0.85rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wk-pod-step {
  width: 100%;
  display: grid;
  place-items: center;
  border-radius: 12px 12px 4px 4px;
  font-weight: 900;
  font-size: 1.3rem;
  margin-top: 4px;
}
.wk-pod-1 .wk-pod-step { height: 86px; background: linear-gradient(180deg, #ffe08a, #e8bb4d 60%, #b98310); color: #2a1a00; }
.wk-pod-2 .wk-pod-step { height: 62px; background: linear-gradient(180deg, #f1f4fa, #aeb8cc); color: #1b2235; }
.wk-pod-3 .wk-pod-step { height: 46px; background: linear-gradient(180deg, #f0b27a, #cd7f32); color: #2a1300; }
@keyframes wk-rise {
  from { opacity: 0; transform: translateY(40px) scale(0.9); }
}
@keyframes wk-bob {
  50% { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .wk-dot, .wk-pod, .wk-pod-crown { animation: none; }
}


/* ===================================================== skins (rendered from shop styles, see services/skins.ts) */
.piece-disc {
  --pa-pulse: sk-pulse 1.8s ease-in-out infinite;
  --pa-hue: sk-hue 5s linear infinite;
  --pa-glitch: sk-jitter 2.6s steps(1) infinite;
  --pa-shimmer: none;
  --pa-sparkle: none;
  overflow: visible;
}
.piece-disc::before {
  content: none;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(9px, 2.6vw, 18px);
  line-height: 1;
  opacity: 0.85;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
  pointer-events: none;
}
.piece-king .piece-disc::before {
  opacity: 0;
}
.pfx {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  display: none;
}
[class*='sk-p-'] .pfx {
  display: block;
}
@keyframes sk-shine {
  from { background-position: 150% 0; }
  to { background-position: -150% 0; }
}
@keyframes sk-twinkle {
  50% { opacity: 0.25; transform: rotate(25deg) scale(0.95); }
}
@keyframes sk-glitch {
  0%, 100% { transform: none; opacity: 0; }
  12% { transform: translateX(-2px); opacity: 1; }
  14% { transform: translateX(2px); opacity: 0.8; }
  16% { opacity: 0; }
  62% { transform: translateY(1px); opacity: 1; }
  64% { opacity: 0; }
}
@keyframes sk-pulse {
  50% { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28), 0 6px 10px rgba(0, 0, 0, 0.3), inset 0 0 0 2px var(--ring-c), 0 0 18px var(--glow, rgba(255, 255, 255, 0.6)); }
}
@keyframes sk-hue {
  to { filter: hue-rotate(360deg); }
}
@keyframes sk-jitter {
  0%, 100% { translate: 0 0; }
  20% { translate: -1px 0; }
  22% { translate: 1px 0; }
  24% { translate: 0 0; }
  70% { translate: 0 1px; }
  72% { translate: 0 0; }
}

/* move effects (equipped "animation" item): a short burst on the landing square */
.fx-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  --fx-c: #ffd54f;
}
.fx-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
[class*='fxs-'] .fx-burst {
  --fx-c: inherit;
}
.fx-ripple .fx-burst::before,
.fx-ripple .fx-burst::after {
  content: '';
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  border: 2px solid var(--fx-c);
  animation: fx-ripple 0.8s ease-out forwards;
}
.fx-ripple .fx-burst::after { animation-delay: 0.15s; }
@keyframes fx-ripple {
  from { transform: scale(0.4); opacity: 1; }
  to { transform: scale(1.9); opacity: 0; }
}
.fx-sparkle .fx-burst {
  background:
    radial-gradient(circle at 50% 10%, var(--fx-c) 0 4%, transparent 5%),
    radial-gradient(circle at 88% 40%, var(--fx-c) 0 4%, transparent 5%),
    radial-gradient(circle at 75% 88%, var(--fx-c) 0 3%, transparent 4%),
    radial-gradient(circle at 15% 80%, var(--fx-c) 0 4%, transparent 5%),
    radial-gradient(circle at 10% 30%, var(--fx-c) 0 3%, transparent 4%);
  animation: fx-pop 0.75s ease-out forwards;
}
@keyframes fx-pop {
  from { transform: scale(0.3); opacity: 1; }
  70% { opacity: 1; }
  to { transform: scale(1.6); opacity: 0; }
}
.fx-fire .fx-burst {
  background:
    radial-gradient(ellipse 45% 70% at 50% 100%, var(--fx-c), transparent 70%),
    radial-gradient(ellipse 30% 55% at 30% 100%, #ffd54f, transparent 70%),
    radial-gradient(ellipse 30% 55% at 72% 100%, #ff3d00, transparent 70%);
  transform-origin: 50% 100%;
  animation: fx-flame 0.9s ease-out forwards;
}
@keyframes fx-flame {
  from { transform: scaleY(0.2); opacity: 1; }
  50% { transform: scaleY(1.25); opacity: 0.95; }
  to { transform: scaleY(1.5) translateY(-15%); opacity: 0; }
}
.fx-lightning .fx-burst {
  background: linear-gradient(135deg, transparent 42%, #fff 45%, var(--fx-c) 48%, transparent 52%), radial-gradient(circle, color-mix(in srgb, var(--fx-c) 60%, transparent), transparent 70%);
  animation: fx-zap 0.55s steps(2) forwards;
}
@keyframes fx-zap {
  0% { opacity: 1; transform: translate(-2px, 1px); }
  30% { opacity: 0.4; transform: translate(2px, -1px); }
  60% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}
.fx-stardust .fx-burst {
  background: repeating-conic-gradient(from 0deg, var(--fx-c) 0deg 4deg, transparent 4deg 30deg);
  border-radius: 50%;
  -webkit-mask: radial-gradient(circle, transparent 18%, #000 20% 46%, transparent 50%);
  mask: radial-gradient(circle, transparent 18%, #000 20% 46%, transparent 50%);
  animation: fx-swirl 1s ease-out forwards;
}
@keyframes fx-swirl {
  from { transform: rotate(0) scale(0.5); opacity: 1; }
  to { transform: rotate(160deg) scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .piece-disc,
  .pfx,
  .fx-burst,
  .fx-burst::before,
  .fx-burst::after {
    animation: none !important;
  }
}

/* ===================================================== DAMEO Coins, Shop, Inventory, Wallet */
.coin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 22%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--border));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.coin-badge strong {
  font-weight: 800;
  font-size: 0.9rem;
}
.coin-ico {
  font-size: 0.95rem;
  line-height: 1;
}
.coin-badge-header {
  padding: 4px 9px;
}
.coin-badge-header strong {
  font-size: 0.8rem;
}
@media (max-width: 380px) {
  .coin-badge-header .coin-ico { display: none; }
}
.coin-badge-xl {
  padding: 10px 18px;
  font-size: 1.6rem;
}
.coin-badge-xl strong {
  font-size: 1.8rem;
}
.h1 svg,
.h2 svg {
  vertical-align: -3px;
  color: var(--gold);
}
.chip-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.chip-tabs::-webkit-scrollbar { display: none; }
.chip-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip-tab-on {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent));
  border-color: var(--accent);
  color: var(--on-accent);
}
.chip-tab-off { opacity: 0.55; }
.chip-tabs-sm .chip-tab { padding: 6px 11px; font-size: 0.8rem; }
.shop-wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.shop-group { margin-bottom: 18px; }
.shop-group-title {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 6px 2px 10px;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
@media (max-width: 400px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
.shop-card {
  position: relative;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--glass-fill-strong, var(--surface)), var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  transition: transform 0.15s, border-color 0.2s;
}
.shop-card:active { transform: scale(0.98); }
.shop-card-on { box-shadow: 0 0 0 2px var(--accent); }
.shop-card-name {
  font-weight: 800;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-card-meta, .shop-card-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shop-sale {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: var(--danger);
}
.price { font-weight: 800; font-variant-numeric: tabular-nums; }
.price s { font-weight: 500; margin-right: 4px; font-size: 0.8em; }
.price-free { color: var(--ok, #2fbf71); }
.owned { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.owned-on { color: var(--accent); }
.rarity {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.rarity-common { background: color-mix(in srgb, #8a94a8 22%, transparent); color: #a9b3c6; }
.rarity-rare { background: color-mix(in srgb, #3d8bff 22%, transparent); color: #5aa0ff; }
.rarity-epic { background: color-mix(in srgb, #a259ff 24%, transparent); color: #b882ff; }
.rarity-legendary { background: color-mix(in srgb, #e8bb4d 26%, transparent); color: #e8bb4d; }
.rarity-mythic { background: linear-gradient(90deg, rgba(255, 70, 120, 0.3), rgba(160, 80, 255, 0.3)); color: #ff6f9c; }
.rarity-edge-rare { border-color: color-mix(in srgb, #3d8bff 45%, var(--border)); }
.rarity-edge-epic { border-color: color-mix(in srgb, #a259ff 50%, var(--border)); }
.rarity-edge-legendary { border-color: color-mix(in srgb, #e8bb4d 60%, var(--border)); box-shadow: 0 6px 20px rgba(232, 187, 77, 0.12); }
.rarity-edge-mythic { border-color: color-mix(in srgb, #ff4f8b 60%, var(--border)); box-shadow: 0 6px 22px rgba(255, 79, 139, 0.16); }
.mini-skin { width: 100%; min-width: 0; }
.mini-skin .board { border-width: 3px; border-radius: 10px; }
.mini-board4 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
}
.mini-board4 .piece { width: 25%; height: 25%; }
.full-preview { width: 100%; max-width: 420px; margin: 0 auto; }
.full-preview .board-wrap { width: 100%; }
.item-detail { display: grid; gap: 14px; }
@media (min-width: 720px) {
  .item-detail { grid-template-columns: 1.2fr 1fr; align-items: start; }
}
.item-info { display: grid; gap: 10px; }
.item-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.item-short, .item-confirm { display: grid; gap: 8px; }
.inv-view { padding: 0; border: 0; background: none; cursor: pointer; }

.wallet-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px 16px;
  margin-bottom: 18px;
  border-radius: 22px;
  color: #f4f6ff;
  background: radial-gradient(120% 90% at 100% 0%, rgba(232, 187, 77, 0.3), transparent 55%), linear-gradient(160deg, #0d1a3f, #070c22);
  border: 1px solid rgba(232, 187, 77, 0.35);
}
.wallet-hero-label { display: inline-flex; gap: 6px; align-items: center; color: rgba(230, 236, 255, 0.75); font-weight: 700; }
.wallet-hero .muted { color: rgba(230, 236, 255, 0.6); }
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 10px 0;
}
@media (max-width: 400px) { .pkg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pkg {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 16px 8px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.pkg:disabled { opacity: 0.6; cursor: default; }
.pkg-best { border-color: color-mix(in srgb, var(--gold) 60%, var(--border)); }
.pkg-coins { font-size: 1.1rem; font-weight: 900; }
.pkg-bonus { font-size: 0.75rem; color: var(--ok, #2fbf71); font-weight: 800; }
.pkg-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 800;
  color: #2a1a00;
  background: linear-gradient(180deg, #ffe08a, #e8bb4d);
}
.ledger { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ledger li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
}
.ledger-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; }
.ledger-ico.in { color: var(--ok, #2fbf71); background: color-mix(in srgb, var(--ok, #2fbf71) 15%, transparent); }
.ledger-ico.out { color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, transparent); }
.ledger-main { display: grid; flex: 1; min-width: 0; }
.ledger-main .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-amt { font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===================================================== admin panel */
.admin-section { display: grid; gap: 12px; }
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (max-width: 400px) { .admin-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.admin-tile { display: grid; gap: 4px; padding: 14px; }
.admin-tile strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.admin-row-static { cursor: default; flex-wrap: wrap; }
.admin-row-main { display: grid; flex: 1; min-width: 0; gap: 2px; }
.admin-row-main strong { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-report .admin-row-main > span:nth-child(2) { white-space: pre-wrap; word-break: break-word; }
.badge-danger { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.pay-status { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.pay-paid { color: var(--ok, #2fbf71); }
.pay-refunded, .pay-rejected { color: var(--danger); }
.pay-pending { color: var(--warn); }
.admin-detail { display: grid; gap: 12px; }
.admin-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 0.9rem; }
.admin-kv > span { color: var(--muted); }
.admin-actions { flex-wrap: wrap; }
.admin-more summary { cursor: pointer; font-weight: 700; margin-bottom: 6px; }
.admin-form { display: grid; gap: 10px; }
.admin-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.admin-grid3 { display: grid; grid-template-columns: 56px 1fr 1fr; gap: 6px; }
@media (max-width: 480px) { .admin-grid2 { grid-template-columns: minmax(0, 1fr); } }
.admin-checks { display: flex; gap: 12px; flex-wrap: wrap; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 0.9rem; }
.field { display: grid; gap: 4px; font-size: 0.85rem; }
.field > span { color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; }
.admin-preview { width: 140px; }
.admin-shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
@media (max-width: 400px) { .admin-shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.admin-shop-card.is-hidden { opacity: 0.55; }
.admin-flags { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-weekly { display: grid; gap: 8px; }
.is-disabled { opacity: 0.5; pointer-events: none; }

/* ===================================================== chat (game + live) */
.chat-fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bottom-h, 64px) + 26px + env(safe-area-inset-bottom) + var(--tg-bottom, 0px));
  z-index: 60;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  color: var(--on-accent);
  font-size: 1.35rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 40%, transparent);
  cursor: pointer;
}
.chat-fab .notif-count { top: -2px; right: -2px; }
@media (min-width: 1001px) {
  .chat-fab { bottom: 24px; }
}
.chat-sheet {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(var(--bottom-h, 64px) + 20px + env(safe-area-inset-bottom) + var(--tg-bottom, 0px));
  z-index: 61;
  display: flex;
  flex-direction: column;
  max-height: min(52svh, 460px);
  border-radius: 20px;
  border: 1px solid var(--glass-edge-soft, var(--border));
  background: var(--glass-fill-strong), var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  animation: modalIn 0.2s var(--ease);
  overflow: hidden;
}
@media (min-width: 1001px) {
  .chat-sheet { left: auto; right: 24px; bottom: 24px; width: 360px; max-height: 70vh; }
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--border);
}
.chat-head strong { flex: 1; }
.chat-tools { display: inline-flex; gap: 2px; }
.chat-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 90px;
}
.chat-empty { text-align: center; margin: 8px; }
.chat-msg {
  align-self: flex-start;
  max-width: 82%;
  display: grid;
  gap: 2px;
  padding: 7px 10px;
  border-radius: 14px 14px 14px 4px;
  background: var(--surface-2);
  word-break: break-word;
}
.chat-mine {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: color-mix(in srgb, var(--accent) 30%, var(--surface-2));
}
.chat-name { font-size: 0.72rem; font-weight: 800; color: var(--accent); }
.chat-emoji { background: none; padding: 0 4px; }
.chat-emoji .chat-body { font-size: 1.8rem; line-height: 1.1; }
.chat-system { align-self: center; font-size: 0.8rem; color: var(--muted); }
.chat-emotes { display: flex; gap: 4px; padding: 6px 10px 0; overflow-x: auto; scrollbar-width: none; }
.chat-emote {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 1.2rem;
  cursor: pointer;
}
.chat-emote:active { transform: scale(0.92); }
.chat-input { display: flex; gap: 6px; padding: 8px 10px 10px; }
.chat-input input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.offer-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.offer-incoming { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.offer-incoming .row-actions { margin-left: auto; }

/* ===================================================== main menu sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  justify-content: flex-end;
  background: rgba(5, 10, 25, 0.55);
  backdrop-filter: blur(3px);
  animation: fade 0.18s ease;
}
.sheet {
  width: min(380px, 92vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--tg-top, 0px));
  background: linear-gradient(180deg, #0d1a3f, #070c22);
  color: #eef2ff;
  border-left: 1px solid rgba(232, 187, 77, 0.25);
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.45);
  animation: sheetIn 0.22s var(--ease);
}
:root[data-theme='light'] .sheet,
html.light .sheet {
  background: var(--surface);
  color: var(--text);
}
@keyframes sheetIn {
  from { transform: translateX(40px); opacity: 0; }
}
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 16px; }
.sheet-me { display: flex; align-items: center; gap: 10px; flex: 1; color: inherit; text-decoration: none; min-width: 0; }
.sheet-me > span { display: grid; min-width: 0; }
.sheet-me strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-quick { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 0 16px 10px; flex-wrap: wrap; }
.sheet-quick .seg { display: inline-flex; align-items: center; gap: 4px; }
.sheet-quick-ico { opacity: 0.7; margin-right: 2px; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px calc(20px + env(safe-area-inset-bottom)); }
.sheet-group {
  margin: 14px 8px 6px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8bb4d;
}
.menu-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 10px;
  border-radius: 12px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.menu-row:hover, .menu-row:focus-visible { background: rgba(255, 255, 255, 0.06); }
.menu-row-ico { font-size: 1.15rem; color: #8fb3ff; flex: none; }
.menu-row > .menu-row-ico { flex: none; }
.menu-row-extra { font-size: 0.8rem; font-weight: 800; color: #e8bb4d; }
.menu-row-go { opacity: 0.4; }

/* ===================================================== live / watch / archive / info */
.live-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; font-weight: 700; }
.live-stats span { display: inline-flex; align-items: center; gap: 6px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.live-card { display: grid; gap: 8px; padding: 12px; color: inherit; text-decoration: none; }
.pos-board .board-wrap { width: 100%; min-width: 0; }
.pos-board .coord { display: none; }
.live-players { display: grid; gap: 4px; }
.live-p { display: flex; align-items: center; gap: 6px; min-width: 0; }
.live-p strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.live-meta span { display: inline-flex; align-items: center; gap: 4px; }
.watch-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.watch-steps { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 8px; }
.watch-result { text-align: center; font-weight: 800; color: var(--gold); margin: 8px 0 0; }
.res-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.res-win { background: var(--ok, #2fbf71); }
.res-loss { background: var(--danger); }
.res-draw { background: var(--muted); }
.faq { display: grid; gap: 8px; margin-bottom: 14px; }
.faq-item summary { cursor: pointer; font-weight: 700; }
.faq-item p { margin: 8px 0 0; }
.about ul { padding-left: 18px; display: grid; gap: 4px; }
.setting-col { display: grid; gap: 8px; }
.setting-col input[type='range'] { width: 100%; accent-color: var(--accent); }
.setting-link { text-decoration: none; color: inherit; }

/* tournaments shown as the third tab of the rating page */
.tour-embedded {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===================================================== avatar frames (not sold) */
.avatar-framed {
  box-shadow: 0 3px 10px rgba(10, 20, 50, 0.35);
}
.av-frame {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  pointer-events: none;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
}
.av-frame-dameo {
  background: conic-gradient(from 200deg, #2c5be0, #8fb3ff, #e8bb4d 30%, #5b8cff 45%, #2c5be0 60%, #8fb3ff 80%, #2c5be0);
  filter: drop-shadow(0 0 4px rgba(91, 140, 255, 0.65));
}
.av-frame-champion {
  inset: -6px;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5.5px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5.5px), #000 calc(100% - 5px));
  background:
    radial-gradient(farthest-side, transparent calc(100% - 3.4px), rgba(255, 250, 225, 0.95) calc(100% - 3px), transparent calc(100% - 2.2px)),
    conic-gradient(from 0deg, #fff6cf, #ffd34d 10%, #a8730c 22%, #ffe9a0 33%, #e8bb4d 45%, #7a4a00 55%, #ffd34d 66%, #fff6cf 75%, #c99212 88%, #fff6cf);
  filter: drop-shadow(0 0 5px rgba(255, 200, 60, 0.85)) drop-shadow(0 0 12px rgba(255, 170, 30, 0.45));
  animation: spin 7s linear infinite;
}
/* outer glow halo that breathes */
.avatar-framed:has(.av-frame-champion)::after {
  content: '';
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  background: radial-gradient(closest-side, transparent 72%, rgba(255, 205, 70, 0.35) 84%, transparent 100%);
  animation: champ-breathe 2.8s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}
@keyframes champ-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.97); }
  50% { opacity: 1; transform: scale(1.04); }
}
.av-crown {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% -70%;
  rotate: -9deg;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 4px rgba(255, 210, 80, 0.6));
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}
/* twinkling sparkles around the champion (large avatars only) */
.av-champ-fx {
  position: absolute;
  inset: -12px;
  pointer-events: none;
  z-index: 3;
}
.av-champ-fx i {
  position: absolute;
  width: 9px;
  height: 9px;
  background: #fff6cf;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 0 3px #ffd34d);
  opacity: 0;
  animation: champ-twinkle 3.2s ease-in-out infinite;
}
.av-champ-fx i:nth-child(1) { top: 14%; right: 2%; }
.av-champ-fx i:nth-child(2) { bottom: 8%; left: 4%; width: 7px; height: 7px; animation-delay: 0.8s; }
.av-champ-fx i:nth-child(3) { top: 46%; left: -2%; width: 6px; height: 6px; animation-delay: 1.6s; }
.av-champ-fx i:nth-child(4) { bottom: 4%; right: 12%; width: 8px; height: 8px; animation-delay: 2.4s; }
@keyframes champ-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  15% { opacity: 1; transform: scale(1) rotate(45deg); }
  32% { opacity: 0; transform: scale(0.4) rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
  .av-frame-champion,
  .avatar-framed:has(.av-frame-champion)::after,
  .av-champ-fx i,
  .level-badge::after { animation: none; }
  .av-champ-fx { display: none; }
}
/* podium #1 with the champion frame: the crown on the avatar replaces the small one above it; the card gets a gold edge */
.podium-1:has(.av-crown) .podium-crown { visibility: hidden; }
.podium-1 {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent), 0 10px 28px -12px color-mix(in srgb, var(--gold) 60%, transparent), var(--shadow-sm);
}
.podium-1::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(60% 45% at 50% 32%, color-mix(in srgb, var(--gold) 28%, transparent), transparent 70%);
  pointer-events: none;
}
.podium-1 > * { position: relative; }
.podium-1 > .podium-rank { position: absolute; }
.podium-1:has(.av-crown) > .avatar { margin-bottom: 6px; }
.frame-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.frame-card-head .h2 { margin: 0; }
.frame-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.frame-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--glass-edge-soft, rgba(255, 255, 255, 0.1));
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.frame-opt:not(:disabled):active { transform: scale(0.97); }
.frame-opt strong { font-size: 0.9rem; }
.frame-opt .small { font-size: 0.72rem; line-height: 1.25; }
.frame-opt-av { padding: 8px 0 6px; }
.frame-opt-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.frame-opt-locked { opacity: 0.55; cursor: not-allowed; }
.frame-opt:disabled:not(.frame-opt-locked) { cursor: default; }
.frame-opt-state { position: absolute; top: 8px; right: 8px; color: var(--accent); display: grid; }
.frame-opt-locked .frame-opt-state { color: var(--muted); }

/* Profil tab is a button (opens the menu): same look as the links */
button.bn-item {
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 1000px) {
  .bottom-nav { gap: 4px; }
}

/* ===================================================== main menu v2 */
.sheet { width: min(400px, 100vw); }
@media (max-width: 520px) {
  .sheet { width: 100vw; border-left: 0; box-shadow: none; }
}
.sheet-head { padding: 16px 12px 12px 18px; }
.sheet-me { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.sheet-me-text { display: grid; gap: 4px; min-width: 0; }
.sheet-me-text strong { font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-me-sub { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.sheet-brand { font-family: var(--font-display); letter-spacing: 0.08em; font-size: 1.2rem; }
.sheet-close { flex: none; }
.sheet-body { padding: 4px 16px calc(28px + env(safe-area-inset-bottom) + var(--tg-bottom, 0px)); display: flex; flex-direction: column; }
.sheet-profile { margin-bottom: 12px; justify-content: center; }
.sheet-coins {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(232, 187, 77, 0.35);
  background: linear-gradient(135deg, rgba(232, 187, 77, 0.16), rgba(232, 187, 77, 0.04));
  color: inherit;
  text-decoration: none;
}
.sheet-coins-main { display: grid; gap: 2px; min-width: 0; }
.sheet-coins-label { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: #e8bb4d; font-weight: 800; }
.sheet-coins-value { font-size: 1.3rem; font-weight: 800; white-space: nowrap; }
.sheet-coins-add { flex: none; pointer-events: none; }
.sheet-group { margin: 20px 4px 8px; }
.menu-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.menu-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 86px;
  padding: 12px 6px;
  border-radius: 16px;
  border: 1px solid rgba(143, 179, 255, 0.16);
  background: rgba(143, 179, 255, 0.06);
  color: inherit;
  text-decoration: none;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  transition: background 0.15s, transform 0.15s;
}
.menu-tile svg { font-size: 1.45rem; color: #8fb3ff; }
.menu-tile:hover, .menu-tile:focus-visible { background: rgba(143, 179, 255, 0.12); }
.menu-tile:active { transform: scale(0.96); }
.menu-row { padding: 10px 8px; min-height: 48px; }
.menu-row-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(143, 179, 255, 0.1);
  font-size: 1.05rem;
}
.menu-row-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-row-danger { color: #ff8a8a; margin-top: 6px; }
.menu-row-danger .menu-row-ico { background: rgba(255, 90, 90, 0.12); color: #ff8a8a; }
.sheet-prefs { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sheet-prefs .seg { display: inline-flex; }
:root[data-theme='light'] .menu-tile, html.light .menu-tile { background: rgba(44, 91, 224, 0.06); border-color: rgba(44, 91, 224, 0.15); }
:root[data-theme='light'] .menu-tile svg, html.light .menu-tile svg, :root[data-theme='light'] .menu-row-ico, html.light .menu-row-ico { color: #2c5be0; }
:root[data-theme='light'] .sheet-prefs, html.light .sheet-prefs { border-top-color: rgba(0, 0, 0, 0.08); }

/* ===================================================== virtual opponents */
.ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.5;
  vertical-align: middle;
  color: #0b1530;
  background: linear-gradient(135deg, #8fb3ff, #b388ff);
  box-shadow: 0 0 8px rgba(143, 179, 255, 0.45);
}
.vs-pop { animation: vsPop 0.45s var(--ease) both; }
@keyframes vsPop { from { transform: scale(0.92); opacity: 0; } }
.player-link { color: inherit; text-decoration: none; border-bottom: 1px dashed rgba(143, 179, 255, 0.5); }
.vr-asking { display: flex; align-items: center; gap: 10px; }
.admin-stack { display: grid; gap: 14px; }
.admin-kpis { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.85rem; color: var(--muted); }
.admin-kpis strong { color: var(--text); }
.vadm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vadm-head p { margin: 4px 0 0; }
.vadm-auto { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; cursor: pointer; }
.vadm-auto input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.vadm-threshold { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.vadm-threshold .field { flex: 1; min-width: 160px; margin: 0; }
.vadm-row { flex-wrap: wrap; }
.vadm-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.vadm-actions select { min-height: 34px; border-radius: 10px; padding: 4px 8px; background: var(--surface-2, rgba(255, 255, 255, 0.06)); color: inherit; border: 1px solid var(--glass-edge-soft, rgba(255, 255, 255, 0.14)); }
@media (max-width: 520px) {
  .vadm-actions { width: 100%; justify-content: flex-end; }
}

/* ===================================================== football sets: selected piece lights up (neon pulse) */
.board-wrap[class*='sk-pw-fc-'] .sq-selected .piece-w,
.board-wrap[class*='sk-pb-fc-'] .sq-selected .piece-b,
.board-wrap[class*='sk-p-fc-'] .sq-selected .piece {
  animation: fcSelected 1.1s ease-in-out infinite;
}
@keyframes fcSelected {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.85)) drop-shadow(0 0 10px rgba(143, 179, 255, 0.8)); transform: translateY(-1px) scale(1.04); }
  50% { filter: drop-shadow(0 0 7px rgba(255, 255, 255, 1)) drop-shadow(0 0 20px rgba(255, 213, 79, 0.9)); transform: translateY(-3px) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .board-wrap[class*='sk-pw-fc-'] .sq-selected .piece-w,
  .board-wrap[class*='sk-pb-fc-'] .sq-selected .piece-b,
  .board-wrap[class*='sk-p-fc-'] .sq-selected .piece { animation: none; filter: drop-shadow(0 0 10px rgba(255, 213, 79, 0.9)); }
}

/* ===================================================== achievements v2 (compact strip, page, congratulations) */
.ach-strip { align-self: start; align-content: start; display: grid; gap: 10px; padding: 14px 16px; text-decoration: none; color: inherit; }
a.ach-strip:hover { border-color: rgba(143, 179, 255, 0.35); }
.ach-strip-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ach-strip-head strong { font-size: 1rem; }
.ach-strip-go { margin-left: auto; color: var(--muted); flex: none; }
.ach-streak-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-weight: 800; font-size: 0.8rem; color: #ffb74d; background: rgba(255, 152, 0, 0.14); }
.ach-strip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ach-strip-row::-webkit-scrollbar { display: none; }
.ach-dot { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 1.05rem;
  color: var(--muted); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
.ach-dot-on { color: #ffd54f; background: radial-gradient(circle at 35% 30%, rgba(255, 213, 79, 0.28), rgba(91, 140, 255, 0.12));
  border-color: rgba(255, 213, 79, 0.45); box-shadow: 0 0 12px rgba(255, 213, 79, 0.25); }
.streak-card { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.16), rgba(124, 77, 255, 0.1)); }
.streak-flame { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; font-size: 1.7rem; color: #ffb74d; background: rgba(255, 152, 0, 0.16); flex: none; }
.streak-main { display: grid; gap: 2px; }
.streak-main strong { font-size: 1.1rem; }
.ach-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.ach-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.07); }
.ach-card-on { border-color: rgba(255, 213, 79, 0.35); background: linear-gradient(135deg, rgba(255, 213, 79, 0.09), rgba(91, 140, 255, 0.05)); }
.ach-card-ico { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; font-size: 1.25rem; color: var(--muted); background: rgba(255, 255, 255, 0.05); }
.ach-card-on .ach-card-ico { color: #ffd54f; background: rgba(255, 213, 79, 0.14); }
.ach-card-main { display: grid; gap: 3px; flex: 1; min-width: 0; }
.ach-card-main .ach-bar { grid-area: auto; margin-top: 4px; }
.ach-reward { flex: none; font-weight: 800; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.ach-reward-got { color: #e8bb4d; }
.ach-pop-backdrop { z-index: 400; }
.ach-pop { position: relative; width: min(360px, calc(100vw - 32px)); padding: 28px 22px 20px; border-radius: 24px; text-align: center; overflow: hidden;
  background: radial-gradient(circle at 50% 0%, rgba(255, 213, 79, 0.22), transparent 60%), linear-gradient(180deg, #172452, #0b1330);
  border: 1px solid rgba(255, 213, 79, 0.35); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 213, 79, 0.18);
  animation: achPop 0.5s var(--ease) both; color: #eef3ff; }
@keyframes achPop { from { transform: scale(0.85) translateY(12px); opacity: 0; } }
.ach-pop-x { position: absolute; top: 8px; right: 8px; }
.ach-pop-burst { position: absolute; left: 50%; top: 72px; width: 0; height: 0; pointer-events: none; }
.ach-pop-burst span { position: absolute; width: 4px; height: 26px; border-radius: 2px; background: linear-gradient(#ffd54f, transparent);
  transform: rotate(var(--a)) translateY(-70px); opacity: 0; animation: achRay 1.4s ease-out 0.15s both; }
@keyframes achRay { 0% { opacity: 0; transform: rotate(var(--a)) translateY(-30px); } 40% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-90px); } }
.ach-pop-ico { position: relative; display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; font-size: 2.6rem; color: #ffd54f;
  background: radial-gradient(circle at 35% 30%, rgba(255, 213, 79, 0.35), rgba(124, 77, 255, 0.25)); box-shadow: 0 0 30px rgba(255, 213, 79, 0.45);
  animation: achIco 1.6s ease-in-out infinite; }
@keyframes achIco { 50% { transform: scale(1.06); box-shadow: 0 0 44px rgba(255, 213, 79, 0.6); } }
.ach-pop-hello { margin: 14px 0 2px; font-size: 1.35rem; font-weight: 800; }
.ach-pop-title { margin: 10px 0 2px; font-family: var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; color: #ffd54f; font-size: 1.3rem; }
.ach-pop-desc { margin: 0 0 10px; font-weight: 700; }
.ach-pop-reward { margin: 6px 0 16px; font-size: 1.05rem; }
.ach-pop-reward strong { color: #ffd54f; }
.ach-pop-actions { justify-content: center; }
@media (prefers-reduced-motion: reduce) { .ach-pop, .ach-pop-ico, .ach-pop-burst span { animation: none; } }

/* matchmaking rule note + VS stats + virtual profile note */
.mm-rule { display: flex; gap: 6px; align-items: flex-start; max-width: 420px; margin: 8px auto 0; text-align: left; line-height: 1.4; }
.mm-rule svg { flex: none; margin-top: 2px; }
.vs-stats { font-size: 0.75rem; color: var(--muted); }
.vp-note { display: flex; gap: 6px; align-items: flex-start; }
.vp-note svg { flex: none; margin-top: 2px; }


/* ===================================================== performance (v3.1): no endless repaint, no live blur
   Measured idle on every page: ~60 style recalcs/s and a full repaint each frame, caused by the drifting
   .ambient background under ~15 kinds of backdrop-filter glass (the GPU re-blurred the whole screen 60×/s),
   endless background-position / box-shadow loops (avatar shine, online dots, skin previews) and, in the shop,
   110 looping previews. Now: static background, opaque glass, loops on transform/opacity only, and
   everything decorative pauses while DAMEO is minimised in Telegram or the screen is off. */
:root,
:root[data-theme='light'],
:root[data-theme='dark'] {
  --glass-blur: none;
}
.ambient {
  animation: none;
}
.header,
.bottom-nav,
.sheet-backdrop,
.modal-backdrop {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
/* things that float over scrolling content get an opaque base instead of the blur */
.header {
  background: var(--glass-fill), color-mix(in srgb, var(--bg) 95%, transparent);
}
.bottom-nav {
  background: var(--glass-fill-strong), var(--surface);
}
.modal,
.toast {
  background: var(--glass-fill-strong), var(--surface);
}
.modal-backdrop,
.sheet-backdrop {
  background: rgba(5, 10, 25, 0.7);
}
/* avatar sheen: once, not forever */
.avatar::before {
  animation: shine 2.2s ease-in-out 1;
}
/* online / live dots: the ring grows on its own layer (transform + opacity) */
.dot-on,
.wk-dot {
  position: relative;
  animation: none;
  box-shadow: none;
}
.dot-on::after,
.wk-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  opacity: 0.55;
  animation: dot-ring 2.2s ease-out 3; /* a few pulses, then still: an endless pulse keeps the GPU drawing (heat) */
}
@keyframes dot-ring {
  70%, 100% { transform: scale(2.3); opacity: 0; }
}
/* skins: pulse glow lives on the overlay (opacity), shimmer is a moving band (transform) */
.piece-disc {
  --pa-pulse: none;
}
@keyframes sk-sweep {
  from { transform: translateX(-45%); }
  to { transform: translateX(45%); }
}
@keyframes sk-glow {
  50% { opacity: 1; }
}
/* football selection: static glow, only the lift animates */
.board-wrap[class*='sk-pw-fc-'] .sq-selected .piece-w,
.board-wrap[class*='sk-pb-fc-'] .sq-selected .piece-b,
.board-wrap[class*='sk-p-fc-'] .sq-selected .piece {
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 14px rgba(255, 213, 79, 0.85));
  animation: fcLift 1.1s ease-in-out infinite;
}
@keyframes fcLift {
  0%, 100% { transform: translateY(-1px) scale(1.04); }
  50% { transform: translateY(-3px) scale(1.08); }
}
/* shop grid: previews are still frames; the card you touch / open plays them */
.shop-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 230px;
}
.shop-grid .piece-disc,
.shop-grid .pfx,
.shop-grid .pfx::after,
.shop-grid .fx-burst,
.shop-grid .fx-burst::before,
.shop-grid .fx-burst::after {
  animation-play-state: paused !important;
}
.shop-grid .shop-card:hover .piece-disc,
.shop-grid .shop-card:hover .pfx,
.shop-grid .shop-card:hover .pfx::after,
.shop-grid .shop-card:hover .fx-burst,
.shop-grid .shop-card:hover .fx-burst::before,
.shop-grid .shop-card:hover .fx-burst::after {
  animation-play-state: running !important;
}
/* minimised in Telegram / screen off / other tab: freeze every animation */
html.app-paused *,
html.app-paused *::before,
html.app-paused *::after {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  .dot-on::after,
  .wk-dot::after,
  .avatar::before {
    animation: none;
  }
}

/* ===================================================== profile: friends block (moved from the bottom bar) */
.pf-friends-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pf-friends-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 10px 6px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: inherit; text-decoration: none; text-align: center;
  font-size: 0.82rem; font-weight: 700; position: relative; line-height: 1.2; }
.pf-friends-btn svg { font-size: 1.3rem; color: var(--accent); }
.pf-friends-btn .tab-count { position: absolute; top: 6px; right: 8px; }
.pf-friends-btn:active { transform: scale(0.97); }

/* ================================================================ HOME v3.1 — FLECT banner, stats, mode cards */
.page-home { gap: 14px; padding-top: 14px; }
.flect-banner {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) 1px minmax(0, 1.08fr);
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 10px;
  min-height: 132px;
  border-radius: 22px;
  color: #fff;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 100%, rgba(255, 158, 44, 0.32), transparent 55%),
    radial-gradient(90% 120% at 0% 0%, rgba(150, 70, 255, 0.45), transparent 60%),
    linear-gradient(135deg, #1a0b3d 0%, #120827 55%, #0b0617 100%);
  border: 1.5px solid rgba(178, 120, 255, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(255, 170, 60, 0.18), 0 10px 26px rgba(98, 40, 200, 0.28);
  transition: transform 0.15s var(--ease);
}
.flect-banner:active { transform: scale(0.985); }
.flect-logo { display: grid; place-items: center; min-width: 0; }
.flect-logo img { width: 100%; max-width: 190px; height: auto; display: block; }
.flect-banner > .flect-logo + .flect-copy { grid-column: 3; }
.flect-banner::after {
  content: '';
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  margin: 10px 0;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.28), transparent);
}
.flect-copy { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.flect-text { font-family: var(--font-display); font-weight: 700; font-size: clamp(0.84rem, 3.7vw, 1.05rem); line-height: 1.25; }
.flect-hl-a { color: #e9d9ff; }
.flect-hl-b { color: #ffbe3d; }
.flect-hl-w { color: #fff; }
.flect-hl-c { color: #d77bff; }
.flect-rest { font-weight: 600; color: rgba(255, 255, 255, 0.9); }
.flect-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flect-gifts { font-size: 1.7rem; line-height: 1; position: relative; }
.flect-crown { font-size: 1.05rem; margin-left: 2px; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(145deg, #c35cff, #7a2ee6); vertical-align: 6px; }
.flect-go { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: #1b2240; border: 1px solid rgba(255, 255, 255, 0.22); color: #fff; font-size: 1.25rem; }

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 16px 6px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.home-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 0 14px; min-width: 0; }
.home-stats > div + div { border-left: 1px solid var(--border); }
.home-stat-v { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.45rem, 7vw, 2rem); line-height: 1.1; white-space: nowrap; }
.home-stat-l { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); line-height: 1.25; overflow-wrap: anywhere; }
.home-stats-badge { position: absolute; top: 6px; right: 8px; }
.home-guest { margin: 0; }

.mode-card { position: relative; }
.mode-go {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
}
.mode-card-accent .mode-go { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.3); color: inherit; }
.mode-card .mode-title { font-size: 1.12rem; line-height: 1.2; margin-top: 6px; }
.mode-card .mode-desc { line-height: 1.35; }
@media (max-width: 420px) {
  .mode-grid { gap: 12px; }
  .mode-card { padding: 14px; }
  .mode-card .mode-title { font-size: 1.02rem; }
  .mode-card .mode-desc { font-size: 0.8rem; }
  .home-stats > div { padding: 0 10px; }
}
@media (max-width: 380px) {
  .page-home { gap: 12px; padding-top: 10px; }
  .flect-banner { min-height: 118px; padding: 10px 12px 10px 8px; gap: 10px; }
  .flect-go { width: 36px; height: 36px; }
  .home-stats { padding: 12px 4px; }
  .mode-grid { gap: 10px; }
  .mode-card { padding: 12px; gap: 4px; }
  .mode-go { top: 10px; right: 10px; width: 28px; height: 28px; }
  .mode-card .mode-icon { width: 38px; height: 38px; }
}
@media (min-width: 700px) {
  .flect-banner { grid-template-columns: 220px 1px minmax(0, 1fr); min-height: 0; padding: 10px 22px 10px 14px; }
  .flect-logo img { max-width: 170px; }
}

/* ================================================================ v3.2 — admin number fields + pricing */
.field-bad input { border-color: var(--danger); }
.field-err { color: var(--danger); font-size: 0.78rem; }
.admin-rate { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.admin-rate > div { display: grid; gap: 2px; }
.admin-rate-v { font-size: 1.25rem; font-family: var(--font-display); }
.admin-auto { margin: 0; display: flex; gap: 6px; align-items: baseline; }
.admin-preview-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 0.9rem; }
.admin-board-row { display: flex; gap: 6px; align-items: center; }
.admin-board-row .admin-row { flex: 1; min-width: 0; }
.admin-board-row img { width: 44px; height: 44px; border-radius: 8px; flex: none; object-fit: cover; }
.admin-hist li { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.admin-row-static { cursor: default; }

/* ================================================================ v3.2 — Limited Collection (shop) */
.ltd-head { display: grid; gap: 2px; margin-bottom: 10px; }
.ltd-head .h2 { margin: 0; background: linear-gradient(90deg, #ffd56b, #f0b429 40%, #c084fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ltd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 210px), 1fr)); gap: 12px; }
.ltd-card {
  --lb-glow: rgba(110, 140, 255, 0.35);
  display: flex; flex-direction: column; min-width: 0; border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, #121a33, #0b1124); border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  content-visibility: auto; contain-intrinsic-size: auto 360px;
}
.ltd-card.is-on { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.ltd-card.is-out .board-art { filter: grayscale(0.7) brightness(0.7); }
.ltd-tier-5 { --lb-glow: rgba(168, 85, 247, 0.45); }
.ltd-tier-6, .ltd-tier-7 { --lb-glow: rgba(240, 180, 41, 0.45); }
.ltd-tier-8 { --lb-glow: rgba(80, 120, 255, 0.55); }
.ltd-card-art { display: block; padding: 0; border: 0; background: radial-gradient(70% 70% at 50% 45%, var(--lb-glow), transparent 70%), #070b18; cursor: pointer; }
.board-art { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.ltd-card-body { display: grid; gap: 7px; padding: 10px 11px 12px; }
.ltd-name { margin: 0; font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; overflow-wrap: anywhere; }
.ltd-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ltd-badge {
  display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; white-space: nowrap;
  color: #ffe2a0; background: linear-gradient(90deg, rgba(240, 180, 41, 0.22), rgba(168, 85, 247, 0.28)); border: 1px solid rgba(240, 180, 41, 0.45);
}
.ltd-badge-out { color: #ffb3b3; background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.5); }
.ltd-out-lg { font-size: 0.95rem; padding: 8px 14px; text-align: center; }
.ltd-left { display: grid; gap: 4px; color: #cfd8ee; }
.ltd-bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.ltd-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f0b429, #c084fc); }
.ltd-mine { display: inline-flex; align-items: center; gap: 5px; color: #6ee7b7; font-weight: 700; font-size: 0.85rem; }
.ltd-mine-lg { font-size: 1.05rem; margin: 0; }
.ltd-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.ltd-price strong { color: #ffd56b; font-size: 1.02rem; white-space: nowrap; }
.ltd-price-lg strong { font-size: 1.35rem; }
.ltd-kicker { margin: 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.22em; color: #f0b429; }
.ltd-detail { display: grid; gap: 14px; }
@media (min-width: 720px) { .ltd-detail { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.ltd-detail-view { display: grid; gap: 10px; min-width: 0; }
.ltd-detail-art { border-radius: 16px; background: #070b18; }

/* ================================================================ v3.2 — DAMEO Collection (profile) */
.col-card { display: grid; gap: 12px; }
.col-head { display: flex; align-items: center; gap: 10px; }
.col-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; color: #ffd56b; background: linear-gradient(145deg, rgba(240, 180, 41, 0.25), rgba(168, 85, 247, 0.25)); border: 1px solid rgba(240, 180, 41, 0.35); font-size: 1.2rem; }
.col-title { display: grid; min-width: 0; }
.col-title .h3 { margin: 0; }
.col-hidden { display: flex; align-items: center; gap: 8px; margin: 0; }
.col-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; }
.col-stats > div { display: grid; gap: 2px; padding: 0 6px; }
.col-stats > div + div { border-left: 1px solid var(--border); }
.col-stats strong { font-family: var(--font-display); font-size: 1.4rem; }
.col-stats strong small { font-size: 0.8rem; color: var(--muted); }
.col-stats span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.col-progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.col-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f0b429, #c084fc); }
.col-sub { margin: 0; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.col-showcase { display: grid; gap: 8px; }
.col-showcase ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.col-show {
  --lb-glow: rgba(110, 140, 255, 0.35);
  display: grid; width: 100%; padding: 0; overflow: hidden; border-radius: 14px; cursor: pointer; text-align: left;
  border: 1px solid rgba(240, 180, 41, 0.45); background: radial-gradient(80% 60% at 50% 35%, var(--lb-glow), transparent 70%), #0a1022; color: #fff;
}
.col-show-txt { display: grid; gap: 2px; padding: 6px 8px 8px; min-width: 0; }
.col-show-name { font-size: 0.74rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.col-serial { font-family: var(--font-display); color: #ffd56b; font-size: 0.9rem; letter-spacing: 0.03em; }
.col-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.col-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(30%, 150px), 1fr)); gap: 8px; }
.col-item {
  display: grid; gap: 3px; justify-items: start; width: 100%; height: 100%; padding: 0 0 8px; overflow: hidden; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-align: left; text-decoration: none; font: inherit;
}
.col-item > :not(.board-art) { margin: 0 8px; }
.col-item-name { font-size: 0.8rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.col-item .rarity { font-size: 0.62rem; }
.col-locked .board-art { filter: grayscale(1) brightness(0.45); }
.col-locked { opacity: 0.8; }
.col-empty { display: grid; gap: 6px; justify-items: start; }
.col-empty p { margin: 0; }
.col-public { margin-top: 2px; }
.col-cert { text-align: center; justify-items: center; }
.col-cert p { margin: 0; }
.col-cert-name { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.08em; }
.col-cert-serial { font-family: var(--font-display); font-size: 2.2rem; color: #ffd56b; letter-spacing: 0.04em; }
@media (max-width: 380px) {
  .ltd-grid { gap: 10px; }
  .ltd-card-body { padding: 9px; }
  .ltd-name { font-size: 0.86rem; }
  .col-showcase ol { gap: 6px; }
}
.mini-art { border-radius: 12px; background: #070b18; }
.ltd-tabs { justify-self: start; }

/* ================================================================ v3.2 — modal safe area (Telegram fullscreen)
 * In fullscreen Telegram draws its own Close / minimise / menu buttons over the top of the page (--tg-top = device
 * safe area + Telegram's content inset, set in initTelegram). Dialogs start below that band and stay inside the screen,
 * so their single close button never sits under Telegram's controls. Telegram's own buttons are not touched. */
.modal-backdrop {
  --modal-top: calc(12px + max(var(--tg-top, 0px), env(safe-area-inset-top, 0px)));
  --modal-bottom: calc(12px + max(var(--tg-bottom, 0px), env(safe-area-inset-bottom, 0px)));
  padding: var(--modal-top) 12px var(--modal-bottom);
}
.modal { max-height: calc(100svh - var(--modal-top) - var(--modal-bottom)); }
html.in-telegram .modal-backdrop { align-items: start; }   /* tall dialogs start right under Telegram's bar */
html.in-telegram .modal { margin-top: 4px; }

/* ================================================================ v3.2 — LIMITED EDITION plate under the board preview */
.ltd-plate {
  display: grid; justify-items: center; gap: 2px; padding: 10px 12px 12px; margin-top: 2px; text-align: center;
  border-radius: 14px; border: 1px solid rgba(240, 180, 41, 0.35);
  background: radial-gradient(120% 140% at 50% 0%, rgba(240, 180, 41, 0.14), transparent 60%), #0a0f1f;
}
.ltd-plate-k { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.32em; padding-left: 0.32em; color: #e9c46a; }
.ltd-plate-serial {
  font-family: var(--font-display); font-size: clamp(1.7rem, 8vw, 2.3rem); line-height: 1.05; letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fff1c1, #f0b429 55%, #b8862b); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ltd-plate-sub { font-size: 0.78rem; color: #cdb88a; }
.ltd-stars { color: #ffd56b; font-weight: 700; font-size: 0.86rem; white-space: nowrap; padding: 1px 8px; border-radius: 999px; background: rgba(255, 213, 107, 0.12); border: 1px solid rgba(255, 213, 107, 0.3); }
.ltd-price-lg .ltd-stars { font-size: 1rem; }

/* ===================================================== Profile Frames collection (artwork rings, /frames/<slug>.webp)
 * The ring image is 1.46× the avatar (its opening = the avatar), drawn above the photo; the opening is fully clear so the
 * face is never covered. A second copy of the ring (::after) carries the effect: opacity + a tiny scale only, slow 3–4 s
 * loops, and only on large avatars (.af-live, ≥ 48 px) — lists of small avatars stay static. */
.av-frame-art {
  position: absolute;
  inset: -15%;      /* ring = 1.30× the avatar: tidy in every layout; the ring only overlaps the photo's outer rim */
  pointer-events: none;
  z-index: 1;
  background: center / 100% 100% no-repeat;
}
.av-frame-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  opacity: 0;
  mix-blend-mode: screen;
}
.af-crimson-queen { background-image: url('frames/crimson-queen.webp'); }
.af-mystic-blossom { background-image: url('frames/mystic-blossom.webp'); }
.af-frost-guardian { background-image: url('frames/frost-guardian.webp'); }
.af-golden-legend { background-image: url('frames/golden-legend.webp'); }
.af-dragon-fury { background-image: url('frames/dragon-fury.webp'); }
.avatar:has(.av-frame-art) { box-shadow: none; }
.avatar .dot { z-index: 2; }
/* glow in / fade out: a brighter copy of the ring in the frame's own colour; opacity only, 2.6–3 s */
.af-live::after { filter: drop-shadow(0 0 4px var(--af-c)); animation: af-pulse 2.8s ease-in-out infinite; }
.af-crimson-queen { --af-c: #ff4fa3; }
.af-mystic-blossom { --af-c: #c77dff; }
.af-frost-guardian { --af-c: #5ab0ff; }
.af-golden-legend { --af-c: #ffcf4a; }
.af-dragon-fury { --af-c: #ff3b2f; }
.af-live.af-frost-guardian::after { animation-duration: 2.4s; }
.af-live.af-golden-legend::after { animation-duration: 3s; }
@keyframes af-pulse { 0%, 100% { opacity: 0.05; } 50% { opacity: 0.85; } }

/* Stones: soft highlight drifting ≤ 2 px */
@keyframes sk-gleam { 0%, 100% { opacity: 0.18; transform: translate(0, 0); } 50% { opacity: 0.42; transform: translate(2px, 1px); } }

/* decorative loops off: setting, low battery (html.calm), reduced motion */
html.calm .pfx, html.calm .pfx::after, html.calm .av-frame-art::after, html.calm .av-frame-champion, html.calm .av-champ-fx, html.calm .level-badge::after, html.calm .avatar-framed::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .pfx, .pfx::after, .av-frame-art::after { animation: none !important; }
}

/* ================================================================ v3.2 — Stones Collection (shop): the Limited card system
 * Cards are the boards' .ltd-card; here only the picture format and each stone's own colour (glow + border). */
.st-badge { padding: 2px 7px; border-radius: 999px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; text-transform: uppercase; }
.st-badge-std { background: #2a2d3a; color: #cfd6e6; border: 1px solid rgba(255, 255, 255, 0.12); }
.st-badge-prem { background: linear-gradient(90deg, rgba(240, 180, 41, 0.22), rgba(240, 180, 41, 0.1)); color: #ffe2a0; border: 1px solid rgba(240, 180, 41, 0.45); }
.st-badge-ltd { background: linear-gradient(90deg, rgba(109, 40, 217, 0.45), rgba(168, 85, 247, 0.3)); color: #f3e8ff; border: 1px solid rgba(192, 132, 252, 0.5); }
.st-card-art { aspect-ratio: 16 / 10; overflow: hidden; }
.st-art-img { aspect-ratio: 16 / 10; object-fit: cover; }
.st-c-st-classic { --lb-glow: rgba(230, 230, 240, 0.28); --st-edge: rgba(230, 230, 240, 0.28); }
.st-c-st-royal-gold { --lb-glow: rgba(240, 180, 41, 0.45); --st-edge: rgba(240, 180, 41, 0.55); }
.st-c-st-obsidian { --lb-glow: rgba(255, 150, 40, 0.3); --st-edge: rgba(255, 150, 40, 0.4); }
.st-c-st-sapphire { --lb-glow: rgba(60, 120, 255, 0.5); --st-edge: rgba(80, 140, 255, 0.55); }
.st-c-st-emerald { --lb-glow: rgba(30, 200, 110, 0.45); --st-edge: rgba(40, 210, 120, 0.5); }
.st-c-st-ruby { --lb-glow: rgba(255, 50, 80, 0.45); --st-edge: rgba(255, 70, 100, 0.5); }
.st-c-st-diamond { --lb-glow: rgba(200, 225, 255, 0.4); --st-edge: rgba(210, 230, 255, 0.5); }
.st-c-st-celestial { --lb-glow: rgba(130, 100, 255, 0.55); --st-edge: rgba(150, 120, 255, 0.6); }
.ltd-card[class*='st-c-'] { --ltd-glow: var(--lb-glow); border-color: var(--st-edge); }
.ltd-card[class*='st-c-'].is-on { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.ltd-card[class*='st-c-'] .ltd-card-art { background: radial-gradient(70% 80% at 50% 45%, var(--lb-glow), transparent 70%), #070b18; }
.st-stage { display: grid; place-items: center; min-height: 200px; padding: 12px; border-radius: 16px; background: radial-gradient(70% 70% at 50% 45%, rgba(255, 255, 255, 0.07), transparent 70%), #07080d; }
.st-stage-art { width: 100%; height: auto; border-radius: 12px; }
.st-pair { display: flex; gap: 18px; align-items: center; justify-content: center; }
.board-wrap.stone-solo { position: relative; display: inline-grid; place-items: center; min-width: 0; flex: none; }
.stone-solo .piece { position: relative; width: 100%; height: 100%; transform: none; transition: none; }
.stone-solo .piece-disc { width: 88%; height: 88%; }

/* ================================================================ v3.2 — Profile Frames picker */
.frame-opt-art .frame-price { color: #ffd56b; font-weight: 700; }
.frame-opt-av-art { padding: 10px 0 6px; }
.frame-card-shop { background: radial-gradient(120% 60% at 50% 0%, rgba(240, 120, 200, 0.08), transparent 60%), var(--surface); }
.frame-buy { display: grid; justify-items: center; gap: 10px; text-align: center; }
.frame-buy-av { padding: 34px 0 26px; }
.frame-buy-price { margin: 0; font-size: 1.4rem; font-weight: 800; color: #ffd56b; }
@media (max-width: 380px) { .st-pair { gap: 10px; } }

/* ================================================================ admin broadcast */
.bc-aud { display: flex; gap: 12px; align-items: center; }
.bc-aud > svg { font-size: 1.6rem; color: var(--accent); flex: none; }
.bc-aud > div { display: grid; gap: 2px; }
.bc-live { display: grid; gap: 8px; }
.bc-live-head { display: flex; justify-content: space-between; }
.bc-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bc-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #6ee7b7); transition: width 0.4s; }
.bc-compose { display: grid; gap: 10px; }
.bc-compose textarea { min-height: 140px; }
.bc-preview { display: grid; gap: 4px; }
.bc-bubble { max-width: 340px; padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: #182533; color: #e8eef5; font-size: 0.92rem; line-height: 1.35; display: grid; gap: 8px; }
.bc-bubble p { margin: 0; overflow-wrap: anywhere; }
.bc-btn { display: block; text-align: center; padding: 7px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); font-weight: 600; font-size: 0.85rem; }
.bc-row { align-items: center; }
.bc-row-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; }

/* ================================================================ DAMEO 3.1 — Premium Stones motion
 * Colours and per-material looks are generated per stone (services/stoneMaterials.ts); here only the shared shapes.
 * All loops animate transform / opacity. Off with html.calm, prefers-reduced-motion; frozen by html.app-paused. */
/* selection: a spinning energy ring around the lifted stone */
.piece::before {
  content: '';
  display: none;
  position: absolute;
  inset: 3%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 12%, var(--stc, #fff) 22%, transparent 36% 58%, var(--stc2, #fff) 72%, transparent 86%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  filter: drop-shadow(0 0 4px var(--stc, #fff));
  animation: stm-spin 1.4s linear infinite;
  pointer-events: none;
}
.piece-selected .piece-disc { transition: transform 0.22s cubic-bezier(0.3, 1.6, 0.5, 1); }

/* move trail: grows with the stone, then fades */
.mv-trail {
  display: none;
  position: absolute;
  height: 3.2%;
  margin-top: -1.6%;
  border-radius: 99px;
  transform-origin: 0 50%;
  rotate: var(--a);
  scale: 0 1;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  box-shadow: 0 0 10px var(--stc, transparent);
  animation: stm-trail 0.85s ease-out forwards;
}
@keyframes stm-trail {
  0% { scale: 0 1; opacity: 0.95; }
  36% { scale: 1 1; opacity: 0.9; }
  100% { scale: 1 0.4; opacity: 0; }
}

/* capture: the stone flashes and breaks into its material's fragments */
.piece-gone { display: none; pointer-events: none; transition: none; z-index: 0; }
.piece-gone .piece-disc { animation: stm-pop 0.32s ease-in forwards; }
.piece-gone::after {
  content: '';
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0, var(--stc, #fff) 35%, transparent 70%);
  opacity: 0;
  animation: stm-flash 0.45s ease-out forwards;
}
.piece-gone .shard {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22%;
  height: 22%;
  margin: -11% 0 0 -11%;
  opacity: 0;
  animation: stm-shard 0.68s cubic-bezier(0.2, 0.7, 0.3, 1) 0.06s forwards;
}
.piece-gone .shard:nth-of-type(1) { --dx: 0%; --dy: -150%; --r: 160deg; }
.piece-gone .shard:nth-of-type(2) { --dx: 110%; --dy: -110%; --r: -120deg; width: 16%; height: 16%; }
.piece-gone .shard:nth-of-type(3) { --dx: 150%; --dy: 10%; --r: 200deg; }
.piece-gone .shard:nth-of-type(4) { --dx: 100%; --dy: 120%; --r: -90deg; width: 14%; height: 14%; }
.piece-gone .shard:nth-of-type(5) { --dx: -10%; --dy: 155%; --r: 140deg; }
.piece-gone .shard:nth-of-type(6) { --dx: -115%; --dy: 105%; --r: -210deg; width: 17%; height: 17%; }
.piece-gone .shard:nth-of-type(7) { --dx: -150%; --dy: -10%; --r: 110deg; }
.piece-gone .shard:nth-of-type(8) { --dx: -105%; --dy: -120%; --r: -160deg; width: 15%; height: 15%; }
@keyframes stm-pop { 0% { transform: scale(1); opacity: 1; } 40% { transform: scale(1.16); opacity: 1; } 100% { transform: scale(0.3); opacity: 0; } }
@keyframes stm-flash { 0% { transform: scale(0.4); opacity: 0.9; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes stm-shard {
  0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--r, 90deg)) scale(0.35); opacity: 0; }
}

/* idle loops */
@keyframes stm-spin { to { transform: rotate(360deg); } }
@keyframes stm-glint { 0%, 62%, 100% { opacity: 0; transform: scale(0.6); } 72% { opacity: 1; transform: scale(1); } 84% { opacity: 0; transform: scale(1.1); } }
@keyframes stm-breathe { 0%, 100% { opacity: 0.1; } 50% { opacity: 0.38; } }
@keyframes stm-lava { 0%, 100% { opacity: 0.05; } 50% { opacity: 0.85; } }
@keyframes stm-sweep { 0%, 55% { transform: translateX(-60%); } 85%, 100% { transform: translateX(60%); } }

/* reduced motion / calm: no loops, no trail, no shards; the energy ring stays as a still ring; captures just fade */
html.calm .piece::before, html.calm .pfx::after { animation: none !important; }
html.calm .mv-trail, html.calm .piece-gone .shard, html.calm .piece-gone::after { display: none !important; }
html.calm .piece-gone .piece-disc { animation: stm-fade 0.2s ease-out forwards; }
@media (prefers-reduced-motion: reduce) {
  .piece::before { animation: none !important; }
  .mv-trail, .piece-gone .shard, .piece-gone::after { display: none !important; }
  .piece-gone .piece-disc { animation: stm-fade 0.2s ease-out forwards; }
}
@keyframes stm-fade { to { opacity: 0; } }

/* ---------------------------------------------------------------- 3D stone preview (shop) */
.st3d {
  --sz: 168px;
  --th: 16px;
  position: relative;
  width: 100%;
  min-height: 236px;
  display: grid;
  place-items: center;
  perspective: 700px;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}
.st3d:active { cursor: grabbing; }
.st3d-tilt { display: block; transform: rotateX(16deg); transform-style: preserve-3d; }
.st3d-coin {
  display: block;
  position: relative;
  width: var(--sz);
  height: var(--sz);
  transform-style: preserve-3d;
  transform: rotateY(var(--ry, -25deg));
}
.st3d-coin.is-spin { animation: st3d-turn 7s linear infinite; }
@keyframes st3d-turn { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }
.st3d-face, .st3d-edge { position: absolute; inset: 0; border-radius: 50%; }
.st3d-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.st3d-face .piece { position: relative; width: 100%; height: 100%; transform: none; transition: none; }
.st3d-face .piece-disc { width: 100%; height: 100%; box-shadow: inset 0 0 0 2px var(--ring-c); }
.st3d-front { transform: translateZ(calc(var(--th) / 2)); }
.st3d-back { transform: rotateY(180deg) translateZ(calc(var(--th) / 2)); }
.st3d-edge { background: radial-gradient(circle, var(--stc2, #333) 60%, color-mix(in srgb, var(--stc2, #333) 55%, #000) 71%); transform: translateZ(var(--z)); }
.st3d-shadow { position: absolute; bottom: 14px; left: 50%; width: 46%; height: 16px; margin-left: -23%; border-radius: 50%; background: radial-gradient(closest-side, var(--stc, rgba(255,255,255,.3)), transparent); opacity: 0.35; filter: blur(4px); }
.st3d-hint { position: absolute; bottom: 0; font-size: 0.7rem; opacity: 0.55; }
html.calm .st3d-coin.is-spin { animation: none; }
@media (prefers-reduced-motion: reduce) { .st3d-coin.is-spin { animation: none; } }
@media (max-width: 380px) { .st3d { --sz: 140px; --th: 14px; min-height: 206px; } }

/* ================================================================ match coin reward (result window) */
.coin-reward {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  width: min(100%, 300px);
  margin: 4px auto 12px;
  padding: 10px 14px;
  border-radius: 16px;
  text-align: left;
  border: 1px solid color-mix(in srgb, #f3c24f 45%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, #f3c24f 18%, var(--surface)), var(--surface));
  overflow: hidden;
  animation: cr-in 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}
.coin-reward.is-loss { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface)); }
.coin-reward.is-wait { display: flex; gap: 8px; justify-content: center; color: var(--muted); font-size: 0.9rem; animation: none; border-style: dashed; background: none; }
.coin-reward-ico { grid-row: 1 / 3; font-size: 2rem; line-height: 1; animation: cr-coin 0.9s ease-out 0.15s both; }
.coin-reward-main { display: flex; align-items: baseline; gap: 6px; }
.coin-reward-n { font-size: 1.5rem; font-weight: 800; color: #e8b52e; font-variant-numeric: tabular-nums; }
.coin-reward.is-loss .coin-reward-n { color: var(--text); }
.coin-reward-label { font-weight: 700; font-size: 0.9rem; }
.coin-reward-why { color: var(--muted); }
.coin-reward.is-win::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 244, 200, 0.5) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: cr-shine 1.2s ease-out 0.5s 1 forwards;
  pointer-events: none;
}
.coin-reward-none { max-width: 300px; margin: 0 auto 10px; }
@keyframes cr-in { from { opacity: 0; transform: translateY(8px) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes cr-coin { 0% { transform: translateY(-14px) rotateY(0) scale(0.6); opacity: 0; } 60% { transform: translateY(2px) rotateY(540deg) scale(1.1); opacity: 1; } 100% { transform: none; } }
@keyframes cr-shine { to { transform: translateX(100%); } }
html.calm .coin-reward, html.calm .coin-reward-ico, html.calm .coin-reward::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .coin-reward, .coin-reward-ico, .coin-reward::after { animation: none; } }

/* Premium Stones: the idle shine runs in bursts (Board): between them it fades out (.st-rest) and then its animations
   are removed (.st-off) — a stopped animation needs no new frames, so a resting board costs the GPU nothing. */
.board-wrap .pfx { transition: opacity 0.6s ease; }
.st-rest .pfx { opacity: 0 !important; }
.st-off .pfx { display: none !important; }   /* even an invisible, still layer kept the GPU redrawing */

/* ================================================================ Referral page */
.ref-page { display: grid; gap: 14px; max-width: 640px; margin-inline: auto; }
.ref-hero {
  position: relative;
  text-align: center;
  padding: 26px 16px 18px;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, #f3c24f 26%, transparent), transparent 62%),
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, #f3c24f 30%, var(--border));
}
.ref-coins { display: flex; justify-content: center; gap: 6px; height: 56px; margin-bottom: 6px; }
.ref-coins i { font-style: normal; font-size: 2.3rem; line-height: 1; display: inline-block; filter: drop-shadow(0 6px 10px rgba(243, 194, 79, 0.35)); animation: ref-float 3.2s ease-in-out infinite; }
.ref-coins i:nth-child(1) { font-size: 1.7rem; margin-top: 16px; animation-delay: -1.1s; }
.ref-coins i:nth-child(3) { font-size: 1.7rem; margin-top: 16px; animation-delay: -2.2s; }
@keyframes ref-float { 0%, 100% { transform: translateY(0) rotateY(0deg); } 50% { transform: translateY(-7px) rotateY(180deg); } }
.ref-title { margin: 0 0 6px; }
.ref-sub { margin: 0 auto; max-width: 420px; color: var(--muted); line-height: 1.45; }

.ref-link { display: grid; gap: 10px; }
.ref-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ref-link-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.ref-url {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;   /* the whole link incl. the code stays visible on small phones */
  user-select: all;
}
.ref-copy { flex: none; }
.ref-copy.is-done { color: var(--success, #22c55e); }
.ref-note { margin: 0; }

.ref-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 620px) { .ref-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ref-stat { display: grid; gap: 4px; padding: 14px; position: relative; overflow: hidden; }
.ref-stat-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.ref-stat-ok .ref-stat-ico { background: color-mix(in srgb, #22c55e 16%, transparent); color: #22c55e; }
.ref-stat-wait .ref-stat-ico { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #f59e0b; }
.ref-stat-gold { border-color: color-mix(in srgb, #f3c24f 40%, var(--border)); background: linear-gradient(150deg, color-mix(in srgb, #f3c24f 14%, var(--surface)), var(--surface)); }
.ref-stat-gold .ref-stat-ico { background: color-mix(in srgb, #f3c24f 22%, transparent); color: #e8b52e; }
.ref-stat-n { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ref-stat-label { font-size: 0.8rem; color: var(--muted); }

.ref-how { display: grid; gap: 10px; }
.ref-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ref-steps li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; }
.ref-step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #f3c24f)); color: var(--on-accent, #fff); }

.ref-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ref-friend, .ref-by { display: flex; gap: 12px; align-items: center; padding: 12px; }
.ref-friend-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ref-friend-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-prog { display: block; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 3px; max-width: 220px; }
.ref-prog i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #f3c24f); transition: width 0.5s ease; }
.ref-chip { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.ref-chip-ok { background: color-mix(in srgb, #22c55e 16%, transparent); color: #22c55e; }
.ref-chip-wait { background: color-mix(in srgb, #f59e0b 14%, transparent); color: #f59e0b; }
.ref-by { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.ref-ok-text { color: #22c55e; display: inline-flex; gap: 4px; align-items: center; }
.ref-empty { display: grid; justify-items: center; gap: 6px; padding: 22px 16px; text-align: center; }
.ref-empty svg { font-size: 1.8rem; opacity: 0.5; }
.ref-empty p { margin: 0; }

.ref-promo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; border-color: color-mix(in srgb, #f3c24f 35%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, #f3c24f 12%, var(--surface)), var(--surface)); }
.ref-promo-ico { font-size: 1.6rem; }
.ref-promo-text { flex: 1; display: grid; gap: 2px; }

html.calm .ref-coins i { animation: none; }
@media (prefers-reduced-motion: reduce) { .ref-coins i { animation: none; } }
.ref-friend-side { flex: none; display: grid; justify-items: end; gap: 4px; }
.ref-chip-gold { background: color-mix(in srgb, #f3c24f 18%, transparent); color: #e8b52e; }

/* ---------------------------------------------------------------- daily rating (reuses the .wk look) */
.dr-cd-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dr-prize {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background:
    radial-gradient(120% 140% at 0% 50%, rgba(255, 224, 138, 0.22), transparent 60%),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(232, 187, 77, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.dr-prize-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: none;
  font-size: 2.2rem;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 224, 138, 0.35), rgba(232, 187, 77, 0.08) 70%);
  animation: dr-bob 3.2s ease-in-out 3;
}
@keyframes dr-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
.dr-prize-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.dr-prize-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(230, 236, 255, 0.7); }
.dr-prize-text strong { font-size: 1.08rem; color: #ffe08a; white-space: nowrap; }
.dr-prize-hint { font-size: 0.8rem; color: rgba(230, 236, 255, 0.75); }
.dr-prize-place { flex: none; }
.dr-nojoin { margin: -4px 0 0; font-size: 0.84rem; color: rgba(230, 236, 255, 0.8); }
.dr-me-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(230, 236, 255, 0.7); }
.dr-me strong { font-size: 1.05rem; }
.dr-me-rank { flex: none; min-width: 34px; height: 34px; font-size: 0.95rem; }
.dr-me-rank:not(.wk-rank-1):not(.wk-rank-2):not(.wk-rank-3) { background: rgba(255, 255, 255, 0.12); color: #f4f6ff; border-color: rgba(255, 255, 255, 0.25); }
.dr-table td.wk-points { font-weight: 800; }
.dr-row-podium td { background: color-mix(in srgb, var(--gold) 7%, var(--surface-2)); }
.dr-gap td { background: none !important; text-align: center; padding: 2px 0 !important; color: var(--muted); letter-spacing: 0.3em; font-size: 0.7rem; }
.dr-yesterday {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 60%),
    var(--surface);
  border-color: color-mix(in srgb, var(--gold) 40%, var(--border));
}
.dr-y-crown { color: var(--gold); font-size: 1.3rem; display: grid; flex: none; }
.dr-y-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; color: inherit; text-decoration: none; }
.dr-y-text { display: grid; min-width: 0; }
.dr-y-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.02rem; }
.dr-y-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }
.dr-y-prize { font-size: 1.6rem; flex: none; }
@media (prefers-reduced-motion: reduce) { .dr-prize-icon { animation: none; } }

/* ---------------------------------------------------------------- missions */
.ms-page { display: grid; gap: 14px; align-content: start; }
.ms-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ms-hero .h1 { margin: 0; }
.ms-hero p { margin: 4px 0 0; }
.ms-balance {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  color: inherit; text-decoration: none; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, color-mix(in srgb, #f3c24f 22%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, #f3c24f 45%, var(--border));
}
.ms-tabs { width: 100%; }
.ms-tabs { display: flex; overflow: visible; }
.ms-tabs .tab { flex: 1 1 0; min-width: 0; justify-content: center; white-space: normal; text-align: center; line-height: 1.2; }
@media (max-width: 420px) { .ms-tabs .tab { font-size: 0.86rem; padding-inline: 8px; } }
.ms-reset { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.ms-reset-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex: none; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); font-size: 1.15rem; }
.ms-reset-main { display: grid; }
.ms-reset-time { font-size: 1.25rem; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.ms-reset-sum { margin-left: auto; display: grid; justify-items: end; gap: 4px; text-align: right; }
.ms-dots { display: flex; gap: 4px; }
.ms-dots i { width: 14px; height: 6px; border-radius: 3px; background: var(--surface-3, color-mix(in srgb, var(--text) 14%, transparent)); }
.ms-dots i.on { background: var(--ok, #2fbf71); }
.ms-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ms-h { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.ms-h svg { color: var(--accent); }
.ms-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; transition: border-color 0.2s, box-shadow 0.2s; }
.ms-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; font-size: 1.25rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.ms-main { display: grid; gap: 3px; min-width: 0; }
.ms-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ms-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-reward { flex: none; font-size: 0.8rem; font-weight: 800; color: #c98a00; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, #f3c24f 18%, transparent); }
:root[data-theme='dark'] .ms-reward, .theme-dark .ms-reward { color: #ffd66b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .ms-reward { color: #ffd66b; } }
.ms-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.3; }
.ms-prog { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.ms-bar { flex: 1; height: 7px; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, var(--text) 10%, transparent); }
.ms-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #6be0a8)); transition: width 0.5s ease; }
.ms-count { font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 2.6em; text-align: right; }
.ms-act { display: grid; justify-items: end; gap: 6px; }
.ms-ready { border-color: color-mix(in srgb, var(--ok, #2fbf71) 55%, var(--border)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ok, #2fbf71) 25%, transparent), 0 8px 22px color-mix(in srgb, var(--ok, #2fbf71) 14%, transparent); }
.ms-ready .ms-bar i { background: var(--ok, #2fbf71); }
.ms-claim { animation: ms-pulse 1.8s ease-in-out 3; }
@keyframes ms-pulse { 50% { transform: scale(1.06); } }
.ms-claimed { opacity: 0.72; }
.ms-claimed .ms-ico { color: var(--ok, #2fbf71); background: color-mix(in srgb, var(--ok, #2fbf71) 13%, transparent); }
.ms-chip-ok { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 700; color: var(--ok, #2fbf71); }
.ms-bonus { background: linear-gradient(135deg, color-mix(in srgb, #f3c24f 14%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, #f3c24f 40%, var(--border)); }
.ms-bonus .ms-ico { color: #c98a00; background: color-mix(in srgb, #f3c24f 20%, transparent); }
.ms-ch-ava { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 1.2rem; color: #fff; background: linear-gradient(140deg, #3d8bfd, #2563eb); }
.ms-ch-ava img { width: 100%; height: 100%; object-fit: cover; }
.ms-ch-status { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; color: var(--muted); min-height: 1.2em; }
.ms-ch-status.is-ok { color: var(--ok, #2fbf71); font-weight: 700; }
.ms-ch-act { gap: 4px; }
.ms-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ms-hist li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 0.88rem; }
.ms-hist li span { flex: 1; min-width: 0; }
.ms-hist-ok { color: var(--ok, #2fbf71); flex: none; }
.ms-alldone { text-align: center; }
.ms-note { margin: 0; }
.ms-promo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface)); }
.ms-promo-ico { font-size: 1.6rem; }
.ms-promo-text { flex: 1; display: grid; gap: 2px; }
.ms-promo-go { font-size: 1.5rem; color: var(--muted); }
@media (max-width: 420px) {
  .ms-card { grid-template-columns: auto minmax(0, 1fr); }
  .ms-act { grid-column: 1 / -1; grid-auto-flow: column; justify-content: end; }
  .ms-reset-sum .muted { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ms-claim { animation: none; } }

/* admin: telegram channels */
.adm-ch { display: grid; gap: 10px; }
.adm-ch.is-active { border-color: color-mix(in srgb, var(--ok, #2fbf71) 45%, var(--border)); }
.adm-ch-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.adm-ch-name { display: grid; min-width: 0; }
.adm-ch-name .muted { overflow-wrap: anywhere; }
.adm-ch-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.adm-ch-stats li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.adm-ch-warn { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding: 8px 10px; border-radius: 10px; color: #b4231b; background: color-mix(in srgb, #e5484d 12%, transparent); border: 1px solid color-mix(in srgb, #e5484d 35%, transparent); }
.adm-ch-warn svg { flex: none; margin-top: 2px; }
.adm-ch-ok { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ok, #2fbf71); }
.adm-ch-probe { display: flex; gap: 8px; }
.adm-ch-probe input { flex: 1; min-width: 0; }
.adm-ch-toggle { display: flex; align-items: center; gap: 8px; }
.adm-danger { color: #e5484d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .adm-ch-warn { color: #ff9b95; } }
:root[data-theme='dark'] .adm-ch-warn { color: #ff9b95; }

/* ---------------------------------------------------------------- telegram gifts (shop) */
.chip-tab-gift { border-color: color-mix(in srgb, #f3c24f 45%, var(--border)); }
.gift-shop { display: grid; gap: 14px; }
.gift-head h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.gift-head h2 svg { color: #e0a91d; }
.gift-head p { margin: 0; }
.gift-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .gift-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gift-card { display: grid; justify-items: center; gap: 8px; padding: 14px 12px; text-align: center; position: relative; overflow: hidden; }
.gift-card::before { content: ''; position: absolute; inset: -40% -20% auto; height: 70%; background: radial-gradient(closest-side, var(--gift-glow, rgba(243, 194, 79, 0.28)), transparent); pointer-events: none; }
.gift-card-heart, .gift-art-heart { --gift-glow: rgba(255, 92, 138, 0.3); }
.gift-card-rose, .gift-art-rose { --gift-glow: rgba(230, 57, 70, 0.28); }
.gift-card-gift_box, .gift-art-gift_box { --gift-glow: rgba(77, 141, 255, 0.3); }
.gift-card-bear, .gift-art-bear { --gift-glow: rgba(224, 150, 72, 0.32); }
.gift-art { position: relative; display: grid; place-items: center; width: 92px; height: 92px; border-radius: 24px; background: radial-gradient(circle at 50% 40%, var(--gift-glow, rgba(243, 194, 79, 0.3)), transparent 70%); }
.gift-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.25)); }
.gift-emoji { font-size: 3.4rem; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.22)); }
.gift-card:hover .gift-emoji, .gift-card:hover .gift-art img { transform: translateY(-3px) scale(1.04); transition: transform 0.25s; }
.gift-art-sm { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.gift-art-sm .gift-emoji { font-size: 1.6rem; }
.gift-art-lg { width: 120px; height: 120px; }
.gift-art-lg .gift-emoji { font-size: 4.4rem; }
.gift-name { font-size: 1.02rem; }
.gift-price { font-weight: 800; font-variant-numeric: tabular-nums; }
.gift-note { margin: 0; }
.gift-paused { margin: 0; padding: 14px 16px; text-align: center; color: var(--muted, inherit); font-weight: 600; }
.gift-orders h3 { margin: 0 0 8px; }
.gift-orders ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gift-orders li { display: flex; align-items: center; gap: 10px; }
.gift-o-main { display: grid; flex: 1; min-width: 0; }
.gift-o-code { font-variant-numeric: tabular-nums; letter-spacing: 0.08em; color: var(--text); }
.gift-chip { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: #b07400; background: color-mix(in srgb, #f3c24f 20%, transparent); }
.gift-chip-ok { color: var(--ok, #12855a); background: color-mix(in srgb, var(--ok, #12855a) 14%, transparent); }
.gift-confirm, .gift-done { display: grid; justify-items: center; gap: 10px; text-align: center; }
.gift-confirm p, .gift-done p { margin: 0; }
.gift-confirm .row-actions { width: 100%; justify-content: center; }
.gift-code-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.gift-code { font-size: 2.6rem; font-weight: 900; letter-spacing: 0.25em; padding: 6px 18px 6px 26px; border-radius: 16px; font-variant-numeric: tabular-nums; background: color-mix(in srgb, #f3c24f 16%, var(--surface-2)); border: 1px dashed color-mix(in srgb, #f3c24f 60%, var(--border)); }
.gift-done-text { line-height: 1.45; }
.gift-done-actions { display: grid; gap: 8px; width: 100%; }

/* admin: gift orders */
.adm-gift { display: grid; gap: 10px; }
.adm-gift.is-done { opacity: 0.85; }
.adm-gift-top { display: flex; align-items: center; gap: 10px; }
.adm-gift-title { display: grid; flex: 1; min-width: 0; }
.adm-gift-code { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 1.3rem; font-weight: 900; letter-spacing: 0.15em; padding: 6px 10px; border-radius: 12px; cursor: pointer; color: inherit; background: color-mix(in srgb, #f3c24f 16%, var(--surface-2)); border: 1px dashed color-mix(in srgb, #f3c24f 55%, var(--border)); }
.adm-gift-code svg { font-size: 0.9rem; opacity: 0.7; }
.adm-gift-buyer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.adm-gift-player { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.adm-gift-player > span { display: grid; }
.adm-gift-tg { display: grid; justify-items: end; gap: 4px; }
.adm-gift-nouser { display: inline-flex; align-items: center; gap: 5px; color: #b07400; text-align: right; }
.adm-gift-id { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 0.8rem; background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); }
.adm-gift-done { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ok, #12855a); flex-wrap: wrap; }
@media (max-width: 420px) { .adm-gift-tg { justify-items: start; } .adm-gift-nouser { text-align: left; } }
.adm-gch { display: grid; gap: 8px; margin: 4px 0 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.adm-gch-row { display: grid; gap: 4px; }
.adm-gch-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.adm-gch-cur { display: grid; gap: 4px; }
.adm-gch-pick { display: grid; gap: 8px; }
.adm-gch-pick ol { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.adm-gch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.adm-gch-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.adm-rt { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.adm-rt p { margin: 4px 0 0; }

/* no long-press link / image menus inside the app (Telegram shows the site URL there) */
a,
img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
a[role='link'] {
  cursor: pointer;
}
/* Telegram on Android opens its own image menu (Open in / Download / copy link) on long press, ignoring JS;
   pictures that can't be hit-tested never get it. Taps fall through to the card/button around them. */
img {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ================================================================= DAMEO 3.2 — premium 3D pieces, kings, move effects */
.piece-w { --edge-base: #b3bedb; }
.piece-b { --edge-base: #0c1326; }
/* the coin's side: a stadium shape under the disc; only its lower band shows → real thickness */
.piece-edge {
  position: absolute;
  width: 78%;
  height: 85.8%;
  border-radius: 50% / 45.45%;
  transform: translateY(4.55%);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(255, 255, 255, 0.24) 26%, rgba(255, 255, 255, 0.06) 50%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(var(--edge-base), var(--edge-base)),
    #151c32;
  box-shadow: 0 5px 9px rgba(0, 0, 0, 0.45), 0 1px 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.piece-disc {
  z-index: 1;
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.28), inset 0 -3px 5px rgba(0, 0, 0, 0.32), inset 0 0 0 2px var(--ring-c);
}
/* kings: two stacked stones with a seam between them */
.piece-king .piece-edge {
  height: 93.6%;
  border-radius: 50% / 41.67%;
  transform: translateY(8.33%);
  background:
    linear-gradient(180deg, transparent 0 90.4%, rgba(0, 0, 0, 0.5) 90.4% 91.6%, rgba(255, 255, 255, 0.3) 91.6% 92.6%, transparent 92.6%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(255, 255, 255, 0.24) 26%, rgba(255, 255, 255, 0.06) 50%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(var(--edge-base), var(--edge-base)),
    #151c32;
}
/* glossy top light */
.p-gloss {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse 58% 34% at 38% 22%, rgba(255, 255, 255, 0.5), transparent 70%),
    radial-gradient(ellipse 60% 22% at 55% 92%, rgba(255, 255, 255, 0.12), transparent 70%);
}
.piece-b .p-gloss { opacity: 0.55; }
/* the crown */
.piece-crown {
  z-index: 2;
  width: 58%;
  height: 58%;
  color: inherit;
  overflow: visible;
  filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 4px rgba(255, 200, 80, 0.35));
  animation: king-float 3.2s ease-in-out infinite;
}
.piece-w .piece-crown { color: inherit; }
.piece-b { --gem: #ff4d6d; }
.piece-w { --gem: #4dabff; }
@keyframes king-float { 50% { transform: translateY(-5%) scale(1.03); } }
/* king aura: a slow golden halo turning around the stone */
.piece-king::after {
  content: '';
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: conic-gradient(from 0deg, transparent 0 8%, rgba(255, 214, 102, 0.75) 16%, transparent 28% 52%, rgba(255, 244, 200, 0.6) 66%, transparent 78%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  filter: drop-shadow(0 0 3px rgba(255, 200, 80, 0.8));
  animation: stm-spin 3.6s linear infinite;
}
.piece-gone::after { animation: none; }
.st-off .piece-crown, .st-off .piece-king::after { animation: none; }
.st-off .piece-king::after { opacity: 0.5; }
/* crowning moment: the crown drops in, golden rays and a shock ring */
.piece-crowned { z-index: 5; }
.piece-crowned .piece-crown { animation: crown-drop 0.9s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.piece-crowned .piece-disc { animation: king-pop 0.9s ease-out; }
@keyframes crown-drop {
  0% { transform: translateY(-190%) scale(1.9) rotate(-12deg); opacity: 0; }
  55% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes king-pop { 40% { transform: scale(1.14); } }
.crown-burst {
  position: absolute;
  inset: -70%;
  pointer-events: none;
  z-index: 4;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 220, 110, 0) 0deg 9deg, rgba(255, 220, 110, 0.6) 9deg 12deg);
  -webkit-mask: radial-gradient(circle, transparent 18%, #000 26%, transparent 66%);
  mask: radial-gradient(circle, transparent 18%, #000 26%, transparent 66%);
  animation: crown-rays 1.25s ease-out forwards;
}
.crown-burst::after {
  content: '';
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  border: 3px solid rgba(255, 226, 140, 0.9);
  box-shadow: 0 0 14px rgba(255, 200, 80, 0.9);
  animation: crown-ring 0.9s ease-out forwards;
}
@keyframes crown-rays { from { transform: scale(0.3) rotate(0); opacity: 1; } to { transform: scale(1.25) rotate(40deg); opacity: 0; } }
@keyframes crown-ring { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
/* move effects: particles on the canvas; the old CSS burst stays only as the calm fallback (and in shop cards) */
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }
.fx-probe { display: none; }
html:not(.calm) .fx-premium .board .fx-burst { display: none; }
html.calm .fx-canvas { display: none; }
@media (prefers-reduced-motion: reduce) {
  .piece-crown, .piece-king::after, .crown-burst, .crown-burst::after, .piece-crowned .piece-disc { animation: none !important; }
  .fx-canvas { display: none; }
}
html.calm .piece-crown, html.calm .piece-king::after { animation: none; }
.piece-gone .piece-edge { display: none; }


/* =====================================================================
   DAMEO 3.3 skin — "Arena Purple" (beta)
   Deep night-violet background, purple glass cards with a soft neon rim,
   pill buttons with glow, floating tab bar with a lit active tab.
   CSS-only layer: delete this block to return to the previous look.
   ===================================================================== */
:root[data-theme='dark'] {
  --bg: #08061a;
  --bg-2: #0e0a2a;
  --surface: #140f33;
  --surface-2: #1b1442;
  --border: #2c2160;
  --border-strong: #3d2e80;
  --text: #f1edff;
  --muted: #a69cd0;
  --accent: #8b5cf6;
  --accent-hover: #a07bff;
  --accent-soft: #2a1c66;
  --on-accent: #ffffff;
  --gold: #f6c343;
  --gold-soft: #3a2a0c;
  --ok: #34d399;
  --ok-soft: #0d3326;
  --sq-light: #3a2d7a;
  --sq-dark: #1a1342;
  --board-edge: #0a0620;
  --piece-b-ring: rgba(180, 150, 255, 0.7);
  --ambient-1: rgba(139, 92, 246, 0.18);
  --ambient-2: rgba(59, 130, 246, 0.08);
  --glass-fill: linear-gradient(150deg, rgba(150, 110, 255, 0.14), rgba(60, 40, 150, 0.06));
  --glass-fill-strong: linear-gradient(150deg, rgba(150, 110, 255, 0.2), rgba(50, 30, 130, 0.12));
  --glass-edge: rgba(180, 150, 255, 0.4);
  --glass-edge-soft: rgba(160, 125, 255, 0.2);
  --glass-hi: rgba(225, 210, 255, 0.18);
  --glass-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.35);
  --blob-1: rgba(139, 92, 246, 0.3);
  --blob-2: rgba(76, 60, 220, 0.2);
  --blob-3: rgba(170, 70, 255, 0.12);
  --neon: 0 0 0 1px rgba(160, 125, 255, 0.22), 0 0 24px rgba(139, 92, 246, 0.16);
}
:root[data-theme='light'] {
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: #ede5ff;
  --bg: #f4f1fc;
  --bg-2: #ebe5fa;
  --border: #ddd4f3;
  --blob-1: rgba(124, 58, 237, 0.18);
  --blob-2: rgba(80, 70, 230, 0.12);
  --neon: 0 0 0 1px rgba(124, 58, 237, 0.12), 0 10px 26px rgba(80, 40, 160, 0.1);
}

:root[data-theme='dark'] body {
  background:
    radial-gradient(120% 60% at 50% -10%, #1d1150 0%, transparent 60%),
    radial-gradient(80% 50% at 100% 60%, rgba(90, 50, 200, 0.18), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- header ---------- */
:root[data-theme='dark'] .header {
  background: linear-gradient(180deg, rgba(8, 6, 26, 0.96), rgba(8, 6, 26, 0.82));
  border-bottom-color: transparent;
  box-shadow: none;
}
.coin-badge-header {
  border-radius: 999px;
  border: 1px solid var(--glass-edge-soft);
  background: var(--glass-fill-strong), var(--surface);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.icon-btn,
.user-btn {
  border-radius: 14px;
}

/* ---------- cards: purple glass + neon rim ---------- */
.card,
.mode-card,
.home-stats > div,
.shop-card,
.tour-card,
.ltd-card,
.streak-card,
.option-card,
.radio-card,
.menu-tile,
.wallet-hero,
.ref-hero,
.profile-head,
.lobby {
  border-radius: 22px;
  border: 1px solid var(--glass-edge-soft);
  background: var(--glass-fill), var(--surface);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--neon), var(--glass-shadow);
}
.card { padding: 18px; }

/* stats: three separate glass tiles like the Arena mockup */
.home-stats {
  padding: 0;
  gap: 10px;
  background: none;
  border: 0;
  box-shadow: none;
}
.home-stats > div,
.home-stats > div + div {
  border-left: 1px solid var(--glass-edge-soft);
  align-items: center;
  text-align: center;
  padding: 16px 8px 14px;
  position: relative;
}
.home-stats > div::before {
  content: '';
  width: 26px;
  height: 4px;
  border-radius: 4px;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #f6c343, #f59e0b);
  box-shadow: 0 0 12px rgba(246, 195, 67, 0.6);
}
.home-stats > div:nth-child(2)::before { background: linear-gradient(90deg, #818cf8, #6366f1); box-shadow: 0 0 12px rgba(129, 140, 248, 0.6); }
.home-stats > div:nth-child(3)::before { background: linear-gradient(90deg, #4ade80, #22c55e); box-shadow: 0 0 12px rgba(74, 222, 128, 0.6); }
.home-stat-v { font-size: clamp(1.4rem, 6.5vw, 1.9rem); }
.home-stat-l { text-transform: none; letter-spacing: 0; font-size: 0.82rem; }
.home-stats-badge { top: -10px; right: 50%; transform: translateX(50%); z-index: 1; }

/* daily missions banner */
/* missions banner on the Arena home (base; the Arena skin below restyles it) */
.ms-home { display: flex; align-items: center; gap: 12px; padding: 12px 14px; position: relative; color: inherit; text-decoration: none; }
.ms-home .ms-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ms-ico-gold { background: var(--gold-soft); color: var(--gold); }
.ms-ready { box-shadow: 0 0 0 2px var(--accent) inset, var(--shadow-sm); }
.ms-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.ms-home {
  background: linear-gradient(110deg, #2a1870 0%, #3b1f96 55%, #5b2fd0 100%) !important;
  border-color: rgba(190, 160, 255, 0.35) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 12px 30px rgba(91, 47, 208, 0.35) !important;
  color: #fff;
}
.ms-home .muted { color: rgba(235, 225, 255, 0.78); }
:root[data-theme='light'] .ms-home .ms-title { color: #fff; }

/* mode cards: primary = blue arena card, others = violet glass */
.mode-card {
  min-height: 150px;
  overflow: hidden;
}
.mode-card::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(170, 120, 255, 0.28), transparent 70%);
  pointer-events: none;
}
.mode-card .mode-icon {
  border-radius: 14px;
  background: linear-gradient(145deg, #a78bfa, #7c3aed);
  color: #fff;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.45);
}
.mode-card-accent {
  background: linear-gradient(150deg, #1e3a9a 0%, #1d2f7a 45%, #121a4d 100%) !important;
  border: 1px solid rgba(90, 170, 255, 0.55) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 1px rgba(60, 140, 255, 0.25), 0 0 28px rgba(50, 130, 255, 0.35) !important;
  color: #fff;
}
.mode-card-accent::after { background: radial-gradient(circle, rgba(80, 160, 255, 0.35), transparent 70%); }
.mode-card-accent .mode-icon {
  background: linear-gradient(145deg, #60a5fa, #2563eb);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
}
.mode-card-accent .mode-desc { color: rgba(220, 232, 255, 0.82); }
.mode-go { border-color: var(--glass-edge-soft); background: rgba(255, 255, 255, 0.05); }

/* ---------- buttons: glowing pills ---------- */
.btn { border-radius: 999px; }
.btn-primary,
:root .btn-primary {
  background: linear-gradient(180deg, #a27bff 0%, #8b5cf6 50%, #6d3ae0 100%);
  color: #fff;
  border: 1px solid rgba(200, 175, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(139, 92, 246, 0.25), 0 10px 26px rgba(139, 92, 246, 0.45);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #b393ff 0%, #9a70ff 50%, #7a48ea 100%);
}
.btn-secondary {
  border: 1px solid var(--glass-edge-soft);
}

/* tabs, segments */
.tabs,
.seg,
.chip-tabs {
  border-radius: 999px;
}
.tab,
.seg-btn { border-radius: 999px; }
.tab-active,
.seg-on {
  background: linear-gradient(180deg, #a27bff, #7c4ff0) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 18px rgba(139, 92, 246, 0.45) !important;
}

/* rows, chips, badges */
.row { border-radius: 16px; }
.rank-chip { border-radius: 10px; }
.badge { border-radius: 999px; }
.dot-on { background: #22c55e; }
.section-head h2,
.card h2 { font-family: var(--font-display); }
a.see-all,
.link-btn { color: #b69cff; }

/* ---------- floating tab bar ---------- */
@media (max-width: 1000px) {
  .bottom-nav {
    background: linear-gradient(180deg, rgba(30, 22, 70, 0.96), rgba(16, 11, 42, 0.98)) !important;
    border: 1px solid rgba(160, 125, 255, 0.28) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(139, 92, 246, 0.18) !important;
  }
  :root[data-theme='light'] .bottom-nav {
    background: linear-gradient(180deg, #ffffff, #f3eefe) !important;
  }
  .bn-item { color: #a9a0cf; }
  :root[data-theme='light'] .bn-item { color: #6b6290; }
  .bottom-nav .bn-active {
    color: #c4a8ff;
    background: radial-gradient(80% 90% at 50% 100%, rgba(139, 92, 246, 0.42), rgba(139, 92, 246, 0.08) 70%) !important;
    box-shadow: inset 0 0 0 1px rgba(160, 125, 255, 0.25) !important;
  }
  :root[data-theme='light'] .bottom-nav .bn-active { color: #7c3aed; }
  .bottom-nav .bn-active::before {
    display: block;
    top: auto;
    bottom: 2px;
    width: 34px;
    height: 3px;
    border-radius: 3px;
    background: #a27bff;
    box-shadow: 0 0 10px #8b5cf6, 0 0 18px #8b5cf6;
  }
  .bottom-nav .bn-active svg { filter: drop-shadow(0 0 6px rgba(160, 120, 255, 0.8)); }
}

/* ---------- sheets, modals, inputs ---------- */
.modal,
.sheet,
.popover-panel {
  border-radius: 24px;
  border: 1px solid var(--glass-edge-soft);
}
:root[data-theme='dark'] .sheet,
:root[data-theme='dark'] .modal {
  background: linear-gradient(180deg, #1a1244, #110c30);
}
.input,
.search,
.input-wrap {
  border-radius: 14px;
}
.input:focus,
.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

/* ---------- board plinth glow ---------- */
:root[data-theme='dark'] .board {
  box-shadow: 0 0 0 1px rgba(160, 125, 255, 0.3), 0 0 36px rgba(139, 92, 246, 0.22), 0 24px 60px rgba(0, 0, 0, 0.5);
}
:root[data-theme='dark'] .player-bar {
  border-radius: 18px;
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--neon);
}

/* ===================================================== Arena (beta 3.3): home layout + smooth feel */

/* --- feel: instant taps, soft press, no grey flash, short page fade --- */
a, button, .bn-item, .arena-stat { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn, .arena-find, .arena-mode-btn, .arena-watch, .arena-round-go, .arena-stat, .ms-home, .bn-item, .shop-card, .row, .tab, .seg-btn, .mode-card, .menu-row, .menu-tile {
  transition: transform 0.16s var(--ease), filter 0.16s var(--ease), background-color 0.2s, border-color 0.2s;
  will-change: transform;
}
.btn:active:not(:disabled), .arena-find:active, .arena-mode-btn:active, .arena-watch:active, .arena-round-go:active,
.arena-stat:active, .ms-home:active, .shop-card:active, .row:active, .mode-card:active, .menu-row:active, .menu-tile:active {
  transform: scale(0.96);
  filter: brightness(1.12);
}
.page-enter { animation: pageIn 0.22s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translate3d(0, 6px, 0); } }
html { scroll-behavior: smooth; }

/* --- header like the mockup --- */
.header-inner { gap: 10px; }
.header-menu-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--glass-edge-soft);
  background: var(--glass-fill-strong), var(--surface);
}
.coin-badge-header { padding: 6px 14px; font-weight: 800; }

/* --- page --- */
.page-home { gap: 16px; padding-top: 14px; }

.arena-round-go {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.3rem;
  background: rgba(14, 8, 40, 0.6);
  border: 1px solid rgba(200, 175, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* greeting hero */
.arena-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 152px;
  padding: 14px 14px 14px 6px;
  border-radius: 26px;
  overflow: hidden;
  color: #fff;
  background:
    repeating-conic-gradient(rgba(255, 255, 255, 0.045) 0 25%, transparent 0 50%) 100% 0 / 40px 40px,
    radial-gradient(70% 120% at 15% 60%, rgba(150, 90, 255, 0.45), transparent 60%),
    linear-gradient(120deg, #2a1470 0%, #1b0f4f 55%, #110a36 100%);
  border: 1px solid rgba(170, 135, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 26px rgba(139, 92, 246, 0.25), 0 16px 36px rgba(0, 0, 0, 0.45);
}
.arena-hero::before {
  content: '';
  position: absolute;
  inset: 0 0 0 55%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.05) 0 25%, transparent 0 50%) 0 0 / 34px 34px;
  transform: perspective(260px) rotateY(-28deg);
  -webkit-mask: linear-gradient(90deg, transparent, #000 40%);
  mask: linear-gradient(90deg, transparent, #000 40%);
  pointer-events: none;
}
.arena-hero-art { flex: none; display: grid; place-items: center; width: 120px; height: 120px; position: relative; }
.arena-hero-art::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(190, 130, 255, 0.55), rgba(120, 60, 230, 0.15) 55%, transparent 72%);
}
.arena-hero-crown {
  position: relative;
  width: 100px;
  height: 100px;
  filter: hue-rotate(215deg) saturate(1.4) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 16px rgba(180, 120, 255, 0.6));
}
.arena-hero-text { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.arena-hero-title { font-family: var(--font-display); font-weight: 800; font-size: 1.22rem; line-height: 1.2; overflow-wrap: anywhere; }
.arena-hero-sub { color: rgba(225, 215, 255, 0.8); font-size: 0.95rem; }
.arena-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(139, 92, 246, 0.28);
  border: 1px solid rgba(190, 160, 255, 0.5);
}
.arena-chip svg { color: #fbbf24; fill: #fbbf24; }
.arena-hero-go { position: absolute; right: 14px; bottom: 14px; width: 42px; height: 42px; }

/* big find-opponent pill with orbit ring */
.arena-find {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 4px;
  padding: 18px 14px 18px 26px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(100deg, #6a35dc 0%, #8b5cf6 55%, #7c3aed 100%);
  border: 1px solid rgba(215, 195, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 0 4px rgba(139, 92, 246, 0.14), 0 0 36px rgba(139, 92, 246, 0.6), 0 14px 30px rgba(60, 20, 150, 0.5);
}
.arena-find::before {
  content: '';
  position: absolute;
  inset: -10px -8px;
  border-radius: 999px;
  border: 2px solid transparent;
  border-top-color: rgba(190, 150, 255, 0.85);
  border-bottom-color: rgba(150, 100, 255, 0.5);
  transform: rotate(-4deg);
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(170, 120, 255, 0.9));
}
.arena-find-ico { flex: none; font-size: 2.1rem; fill: #fff; filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6)); }
.arena-find-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.arena-find-title { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; line-height: 1.15; }
.arena-find-sub { font-size: 0.9rem; color: rgba(240, 232, 255, 0.85); }
.arena-find .arena-round-go { background: rgba(40, 15, 110, 0.6); }

/* three stat tiles */
.arena-stats { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.arena-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 118px;
  padding: 12px 6px;
  border-radius: 22px;
  text-align: center;
  color: var(--text);
  background: var(--glass-fill), var(--surface);
  border: 1px solid var(--glass-edge-soft);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--neon);
}
.arena-stat-ico { font-size: 1.6rem; margin-bottom: 4px; }
.ico-gold { color: #fbbf24; fill: rgba(251, 191, 36, 0.35); filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5)); }
.ico-indigo { color: #818cf8; filter: drop-shadow(0 0 8px rgba(129, 140, 248, 0.5)); }
.arena-stat-v { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.35rem, 6.4vw, 1.8rem); line-height: 1.1; white-space: nowrap; }
.arena-stat-l { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); line-height: 1.2; }
.arena-ring { position: relative; display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 2px; }
.arena-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.arena-ring circle { fill: none; stroke-width: 6; }
.arena-ring-bg { stroke: rgba(160, 125, 255, 0.16); }
.arena-ring-fg { stroke: #22c55e; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.8)); }
.arena-ring-v { position: relative; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.arena-stats-badge { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 1; }

/* missions banner (component lives in Missions.tsx) */
.ms-home { position: relative; min-height: 84px; padding: 16px 64px 16px 16px !important; border-radius: 22px !important; }
.ms-home .ms-ico {
  width: 54px;
  height: 54px;
  flex: none;
  background: radial-gradient(circle, #fff 0 14%, #ef4444 15% 33%, #fff 34% 50%, #ef4444 51% 68%, #fff 69% 100%) !important;
  color: transparent !important;
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}
.ms-home .ms-title { font-size: 1.1rem; font-weight: 800; }
.ms-home-go {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(14, 8, 40, 0.5);
  border: 1px solid rgba(200, 175, 255, 0.35);
  color: #fff;
}
.ms-home .ms-dot { right: 58px; }

/* two big mode cards */
.arena-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.arena-mode {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 250px;
  padding: 18px 12px 12px 14px;
  border-radius: 24px;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
}
.arena-mode-blue {
  background: linear-gradient(160deg, #1f4ac0 0%, #16318a 50%, #0c1950 100%);
  border: 1.5px solid rgba(90, 175, 255, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 26px rgba(50, 130, 255, 0.4);
}
.arena-mode-violet {
  background: linear-gradient(160deg, #4a24a6 0%, #33197c 50%, #1c0f4c 100%);
  border: 1.5px solid rgba(180, 140, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 26px rgba(139, 92, 246, 0.4);
}
.arena-mode-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.arena-mode-blue .arena-mode-art {
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.07) 0 25%, rgba(0, 0, 30, 0.25) 0 50%) 0 0 / 26px 26px;
  -webkit-mask: radial-gradient(90% 60% at 100% 35%, #000 30%, transparent 75%);
  mask: radial-gradient(90% 60% at 100% 35%, #000 30%, transparent 75%);
}
.am-piece {
  position: absolute;
  width: 46px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(60% 50% at 50% 35%, #6b8cff, #1e3a9a 70%);
  box-shadow: 0 5px 0 #0b1a5a, 0 0 14px rgba(80, 150, 255, 0.6);
}
.am-p1 { right: 26px; top: 66px; }
.am-p2 { right: -6px; top: 98px; background: radial-gradient(60% 50% at 50% 35%, #d8a0ff, #7c3aed 70%); box-shadow: 0 5px 0 #3b1580, 0 0 14px rgba(170, 110, 255, 0.7); }
.am-p3 { right: 46px; top: 30px; opacity: 0.7; }
.am-head { position: absolute; border-radius: 50%; background: linear-gradient(160deg, #b693ff, #6d3ae0); box-shadow: 0 0 18px rgba(170, 120, 255, 0.55); }
.am-head::after { content: ''; position: absolute; left: 50%; top: 110%; width: 170%; height: 110%; transform: translateX(-50%); border-radius: 50% 50% 18% 18%; background: inherit; }
.am-h1 { right: 18px; top: 60px; width: 34px; height: 34px; }
.am-h2 { right: 60px; top: 82px; width: 22px; height: 22px; opacity: 0.85; }
.arena-mode .arena-mode-art { -webkit-mask-composite: source-over; }
.arena-mode-violet .arena-mode-art { -webkit-mask: linear-gradient(180deg, #000 55%, transparent 80%); mask: linear-gradient(180deg, #000 55%, transparent 80%); }
.arena-mode-ico { font-size: 2.4rem; margin-bottom: 14px; }
.arena-mode-blue .arena-mode-ico { color: #93c5fd; filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.9)); }
.arena-mode-violet .arena-mode-ico { color: #c4b5fd; fill: rgba(167, 139, 250, 0.5); filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.9)); }
.arena-mode-title { font-family: var(--font-display); font-weight: 800; font-size: 1.22rem; line-height: 1.2; }
.arena-mode-desc { font-size: 0.85rem; line-height: 1.35; color: rgba(225, 228, 255, 0.82); }
.arena-mode-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 800;
  color: #fff;
}
.arena-mode-blue .arena-mode-btn {
  background: linear-gradient(180deg, #1d5bf0, #1740b8);
  border: 1.5px solid rgba(120, 195, 255, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 16px rgba(59, 130, 246, 0.6);
}
.arena-mode-violet .arena-mode-btn {
  background: linear-gradient(180deg, #7a3aec, #5520b0);
  border: 1.5px solid rgba(200, 170, 255, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 16px rgba(139, 92, 246, 0.6);
}

/* live games */
.arena-live { display: flex; flex-direction: column; gap: 10px; }
.arena-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.arena-sec-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.3rem; }
.arena-flame { color: #a855f7; fill: rgba(168, 85, 247, 0.65); font-size: 1.6rem; filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.6)); }
.arena-see-all { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.arena-live-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 22px;
  background: var(--glass-fill), var(--surface);
  border: 1px solid var(--glass-edge-soft);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--neon);
}
.arena-live-empty { justify-content: center; min-height: 70px; }
.arena-live-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.arena-live-on { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted); }
.arena-live-title { font-weight: 800; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arena-live-sub { font-size: 0.82rem; color: var(--muted); }
.arena-watch {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(180deg, #5b2fd0, #3f1d96);
  border: 1px solid rgba(190, 160, 255, 0.55);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.45);
}

/* light theme: keep the hero/find/mode cards as they are (they carry their own colours) */
:root[data-theme='light'] .arena-stat,
:root[data-theme='light'] .arena-live-row { background: #fff; }

@media (max-width: 380px) {
  .arena-hero-art { width: 92px; height: 92px; }
  .arena-hero-crown { width: 76px; height: 76px; }
  .arena-hero-title { font-size: 1.08rem; }
  .arena-find { padding: 16px 12px 16px 20px; }
  .arena-find-title { font-size: 1.2rem; }
  .arena-mode { min-height: 230px; }
  .arena-mode-title { font-size: 1.05rem; }
  .arena-watch { padding: 9px 11px; }
}

/* --- the rest of the app: rounder, calmer, one button language --- */
.card, .shop-card, .tour-card, .ltd-card, .lobby, .wallet-hero, .profile-head, .ref-hero { border-radius: 24px; }
.btn { min-height: 44px; font-weight: 700; }
.btn-sm { min-height: 36px; }
.btn-secondary, .btn-ghost { border-radius: 999px; }
.icon-btn { border-radius: 14px; }
.avatar { border-radius: 50%; }
.page-head h1, .page h1 { font-family: var(--font-display); letter-spacing: -0.01em; }
.footer { display: none; }
.am-p1 { right: 14px; top: 40px; }
.am-p2 { right: -10px; top: 66px; }
.am-p3 { right: 52px; top: 16px; }
.am-h1 { right: 14px; top: 34px; }
.am-h2 { right: 54px; top: 52px; }
.arena-mode-title, .arena-mode-desc { position: relative; text-shadow: 0 2px 10px rgba(0, 0, 20, 0.6); }

/* Play: round glowing mode tiles */
.mode-list { gap: 12px; }
.mode-tab {
  border-radius: 22px !important;
  padding: 16px 14px !important;
  min-height: 112px;
  align-items: flex-start;
}
.mode-tab .mode-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.35rem;
  color: #fff;
  background: linear-gradient(145deg, #a78bfa, #6d3ae0);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.55);
}
.mode-tab-active {
  background: linear-gradient(150deg, #5b2fd0, #33197c) !important;
  border-color: rgba(200, 170, 255, 0.7) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 24px rgba(139, 92, 246, 0.5) !important;
  color: #fff;
}
.mode-tab-active .mode-icon { background: #fff; color: #6d3ae0; }
.play-panel { border-radius: 26px !important; }
.play-panel .btn-primary { min-height: 54px; font-size: 1.05rem; }
.notice { border-radius: 18px; }

/* ===================================================== Arena v2: ads carousel, level bar, quick actions */
/* header is solid so scrolled content never shows through it */
:root[data-theme='dark'] .header { background: #0a0720 !important; border-bottom: 1px solid rgba(160, 125, 255, 0.12); }
:root[data-theme='light'] .header { background: #f4f1fc !important; }

.promo { display: flex; flex-direction: column; gap: 8px; }
.promo-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  border-radius: 24px;
}
.promo-track::-webkit-scrollbar { display: none; }
.promo-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; scroll-snap-stop: always; }
.promo-slide > a { height: 100%; min-height: 140px; border-radius: 24px; }
.promo-dots { display: flex; justify-content: center; gap: 6px; }
.promo-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(170, 150, 230, 0.35);
  transition: width 0.25s var(--ease), background-color 0.25s;
}
.promo-dot-on { width: 22px; background: #a27bff; box-shadow: 0 0 8px rgba(162, 123, 255, 0.8); }

.bookly-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 10px;
  color: #fff;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(110% 90% at 100% 100%, rgba(253, 224, 71, 0.22), transparent 55%),
    radial-gradient(90% 120% at 0% 0%, rgba(45, 212, 191, 0.4), transparent 60%),
    linear-gradient(135deg, #082f35 0%, #0b1f33 55%, #0a0f24 100%);
  border: 1.5px solid rgba(45, 212, 191, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 22px rgba(45, 212, 191, 0.25);
}
.bookly-art { flex: 0 0 44%; display: grid; place-items: center; }
.bookly-book { width: 100%; max-width: 170px; height: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 14px rgba(45, 212, 191, 0.35)); }
.bookly-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bookly-name { align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; color: #0b2b2c; background: linear-gradient(90deg, #5eead4, #fde047); }
.bookly-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1rem, 4.4vw, 1.2rem); line-height: 1.2; }
.bookly-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.bookly-sub { font-size: 0.8rem; color: rgba(220, 245, 240, 0.82); line-height: 1.3; }
.bookly-go { background: #0d3a3e !important; border-color: rgba(94, 234, 212, 0.45) !important; }

/* level progress */
.arena-level {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px 12px;
  padding: 12px 16px;
  border-radius: 20px;
  color: var(--text);
  background: var(--glass-fill), var(--surface);
  border: 1px solid var(--glass-edge-soft);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--neon);
}
.arena-level-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-family: var(--font-display); }
.arena-level-badge svg { color: #fbbf24; fill: #fbbf24; }
.arena-level-bar { height: 10px; border-radius: 999px; background: rgba(160, 125, 255, 0.16); overflow: hidden; }
.arena-level-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7c3aed, #c084fc); box-shadow: 0 0 10px rgba(192, 132, 252, 0.7); transition: width 0.6s var(--ease); }
.arena-level-next { grid-column: 1 / -1; font-size: 0.8rem; color: var(--muted); }

/* quick round actions */
.arena-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.arena-q {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  transition: transform 0.16s var(--ease);
}
.arena-q:active { transform: scale(0.92); }
.arena-q-ico {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  font-size: 1.55rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.q-blue { background: linear-gradient(145deg, #3b82f6, #1e3a9a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 18px rgba(59, 130, 246, 0.5); }
.q-violet { background: linear-gradient(145deg, #a78bfa, #5b21b6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 18px rgba(139, 92, 246, 0.5); }
.q-gold { background: linear-gradient(145deg, #fbbf24, #b45309); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 18px rgba(251, 191, 36, 0.45); }
.q-green { background: linear-gradient(145deg, #34d399, #047857); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 18px rgba(52, 211, 153, 0.45); }
@media (max-width: 360px) { .arena-q-ico { width: 54px; height: 54px; } }

/* ===================================================== Rating (beta 3.3): my-place card, stage podium, card list */
.lb-page { gap: 16px; padding-top: 14px; }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lb-top .h1 { margin: 0; }

.lb-me {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 14px;
  padding: 18px;
  border-radius: 26px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(170, 110, 255, 0.45), transparent 60%),
    linear-gradient(130deg, #3b1f96 0%, #24125e 60%, #150b3c 100%);
  border: 1px solid rgba(190, 160, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 0 28px rgba(139, 92, 246, 0.35);
}
.lb-me-left { display: flex; flex-direction: column; }
.lb-me-label { font-size: 0.8rem; color: rgba(230, 220, 255, 0.75); }
.lb-me-rank { font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; line-height: 1.05; text-shadow: 0 0 18px rgba(200, 160, 255, 0.6); }
.lb-me-of { font-size: 0.78rem; color: rgba(230, 220, 255, 0.7); }
.lb-me-right { display: flex; flex-wrap: wrap; align-content: center; justify-content: flex-end; gap: 6px; }
.lb-me-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  background: rgba(10, 5, 35, 0.4);
  border: 1px solid rgba(200, 175, 255, 0.35);
}
.lb-me-chip svg { color: #fbbf24; }
.lb-me-chip-lv { color: #e9d5ff; }
.lb-me-chip-pct { color: #4ade80; border-color: rgba(74, 222, 128, 0.45); }
.lb-me-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(10, 5, 35, 0.35);
}
.lb-me-foot svg { color: #4ade80; flex: none; }

.lb-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; }
.lb-tabs .tab { justify-content: center; text-align: center; padding: 10px 6px; }

/* stage podium: pedestals of different height */
.lb-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  padding: 26px 6px 0;
  border-radius: 26px;
  background: radial-gradient(70% 70% at 50% 100%, rgba(139, 92, 246, 0.35), transparent 70%);
}
.lb-pod { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); min-width: 0; }
.lb-pod-crown {
  position: absolute;
  top: -26px;
  font-size: 1.8rem;
  color: #fbbf24;
  fill: rgba(251, 191, 36, 0.55);
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.8));
}
.lb-pod-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 0.85rem; }
.lb-pod-rating { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; color: var(--muted); }
.lb-pod-1 .lb-pod-rating { color: #fbbf24; }
.lb-pod-step {
  align-self: stretch;
  display: grid;
  place-items: start center;
  padding-top: 10px;
  margin-top: 6px;
  border-radius: 18px 18px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 0;
}
.lb-pod-1 .lb-pod-step { height: 96px; background: linear-gradient(180deg, #f6c343, #b7791f 70%, rgba(120, 70, 10, 0.4)); box-shadow: 0 0 24px rgba(246, 195, 67, 0.4); }
.lb-pod-2 .lb-pod-step { height: 70px; background: linear-gradient(180deg, #cbd5e1, #64748b 70%, rgba(60, 70, 90, 0.4)); }
.lb-pod-3 .lb-pod-step { height: 54px; background: linear-gradient(180deg, #e2a26b, #9a5b2c 70%, rgba(90, 50, 20, 0.4)); }
.lb-pod-n { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: rgba(255, 255, 255, 0.95); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }

.lb-search { width: 100%; max-width: none; border-radius: 999px !important; }

.lb-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; transition: opacity 0.2s; }
.lb-cards.is-loading { opacity: 0.55; }
.lb-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: 20px;
  color: var(--text);
  background: var(--glass-fill), var(--surface);
  border: 1px solid var(--glass-edge-soft);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  transition: transform 0.16s var(--ease);
}
.lb-card:active { transform: scale(0.97); }
.lb-card-me { border-color: rgba(190, 160, 255, 0.8); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 18px rgba(139, 92, 246, 0.45); }
.lb-card-rank {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--muted);
  background: rgba(160, 125, 255, 0.1);
}
.lb-card-rank-top { color: #fff; background: linear-gradient(145deg, #8b5cf6, #5b21b6); box-shadow: 0 0 10px rgba(139, 92, 246, 0.5); }
.lb-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lb-card-name { display: flex; align-items: center; gap: 6px; font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lb-card-sub { font-size: 0.78rem; color: var(--muted); }
.lb-card-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-family: var(--font-display); }
.lb-card-end strong { font-size: 1.05rem; }

.lb-pager { justify-content: center; gap: 14px; }
.lb-pager .icon-btn { border-radius: 50%; width: 44px; height: 44px; }
.lb-pager-n { font-weight: 700; color: var(--muted); }

/* floating "you" bar once the card scrolls away */
.lb-mebar {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom) + var(--tg-bottom, 0px));
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  color: #fff;
  font: inherit;
  background: linear-gradient(100deg, #6d3ae0, #8b5cf6);
  border: 1px solid rgba(215, 195, 255, 0.6);
  box-shadow: 0 0 22px rgba(139, 92, 246, 0.6), 0 10px 24px rgba(0, 0, 0, 0.45);
  animation: mebarIn 0.25s var(--ease) both;
}
@keyframes mebarIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.lb-mebar-rank { padding: 6px 10px; border-radius: 999px; background: rgba(20, 8, 60, 0.5); font-weight: 800; }
.lb-mebar-name { font-weight: 700; }
@media (min-width: 1001px) { .lb-mebar { bottom: 24px; } }
.lb-search { flex: none !important; }
.lb-tabs { width: 100%; align-self: stretch; }

/* ===================================================== Beta 3.3 — whole-app pass */

/* page heads: title only, short and clean (long descriptions removed) */
.page-head > div > p.muted { display: none; }
.page-head { align-items: center; }
.page-head .h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.6rem; }
.page-head .h1 > svg { color: #b69cff; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 14px; border: 1px solid var(--glass-edge-soft); background: var(--glass-fill-strong), var(--surface); color: var(--text); font-size: 1.15rem; }

/* tabs that do not fit: equal pills that scroll instead of cutting text */
.tabs { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; white-space: nowrap; }
.chip-tabs { padding: 2px 2px 6px; margin-bottom: 0; }
.chip-tab { border-radius: 999px; border-color: var(--glass-edge-soft); background: var(--glass-fill), var(--surface); font-weight: 700; }
.chip-tab-on { background: linear-gradient(180deg, #a27bff, #7c4ff0) !important; color: #fff !important; border-color: transparent !important; box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4); }

/* ---------- menu sheet ---------- */
.sheet { border-radius: 0 28px 28px 0; }
@media (max-width: 1000px) { .sheet { border-radius: 28px 28px 0 0; } }
.sheet-me-link { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; min-width: 0; }
.sheet-me-open { display: inline-flex; align-items: center; gap: 2px; font-size: 0.8rem; font-weight: 700; color: #b69cff; }
.sheet-coins {
  border-radius: 22px !important;
  background: linear-gradient(110deg, #3b1f96, #5b2fd0) !important;
  border: 1px solid rgba(190, 160, 255, 0.45) !important;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}
.sheet-coins-label { color: rgba(235, 225, 255, 0.8) !important; }
.menu-tiles-round { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; margin: 4px 0 6px; }
.menu-tiles-round .menu-tile {
  min-height: 0;
  padding: 0;
  gap: 7px;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  color: var(--text);
}
.menu-tiles-round .menu-tile > svg {
  box-sizing: content-box;
  width: 22px;
  height: 22px;
  padding: 16px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #a78bfa, #5b21b6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 14px rgba(139, 92, 246, 0.45);
}
.menu-tiles-round li:nth-child(2) .menu-tile > svg { background: linear-gradient(145deg, #fbbf24, #b45309); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 14px rgba(251, 191, 36, 0.4); }
.menu-tiles-round li:nth-child(3) .menu-tile > svg { background: linear-gradient(145deg, #60a5fa, #1d4ed8); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 14px rgba(59, 130, 246, 0.45); }
.menu-tiles-round li:nth-child(5) .menu-tile > svg { background: linear-gradient(145deg, #f472b6, #be185d); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 14px rgba(236, 72, 153, 0.4); }
.menu-tiles-round li:nth-child(8) .menu-tile > svg { background: linear-gradient(145deg, #34d399, #047857); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 14px rgba(52, 211, 153, 0.4); }
.menu-rows-card {
  border-radius: 22px;
  overflow: hidden;
  background: var(--glass-fill), var(--surface);
  border: 1px solid var(--glass-edge-soft);
}
.menu-rows-card .menu-row { border-radius: 0; padding: 14px 16px; }
.menu-rows-card li + li .menu-row { border-top: 1px solid var(--glass-edge-soft); }
.menu-row-ico { border-radius: 50% !important; }

/* ---------- play page ---------- */
.play-head { flex-wrap: nowrap; }
.play-rules { flex: none; }
.pp { display: flex; flex-direction: column; gap: 14px; }
.pp-desc { margin: 0; color: var(--muted); line-height: 1.4; }
.pp-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(160, 125, 255, 0.3);
}
.pp-field { display: flex; flex-direction: column; gap: 8px; }
.pp-label { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.pp-levels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.pp-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border-radius: 18px;
  font: inherit;
  font-weight: 800;
  color: var(--text);
  background: var(--glass-fill), var(--surface-2);
  border: 1px solid var(--glass-edge-soft);
  transition: transform 0.16s var(--ease), background-color 0.2s;
}
.pp-level:active { transform: scale(0.95); }
.pp-level-on {
  color: #fff;
  background: linear-gradient(160deg, #7c3aed, #4c1d95);
  border-color: rgba(200, 170, 255, 0.7);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.5);
}
.pp-stars { display: flex; gap: 3px; font-weight: 800; color: #fbbf24; min-height: 12px; align-items: center; }
.pp-stars i { width: 10px; height: 10px; clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 35%); background: rgba(251, 191, 36, 0.25); }
.pp-stars i.on { background: #fbbf24; }
.pp-hint { font-size: 0.82rem; color: var(--muted); }
.pp-seg { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pp-seg .seg-btn { justify-content: center; display: inline-flex; align-items: center; gap: 6px; }
.pp-side { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.pp-side-w { background: radial-gradient(circle at 35% 30%, #fff, #c7cde0); }
.pp-side-b { background: radial-gradient(circle at 35% 30%, #6b7280, #111827); border: 1px solid rgba(255, 255, 255, 0.3); }
.pp-side-r { background: linear-gradient(90deg, #fff 50%, #111827 50%); border: 1px solid rgba(255, 255, 255, 0.3); }
.play-panel .btn-lg { margin-top: 4px; }
.play-panel .match-stage { min-height: 0; padding: 4px 0 0; }

/* ---------- game screen ---------- */
.game-page { padding-top: 10px; gap: 10px; }
.game-top { display: flex; align-items: center; justify-content: space-between; }
.game-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: var(--glass-fill-strong), var(--surface);
  border: 1px solid var(--glass-edge-soft);
}
.game-rules { width: 40px; height: 40px; }
.game-side { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; display: flex; flex-direction: column; gap: 12px; }
.game-side .turn-pill { border-radius: 999px; text-align: center; font-weight: 800; padding: 10px 14px; }
.game-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.ga {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.15;
  transition: transform 0.16s var(--ease);
}
.ga:active:not(:disabled) { transform: scale(0.92); }
.ga:disabled { opacity: 0.4; }
.ga-ico {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.3rem;
  color: #e9d5ff;
  background: var(--glass-fill-strong), var(--surface-2);
  border: 1px solid var(--glass-edge-soft);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.ga-danger .ga-ico { color: #fecaca; background: linear-gradient(160deg, #7f1d1d, #450a0a); border-color: rgba(248, 113, 113, 0.45); }
.ga-danger { color: #fca5a5; }
.game-moves { border-radius: 18px; background: var(--glass-fill), var(--surface); border: 1px solid var(--glass-edge-soft); }
.game-moves summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-weight: 800; }
.game-moves summary::-webkit-details-marker { display: none; }
.game-moves-n { padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }
.game-moves .history { margin: 0 12px 12px; max-height: 180px; }
.game-page .msg-line { min-height: 1.2em; margin: 0; text-align: center; }
.game-page .player-bar { border-radius: 18px; }
/* no bottom bar during a game: give the space back */
.game-page ~ * {}
body:has(.game-page) .main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ---------- admin ---------- */
.admin-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(120deg, #3b1f96, #1d1052);
  border: 1px solid rgba(190, 160, 255, 0.45);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.3);
}
.admin-hero-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font-size: 1.5rem; background: rgba(255, 255, 255, 0.12); }
.admin-hero-text { display: flex; flex-direction: column; gap: 2px; }
.admin-hero-text strong { font-family: var(--font-display); font-size: 1.25rem; }
.admin-hero-text span { font-size: 0.82rem; color: rgba(235, 225, 255, 0.8); }
.admin-groups { display: grid; gap: 10px; }
.admin-group { padding: 14px; border-radius: 22px; background: var(--glass-fill), var(--surface); border: 1px solid var(--glass-edge-soft); }
.admin-group h3 { margin: 0 0 10px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.admin-group h3::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.admin-group-violet h3::before { background: #a78bfa; }
.admin-group-blue h3::before { background: #60a5fa; }
.admin-group-gold h3::before { background: #fbbf24; }
.admin-group-red h3::before { background: #f87171; }
.admin-kpis-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.admin-kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; background: rgba(160, 125, 255, 0.08); min-width: 0; }
.admin-kpi strong { font-family: var(--font-display); font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-kpi span { font-size: 0.72rem; color: var(--muted); }
.admin-kpi-alert { background: rgba(248, 113, 113, 0.15); outline: 1px solid rgba(248, 113, 113, 0.5); }
.admin-kpi-alert strong { color: #fca5a5; }
.admin-sec-title { margin: 6px 0 0; font-family: var(--font-display); font-size: 1.15rem; }
.admin-hub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.admin-hub-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 28px 10px 10px;
  border-radius: 20px;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: left;
  color: var(--text);
  background: var(--glass-fill), var(--surface);
  border: 1px solid var(--glass-edge-soft);
  transition: transform 0.16s var(--ease);
}
.admin-hub-tile:active { transform: scale(0.96); }
.admin-hub-ico { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; color: #fff; background: linear-gradient(145deg, #a78bfa, #5b21b6); }
.ahi-payments, .ahi-packages { background: linear-gradient(145deg, #fbbf24, #b45309); }
.ahi-reports { background: linear-gradient(145deg, #f87171, #b91c1c); }
.ahi-users, .ahi-roles { background: linear-gradient(145deg, #60a5fa, #1d4ed8); }
.ahi-shop { background: linear-gradient(145deg, #f472b6, #be185d); }
.ahi-virtual, .ahi-weekly { background: linear-gradient(145deg, #34d399, #047857); }
.admin-hub-name { flex: 1; min-width: 0; line-height: 1.2; }
.admin-hub-badge { position: absolute; top: 6px; left: 40px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; color: #fff; background: #ef4444; }
.admin-hub-go { position: absolute; right: 10px; color: var(--muted); }
.admin-subhead { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.admin-subtitle { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--font-display); font-size: 1.4rem; }
.admin-page .card { border-radius: 20px; }
.header .notif-btn { border: 0; background: none; }
.page > .tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; padding: 4px; }
.page > .tabs .tab { justify-content: center; font-size: 0.85rem; padding: 9px 6px; }
/* profile stats: one compact row of four */
.stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 6px !important; }
.stats-grid .stat { padding: 12px 6px !important; text-align: center; border-radius: 18px !important; min-height: 0 !important; }
.stats-grid .stat-value { font-size: 1.15rem !important; }
.stats-grid .stat-label { overflow-wrap: anywhere; line-height: 1.15; }
.stats-grid .stat-label { font-size: 0.68rem !important; }
.stats-grid .stat:last-child { grid-column: auto !important; }
.stats-grid .stat-label { font-size: 0.64rem !important; }
.admin-hub-name { font-size: 0.86rem; overflow-wrap: anywhere; }

/* ---------- intro (boot splash), Arena style ---------- */
.splash {
  position: relative;
  overflow: hidden;
  gap: 14px;
  background:
    radial-gradient(90% 60% at 50% 38%, rgba(139, 92, 246, 0.28), transparent 70%),
    radial-gradient(70% 50% at 50% 100%, rgba(59, 130, 246, 0.12), transparent 70%),
    var(--bg);
}
.splash-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  left: 50%;
  top: 50%;
  margin: -190px 0 0 -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(160, 120, 255, 0.35), transparent 65%);
  filter: blur(10px);
  animation: splash-pulse 2.4s ease-in-out infinite;
}
.splash-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  animation: splash-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both, breathe 2.4s ease-in-out 0.7s infinite;
}
.splash-mark .logo-mark { filter: drop-shadow(0 10px 26px rgba(139, 92, 246, 0.55)); }
.splash-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(196, 170, 255, 0.95) 80%, #f6c343 92%, transparent) border-box;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  animation: spin 1.6s linear infinite;
}
.splash-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.9rem;
  letter-spacing: 0.32em;
  margin-right: -0.32em;
  color: var(--text);
  text-shadow: 0 0 22px rgba(160, 120, 255, 0.55);
  animation: splash-rise 0.6s ease-out 0.25s both;
}
.splash-tag {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  animation: splash-rise 0.6s ease-out 0.45s both;
}
.splash .splash-bar {
  margin-top: 10px;
  width: 140px;
  background: rgba(160, 125, 255, 0.18);
}
.splash .splash-bar::after { background: linear-gradient(90deg, #8b5cf6, #c4a8ff, #f6c343); }
@keyframes splash-in {
  from { opacity: 0; transform: scale(0.6) rotate(-12deg); }
  to { opacity: 1; transform: none; }
}
@keyframes splash-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes splash-pulse {
  50% { opacity: 0.6; transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .splash-glow, .splash-orbit, .splash-mark, .splash-word, .splash-tag { animation: none; }
}

/* profile: frames folded into one row, tap to open */
.frame-fold {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 52px;
}
.frame-fold-av { flex: none; display: grid; place-items: center; width: 56px; height: 56px; }
.frame-fold-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.frame-fold-text strong { font-size: 1.05rem; }
.frame-fold-text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame-fold-chev { flex: none; font-size: 1.3rem; color: var(--muted); transition: transform 0.2s var(--ease); }
.frame-fold[aria-expanded='true'] .frame-fold-chev { transform: rotate(180deg); }
.frame-fold + .frame-opts { margin-top: 14px; }

/* rating podium: the champion frame brings its own crown */
.lb-pod-1:has(.av-crown) .lb-pod-crown { display: none; }

/* ---------- daily rating, Arena style ---------- */
.dr .wk-hero {
  gap: 14px;
  padding: 18px;
  border-radius: 26px;
  background:
    radial-gradient(110% 80% at 100% 0%, rgba(246, 195, 67, 0.22), transparent 55%),
    radial-gradient(90% 90% at 0% 100%, rgba(139, 92, 246, 0.45), transparent 60%),
    linear-gradient(160deg, #24145c 0%, #170e3e 55%, #0f0a2a 100%);
  border: 1px solid rgba(180, 150, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(160, 125, 255, 0.12), 0 18px 44px rgba(20, 8, 60, 0.55);
}
.dr .wk-hero::after { background: radial-gradient(60% 40% at 50% 0%, rgba(255, 255, 255, 0.06), transparent 70%); }
.dr .wk-hero-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dr .wk-season { margin-left: auto; color: #f6c343; }
.dr-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; color: #e9e2ff;
  background: rgba(160, 125, 255, 0.16); border: 1px solid rgba(180, 150, 255, 0.3);
}
.dr .wk-trophy {
  background: linear-gradient(160deg, #ffe08a, #f6c343 55%, #c98a12);
  color: #2a1a00;
  box-shadow: 0 0 0 4px rgba(246, 195, 67, 0.15), 0 10px 24px rgba(246, 195, 67, 0.35);
}
.dr .wk-title { font-size: clamp(1.45rem, 6.4vw, 1.9rem); }
.dr .wk-title span { color: #f6c343; }
.dr .wk-sub { display: flex; align-items: center; gap: 6px; color: #c9bff0; }
.dr-strip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.dr-countdown, .dr .dr-prize {
  display: grid; gap: 6px; align-content: center;
  padding: 12px; border-radius: 18px;
  background: rgba(10, 6, 30, 0.45);
  border: 1px solid rgba(180, 150, 255, 0.25);
  min-width: 0;
}
.dr .wk-cd-label { font-size: 0.68rem; letter-spacing: 0.1em; color: #b9aee6; }
.dr-cd { display: flex; align-items: baseline; gap: 2px; font-variant-numeric: tabular-nums; }
.dr-cd-part { display: inline-flex; align-items: baseline; gap: 2px; }
.dr-cd-part i { font-style: normal; color: #8c7fc4; font-weight: 800; margin: 0 1px; }
.dr-cd-part strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: #fff; line-height: 1; }
.dr-cd-part small { display: none; }
.dr .dr-prize {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  background: linear-gradient(150deg, rgba(246, 195, 67, 0.18), rgba(10, 6, 30, 0.45));
  border-color: rgba(246, 195, 67, 0.4);
}
.dr .dr-prize-icon { width: 42px; height: 42px; font-size: 1.6rem; border-radius: 14px; }
.dr .dr-prize-text strong { font-size: 0.95rem; white-space: normal; line-height: 1.2; color: #ffe08a; }
.dr .dr-prize-label { font-size: 0.66rem; color: #e9dcb0; }
.dr-nojoin { margin: 0; font-size: 0.8rem; line-height: 1.4; color: #b9aee6; }
.dr .wk-me {
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(180, 150, 255, 0.35);
  border-radius: 18px;
}
/* top-10 list as rounded purple rows */
.dr .wk-table-card { border-radius: 24px; }
.dr .wk-table td { background: rgba(139, 92, 246, 0.08); padding-top: 10px; padding-bottom: 10px; }
.dr .wk-table td:first-child { border-radius: 16px 0 0 16px; }
.dr .wk-table td:last-child { border-radius: 0 16px 16px 0; }
.dr .wk-row-1 td { background: rgba(246, 195, 67, 0.16); }
.dr .dr-row-podium td { background: rgba(180, 150, 255, 0.14); }
.dr .wk-points { color: #34d399; }
.dr .wk-row-me td { box-shadow: inset 0 1px 0 #a07bff, inset 0 -1px 0 #a07bff; }
.dr .wk-row-me td:first-child { box-shadow: inset 1px 1px 0 #a07bff, inset 0 -1px 0 #a07bff; }
.dr .wk-row-me td:last-child { box-shadow: inset -1px 1px 0 #a07bff, inset 0 -1px 0 #a07bff; }
.dr .dr-yesterday { border-radius: 20px; border-color: rgba(246, 195, 67, 0.35); background: linear-gradient(150deg, rgba(246, 195, 67, 0.12), var(--surface)); }
@media (max-width: 360px) {
  .dr-strip { grid-template-columns: minmax(0, 1fr); }
}
:root[data-theme='light'] .dr .wk-table td { background: rgba(124, 58, 237, 0.06); }

/* ---------- level badges 31–100: each ten levels a richer family ---------- */
.level-badge .lb-ico { flex: none; font-size: 0.78rem; margin-right: 1px; align-self: center; filter: drop-shadow(0 0 3px currentColor); }
.level-badge.lb-elite { padding: 2px 9px 2px 7px; }
.level-badge.lt-9,
.level-badge.lt-10,
.level-badge.lt-11,
.level-badge.lt-12,
.level-badge.lt-13,
.level-badge.lt-14,
.level-badge.lt-15 { align-items: center; gap: 3px; }
.level-badge.lt-9::after,
.level-badge.lt-10::after,
.level-badge.lt-11::after,
.level-badge.lt-12::after,
.level-badge.lt-13::after,
.level-badge.lt-14::after,
.level-badge.lt-15::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.6) 48%, transparent 62%);
  background-size: 260% 100%;
  animation: shine 4s ease-in-out 2;
  pointer-events: none;
}
/* 40–49 MYTHIC: obsidian with a gold rim */
.level-badge.lt-9 {
  --lb-ink: #ffe6a3;
  background: linear-gradient(150deg, #2b2b33, #0d0d12 60%, #2a2318);
  box-shadow: inset 0 0 0 1px #d9a836, inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 8px rgba(217, 168, 54, 0.45);
}
.level-badge.lt-9 .lb-ico { color: #f6c343; }
.level-badge.lt-9 .lb-n { color: #ffd76a; }
/* 50–59 CELESTIAL: night sky, silver stars */
.level-badge.lt-10 {
  --lb-ink: #eaf2ff;
  background:
    radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 65%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 25%, #cfe3ff 50%, transparent 51%),
    linear-gradient(150deg, #1f3c88, #0b1638 65%, #241a5c);
  box-shadow: inset 0 0 0 1px #9cc4ff, inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 10px rgba(120, 170, 255, 0.55);
}
.level-badge.lt-10 .lb-ico { color: #dce9ff; }
/* 60–69 INFERNO: molten fire */
.level-badge.lt-11 {
  --lb-ink: #fff4e0;
  background: linear-gradient(160deg, #ffcf5a, #ff7a1a 35%, #d61f1f 70%, #6b0a0a);
  box-shadow: inset 0 0 0 1px #ffd27a, inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 12px rgba(255, 110, 30, 0.7);
}
.level-badge.lt-11 .lb-ico { color: #fff3c4; }
.level-badge.lt-11 .lb-n { text-shadow: 0 0 6px rgba(255, 200, 80, 0.9), 0 1px 1px rgba(0, 0, 0, 0.4); }
/* 70–79 AURORA: northern lights */
.level-badge.lt-12 {
  --lb-ink: #f2fffb;
  background: linear-gradient(120deg, #0f766e, #22c3a6 25%, #6d5cff 55%, #d946ef 80%, #0f766e);
  box-shadow: inset 0 0 0 1px rgba(200, 255, 240, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 12px rgba(80, 230, 200, 0.6), 0 0 18px rgba(170, 90, 255, 0.35);
}
.level-badge.lt-12 .lb-ico { color: #e8fff8; }
/* 80–89 PRISM: diamond rainbow */
.level-badge.lt-13 {
  --lb-ink: #1a1030;
  background: linear-gradient(115deg, #ffffff, #c8f3ff 18%, #ffd6f5 36%, #fff2b8 54%, #c9ffd9 72%, #d9d2ff 90%);
  box-shadow: inset 0 0 0 1.5px #ffffff, 0 0 0 1px rgba(160, 120, 255, 0.6), 0 0 14px rgba(200, 160, 255, 0.75);
}
.level-badge.lt-13 .lb-ico { color: #7c3aed; filter: none; }
.level-badge.lt-13 .lb-n { text-shadow: 0 1px 0 #fff; }
/* 90–99 DIVINE: white gold with a halo */
.level-badge.lt-14 {
  --lb-ink: #4a3200;
  background: radial-gradient(120% 140% at 50% 0%, #fffdf2, #fff0b8 45%, #e9b83c 100%);
  box-shadow: inset 0 0 0 1.5px #fff8dc, 0 0 0 2px #e6b33a, 0 0 16px rgba(255, 214, 90, 0.9), 0 0 28px rgba(255, 240, 180, 0.5);
}
.level-badge.lt-14 .lb-ico { color: #c98a12; filter: none; }
.level-badge.lt-14 .lb-n { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); }
/* 100 MAX: the crown — gold on black with a double gold ring */
.level-badge.lt-15 {
  --lb-ink: #ffe9a8;
  padding: 3px 11px 3px 8px;
  background: linear-gradient(160deg, #1a1206, #000 50%, #2a1d05);
  box-shadow: inset 0 0 0 1.5px #ffd34d, 0 0 0 2px #000, 0 0 0 3.5px #c99212, 0 0 18px rgba(255, 196, 60, 0.85), 0 0 34px rgba(255, 150, 40, 0.45);
}
.level-badge.lt-15 .lb-ico { color: #ffd34d; font-size: 0.9rem; }
.level-badge.lt-15 .lb-n {
  background: linear-gradient(180deg, #fff6cf, #ffd34d 55%, #c99212);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 4px rgba(255, 211, 77, 0.8));
}
@media (prefers-reduced-motion: reduce) {
  .level-badge::after { animation: none !important; }
}

/* rating rows: the level badge leads the second line */
.lb-card-sub { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lb-card-sub .level-badge, .lb-me-right .level-badge { flex: none; }

/* ================================================================ DAMEO Pass (season pass) */
.ps-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-bottom: 96px; --ps-a: hsl(var(--ps-h, 265) 85% 62%); --ps-b: hsl(calc(var(--ps-h, 265) + 40) 80% 45%); }
.ps-hero {
  position: relative; overflow: hidden; display: grid; gap: 14px; padding: 18px 16px; border-radius: 22px; color: #fff;
  background: radial-gradient(120% 90% at 100% 0%, hsl(var(--ps-h, 265) 90% 60% / 0.55), transparent 60%),
    linear-gradient(150deg, #1c1240 0%, #2b1a6b 55%, #3b1d8f 100%);
  border: 1px solid rgba(200, 180, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 14px 34px rgba(40, 15, 110, 0.45);
}
.ps-hero::after { content: ''; position: absolute; inset: auto -30% -60% auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(251, 191, 36, 0.22), transparent 65%); pointer-events: none; }
.ps-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ps-season { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; letter-spacing: 0.04em; color: rgba(235, 225, 255, 0.8); text-transform: uppercase; }
.ps-theme { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.15; color: #fff; }
.ps-ends { flex: none; font-size: 0.8rem; padding: 6px 10px; border-radius: 99px; background: rgba(10, 5, 40, 0.45); border: 1px solid rgba(200, 180, 255, 0.3); }
.ps-lvl-row { display: flex; align-items: center; gap: 12px; }
.ps-lvl {
  position: relative; flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.5rem; color: #fff;
  background: radial-gradient(circle at 35% 30%, #a78bfa, #5b21b6 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 0 3px rgba(167, 139, 250, 0.35), 0 0 22px rgba(139, 92, 246, 0.7);
}
.ps-lvl-elite { background: radial-gradient(circle at 35% 30%, #fde68a, #b45309 72%); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 0 3px rgba(251, 191, 36, 0.4), 0 0 24px rgba(251, 191, 36, 0.7); color: #3b1d02; }
.ps-lvl-crown { position: absolute; top: -12px; font-size: 1.1rem; color: #fbbf24; filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.9)); }
.ps-lvl-sm { width: 44px; height: 44px; font-size: 1.15rem; }
.ps-lvl-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.ps-bar { height: 12px; border-radius: 99px; background: rgba(10, 5, 40, 0.5); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4); }
.ps-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #fbbf24, #f59e0b 60%, #fde68a); box-shadow: 0 0 12px rgba(251, 191, 36, 0.7); transition: width 0.6s var(--ease); }
.ps-bar-sm { height: 7px; }
.ps-xp { font-size: 0.85rem; color: rgba(235, 225, 255, 0.85); font-variant-numeric: tabular-nums; }
.ps-today { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.85rem; color: rgba(235, 225, 255, 0.9); }
.ps-today svg { color: #fbbf24; }
.ps-capped { color: #fca5a5; }
.ps-boost { margin-left: auto; padding: 3px 9px; border-radius: 99px; font-weight: 700; font-size: 0.75rem; color: #3b1d02; background: linear-gradient(90deg, #fde68a, #f59e0b); }
.ps-checkin { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.ps-done { opacity: 0.8; }

.ps-track-card { padding: 14px 0 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; overflow: hidden; }
.ps-track-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px; }
.ps-track-head h2 { margin: 0; font-size: 1.05rem; }
.ps-track-wrap { position: relative; display: flex; min-width: 0; }
.ps-labels { flex: none; width: 34px; display: grid; grid-template-rows: 104px 34px 104px; position: relative; z-index: 2; }
.ps-label { writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 0 10px 10px 0; }
.ps-label-free { color: var(--accent); background: var(--accent-soft); }
.ps-label-elite { color: #92400e; background: linear-gradient(180deg, #fde68a, #f59e0b); }
.ps-track { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 6px 8px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ps-track::-webkit-scrollbar { display: none; }
.ps-col { flex: none; width: 76px; display: grid; grid-template-rows: 104px 34px 104px; scroll-snap-align: start; }
.ps-node { position: relative; display: grid; place-items: center; }
.ps-line { position: absolute; left: -8px; right: 0; top: 50%; height: 4px; transform: translateY(-50%); background: var(--border); }
.ps-reached .ps-line { background: linear-gradient(90deg, #8b5cf6, #fbbf24); }
.ps-dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; background: var(--surface-2); border: 2px solid var(--border-strong); color: var(--muted); }
.ps-reached .ps-dot { background: #7c3aed; border-color: #c4b5fd; color: #fff; }
.ps-current .ps-dot { width: 32px; height: 32px; background: #fbbf24; border-color: #fff; color: #3b1d02; box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.3), 0 0 16px rgba(251, 191, 36, 0.8); }

.ps-rw {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  margin: 4px 0; padding: 8px 4px; border-radius: 14px; font: inherit; cursor: pointer; color: var(--text);
  border: 1px solid var(--border); background: var(--surface-2); transition: transform 0.15s var(--ease);
}
.ps-rw:active { transform: scale(0.96); }
.ps-elite { background: linear-gradient(160deg, rgba(251, 191, 36, 0.16), rgba(180, 83, 9, 0.12)); border-color: rgba(217, 119, 6, 0.45); }
.ps-r-epic { border-color: rgba(168, 85, 247, 0.6); }
.ps-r-legendary { border-color: rgba(245, 158, 11, 0.8); box-shadow: 0 0 10px rgba(245, 158, 11, 0.25); }
.ps-r-mythic { border-color: #f472b6; box-shadow: 0 0 14px rgba(244, 114, 182, 0.45); background: linear-gradient(160deg, rgba(244, 114, 182, 0.2), rgba(251, 191, 36, 0.2)); }
.ps-locked, .ps-elite_locked { filter: saturate(0.55); }
.ps-locked .ps-rw-ico, .ps-locked .ps-rw-img, .ps-elite_locked .ps-rw-ico, .ps-elite_locked .ps-rw-img { opacity: 0.55; }
.ps-claimed { opacity: 0.55; }
.ps-ready { border: 2px solid #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2), 0 0 16px rgba(251, 191, 36, 0.45); animation: ps-pulse 1.8s ease-in-out infinite; }
@keyframes ps-pulse { 50% { box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.12), 0 0 22px rgba(251, 191, 36, 0.6); } }
@media (prefers-reduced-motion: reduce) { .ps-ready { animation: none; } }
.ps-rw-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; }
.ps-coin { color: #b45309; background: radial-gradient(circle at 35% 30%, #fef3c7, #fbbf24); }
.ps-title-ico { color: #fff; background: radial-gradient(circle at 35% 30%, #c4b5fd, #6d28d9); }
.ps-fx { color: #fff; background: radial-gradient(circle at 35% 30%, #f9a8d4, #db2777); }
.ps-rw-img { width: 42px; height: 42px; object-fit: cover; border-radius: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.ps-rw-l { font-size: 0.72rem; font-weight: 600; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-rw-badge { position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 0.65rem; background: rgba(0, 0, 0, 0.45); color: #fff; }
.ps-rw-badge.ps-ok { background: var(--ok); }
.ps-rw-claim { position: absolute; bottom: -9px; padding: 2px 8px; border-radius: 99px; font-size: 0.68rem; font-weight: 800; color: #3b1d02; background: linear-gradient(90deg, #fde68a, #f59e0b); box-shadow: 0 2px 6px rgba(180, 83, 9, 0.4); }

.ps-elite-card {
  display: grid; gap: 12px; padding: 16px; border-radius: 20px; color: #3b1d02;
  background: linear-gradient(140deg, #fde68a 0%, #fbbf24 45%, #d97706 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 26px rgba(180, 83, 9, 0.35);
}
.ps-elite-top { display: flex; align-items: center; gap: 12px; }
.ps-elite-crown { flex: none; font-size: 2.2rem; color: #7c2d12; filter: drop-shadow(0 2px 3px rgba(255, 255, 255, 0.6)); }
.ps-elite-title { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.ps-elite-sub { font-size: 0.85rem; color: #78350f; }
.ps-elite-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ps-buy { justify-content: center; font-weight: 800; border-radius: 14px; padding: 12px 8px; }
.ps-buy-coins { color: #fff; background: #7c2d12; border-color: #7c2d12; }
.ps-buy-stars { color: #7c2d12; background: rgba(255, 255, 255, 0.7); border-color: rgba(124, 45, 18, 0.35); }
.ps-elite-on { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; color: #b45309; background: var(--gold-soft); }

.ps-how h2, .ps-titles h2 { margin: 0 0 8px; font-size: 1rem; }
.ps-how ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ps-how li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.ps-how li:last-child { border-bottom: 0; }
.ps-how-ico { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.ps-how-l { flex: 1; min-width: 0; font-size: 0.9rem; }
.ps-how-today { font-size: 0.75rem; color: var(--ok); font-weight: 700; }
.ps-how-xp { flex: none; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.ps-title-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-title-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.ps-title-chip.ps-on { color: #3b1d02; background: linear-gradient(90deg, #fde68a, #f59e0b); border-color: #d97706; }
.ps-title-state { font-weight: 500; font-size: 0.72rem; opacity: 0.75; }

.ps-home {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; color: #fff; text-decoration: none;
  background: linear-gradient(120deg, #2b1a6b, #4c1d95 60%, #6d28d9);
  border: 1px solid rgba(200, 180, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 20px rgba(60, 20, 150, 0.35);
}
.ps-home-ready { border-color: #fbbf24; box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 0 2px rgba(251, 191, 36, 0.35), 0 8px 22px rgba(60, 20, 150, 0.4); }
.ps-home-main { flex: 1; min-width: 0; display: grid; gap: 5px; }
.ps-home-title { font-weight: 700; }
.ps-home-sub { font-size: 0.8rem; color: rgba(235, 225, 255, 0.85); }
.ps-home-go { flex: none; opacity: 0.8; }

/* ================================================================ DAMEO Pass artwork */
.pa { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; isolation: isolate; overflow: hidden; }
.pa-body { position: relative; z-index: 2; display: grid; place-items: center; width: 100%; height: 100%; }
.pa-svg { width: 100%; height: 100%; overflow: visible; }
.pa-img { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.pa-common { background: radial-gradient(circle at 50% 40%, rgba(167,139,250,.22), transparent 70%); }
.pa-rare { background: radial-gradient(circle at 50% 40%, rgba(96,165,250,.35), transparent 72%); }
.pa-epic { background: radial-gradient(circle at 50% 40%, rgba(192,132,252,.5), transparent 72%); }
.pa-legendary { background: radial-gradient(circle at 50% 40%, rgba(251,191,36,.55), transparent 72%); }
.pa-mythic { background: radial-gradient(circle at 50% 40%, rgba(244,114,182,.6), rgba(251,191,36,.25) 60%, transparent 76%); }
.pa-epic .pa-body { animation: pa-float 3.2s ease-in-out infinite; }
.pa-legendary .pa-body, .pa-mythic .pa-body { animation: pa-float 2.6s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(251,191,36,.7)); }
@keyframes pa-float { 50% { transform: translateY(-3px) scale(1.04); } }
.pa-rays { position: absolute; inset: -40%; z-index: 1; background: repeating-conic-gradient(from 0deg, rgba(253,230,138,.55) 0 8deg, transparent 8deg 24deg); animation: pa-spin 9s linear infinite; mask-image: radial-gradient(circle, #000 18%, transparent 60%); -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 60%); }
.pa-mythic .pa-rays { background: repeating-conic-gradient(from 0deg, rgba(244,114,182,.6) 0 8deg, rgba(253,230,138,.45) 8deg 16deg, transparent 16deg 30deg); animation-duration: 6s; }
@keyframes pa-spin { to { transform: rotate(360deg); } }
.pa-shine { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 48%, transparent 60%); transform: translateX(-120%); animation: pa-shine 3.4s ease-in-out infinite; }
@keyframes pa-shine { 55%, 100% { transform: translateX(120%); } }
.pa-spark { transform-box: fill-box; transform-origin: center; animation: pa-twinkle 1.8s ease-in-out infinite; }
@keyframes pa-twinkle { 0%, 100% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1); } }
.pa-ripple { transform-box: fill-box; transform-origin: center; animation: pa-ripple 1.5s ease-out infinite; }
@keyframes pa-ripple { from { opacity: .9; transform: scale(.5); } to { opacity: 0; transform: scale(1.15); } }
.pa-flame { transform-box: fill-box; transform-origin: bottom; animation: pa-flame .5s ease-in-out infinite alternate; }
@keyframes pa-flame { to { transform: scaleY(1.08) skewX(2deg); } }
.pa-emoji { flex: none; display: inline-block; vertical-align: middle; }
.pa-emoji-big { filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.pa-badge { filter: drop-shadow(0 2px 5px rgba(0,0,0,.35)); }
.pa-frame-art { display: grid; place-items: center; }
.pa-frame-face { display: block; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #c4b5fd 0 22%, transparent 23%), radial-gradient(ellipse at 50% 100%, #c4b5fd 0 42%, #2e1065 43%); }
.pa-bg-art { width: 52px; height: 40px; border-radius: 9px; overflow: hidden; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.pa-bg-art .pbg { border-radius: 0; }
.pa-name-emoji { display: inline-flex; margin-left: 5px; vertical-align: -3px; animation: pa-pop 3s ease-in-out infinite; }
@keyframes pa-pop { 0%, 86%, 100% { transform: none; } 92% { transform: scale(1.18) rotate(-6deg); } }

/* avatar frames */
.pf { position: relative; display: inline-grid; place-items: center; flex: none; }
.pf-in { position: relative; z-index: 2; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; display: grid; place-items: center; }
.pf-in > .avatar { width: 100% !important; height: 100% !important; }
.pf-ring { position: absolute; inset: calc(var(--pf) * -0.1); border-radius: 50%; z-index: 1; }
.pf-violet .pf-ring { background: conic-gradient(#c4b5fd, #7c3aed, #a78bfa, #5b21b6, #c4b5fd); box-shadow: 0 0 14px rgba(139,92,246,.8); animation: pa-spin 6s linear infinite; }
.pf-silver .pf-ring { background: conic-gradient(#fff, #94a3b8, #f1f5f9, #64748b, #fff); box-shadow: 0 0 10px rgba(226,232,240,.7); }
.pf-gold .pf-ring { background: conic-gradient(#fff3b0, #f59e0b, #fde68a, #b45309, #fff3b0); box-shadow: 0 0 16px rgba(251,191,36,.85); animation: pa-spin 8s linear infinite; }
.pf-epic .pf-ring { background: conic-gradient(#f472b6, #a855f7, #22d3ee, #a855f7, #f472b6); box-shadow: 0 0 18px rgba(217,70,239,.9); animation: pa-spin 3s linear infinite; }
.pf-legend .pf-ring { inset: calc(var(--pf) * -0.13); background: conic-gradient(#fde68a, #f97316, #fbbf24, #ef4444, #fde68a); box-shadow: 0 0 22px rgba(249,115,22,.95), 0 0 40px rgba(251,191,36,.5); animation: pa-spin 2.4s linear infinite; }
.pf-crown { position: absolute; z-index: 3; width: 46%; top: -30%; left: 27%; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
.pf-wing { position: absolute; z-index: 0; top: 8%; width: 46%; height: 70%; background: linear-gradient(160deg, #fff7d1, #fbbf24 55%, transparent); clip-path: polygon(100% 20%, 0 0, 20% 30%, 0 40%, 25% 60%, 5% 75%, 100% 90%); filter: drop-shadow(0 0 6px rgba(251,191,36,.9)); animation: pf-flap 2.4s ease-in-out infinite; }
.pf-wing-l { left: -36%; }
.pf-wing-r { right: -36%; transform: scaleX(-1); animation-name: pf-flap-r; }
@keyframes pf-flap { 50% { transform: rotate(-8deg) translateY(-2px); } }
@keyframes pf-flap-r { 0%, 100% { transform: scaleX(-1); } 50% { transform: scaleX(-1) rotate(-8deg) translateY(-2px); } }

/* profile backgrounds */
.pbg { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.pbg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pbg-stars { position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 12% 20%, #fff, transparent), radial-gradient(1px 1px at 30% 60%, #fff, transparent), radial-gradient(1.5px 1.5px at 55% 15%, #fff, transparent), radial-gradient(1px 1px at 70% 40%, #fff, transparent), radial-gradient(1.5px 1.5px at 88% 70%, #fff, transparent), radial-gradient(1px 1px at 42% 85%, #fff, transparent); animation: pbg-tw 3s ease-in-out infinite alternate; }
@keyframes pbg-tw { from { opacity: .35; } to { opacity: 1; } }
.pbg-bg-night { background: linear-gradient(180deg, #1e1b4b 0%, #4c1d95 70%, #7c3aed 100%); }
.pbg-bg-aurora { background: linear-gradient(180deg, #020617, #0f172a); }
.pbg-bg-aurora::before { content: ''; position: absolute; inset: -30% -10%; background: linear-gradient(100deg, transparent 15%, rgba(52,211,153,.75) 30%, rgba(56,189,248,.55) 45%, rgba(168,85,247,.7) 62%, transparent 80%); filter: blur(14px); animation: pbg-wave 7s ease-in-out infinite alternate; }
@keyframes pbg-wave { from { transform: translateX(-8%) skewY(-6deg); } to { transform: translateX(8%) skewY(4deg); } }
.pbg-bg-palace { background: radial-gradient(circle at 50% 110%, #fde68a, #f59e0b 35%, #78350f 75%, #451a03); }
.pbg-bg-palace::before { content: ''; position: absolute; inset: -60%; background: repeating-conic-gradient(from 0deg at 50% 70%, rgba(255,247,209,.35) 0 6deg, transparent 6deg 18deg); animation: pa-spin 30s linear infinite; }
.pbg-bg-palace .pbg-stars { opacity: .5; }
.pbg-bg-cosmos { background: radial-gradient(circle at 25% 30%, rgba(236,72,153,.55), transparent 45%), radial-gradient(circle at 75% 60%, rgba(59,130,246,.5), transparent 50%), #0b0620; }
.pbg-bg-cosmos svg { animation: pa-float 6s ease-in-out infinite; }

/* titles */
.pt { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 0.75rem; font-weight: 800; letter-spacing: .02em; }
.pt-violet { color: #fff; background: linear-gradient(90deg, #7c3aed, #a855f7); box-shadow: 0 0 10px rgba(168,85,247,.5); }
.pt-gold { color: #451a03; background: linear-gradient(90deg, #fde68a, #f59e0b); box-shadow: 0 0 12px rgba(251,191,36,.55); }
.pt-champ { color: #451a03; background: linear-gradient(90deg, #fde68a, #f59e0b, #fde68a); background-size: 200% 100%; animation: pt-flow 2.5s linear infinite; box-shadow: 0 0 14px rgba(251,191,36,.7); }
@keyframes pt-flow { to { background-position: 200% 0; } }

/* profile head with a pass background */
.profile-head.has-pbg { position: relative; overflow: hidden; isolation: isolate; color: #fff; }
.profile-head.has-pbg > :not(.pbg) { position: relative; z-index: 1; }
.profile-head.has-pbg .chip { background: rgba(10, 5, 40, 0.45); color: #fff; border-color: rgba(255,255,255,.25); }
.profile-head.has-pbg .h1, .profile-head.has-pbg .pr-value, .profile-head.has-pbg .pr-label { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.profile-pass { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 6px; }
@media (prefers-reduced-motion: reduce) { .pa *, .pa, .pf-ring, .pf-wing, .pbg *, .pbg::before, .pa-name-emoji, .pt-champ { animation: none !important; } }

/* Pass page v2: art cells, showcase, my style */
.ps-col { width: 80px; grid-template-rows: 96px 34px 96px; }
.ps-labels { grid-template-rows: 96px 34px 96px; }
.ps-rw { padding: 6px 4px; overflow: visible; }
.ps-rw .pa { width: 62px; height: 62px; }
.ps-elite .pa { box-shadow: inset 0 0 0 1px rgba(251,191,36,.25); }
.ps-show { display: grid; gap: 12px; padding: 14px 12px; border-radius: 22px; color: #fff; background: linear-gradient(160deg, #1b1038, #2a1560 70%, #321a75); border: 1px solid rgba(167,139,250,.45); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 22px rgba(124,58,237,.25); }
.ps-show-elite { background: linear-gradient(160deg, #24103a, #3b1650 60%, #4a2408); border-color: rgba(251,191,36,.65); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 26px rgba(251,191,36,.28); }
.ps-show-head { display: flex; align-items: center; gap: 10px; }
.ps-show-head h2 { margin: 0; font-size: 1rem; color: #fff; font-family: var(--font-display); letter-spacing: .01em; }
.ps-show-elite .ps-show-head h2 { color: #fde68a; }
.ps-show-head span { font-size: 0.8rem; color: rgba(235,225,255,.78); }
.ps-show-ico { flex: none; font-size: 1.9rem; color: #a78bfa; filter: drop-shadow(0 0 8px rgba(167,139,250,.8)); }
.ps-show-elite .ps-show-ico { color: #fbbf24; filter: drop-shadow(0 0 8px rgba(251,191,36,.85)); }
.ps-show-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ps-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 3px 8px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(167,139,250,.28); min-width: 0; }
.ps-show-elite .ps-card { border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.06); }
.ps-card .pa { width: 54px; height: 54px; }
.ps-card-lv { position: absolute; top: -1px; left: 50%; transform: translateX(-50%); padding: 1px 8px; border-radius: 0 0 8px 8px; font-size: 0.66rem; font-weight: 800; color: #ede9fe; background: #5b21b6; }
.ps-show-elite .ps-card-lv { color: #451a03; background: linear-gradient(90deg, #fde68a, #f59e0b); }
.ps-card-l { font-size: 0.66rem; line-height: 1.2; text-align: center; color: rgba(245,240,255,.92); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.ps-card-ok { position: absolute; top: 5px; right: 5px; color: #34d399; font-size: 0.8rem; }
.ps-card.ps-r-legendary { border-color: rgba(251,191,36,.8); }
.ps-card.ps-r-mythic { border-color: #f472b6; box-shadow: 0 0 14px rgba(244,114,182,.45); }
.ps-elite-note { font-size: 0.75rem; color: #78350f; text-align: center; }
.ps-elite-card .ps-buy { width: 100%; padding: 14px; font-size: 1.05rem; }
.ps-coll { display: grid; gap: 12px; }
.ps-coll h2 { margin: 0; font-size: 1rem; }
.ps-preview { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px 14px; border-radius: 18px; overflow: hidden; isolation: isolate; background: var(--surface-2); border: 1px solid var(--border); min-height: 104px; }
.ps-preview.has-pbg { color: #fff; border-color: transparent; }
.ps-preview > :not(.pbg) { position: relative; z-index: 1; }
.ps-preview-id { display: grid; gap: 6px; min-width: 0; }
.ps-preview-id strong { font-size: 1.1rem; display: inline-flex; align-items: center; text-shadow: 0 1px 4px rgba(0,0,0,.35); }
.ps-preview-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ps-kinds { display: flex; overflow-x: auto; scrollbar-width: none; }
.ps-kinds .seg-btn { flex: 1 0 auto; }
.ps-own { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ps-own-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; font: inherit; color: var(--text); cursor: pointer; background: var(--surface-2); border: 1px solid var(--border); }
.ps-own-item.ps-on { border: 2px solid #fbbf24; box-shadow: 0 0 12px rgba(251,191,36,.4); }
.ps-own-l { font-size: 0.72rem; font-weight: 600; text-align: center; line-height: 1.15; }
.ps-own-s { font-size: 0.68rem; font-weight: 800; color: var(--accent); }
.ps-own-item.ps-on .ps-own-s { color: #b45309; }
.ps-own-days { position: absolute; top: 4px; right: 4px; font-size: 0.6rem; padding: 1px 5px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.ps-to-profile { display: inline-flex; align-items: center; gap: 4px; justify-self: end; font-size: 0.85rem; font-weight: 700; color: var(--accent); }
.ps-kinds { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 4px; }
.ps-kinds .seg-btn { padding: 8px 2px; font-size: 0.78rem; min-width: 0; }
.pa-frame-art { width: 100%; height: 100%; padding-top: 8px; }
.pa-frame-art .pf { margin: auto; }

/* DAMEO Pass v3 — premium art: aura, electric arcs, crown sticker; reveal */
.pa-prem { background: radial-gradient(circle at 50% 45%, rgba(251,191,36,.55), rgba(168,85,247,.25) 55%, transparent 75%); }
.pa-prem .pa-rays { background: repeating-conic-gradient(from 0deg, rgba(253,230,138,.6) 0 7deg, transparent 7deg 20deg); }
.pa-prem .pa-body { filter: drop-shadow(0 0 5px rgba(251,191,36,.75)) drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.pa-bolts { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; pointer-events: none; overflow: visible; filter: drop-shadow(0 0 2px #fde68a) drop-shadow(0 0 4px #f59e0b); }
.pa-bolt { opacity: 0; animation: pa-zap 2.6s steps(1, end) infinite; }
.pa-bolt-2 { animation-delay: .7s; }
.pa-bolt-3 { animation-delay: 1.4s; }
.pa-bolt-4 { animation-delay: 2s; }
@keyframes pa-zap { 0% { opacity: 1; } 4% { opacity: 0; } 7% { opacity: 1; } 11%, 100% { opacity: 0; } }
.pa-item { position: relative; display: grid; place-items: center; }
.pa-item-crown { position: absolute; width: 26px; height: 26px; top: -10px; right: -9px; transform: rotate(18deg); }
.pa-big { width: 150px !important; height: 150px !important; border-radius: 28px; overflow: visible; }
.pa-big .pa-img { width: 116px; height: 116px; border-radius: 20px; }
.pa-big .pa-item-crown { width: 56px; height: 56px; top: -24px; right: -22px; }
.pa-big .pa-bg-art { width: 140px; height: 104px; border-radius: 18px; }
.pa-big .pa-frame-art .pf { width: 84px !important; height: 84px !important; --pf: 84px !important; }
.pa-big .pa-rays { inset: -70%; }

/* premium track look (track + showcase) */
.ps-show-elite .ps-card { background: linear-gradient(170deg, rgba(251,191,36,.12), rgba(88,28,135,.35)); }
.ps-show-elite .ps-card::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; background: linear-gradient(120deg, #fde68a, #b45309 30%, #fde68a 50%, #92400e 70%, #fde68a); background-size: 250% 100%; animation: ps-goldline 3.5s linear infinite; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
@keyframes ps-goldline { to { background-position: 250% 0; } }
.ps-show-elite .ps-card.ps-r-mythic { box-shadow: 0 0 18px rgba(244,114,182,.55), 0 0 30px rgba(251,191,36,.35); }
.ps-show-elite .ps-card-l { color: #fde68a; }
.ps-elite.ps-rw { background: linear-gradient(165deg, #3b1a5e, #1f0b3a); border-color: rgba(251,191,36,.7); color: #fde68a; }
.ps-elite.ps-ready { border-color: #fde68a; }

/* reward reveal */
.pr-veil { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); background: radial-gradient(circle at 50% 45%, rgba(76,29,149,.94), rgba(8,3,25,.98) 70%); animation: pr-in .25s ease-out; padding: 24px; }
.pr-veil.pr-prem { background: radial-gradient(circle at 50% 45%, rgba(146,64,14,.94), rgba(46,16,101,.96) 45%, rgba(8,3,25,.99) 75%); }
@keyframes pr-in { from { opacity: 0; } }
.pr-flash { position: absolute; inset: 0; background: #fff; opacity: 0; animation: pr-flash .5s ease-out; pointer-events: none; }
.pr-prem .pr-flash { background: #fde68a; }
@keyframes pr-flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.pr-rays { position: absolute; left: 50%; top: 42%; width: 760px; height: 760px; margin: -380px 0 0 -380px; background: repeating-conic-gradient(from 0deg, rgba(196,181,253,.28) 0 6deg, transparent 6deg 18deg); animation: pa-spin 14s linear infinite; mask-image: radial-gradient(circle, #000 10%, transparent 62%); -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 62%); pointer-events: none; }
.pr-prem .pr-rays { background: repeating-conic-gradient(from 0deg, rgba(253,230,138,.45) 0 6deg, transparent 6deg 16deg); animation-duration: 9s; }
.pr-bolts { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: drop-shadow(0 0 4px #fde68a) drop-shadow(0 0 10px #f59e0b); }
.pr-bolts path { opacity: 0; animation: pa-zap 1.6s steps(1, end) infinite; }
.pr-bolts path:nth-child(2) { animation-delay: .35s; }
.pr-bolts path:nth-child(3) { animation-delay: .8s; }
.pr-bolts path:nth-child(4) { animation-delay: 1.15s; }
.pr-card { position: relative; z-index: 2; display: grid; justify-items: center; gap: 14px; width: min(340px, 100%); text-align: center; color: #fff; animation: pr-pop .7s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes pr-pop { 0% { transform: scale(.2) rotate(-12deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.pr-rarity { padding: 4px 14px; border-radius: 99px; font-size: .78rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: #ede9fe; background: rgba(124,58,237,.6); border: 1px solid rgba(196,181,253,.6); }
.pr-r-legendary .pr-rarity, .pr-r-epic.pr-prem-c .pr-rarity { color: #451a03; background: linear-gradient(90deg, #fde68a, #f59e0b); border-color: #fde68a; }
.pr-r-mythic .pr-rarity { color: #fff; background: linear-gradient(90deg, #ec4899, #a855f7, #f59e0b); border-color: #fbcfe8; }
.pr-stage { position: relative; display: grid; place-items: center; width: 190px; height: 190px; }
.pr-stage::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(253,230,138,.55), transparent 65%); animation: pr-pulse 1.6s ease-in-out infinite; }
@keyframes pr-pulse { 50% { transform: scale(1.12); opacity: .7; } }
.pr-name { font-family: var(--font-display); font-size: 1.45rem; font-weight: 800; line-height: 1.2; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.pr-prem .pr-name { color: #fde68a; text-shadow: 0 0 14px rgba(251,191,36,.6), 0 2px 8px rgba(0,0,0,.7); }
.pr-sub { font-size: .95rem; color: rgba(237,233,254,.9); }
.pr-coins { font-family: var(--font-display); font-size: 2rem; font-weight: 900; color: #fde68a; text-shadow: 0 0 16px rgba(251,191,36,.8); }
.pr-btn { margin-top: 6px; min-width: 200px; padding: 14px 22px; border-radius: 16px; border: 0; font: inherit; font-weight: 900; font-size: 1.05rem; cursor: pointer; color: #3b0764; background: linear-gradient(90deg, #fde68a, #f59e0b); box-shadow: 0 0 0 3px rgba(253,230,138,.25), 0 8px 24px rgba(245,158,11,.5); }
.pr-lv { font-size: .8rem; font-weight: 800; color: rgba(237,233,254,.75); letter-spacing: .08em; }
.pr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: min(360px, 100%); max-height: 52vh; overflow-y: auto; padding: 4px; }
.pr-grid .ps-card { animation: pr-pop .5s cubic-bezier(.2,1.6,.4,1) both; }
.pr-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pr-confetti i { position: absolute; top: -10px; width: 7px; height: 12px; border-radius: 2px; animation: pr-fall 2.4s linear forwards; }
@keyframes pr-fall { to { transform: translateY(110vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .pr-rays, .pr-bolts path, .pr-card, .pr-stage::before, .pa-bolt, .ps-show-elite .ps-card::before { animation: none !important; } }

/* DAMEO Pass v4 — PNG artwork */
.pa-png { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 3px 4px rgba(10,0,30,.55)); transition: transform .25s var(--ease); }
.pa:hover .pa-png { transform: scale(1.08) rotate(-2deg); }
.pa:active .pa-png { transform: scale(.94); }
.pa-parts { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; border-radius: inherit; }
.pa-parts i { position: absolute; bottom: -6px; width: 4px; height: 4px; border-radius: 50%; background: #fde68a; box-shadow: 0 0 6px 2px rgba(251,191,36,.9); animation: pa-rise 2.2s linear infinite; }
.pa-mythic .pa-parts i:nth-child(3n) { background: #f9a8d4; box-shadow: 0 0 6px 2px rgba(244,114,182,.9); }
@keyframes pa-rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-120px) translateX(8px) scale(.2); opacity: 0; } }
.pf-img { position: relative; display: inline-grid; place-items: center; }
.pf-img .pf-in { width: 66%; height: 66%; margin-top: 8%; }
.pf-img .pf-art { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: contain; z-index: 3; pointer-events: none; filter: drop-shadow(0 0 6px rgba(168,85,247,.7)); }
.pf-f-legend .pf-art, .pf-f-epic .pf-art { animation: pf-glow 2s ease-in-out infinite; }
@keyframes pf-glow { 50% { filter: drop-shadow(0 0 12px rgba(251,191,36,.95)) brightness(1.12); } }
.pbg-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); }
.pbg-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,8,50,.15), rgba(20,8,50,.55)); }

/* ================================================================ DAMEO Pass v4 — Season 01 page */
.ps-page { --ps-glass: linear-gradient(160deg, rgba(46, 18, 98, .92), rgba(24, 8, 56, .94)); --ps-edge: rgba(167, 139, 250, .35); }
.ps-page .card { background: var(--ps-glass); color: #f5f3ff; border: 1px solid var(--ps-edge); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 26px rgba(20, 5, 60, .35); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.ps-page .card h2 { color: #fff; }
.ps-page .muted { color: rgba(221, 214, 254, .75); }
.ps-page .ms-title { color: #fff; }
.ps-banner { position: relative; overflow: hidden; display: grid; gap: 10px; padding: 18px 16px 16px; border-radius: 24px; color: #fff; isolation: isolate;
  background: radial-gradient(90% 80% at 100% 0%, rgba(168,85,247,.55), transparent 60%), radial-gradient(70% 60% at 0% 100%, rgba(245,158,11,.22), transparent 60%), linear-gradient(155deg, #1a0b3d, #2e1065 55%, #3b0f80);
  border: 1px solid rgba(196,181,253,.45); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 30px rgba(124,58,237,.35), 0 16px 36px rgba(30,10,80,.5); }
.ps-banner::before { content: ''; position: absolute; inset: -40% -20% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(253,230,138,.28), transparent 60%); z-index: -1; animation: pr-pulse 4s ease-in-out infinite; }
.ps-banner-crown { position: absolute; right: -6px; top: 4px; width: 112px; z-index: -1; filter: drop-shadow(0 0 18px rgba(251,191,36,.6)); animation: pa-float 4s ease-in-out infinite; }
.ps-banner-pieces { position: absolute; right: 70px; top: 62px; width: 70px; z-index: -1; opacity: .85; transform: rotate(-12deg); animation: pa-float 5s ease-in-out infinite reverse; }
.ps-chip-season { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: .74rem; font-weight: 700; letter-spacing: .04em; color: #e9d5ff; background: rgba(15,5,40,.5); border: 1px solid rgba(196,181,253,.35); }
.ps-banner-title { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 2.1rem; line-height: 1; letter-spacing: .02em; font-style: italic; color: #f5f3ff; text-shadow: 0 0 18px rgba(196,181,253,.6), 0 3px 0 #4c1d95; }
.ps-banner-title span { background: linear-gradient(180deg, #fff7d1, #fbbf24 55%, #d97706); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 10px rgba(251,191,36,.55)); }
.ps-banner .ps-ends { justify-self: start; display: inline-flex; align-items: center; gap: 6px; }
.ps-banner .ps-ends svg { color: #fbbf24; }
.ps-lvl small { position: absolute; top: 9px; font-size: .55rem; font-weight: 800; letter-spacing: .1em; opacity: .85; }
.ps-lvl strong { margin-top: 6px; }
.ps-wallet { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: .78rem; font-weight: 800; color: #ede9fe; background: rgba(15,5,40,.55); border: 1px solid rgba(196,181,253,.35); }
.ps-pill-gold { color: #451a03; background: linear-gradient(90deg, #fde68a, #f59e0b); border-color: #fde68a; }
.ps-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; }
.ps-tabs .seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 800; }
.ps-tab-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; font-size: .7rem; color: #fff; background: var(--danger); }
button.ps-card { font: inherit; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
button.ps-card:hover { transform: translateY(-3px); box-shadow: 0 0 18px rgba(168,85,247,.45); }
button.ps-card:active { transform: scale(.96); }
.ps-card-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #fbbf24; box-shadow: 0 0 8px #fbbf24; animation: pr-pulse 1.4s ease-in-out infinite; }
.ps-card.ps-card-locked .pa-png, .ps-card.ps-card-elite_locked .pa-png { filter: grayscale(.35) brightness(.8) drop-shadow(0 3px 4px rgba(10,0,30,.55)); }
.ps-card .pa { width: 62px; height: 62px; }
.ps-rw .pa { width: 66px; height: 66px; }
.ps-rw { background: rgba(255,255,255,.06); border-color: rgba(167,139,250,.35); color: #fff; }
.ps-rw.ps-locked .pa-png, .ps-rw.ps-elite_locked .pa-png { filter: grayscale(.4) brightness(.75); }
.ps-empty { visibility: hidden; }
.ps-elite-card { position: relative; overflow: hidden; isolation: isolate; }
.ps-elite-art { position: absolute; right: -14px; top: -10px; width: 120px; z-index: -1; opacity: .9; filter: drop-shadow(0 0 14px rgba(255,255,255,.5)); }
.ps-elite-card .ps-elite-top { padding-right: 92px; }
.ps-buy-stars-big { width: 100%; padding: 14px; font-size: 1.05rem; font-weight: 900; color: #fff; border: 0; border-radius: 16px; background: linear-gradient(90deg, #7c3aed, #a855f7 50%, #7c3aed); background-size: 200% 100%; animation: pt-flow 3s linear infinite; box-shadow: 0 0 0 3px rgba(255,255,255,.35), 0 8px 22px rgba(91,33,182,.45); }
.ps-switch { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--warn); }
.ps-switch input { width: 20px; height: 20px; accent-color: #f59e0b; }
.ps-home-art { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(251,191,36,.7)); }
.ps-today-line { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; }
.ps-page .ps-how li { border-color: rgba(167,139,250,.2); }
.ps-page .ps-how-ico { background: rgba(167,139,250,.2); color: #c4b5fd; }
.ps-page .ps-own-item { background: rgba(255,255,255,.06); border-color: rgba(167,139,250,.3); color: #fff; }
.ps-page .ps-own-s { color: #c4b5fd; }
.ps-page .ps-preview { background: rgba(255,255,255,.05); border-color: rgba(167,139,250,.3); color: #fff; }
.ps-page .ps-to-profile { color: #c4b5fd; }
.ps-own-item .pa { width: 58px; height: 58px; }

/* reward details */
.pd-veil { position: fixed; inset: 0; z-index: 900; display: flex; align-items: flex-end; justify-content: center; background: rgba(8,3,25,.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: pr-in .2s ease-out; }
.pd-sheet { position: relative; width: min(480px, 100%); display: grid; justify-items: center; gap: 10px; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; color: #fff; text-align: center;
  background: radial-gradient(80% 60% at 50% 0%, rgba(168,85,247,.45), transparent 70%), linear-gradient(170deg, #2a1160, #160632); border: 1px solid rgba(196,181,253,.45); border-bottom: 0; animation: pd-up .32s cubic-bezier(.2,1.2,.4,1); }
.pd-elite { background: radial-gradient(80% 60% at 50% 0%, rgba(251,191,36,.38), transparent 70%), linear-gradient(170deg, #3a1550, #160632); border-color: rgba(251,191,36,.6); }
@keyframes pd-up { from { transform: translateY(100%); } }
.pd-close { position: absolute; top: 12px; right: 12px; color: #fff; }
.pd-stage { position: relative; display: grid; place-items: center; width: 180px; height: 180px; }
.pd-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; }
.pd-elite .pd-name { color: #fde68a; }
.pd-note { font-size: .95rem; color: #e9d5ff; }
.pd-kind { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(221,214,254,.7); }
.pd-state { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 14px; background: rgba(15,5,40,.55); border: 1px solid rgba(196,181,253,.35); font-weight: 700; }
.pd-ok { color: #34d399; }

/* level up */
.lu-label { font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; letter-spacing: .3em; color: #fde68a; text-shadow: 0 0 14px rgba(251,191,36,.9); animation: pr-pop .6s .1s both; }
.lu-num { font-family: var(--font-display); font-weight: 900; font-size: 6rem; line-height: 1; font-style: italic; background: linear-gradient(180deg, #fff7d1, #fbbf24 55%, #b45309); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 24px rgba(251,191,36,.8)); animation: lu-slam .8s cubic-bezier(.2,1.8,.3,1) both; }
@keyframes lu-slam { 0% { transform: scale(3); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (max-width: 380px) { .ps-banner-title { font-size: 1.75rem; } .ps-banner-crown { width: 92px; } .ps-banner-pieces { display: none; } .ps-show-grid { gap: 6px; } .ps-card-l { font-size: .62rem; } }
.pd-close { background: rgba(255,255,255,.12) !important; border: 1px solid rgba(255,255,255,.25) !important; color: #fff !important; }
.ps-page .ms-beta .btn-secondary { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(196,181,253,.4); } .ps-page .ms-beta .btn-ghost { color: #c4b5fd; }

/* calmer reward reveal (v5) */
.pr-veil { animation-duration: .35s; }
.pr-rays { opacity: .55; animation-duration: 28s !important; }
.pr-prem .pr-rays { animation-duration: 22s !important; }
.pr-bolts path { animation-duration: 3.2s; }
.pr-bolts path:nth-child(3), .pr-bolts path:nth-child(4) { display: none; }
.pr-card { animation: pr-pop-soft .45s ease-out both; }
@keyframes pr-pop-soft { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.pr-grid .ps-card { animation: pr-pop-soft .35s ease-out both; }
.pr-stage::before { animation-duration: 3s; }
.pr-confetti i { width: 6px; height: 9px; opacity: .8; }
.pa-big .pa-rays { opacity: .6; }
.lu-num { animation: pr-pop-soft .5s ease-out both; }
/* frames with real artwork: avatar sits inside the cleared hole */
.pf-img .pf-in { width: 62%; height: 62%; margin-top: 10%; }
.user-btn .pf-img .pf-art { inset: -10%; width: 120%; height: 120%; }

/* ===== Pass performance (v6): static lists, effects only in the single big view ===== */
.pa-still { overflow: visible; background: none !important; }
.pa-still .pa-png { filter: none; transition: transform .15s ease-out; }
.pa-still.pa-epic, .pa-still.pa-legendary, .pa-still.pa-mythic { background: radial-gradient(circle at 50% 50%, rgba(251,191,36,.28), transparent 68%) !important; }
.pa-still.pa-rare { background: radial-gradient(circle at 50% 50%, rgba(168,85,247,.3), transparent 68%) !important; }
.ps-page .card { -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 6px 16px rgba(20, 5, 60, .3); }
.ps-ready { animation: none; box-shadow: 0 0 0 2px rgba(251,191,36,.35); }
.ps-banner::before, .ps-banner-crown, .ps-banner-pieces { animation: none; }
.ps-banner-crown { filter: none; }
.ps-buy-stars-big { animation: none; }
.ps-card-dot { animation: none; }
.ps-track { will-change: scroll-position; contain: layout paint; }
.ps-col { contain: layout paint; }
.ps-rw { transition: transform .12s ease-out; }
.pf-f-legend .pf-art, .pf-f-epic .pf-art { animation: none; }
.pf-img .pf-art { filter: none; }
.pa-name-emoji { animation: none; }
.pbg-stars { animation: none; }
.ps-banner { box-shadow: 0 10px 24px rgba(30,10,80,.4); }

/* ===== DAMEO PASS — Free / Premium grids (v7, static = smooth on phones) ===== */
.pv-claim-all { justify-content: center; font-weight: 800; }
.pv-sec { display: grid; gap: 12px; padding: 14px 12px; border-radius: 22px; color: #fff; }
.pv-free { background: linear-gradient(165deg, #241048, #170a33); border: 1px solid rgba(167,139,250,.4); }
.pv-elite { background: linear-gradient(165deg, #2c1150, #1f0b36 60%, #2a1405); border: 1.5px solid rgba(251,191,36,.75); box-shadow: 0 0 0 3px rgba(251,191,36,.12), 0 0 22px rgba(251,191,36,.18); }
.pv-head { display: flex; align-items: center; gap: 10px; }
.pv-ico { flex: none; font-size: 1.8rem; color: #a78bfa; }
.pv-elite .pv-ico { color: #fbbf24; }
.pv-head-t { flex: 1; min-width: 0; display: grid; }
.pv-head h2 { margin: 0; font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 1.15rem; letter-spacing: .02em; color: #ede9fe; }
.pv-elite .pv-head h2 { color: #fde68a; }
.pv-head span { font-size: .78rem; color: rgba(221,214,254,.78); }
.pv-buy-mini { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; border: 0; border-radius: 12px; font: inherit; font-weight: 900; font-size: .8rem; color: #451a03; background: linear-gradient(90deg, #fde68a, #f59e0b); cursor: pointer; }
.pv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 370px) { .pv-grid { gap: 6px; } }
.pv-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 20px 3px 8px; border-radius: 14px; font: inherit; color: #fff; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid rgba(167,139,250,.28); transition: transform .12s ease-out; }
.pv-card:active { transform: scale(.95); }
.pv-card .pa { width: 100%; height: auto; aspect-ratio: 1; max-width: 72px; }
.pv-card .pa-png { filter: none; }
.pv-elite .pv-card { background: linear-gradient(170deg, rgba(251,191,36,.10), rgba(88,28,135,.3)); border-color: rgba(251,191,36,.55); }
.pv-elite .pv-card.pv-r-legendary, .pv-elite .pv-card.pv-r-mythic { box-shadow: 0 0 10px rgba(251,191,36,.35); }
.pv-elite .pv-card.pv-r-mythic { border-color: #f472b6; }
.pv-lv { position: absolute; top: -1px; left: 50%; transform: translateX(-50%); padding: 1px 8px; border-radius: 0 0 8px 8px; font-size: .64rem; font-weight: 900; color: #ede9fe; background: #5b21b6; white-space: nowrap; }
.pv-elite .pv-lv { color: #451a03; background: linear-gradient(90deg, #fde68a, #f59e0b); }
.pv-name { font-size: .64rem; line-height: 1.2; text-align: center; color: rgba(245,240,255,.92); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.pv-elite .pv-name { color: #fde68a; }
.pv-st { position: absolute; top: 5px; right: 5px; width: 15px; height: 15px; padding: 2px; border-radius: 50%; color: #fff; background: rgba(0,0,0,.5); }
.pv-ok { background: var(--ok); }
.pv-locked .pa-png, .pv-elite_locked .pa-png { opacity: .55; filter: grayscale(.45); }
.pv-ready { border: 2px solid #fbbf24 !important; }
.pv-get { position: absolute; bottom: -8px; padding: 1px 8px; border-radius: 99px; font-size: .62rem; font-weight: 900; color: #451a03; background: linear-gradient(90deg, #fde68a, #f59e0b); }
.pv-info ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .88rem; color: rgba(237,233,254,.9); }
.pv-info h2, .pv-sub { margin: 0 0 8px; font-size: 1rem; }
.pv-coll-head { display: flex; align-items: baseline; justify-content: space-between; }
.pv-coll-head h2 { margin: 0; font-size: 1rem; }
.pv-coll-head strong { color: #fde68a; }
.pv-sub { margin-top: 6px; }
.pd-stage .pa-big .pa-png { width: 140px; height: 140px; }
.pv-free .pv-ready { border: 2px solid #a78bfa !important; }
.pv-free .pv-get { color: #fff; background: #7c3aed; }
.pbg-img img { transform: none; }

/* ===== v8: the user's artwork as backgrounds ===== */
.pv-page-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgba(14,5,34,.55), rgba(14,5,34,.88) 55%, #0e0522), var(--pv-bg) center top / cover no-repeat; }
.ps-page { position: relative; isolation: isolate; }
.ps-banner { background: linear-gradient(180deg, rgba(20,8,50,.25), rgba(20,8,50,.82) 70%), var(--pv-hero) center 30% / cover no-repeat; }
.ps-banner::before { display: none; }
.ps-banner-crown, .ps-banner-pieces { display: none; }
.pv-free .pv-card { background: var(--pv-card-free) center / cover no-repeat; border-color: rgba(167,139,250,.45); }
.pv-elite .pv-card { background: var(--pv-card-prem) center / cover no-repeat; border-color: rgba(251,191,36,.6); }
.pv-free { background: rgba(23,10,51,.82); }
.pv-elite { background: rgba(31,11,54,.85); }
.pv-card .pa-still { background: none !important; }
.pv-card .pa { max-width: 76px; }

/* ===== frames fitted to their measured hole (v9) ===== */
.pf-fit { position: relative; display: inline-grid; place-items: center; flex: none; overflow: visible; }
.pf-fit .pf-in { position: relative; z-index: 1; display: block; margin: 0; overflow: hidden; border-radius: 24%; }
.pf-fit .pf-in > .avatar { width: 100% !important; height: 100% !important; border-radius: 0; box-shadow: none; }
.pf-fit .pf-in > .avatar::before { display: none; }
.pf-fit .pf-in > .avatar img { border-radius: 0; }
.pf-fit .pf-in > .avatar .dot { display: none; }
.pf-fit .pf-art { position: absolute; z-index: 2; max-width: none; inset: auto; pointer-events: none; filter: none; }
.pbg-img img { transform: scale(1.12); }
/* background rewards: show the picture as a framed portrait thumbnail */
.pa-k-background .pa-png { width: 64%; height: 92%; margin: 4% auto 0; display: block; object-fit: cover; border-radius: 9px; border: 2px solid rgba(255,255,255,.75); box-shadow: 0 3px 10px rgba(0,0,0,.55); }
.pv-elite .pa-k-background .pa-png { border-color: #fbbf24; }
.pa-big.pa-k-background .pa-png { width: 110px; height: 150px; }

/* ---------- Beta 4.5: DAMEO Pass effects in the shop / inventory (artwork instead of the sample board) */
.mini-art.fx-art { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.fx-trail .fx-burst, .fx-royal .fx-burst { border-radius: 50%; box-shadow: 0 0 0 2px var(--fx-c, #b45cff), 0 0 18px var(--fx-c, #b45cff); animation: fxTrailRing 0.7s ease-out both; }
@keyframes fxTrailRing { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }

/* ---------- Beta 4.5: DAMEO Pass combo effects (2x / 3x) */
.combo-canvas { z-index: 6; }
.combo-tag {
  position: absolute; left: 50%; top: 42%; z-index: 7; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transform: translate(-50%, -50%) scale(0.4); opacity: 0;
  animation: comboTag 2.6s cubic-bezier(.2,1.4,.4,1) var(--d, .9s) both;
}
.combo-tag b {
  font: 900 clamp(44px, 16vw, 76px)/1 var(--font-display, inherit); letter-spacing: -1px;
  color: #f3e6ff; -webkit-text-stroke: 2px #6d28d9;
  text-shadow: 0 0 18px rgba(186,92,255,.9), 0 4px 0 #4c1d95;
}
.combo-tag span {
  font-weight: 800; font-size: 15px; color: #fff; padding: 3px 12px; border-radius: 999px;
  background: linear-gradient(90deg, #6d28d9, #a855f7); box-shadow: 0 0 14px rgba(168,85,247,.7);
}
.combo-tag-gold b { color: #fff4cc; -webkit-text-stroke-color: #b45309; text-shadow: 0 0 20px rgba(255,196,64,.95), 0 4px 0 #92400e; }
.combo-tag-gold span { background: linear-gradient(90deg, #b45309, #f59e0b, #7c3aed); box-shadow: 0 0 16px rgba(255,196,64,.8); }
@keyframes comboTag {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(1); }
  78% { transform: translate(-50%, -58%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -70%) scale(0.92); opacity: 0; }
}

/* ---------- Beta 4.5: DAMEO Pass victory animation */
.vfx { position: fixed; inset: 0; z-index: 9999; pointer-events: none; display: grid; place-items: center; animation: vfxOut 2.9s ease both; }
.vfx > * { grid-area: 1 / 1; }
.vfx-rays {
  width: 150vmax; height: 150vmax; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,205,90,.38) 0 7deg, transparent 7deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 8%, transparent 46%); mask: radial-gradient(circle, #000 8%, transparent 46%);
  animation: vfxRays 2.9s linear both;
}
.vfx-ring { width: 260px; height: 260px; border-radius: 50%; border: 4px solid rgba(255,205,90,.9); box-shadow: 0 0 30px rgba(255,190,60,.9), inset 0 0 30px rgba(168,85,247,.7); animation: vfxRing 1.2s .35s ease-out both; }
.vfx-crown { width: min(56vw, 230px); filter: drop-shadow(0 0 24px rgba(255,190,60,.9)); animation: vfxCrown 1s cubic-bezier(.2,1.5,.4,1) both; }
.vfx-spark { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle, #fff 0 25%, #ffd36b 40%, rgba(255,160,40,0) 70%); animation: vfxSpark .9s ease-out both; }
.vfx-text { margin-top: 260px; font: 900 34px/1 var(--font-display, inherit); letter-spacing: 3px; text-transform: uppercase; color: #fff3c4; text-shadow: 0 0 16px rgba(255,190,60,.95), 0 3px 0 #92400e; animation: vfxText 1s .45s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes vfxOut { 0%, 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes vfxRays { from { transform: rotate(0) scale(.6); opacity: 0; } 15% { opacity: 1; } to { transform: rotate(40deg) scale(1); opacity: .8; } }
@keyframes vfxRing { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes vfxCrown { from { transform: translateY(-60vh) scale(.6); } 70% { transform: translateY(0) scale(1.08); } to { transform: translateY(0) scale(1); } }
@keyframes vfxSpark { from { transform: translate(0, 0) scale(.4); opacity: 1; } to { transform: translate(var(--x), var(--y)) scale(1.4); opacity: 0; } }
@keyframes vfxText { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .combo-tag, .vfx { display: none; } }

/* ---------- Beta 4.5: Royal Avatar Frame is animated (a soft purple-gold glow breathing behind it, the wings lift) */
.pf-f-royal-wings::before {
  content: ''; position: absolute; inset: -18%; border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(186,92,255,.55) 0 35%, rgba(255,196,64,.25) 50%, transparent 68%);
  animation: pfRoyalGlow 2.8s ease-in-out infinite;
}
.pf-f-royal-wings .pf-art { animation: pfRoyalLift 2.8s ease-in-out infinite; will-change: transform; }
@keyframes pfRoyalGlow { 0%, 100% { opacity: .35; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes pfRoyalLift { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2%) scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .pf-f-royal-wings::before, .pf-f-royal-wings .pf-art { animation: none; } }
html.calm .pf-f-royal-wings::before, html.calm .pf-f-royal-wings .pf-art { animation: none; }
.inv-pass-art { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; }
.inv-pass[class] .inv-pass-art[src*='prem-19'] { object-fit: contain; background: radial-gradient(circle, rgba(168,85,247,.35), transparent 70%); }
.inv-pass-desc { line-height: 1.3; min-height: 2.6em; }
.inv-pass-note { margin: -4px 0 10px; }
.vfx { overflow: hidden; }
.vfx > .vfx-rays { position: absolute; left: 50%; top: 50%; margin: -75vmax 0 0 -75vmax; }
.vfx-spark { position: absolute; left: calc(50% - 5px); top: calc(50% - 5px); }
.inv-pass .inv-pass-desc, .inv-pass .btn { white-space: normal; overflow-wrap: anywhere; }
.inv-pass .btn { height: auto; min-height: 34px; line-height: 1.2; }
/* wide scene pictures (effects, combos): fill the reward's picture area as a rounded tile */
.pa .pa-png[src*='pass/fx-'], .pa .pa-png[src*='pass/combo-'] { width: 92%; height: 78%; object-fit: cover; border-radius: 12px; border: 1.5px solid rgba(255,214,120,.55); box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.pa-big .pa-png[src*='pass/fx-'], .pa-big .pa-png[src*='pass/combo-'] { width: 240px; height: 120px; }
.pa-k-background .pa-png { object-fit: cover; object-position: center; } .pa-k-background .pa-png[src*='bg-laurel'] { object-fit: fill; filter: brightness(1.35) saturate(1.1); }
/* ---------- Beta 4.6: XP boosters kept in the inventory */
.inv-boost-art { object-fit: contain; background: radial-gradient(circle, rgba(168,85,247,.28), transparent 70%); }
.inv-boost-on { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 12px; border: 1.5px solid rgba(168,85,247,.55); box-shadow: 0 0 18px rgba(168,85,247,.25); }
.inv-boost-on img { width: 54px; height: 54px; object-fit: contain; }
.inv-boost-on div { display: flex; flex-direction: column; gap: 2px; }
.inv-pass .shop-card-name { white-space: normal; overflow: visible; text-overflow: clip; }
/* ---------- Beta 4.7: XP of the game in the result dialog */
.pass-xp-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 10px auto 4px; padding: 8px 16px; border-radius: 14px; text-decoration: none;
  background: linear-gradient(135deg, #4c1d95, #7c3aed); color: #fff; box-shadow: 0 6px 18px rgba(124,58,237,.35); animation: passXpIn .5s cubic-bezier(.2,1.4,.4,1) both; }
.pass-xp-chip b { font-size: 16px; color: #fde68a; }
.pass-xp-chip span { font-size: 12px; opacity: .85; }
@keyframes passXpIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== Beta 4.8: the Pass road side by side (PUBG style): Free on top, the level line in the middle, Premium below ===== */
.pv-road { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 0 10px; border-radius: 22px; color: #fff;
  background: rgba(23,10,51,.84); border: 1px solid rgba(167,139,250,.35); }
.pv-road-head { display: flex; align-items: center; gap: 8px; padding: 0 12px; flex-wrap: wrap; }
.pv-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font: 900 italic .78rem/1 var(--font-display, inherit); letter-spacing: .03em; }
.pv-tag-free { color: #ede9fe; background: rgba(124,58,237,.45); border: 1px solid rgba(167,139,250,.6); }
.pv-tag-prem { color: #451a03; background: linear-gradient(90deg, #fde68a, #f59e0b); }
.pv-road-head .pv-buy-mini { margin-left: auto; padding: 6px 10px; }
.pv-road-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 4px 12px 8px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.pv-road-scroll::-webkit-scrollbar { display: none; }
.pv-col { flex: none; width: 92px; display: grid; grid-template-rows: auto auto; gap: 0; scroll-snap-align: start; }
.pv-top { display: grid; }
.pv-road .pv-free, .pv-road .pv-elite { background: none; border: 0; box-shadow: none; padding: 0; }
.pv-cell { display: grid; }
.pv-road .pv-card { height: 132px; padding: 8px 4px 10px; justify-content: center; }
.pv-road .pv-card .pa { max-width: 70px; }
/* the level line: a track through every column, filled up to the current level */
.pv-node { position: relative; height: 34px; display: grid; place-items: center; }
.pv-node::before { content: ''; position: absolute; left: -8px; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px;
  background: linear-gradient(90deg, #fbbf24 calc(var(--p, 0) * 100%), rgba(255,255,255,.14) calc(var(--p, 0) * 100%)); }
.pv-col:first-child .pv-node::before { left: 50%; }
.pv-node span { position: relative; z-index: 1; min-width: 28px; height: 28px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  border-radius: 999px; font-weight: 900; font-size: .8rem; color: #ddd6fe; background: #2e1065; border: 2px solid rgba(167,139,250,.6); }
.pv-col-on .pv-node span { color: #451a03; background: linear-gradient(135deg, #fde68a, #f59e0b); border-color: #fff7d6; box-shadow: 0 0 10px rgba(251,191,36,.6); }
/* the final level: a bigger column with a glow */
.pv-col-final { width: 128px; }
.pv-col-final .pv-card { height: 158px; }
.pv-col-final .pv-card .pa { max-width: 100px; }
.pv-col-final .pv-node span { min-width: 44px; height: 32px; font-size: .9rem; }
.pv-col-final .pv-elite .pv-card { border: 2px solid #f472b6; box-shadow: 0 0 16px rgba(244,114,182,.55), 0 0 26px rgba(251,191,36,.35); }
.pv-col-final .pv-free .pv-card { border: 2px solid #a78bfa; box-shadow: 0 0 14px rgba(167,139,250,.5); }
.pv-col-final .pv-name { font-weight: 800; font-size: .72rem; }
.pv-road-scroll { align-items: center; } /* the bigger final column stays centred on the level line */

/* ===== Beta 4.9: Royal Crown Frame (Premium Lv.19) is the animated one; piece-set pictures as tiles ===== */
.pf-f-crown-wings::before {
  content: ''; position: absolute; inset: -16%; border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(186,92,255,.6) 0 34%, rgba(255,196,64,.28) 50%, transparent 68%);
  animation: pfRoyalGlow 2.8s ease-in-out infinite;
}
.pf-f-crown-wings .pf-art { animation: pfRoyalLift 2.8s ease-in-out infinite; will-change: transform; }
@media (prefers-reduced-motion: reduce) { .pf-f-crown-wings::before, .pf-f-crown-wings .pf-art { animation: none; } }
html.calm .pf-f-crown-wings::before, html.calm .pf-f-crown-wings .pf-art { animation: none; }
.pa .pa-png[src*='pass/stone-'] { width: 92%; height: 78%; object-fit: cover; border-radius: 12px; border: 1.5px solid rgba(255,214,120,.55); box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.pa-big .pa-png[src*='pass/stone-'] { width: 240px; height: 150px; }

/* ===== Beta 4.10: Premium for Telegram Stars (50 ⭐, 10% off) ===== */
.pv-off, .ps-off { font-style: normal; display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 999px; font-size: .68rem; font-weight: 900; color: #fff; background: #dc2626; }
.ps-price { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 8px; }
.ps-price s { color: rgba(253,230,138,.6); font-weight: 700; }
.ps-price b { font-size: 1.4rem; color: #fde68a; }
.ps-pay { display: grid; gap: 10px; text-align: center; }
.ps-pay-price { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ps-pay-price s { opacity: .55; font-weight: 700; }
.ps-pay-price b { font-size: 1.8rem; }
.ps-pay-opt { display: grid; gap: 8px; padding: 12px; border-radius: 16px; border: 1px solid rgba(167,139,250,.35); background: rgba(124,58,237,.06); }
.ps-pay-stars { border-color: rgba(251,191,36,.7); background: rgba(251,191,36,.08); }
.ps-pay-id { border: 1px dashed rgba(124,58,237,.5); border-radius: 10px; padding: 6px 8px; background: none; font: inherit; font-size: .75rem; cursor: pointer; color: inherit; overflow-wrap: anywhere; }
.ps-pay-id code { font-size: .72rem; }

/* an avatar wearing a DAMEO Pass frame keeps its box; the frame art may reach outside it */
.avatar-passframe { position: relative; display: inline-grid; place-items: center; flex: none; overflow: visible; vertical-align: middle; }
.inv-frame-view { display: grid; place-items: center; height: 104px; margin: 4px 0 2px; }
.inv-frame-more { display: flex; justify-content: center; margin: 14px auto 0; width: fit-content; }

/* fair play (0045): warning / playban notice */
.notice-danger {
  background: color-mix(in srgb, var(--danger, #ff4d6d) 14%, transparent);
  border-color: color-mix(in srgb, var(--danger, #ff4d6d) 40%, transparent);
  color: var(--danger, #ff4d6d);
}
.fair-play p { margin: 4px 0 0; color: var(--text); font-size: 0.82rem; line-height: 1.4; }
.fair-play p.muted { color: var(--muted); }
.fair-play strong { display: block; }
.result .fair-play { text-align: left; margin: 0 0 12px; }

.tc-option:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.6); }

/* invalid-move shake restarts by switching between two identical animations (the board used to be re-mounted with
   key={shake}, which also replayed the last move's effect and combo whenever a piece was tapped out of turn) */
.board-shake.board-shake-2 { animation-name: shake-2; }
@keyframes shake-2 {
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

/* Premium Pass ad: the whole slide is the picture (16:9) */
.pass-banner { display: block; position: relative; overflow: hidden; cursor: pointer; background: #1a0b3d; -webkit-tap-highlight-color: transparent; }
.promo-slide > a.pass-banner { min-height: 0; }
.pass-banner img { display: block; width: 100%; height: 100%; aspect-ratio: 1080 / 608; object-fit: cover; pointer-events: none; -webkit-user-select: none; user-select: none; }
.pass-banner:active { transform: scale(0.985); }
