:root {
  --felt-deep: #0f3d2e;
  --felt-mid: #165c43;
  --felt-light: #1f7a58;
  --felt-base: #0a241c;
  --felt-grad-top: #0c2b20;
  --felt-grad-bot: #0a1f18;
  --felt-spot: rgba(232, 165, 75, 0.12);
  --felt-spot-2: rgba(31, 122, 88, 0.55);
  --ink: #f4efe4;
  --ink-dim: rgba(244, 239, 228, 0.72);
  --amber: #e8a54b;
  --amber-deep: #c47d22;
  --danger: #d85a4a;
  --card: #f7f1e6;
  --card-face: linear-gradient(160deg, #fffdf8, #f7f1e6);
  --card-ink: #1c1a17;
  --card-border: rgba(28, 26, 23, 0.08);
  --red-suit: #c0392b;
  --black-suit: #1c1a17;
  --card-back-a: #1a4d38;
  --card-back-b: #163f2e;
  --card-back-border: rgba(232, 165, 75, 0.5);
  --card-back-sheen: rgba(244, 239, 228, 0.12);
  --card-back-angle: 45deg;
  --card-back-stripe: 6px;
  --table-glow: rgba(31, 122, 88, 0.35);
  --table-rim: rgba(232, 165, 75, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --ck-light: #e8d5b5;
  --ck-dark: #3d6b52;
  --ck-wrap-glow: rgba(31, 122, 88, 0.28);
  --ck-wrap-border: rgba(232, 165, 75, 0.18);
  --ck-select: rgba(232, 165, 75, 0.95);
  --ck-last: rgba(232, 165, 75, 0.45);
  --ck-man-w: radial-gradient(circle at 35% 30%, #fffef8, #e8dcc4 55%, #cbb896);
  --ck-man-w-edge: #6b5738;
  --ck-man-b: radial-gradient(circle at 35% 30%, #5a4334, #241812 62%, #140e0a);
  --ck-man-b-edge: #f0e6d2;
  --ck-king-w: rgba(232, 165, 75, 0.55);
  --ck-king-b: rgba(232, 165, 75, 0.35);
  --ck-dot-w: #f4efe4;
  --ck-dot-b: #1c1814;
  --dm-face: linear-gradient(165deg, #fbf6ec 0%, #ebe2d2 55%, #e2d8c6 100%);
  --dm-edge: rgba(40, 30, 20, 0.35);
  --dm-split: rgba(30, 24, 18, 0.35);
  --dm-pip: #1a1510;
  --dm-shine: rgba(255, 255, 255, 0.55);
  --dm-shadow: rgba(0, 0, 0, 0.14);
  font-synthesis: none;
}

/* Классическая колода */
[data-card-theme='classic'] {
  --card: #f7f1e6;
  --card-face: linear-gradient(160deg, #fffdf8, #f7f1e6);
  --card-ink: #1c1a17;
  --card-border: rgba(28, 26, 23, 0.08);
  --red-suit: #c0392b;
  --black-suit: #1c1a17;
  --card-back-a: #1a4d38;
  --card-back-b: #163f2e;
  --card-back-border: rgba(232, 165, 75, 0.5);
  --card-back-sheen: rgba(244, 239, 228, 0.12);
  --card-back-angle: 45deg;
  --card-back-stripe: 6px;
}

/* Темная колода */
[data-card-theme='noir'] {
  --card: #1a1c22;
  --card-face: linear-gradient(165deg, #2a2e38 0%, #14161c 100%);
  --card-ink: #ffffff;
  --card-border: rgba(212, 175, 95, 0.4);
  --red-suit: #ff6b5a;
  --black-suit: #ffffff;
  --card-back-a: #0c0d10;
  --card-back-b: #1c1f28;
  --card-back-border: rgba(212, 175, 95, 0.7);
  --card-back-sheen: rgba(212, 175, 95, 0.16);
  --card-back-angle: 90deg;
  --card-back-stripe: 5px;
}

/* Светлая колода */
[data-card-theme='ivory'] {
  --card: #ffffff;
  --card-face: linear-gradient(160deg, #ffffff 0%, #eef3f8 100%);
  --card-ink: #15202b;
  --card-border: rgba(21, 32, 43, 0.16);
  --red-suit: #c62828;
  --black-suit: #15202b;
  --card-back-a: #3d5a73;
  --card-back-b: #2a4054;
  --card-back-border: rgba(180, 210, 230, 0.75);
  --card-back-sheen: rgba(255, 255, 255, 0.2);
  --card-back-angle: 135deg;
  --card-back-stripe: 8px;
}

/* —— Скины стола (сукно) —— */
[data-table-theme='classic'] {
  --felt-deep: #0f3d2e;
  --felt-mid: #165c43;
  --felt-light: #1f7a58;
  --felt-base: #0a241c;
  --felt-grad-top: #0c2b20;
  --felt-grad-bot: #0a1f18;
  --felt-spot: rgba(232, 165, 75, 0.12);
  --felt-spot-2: rgba(31, 122, 88, 0.55);
  --table-glow: rgba(31, 122, 88, 0.35);
  --table-rim: rgba(232, 165, 75, 0.12);
}

[data-table-theme='burgundy'] {
  --felt-deep: #5a1828;
  --felt-mid: #7a2236;
  --felt-light: #9a2e44;
  --felt-base: #1a0a10;
  --felt-grad-top: #2a1018;
  --felt-grad-bot: #12060c;
  --felt-spot: rgba(232, 165, 75, 0.14);
  --felt-spot-2: rgba(154, 46, 68, 0.5);
  --table-glow: rgba(154, 46, 68, 0.4);
  --table-rim: rgba(232, 165, 75, 0.16);
}

[data-table-theme='midnight'] {
  --felt-deep: #152a4a;
  --felt-mid: #1c3a62;
  --felt-light: #2a5080;
  --felt-base: #080e18;
  --felt-grad-top: #0c1628;
  --felt-grad-bot: #060a12;
  --felt-spot: rgba(180, 210, 255, 0.1);
  --felt-spot-2: rgba(42, 80, 128, 0.55);
  --table-glow: rgba(42, 80, 128, 0.42);
  --table-rim: rgba(160, 190, 230, 0.14);
}

[data-table-theme='ember'] {
  --felt-deep: #1c1814;
  --felt-mid: #2a2420;
  --felt-light: #3a322c;
  --felt-base: #0c0a08;
  --felt-grad-top: #161210;
  --felt-grad-bot: #080604;
  --felt-spot: rgba(232, 120, 60, 0.18);
  --felt-spot-2: rgba(90, 50, 30, 0.45);
  --table-glow: rgba(200, 110, 50, 0.28);
  --table-rim: rgba(232, 140, 70, 0.18);
}

[data-table-theme='lagoon'] {
  --felt-deep: #0d4a48;
  --felt-mid: #14615e;
  --felt-light: #1d7a76;
  --felt-base: #061818;
  --felt-grad-top: #0a2c2a;
  --felt-grad-bot: #041414;
  --felt-spot: rgba(120, 220, 200, 0.12);
  --felt-spot-2: rgba(29, 122, 118, 0.5);
  --table-glow: rgba(29, 122, 118, 0.38);
  --table-rim: rgba(140, 210, 200, 0.14);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background: var(--felt-base);
  background-color: #0a241c;
  color-scheme: dark;
  overscroll-behavior-y: auto;
}

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 239, 228, 0.18) transparent;
}

/* APK/PWA: скролл внутри #app, тонкая полоска вместо системной белой */
html.is-installed-app,
html.is-installed-app body {
  height: 100%;
  height: 100dvh;
  height: 100lvh;
  overflow: hidden;
  overscroll-behavior-y: none;
  background: #0a241c;
  background-color: #0a241c;
}

html.is-installed-app #app {
  height: 100%;
  height: 100dvh;
  height: 100lvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 165, 75, 0.55) rgba(0, 0, 0, 0.18);
  background-color: transparent;
}

html.is-installed-app #app::-webkit-scrollbar {
  width: 5px;
  height: 5px;
  background: transparent;
}

html.is-installed-app #app::-webkit-scrollbar-thumb {
  background: rgba(232, 165, 75, 0.5);
  border-radius: 99px;
}

html.is-installed-app #app::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.18);
}

/* PWA / ярлык: контент не под губой и камерой, сукно на весь экран */
html.is-ios #app,
html.is-installed-app:not(.is-ios) #app {
  padding-top: env(safe-area-inset-top, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  box-sizing: border-box;
}

html.is-ios .felt-bg {
  top: calc(-1 * env(safe-area-inset-top, 0px));
  right: calc(-1 * env(safe-area-inset-right, 0px));
  bottom: calc(-1 * env(safe-area-inset-bottom, 0px));
  left: calc(-1 * env(safe-area-inset-left, 0px));
}

html.is-ios,
html.is-ios body {
  overflow-x: hidden;
  max-width: 100%;
}

html.is-ios.is-installed-app,
html.is-ios.is-installed-app body,
html.is-ios.is-installed-app #app {
  height: 100%;
  min-height: 100%;
  min-height: -webkit-fill-available;
  height: -webkit-fill-available;
}

@media (display-mode: standalone),
       (display-mode: fullscreen),
       (display-mode: minimal-ui),
       (display-mode: window-controls-overlay) {
  html,
  body {
    height: 100%;
    height: 100dvh;
    height: 100lvh;
    overflow: hidden;
    overscroll-behavior-y: none;
    background: #0a241c;
    background-color: #0a241c;
  }

  #app {
    height: 100%;
    height: 100dvh;
    height: 100lvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(232, 165, 75, 0.55) rgba(0, 0, 0, 0.18);
    background-color: transparent;
  }

  #app::-webkit-scrollbar {
    width: 5px;
    height: 5px;
    background: transparent;
  }

  #app::-webkit-scrollbar-thumb {
    background: rgba(232, 165, 75, 0.5);
    border-radius: 99px;
  }
}

@media (display-mode: standalone),
       (display-mode: fullscreen),
       (display-mode: minimal-ui),
       (display-mode: window-controls-overlay) {
  html.is-ios,
  html.is-ios body,
  html.is-ios #app {
    height: 100%;
    min-height: 100%;
    min-height: -webkit-fill-available;
    height: -webkit-fill-available;
  }
}

.ptr-indicator {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(10, 22, 18, 0.92);
  border: 1px solid rgba(232, 165, 75, 0.4);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.ptr-indicator.is-visible {
  opacity: 1;
}

.ptr-indicator.is-ready {
  border-color: rgba(232, 165, 75, 0.9);
}

.ptr-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(244, 239, 228, 0.22);
  border-top-color: var(--amber);
  border-radius: 50%;
  flex-shrink: 0;
}

.ptr-indicator.is-ready .ptr-spinner,
.ptr-indicator.is-loading .ptr-spinner {
  animation: ptr-spin 0.7s linear infinite;
}

@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

.felt-bg {
  position: fixed;
  inset: 0;
  /* В APK сукно должно закрывать и вырез экрана, без белой полосы сверху */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 30%, var(--felt-spot), transparent 55%),
    radial-gradient(circle at 20% 80%, var(--felt-spot-2), transparent 40%),
    linear-gradient(160deg, var(--felt-grad-top) 0%, var(--felt-deep) 40%, var(--felt-grad-bot) 100%);
  z-index: -2;
}

html.is-installed-app .felt-bg {
  top: calc(-1 * env(safe-area-inset-top, 0px));
  right: calc(-1 * env(safe-area-inset-right, 0px));
  bottom: calc(-1 * env(safe-area-inset-bottom, 0px));
  left: calc(-1 * env(safe-area-inset-left, 0px));
}

.felt-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.conn-dot {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 50;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.conn-dot[hidden] {
  display: none !important;
}

.conn-dot.ok {
  background: #3dcc7a;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 8px rgba(61, 204, 122, 0.55);
}

.conn-dot.warn {
  background: #e8a54b;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 8px rgba(232, 165, 75, 0.45);
}

.conn-dot.err {
  background: #e85a4a;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 8px rgba(232, 90, 74, 0.5);
}

.boot-hint {
  margin: 0 0 18px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink-dim);
}

.boot-hint code {
  color: var(--amber);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
}

.screen {
  display: none;
  flex: 1;
  padding: 24px clamp(16px, 4vw, 48px) 32px;
}

html.is-ios .screen,
html.is-installed-app:not(.is-ios) .screen {
  padding-top: 16px;
  padding-bottom: 20px;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* До готовности JS: не мигать лендингом (класс снимается в showScreen) */
html.boot-session #screen-auth {
  display: none !important;
}
html.boot-session[data-boot-screen="home"] #screen-home,
html.boot-session:not([data-boot-screen]) #screen-home {
  display: flex !important;
  flex-direction: column;
  flex: 1;
}
html.boot-session[data-boot-screen="lobby"] #screen-lobby,
html.boot-session[data-boot-screen="profile"] #screen-profile,
html.boot-session[data-boot-screen="subscribe"] #screen-subscribe,
html.boot-session[data-boot-screen="changelog"] #screen-changelog,
html.boot-session[data-boot-screen="admin"] #screen-admin,
html.boot-session[data-boot-screen="game"] #screen-game,
html.boot-session[data-boot-screen="seabattle"] #screen-seabattle,
html.boot-session[data-boot-screen="domino"] #screen-domino,
html.boot-session[data-boot-screen="chess"] #screen-chess,
html.boot-session[data-boot-screen="checkers"] #screen-checkers,
html.boot-session[data-boot-screen="nardi"] #screen-nardi,
html.boot-session[data-boot-screen="gomoku"] #screen-gomoku,
html.boot-session[data-boot-screen="wordguess"] #screen-wordguess,
html.boot-session[data-boot-screen="loto"] #screen-loto,
html.boot-session[data-boot-screen="hangman"] #screen-hangman {
  display: flex !important;
  flex-direction: column;
  flex: 1;
}

.screen.active.screen-enter {
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.brand {
  font-family: 'Spectral', serif;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--amber);
  line-height: 1.05;
}

.brand.small {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

h1, h2 {
  font-family: 'Spectral', serif;
  font-weight: 600;
  margin: 8px 0 0;
}

h1 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  color: var(--ink);
}

.lede {
  color: var(--ink-dim);
  max-width: 40ch;
  line-height: 1.4;
  margin: 6px 0 14px;
  font-size: 0.92rem;
}

.home-panel {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 18px 16px 16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 92, 67, 0.55), rgba(12, 43, 32, 0.75));
  border: 1px solid rgba(232, 165, 75, 0.22);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.home-panel h1 {
  margin: 0 0 8px;
  font-size: clamp(1.2rem, 4.5vw, 1.45rem);
  line-height: 1.2;
  text-align: center;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--ink-dim);
}

input {
  appearance: none;
  border: 1px solid rgba(244, 239, 228, 0.18);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232, 165, 75, 0.2);
}

.code-input {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-align: center;
  font-weight: 700;
  width: 120px;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.home-actions #btn-create {
  width: 100%;
}

.bot-play {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(244, 239, 228, 0.1);
  background: rgba(0, 0, 0, 0.18);
}

.bot-play[hidden] {
  display: none;
}

.bot-play-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bot-play-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--ink-dim);
}

.bot-diff {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.bot-diff-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
}

.bot-diff-btn.is-active {
  border-color: rgba(232, 165, 75, 0.75);
  background: rgba(232, 165, 75, 0.14);
}

.bot-play #btn-bot-play {
  width: 100%;
}

.home-join-panel .lede {
  margin: 0 0 16px;
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.35;
}

.join-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.home-join-panel .join-row {
  max-width: none;
  grid-template-columns: 1.35fr 0.85fr;
}

.join-row .code-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
}

.join-row .code-input::placeholder {
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  font-weight: 600;
  text-transform: none;
}

.join-row .code-input:focus {
  outline: none;
  border-color: rgba(232, 165, 75, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 165, 75, 0.12);
}

.join-row #btn-join {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 14px 10px;
  border-radius: 14px;
}

#join-error {
  margin-top: 12px;
}

.btn {
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  border-radius: 12px;
  padding: 14px 20px;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  color: #1c1408;
}

.btn.ghost {
  background: rgba(244, 239, 228, 0.08);
  color: var(--ink);
  border: 1px solid rgba(244, 239, 228, 0.16);
}

.btn.danger {
  background: linear-gradient(180deg, #e06b5c, var(--danger));
  color: #fff;
}

.btn.sm {
  padding: 10px 14px;
  font-size: 0.9rem;
}

.error {
  color: #ffb4a8;
  margin: 12px 0 0;
  font-size: 0.9rem;
}

.ok-msg {
  color: #b8e0c8;
  margin: 12px 0 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

#auth-dev-link a {
  color: var(--amber);
  word-break: break-all;
}

#btn-resend {
  margin-top: 12px;
}

.error.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(40, 12, 10, 0.92);
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(216, 90, 74, 0.5);
  z-index: 20;
}

.topbar, .game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.lobby-topbar {
  align-items: flex-start;
  position: relative;
  padding-right: 72px;
}

.lobby-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.lobby-heading h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 700;
  line-height: 1.25;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.lobby-code-sep {
  color: var(--ink-dim);
  font-weight: 600;
}

.lobby-leave {
  position: absolute;
  top: 0;
  right: 0;
  padding: 8px 12px;
}

.brand-mark-lobby {
  font-size: clamp(1.55rem, 3.5vw, 1.9rem);
}

.brand-mark-lobby .brand-ok {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.code-pill {
  display: inline-block;
  margin-left: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(232, 165, 75, 0.18);
  color: var(--amber);
  letter-spacing: 0.18em;
  font-family: 'Manrope', sans-serif;
  font-size: 0.95rem;
}

button.code-pill-btn {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.18em;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

button.code-pill-btn:hover {
  background: rgba(232, 165, 75, 0.28);
  border-color: rgba(232, 165, 75, 0.35);
}

button.code-pill-btn:active {
  transform: scale(0.97);
}

button.code-pill-btn.is-copied {
  background: rgba(120, 180, 130, 0.28);
  color: #b8e0c8;
  letter-spacing: 0.06em;
}

button.code-pill-btn[hidden] {
  display: none !important;
}

.lobby-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  max-width: 900px;
}

@media (max-width: 720px) {
  .lobby-grid { grid-template-columns: 1fr; }
}

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(244, 239, 228, 0.08);
}

.player-list .tag {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(244, 239, 228, 0.1);
}

.player-list .tag.ready {
  background: rgba(232, 165, 75, 0.25);
  color: var(--amber);
}

.lobby-side {
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(244, 239, 228, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lobby-invite {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-invite[hidden] {
  display: none !important;
}

.lobby-invite-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-dim);
}

.lobby-invite-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 168px;
  overflow-y: auto;
}

.lobby-invite-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.lobby-invite-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.88rem;
}

.lobby-invite-empty {
  color: var(--ink-dim);
  font-size: 0.82rem;
  line-height: 1.35;
  background: transparent !important;
  padding: 0 2px !important;
}

.hint {
  margin: 0;
  color: var(--ink-dim);
  line-height: 1.45;
  font-size: 0.95rem;
}

.ready-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.ready-toggle input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border-radius: 6px;
  border: 2px solid rgba(232, 165, 75, 0.55);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: grid;
  place-content: center;
  box-shadow: none;
  accent-color: var(--amber);
}

.ready-toggle input[type='checkbox']::before {
  content: '';
  width: 11px;
  height: 11px;
  transform: scale(0);
  transition: transform 0.12s ease;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
  background: var(--amber);
}

.ready-toggle input[type='checkbox']:checked {
  border-color: var(--amber);
  background: rgba(232, 165, 75, 0.22);
}

.ready-toggle input[type='checkbox']:checked::before {
  transform: scale(1);
}

.ready-toggle input[type='checkbox']:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* GAME */
.game-top {
  justify-content: center;
}

.status-line {
  flex: 0 0 auto;
  text-align: center;
  margin: 0;
  padding: 6px 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  min-height: 1.4em;
  line-height: 1.3;
}

.game-turn-status {
  margin: 2px 0 0;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(244, 239, 228, 0.1);
  color: var(--ink-dim);
}

/* Дурак: статус под столом всегда ровно 2 строки — без прыжков верстки */
#screen-game #game-status {
  flex: 0 0 auto;
  box-sizing: border-box;
  height: calc(1.3em * 2 + 12px);
  min-height: calc(1.3em * 2 + 12px);
  max-height: calc(1.3em * 2 + 12px);
  margin: 6px 0 0;
  padding: 6px 12px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  text-overflow: ellipsis;
  word-break: break-word;
}

.opponents {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 88px;
  margin-bottom: 12px;
}

.opponent {
  min-width: 132px;
  padding: 12px 14px 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(244, 239, 228, 0.1);
  text-align: center;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.opponent.attacker {
  border-color: rgba(232, 165, 75, 0.55);
  box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.2);
}

.opponent.defender {
  border-color: rgba(120, 180, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(120, 180, 255, 0.2);
}

.opponent.is-fool {
  border-color: rgba(220, 80, 80, 0.65);
  box-shadow: 0 0 0 1px rgba(220, 80, 80, 0.25);
}

.opponent.is-safe {
  border-color: rgba(70, 170, 110, 0.6);
  box-shadow: 0 0 0 1px rgba(70, 170, 110, 0.22);
}

.opponent .name {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.opponent .opp-text {
  min-width: 0;
}

.opponent .opp-count {
  display: none;
}

.opp-cards {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 52px;
  margin: 0 auto 2px;
  min-width: 72px;
}

.opp-card-back {
  --i: 0;
  width: 28px;
  height: 40px;
  margin-left: -14px;
  border-radius: 4px;
  background:
    linear-gradient(145deg, var(--card-back-sheen), transparent 45%),
    repeating-linear-gradient(
      var(--card-back-angle),
      var(--card-back-a) 0 4px,
      var(--card-back-b) 4px 8px
    );
  border: 1.5px solid var(--card-back-border);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  transform: rotate(calc(var(--i) * 7deg));
  transform-origin: center bottom;
}

.opp-card-back:first-child {
  margin-left: 0;
}

.opp-more {
  align-self: center;
  margin-left: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--amber);
}

.opp-empty {
  font-size: 0.8rem;
  color: var(--ink-dim);
  align-self: center;
}

.table-area {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  gap: 8px;
  min-height: 220px;
  margin: 8px 0 8px;
  padding: 14px clamp(12px, 3vw, 28px) 10px;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at center, var(--table-glow), transparent 65%),
    linear-gradient(160deg, var(--felt-mid), var(--felt-deep));
  border: 2px solid var(--table-rim);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.25);
}

.table-play {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 36px);
  min-height: 0;
  width: 100%;
}

.table-actions {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 2px 0 0;
  z-index: 3;
}

.table-deck {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 96px;
}

.table-discard {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  pointer-events: none;
}

.discard-pile {
  appearance: none;
  border: none;
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  font: inherit;
  padding: 4px 6px 5px;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-radius: 10px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  min-width: 0;
}

.discard-pile:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.discard-pile.is-empty {
  opacity: 0.55;
}

.discard-stack {
  position: relative;
  width: 34px;
  height: 44px;
}

.discard-sheet {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 28px;
  height: 40px;
  border-radius: 5px;
  border-width: 1px;
  transform: rotate(calc(var(--i, 0) * -5deg)) translate(calc(var(--i, 0) * 2px), calc(var(--i, 0) * -1px));
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}

.discard-pile:not(.is-empty):hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(232, 165, 75, 0.35);
}

.discard-pile .deck-count-label {
  font-size: 0.65rem;
  padding: 1px 6px;
  font-weight: 700;
}

.discard-panel {
  max-width: min(560px, 94vw);
  max-height: min(80dvh, 720px);
  display: flex;
  flex-direction: column;
}

.discard-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  overflow: auto;
  padding: 4px 2px 8px;
  max-height: min(52dvh, 420px);
}

.discard-grid .card {
  pointer-events: none;
  cursor: default;
}

.deck-pile {
  position: relative;
  width: 118px;
  height: 118px;
}

.deck-pile .card.trump-under {
  position: absolute;
  left: 42px;
  top: 22px;
  transform: rotate(90deg);
  z-index: 1;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.card-back,
.deck-pile .card-back {
  background:
    linear-gradient(145deg, var(--card-back-sheen), transparent 40%),
    repeating-linear-gradient(
      var(--card-back-angle),
      var(--card-back-a) 0 var(--card-back-stripe),
      var(--card-back-b) var(--card-back-stripe) calc(var(--card-back-stripe) * 2)
    );
  border: 2px solid var(--card-back-border);
}

.deck-pile .card-back {
  position: absolute;
  left: 0;
  top: 8px;
  width: 72px;
  height: 104px;
  border-radius: 10px;
  z-index: 2;
  box-shadow:
    3px 3px 0 rgba(0, 0, 0, 0.18),
    6px 6px 0 rgba(0, 0, 0, 0.12),
    0 10px 20px rgba(0, 0, 0, 0.28);
}

.deck-pile .card-back.empty {
  opacity: 0.25;
  box-shadow: none;
  border-style: dashed;
}

.deck-pile.only-trump .card.trump-under {
  left: 20px;
  top: 8px;
  transform: none;
}

.deck-count-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.28);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  white-space: nowrap;
}

.deck-trump-name {
  font-size: 0.78rem;
  color: var(--ink-dim);
  text-align: center;
  white-space: nowrap;
}

.table-cards {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 22px 28px;
  justify-content: center;
  align-content: center;
  min-height: 140px;
  padding: 8px;
}

.table-cards:empty::after {
  content: 'Стол';
  color: rgba(244, 239, 228, 0.28);
  font-family: 'Spectral', serif;
  font-size: 1.2rem;
}

.pair {
  position: relative;
  width: 110px;
  height: 140px;
}

.pair .card {
  position: absolute;
}

.pair .card.attack {
  left: 0;
  top: 0;
  z-index: 1;
}

.pair .card.defend {
  left: 44px;
  top: 34px;
  transform: rotate(14deg);
  z-index: 2;
}

.pair .card.attack.selectable {
  outline: 2px solid #7eb6ff;
  cursor: pointer;
  animation: targetPulse 1.1s ease-in-out infinite;
}

@keyframes targetPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(126, 182, 255, 0.45); }
  50% { box-shadow: 0 0 0 4px rgba(126, 182, 255, 0.2); }
}

.hand-wrap {
  margin-top: auto;
  padding-top: 8px;
}

.hand {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 120px;
}

.card {
  width: 72px;
  height: 104px;
  border-radius: 10px;
  background: var(--card-face);
  color: var(--black-suit);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-face-shadow, 0 8px 18px rgba(0, 0, 0, 0.28));
  display: block;
  padding: 0;
  font-weight: 800;
  user-select: none;
  position: relative;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.2s ease,
    filter 0.2s ease,
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}

.card.card-enter,
.pair.pair-enter {
  animation: cardEnter 0.28s ease both;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pair .card.defend.card-enter {
  animation: defendEnter 0.28s ease both;
}

@keyframes defendEnter {
  from {
    opacity: 0;
    transform: rotate(14deg) translateY(-6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: rotate(14deg);
  }
}

.card.red { color: var(--red-suit); }
.card:not(.red) { color: var(--black-suit); }

.card-corner {
  position: absolute;
  top: 6px;
  left: 7px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  z-index: 1;
}

.card-corner.bottom {
  top: auto;
  left: auto;
  right: 7px;
  bottom: 6px;
  transform: rotate(180deg);
}

.card .rank {
  font-size: 1.05rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.card-pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  line-height: 1;
  pointer-events: none;
  opacity: 0.95;
}

.card.mini {
  width: 42px;
  height: 60px;
  border-radius: 6px;
}

.card.mini .card-corner {
  top: 3px;
  left: 4px;
}

.card.mini .card-corner.bottom {
  top: auto;
  left: auto;
  right: 4px;
  bottom: 3px;
}

.card.mini .rank { font-size: 0.72rem; }
.card.mini .card-pip { font-size: 1.05rem; }

.card.playable {
  cursor: pointer;
}

.card.playable:hover {
  transform: translateY(-12px);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.35);
}

.card.dim {
  opacity: 0.4;
  filter: grayscale(0.3);
}

.card.transfer-hint {
  box-shadow: 0 0 0 2px var(--amber), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 52px;
}

.choice-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(232, 165, 75, 0.35);
}

.choice-bar[hidden] {
  display: none !important;
}

.choice-bar.is-compact {
  background: transparent;
  border: none;
  padding: 0;
}

.choice-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-dim);
  margin-right: 2px;
}

.choice-label[hidden] {
  display: none !important;
}

.status-line.choice-hint {
  color: var(--amber);
}

.card.selected {
  transform: translateY(-14px);
  box-shadow: 0 0 0 2px var(--amber), 0 16px 28px rgba(0, 0, 0, 0.35);
}

.role {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  color: var(--amber);
}

/* Auth / account / social */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.tab {
  flex: 1;
  border: 1px solid rgba(244, 239, 228, 0.14);
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink-dim);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  color: #1c1408;
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  border-color: transparent;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-form[hidden] {
  display: none !important;
}

.auth-forgot-link {
  align-self: flex-end;
  margin: -2px 0 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--amber);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-forgot-link:hover {
  color: #f0c070;
}

.auth-form .btn.ghost.sm {
  margin-top: 4px;
}

/* Landing */
.screen.landing {
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.landing-hero {
  --hero-content-w: min(48rem, 86vw);
  --hero-rail: max(16px, calc((100% - var(--hero-content-w)) / 2));
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: clamp(96px, 12vh, 140px) clamp(18px, 4vw, 48px) clamp(110px, 14vh, 160px);
  box-sizing: border-box;
  isolation: isolate;
}

.hero-visual {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(232, 165, 75, 0.16), transparent 55%),
    radial-gradient(ellipse 70% 50% at 20% 80%, rgba(31, 122, 88, 0.45), transparent 50%),
    linear-gradient(160deg, #0c2b20 0%, #0f3d2e 45%, #071912 100%);
}

.fan-card,
.hero-chess,
.hero-sea,
.hero-dominoes,
.hero-loto,
.hero-wordguess {
  position: absolute;
  will-change: transform;
  opacity: 0;
}

.fan-card {
  width: min(14vw, 96px);
  height: min(20vw, 138px);
  border-radius: 10px;
  background: linear-gradient(160deg, #fffdf8, #f0e6d4);
  color: #1c1a17;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(28, 26, 23, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 10px;
  font-family: 'Spectral', serif;
  font-weight: 700;
  font-size: 1.05rem;
  animation:
    dealIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    tokenFloat 6.5s ease-in-out infinite;
}

.fan-card i {
  font-style: normal;
  font-size: 1.65rem;
  align-self: center;
  line-height: 1;
}

.fan-card.c5 span {
  font-size: 0.92em;
  letter-spacing: -0.04em;
}

/* Веер карт — правый край текстового блока */
.fan-card.c1 {
  right: var(--hero-rail);
  top: clamp(18px, 3vh, 36px);
  color: #1c1a17;
  --deal-rot: -20deg;
  --deal-x: 40px;
  animation-delay: 0.04s, 0.85s;
  z-index: 6;
}
.fan-card.c2 {
  right: calc(var(--hero-rail) + 3.2rem);
  top: calc(clamp(18px, 3vh, 36px) + 4px);
  color: #c0392b;
  --deal-rot: -12deg;
  --deal-x: 32px;
  animation-delay: 0.1s, 0.95s;
  z-index: 5;
}
.fan-card.c3 {
  right: calc(var(--hero-rail) + 6.4rem);
  top: calc(clamp(18px, 3vh, 36px) + 8px);
  color: #c0392b;
  --deal-rot: -4deg;
  --deal-x: 24px;
  animation-delay: 0.16s, 1.05s;
  z-index: 4;
}
.fan-card.c4 {
  right: calc(var(--hero-rail) + 9.6rem);
  top: calc(clamp(18px, 3vh, 36px) + 12px);
  color: #1c1a17;
  --deal-rot: 4deg;
  --deal-x: 18px;
  animation-delay: 0.22s, 1.15s;
  z-index: 3;
}
.fan-card.c5 {
  right: calc(var(--hero-rail) + 12.8rem);
  top: calc(clamp(18px, 3vh, 36px) + 16px);
  color: #c0392b;
  --deal-rot: 12deg;
  --deal-x: 14px;
  animation-delay: 0.28s, 1.25s;
  z-index: 2;
}
.fan-card.c6 {
  right: calc(var(--hero-rail) + 16rem);
  top: calc(clamp(18px, 3vh, 36px) + 20px);
  color: #1c1a17;
  --deal-rot: 20deg;
  --deal-x: 10px;
  animation-delay: 0.34s, 1.35s;
  z-index: 1;
}

/* Chessboard — левый край текстового блока */
.hero-chess {
  left: var(--hero-rail);
  right: auto;
  top: clamp(20px, 3vh, 40px);
  width: clamp(108px, 14vw, 190px);
  aspect-ratio: 1;
  --deal-rot: -5deg;
  --deal-x: -12px;
  animation:
    dealIn 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    boardDrift 8s ease-in-out 1s infinite;
  animation-delay: 0.4s, 1.35s;
  z-index: 1;
}

.chess-board {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.4);
  border: 3px solid rgba(244, 239, 228, 0.28);
  background:
    repeating-conic-gradient(#edd9b0 0% 25%, #5a3d24 0% 50%)
    0 0 / 25% 25%;
  position: relative;
}

.chess-board .cp {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  left: calc((var(--c) - 1) * 12.5%);
  top: calc((var(--r) - 1) * 12.5%);
  display: grid;
  place-items: center;
  font-size: clamp(0.95rem, 2.6vw, 1.7rem);
  line-height: 1;
  font-weight: 700;
  animation: none;
  pointer-events: none;
  user-select: none;
}

.chess-board .cp.light {
  color: #fff8ec;
  -webkit-text-stroke: 1px #2a1a0e;
  text-shadow:
    0 0 1px #2a1a0e,
    0 1px 0 #2a1a0e,
    0 2px 3px rgba(0, 0, 0, 0.4);
}

.chess-board .cp.dark {
  color: #140e0a;
  -webkit-text-stroke: 0.6px rgba(255, 244, 220, 0.55);
  text-shadow:
    0 0 1px rgba(255, 244, 220, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Sea battle — левый низ у края текстового блока */
.hero-sea {
  left: var(--hero-rail);
  right: auto;
  top: auto;
  bottom: clamp(20px, 3.5vh, 40px);
  width: clamp(140px, 15vw, 210px);
  aspect-ratio: 1;
  --deal-rot: 4deg;
  --deal-x: 12px;
  animation:
    dealIn 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    boardDrift 7s ease-in-out 1.2s infinite;
  animation-delay: 0.48s, 1.45s;
  z-index: 1;
}

.sea-board {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1.1fr repeat(10, 1fr);
  grid-template-rows: 1.1fr repeat(10, 1fr);
  border-radius: 12px;
  overflow: hidden;
  background: #0a3345;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.42);
  border: 2px solid rgba(140, 210, 230, 0.28);
  font-family: 'Manrope', sans-serif;
}

.sea-corner {
  grid-column: 1;
  grid-row: 1;
  background: #082a38;
}

.sea-cols {
  grid-column: 2 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  background: #082a38;
  color: rgba(210, 235, 245, 0.9);
  font-size: clamp(0.45rem, 1.1vw, 0.68rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sea-cols span,
.sea-rows span {
  display: grid;
  place-items: center;
}

.sea-rows {
  grid-column: 1;
  grid-row: 2 / -1;
  display: grid;
  grid-template-rows: repeat(10, 1fr);
  background: #082a38;
  color: rgba(210, 235, 245, 0.9);
  font-size: clamp(0.42rem, 1vw, 0.64rem);
  font-weight: 700;
}

.sea-field {
  grid-column: 2 / -1;
  grid-row: 2 / -1;
  position: relative;
  background:
    linear-gradient(180deg, rgba(70, 160, 195, 0.2), transparent 45%),
    #0c4258;
}

.sea-field::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(180, 230, 245, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 230, 245, 0.2) 1px, transparent 1px);
  background-size: 10% 10%;
  pointer-events: none;
  animation: seaShimmer 5s ease-in-out infinite;
}

.sea-field .sea-cell {
  position: absolute;
  width: 10%;
  height: 10%;
  left: calc((var(--c) - 1) * 10%);
  top: calc((var(--r) - 1) * 10%);
  box-sizing: border-box;
  border-radius: 2px;
  z-index: 1;
}

.sea-field .sea-cell.is-ship {
  background: linear-gradient(160deg, #6f8fa3, #3d5a6e);
  box-shadow: inset 0 0 0 1px rgba(232, 165, 75, 0.35);
}

.sea-field .sea-cell.is-hit {
  background: #c0392b;
  box-shadow: inset 0 0 0 1px rgba(255, 200, 180, 0.4);
  z-index: 2;
}

.sea-field .sea-cell.is-sunk {
  background: #5a1f1a;
  box-shadow: inset 0 0 0 1px rgba(255, 120, 100, 0.35);
  z-index: 2;
}

.sea-field .sea-cell.is-miss {
  background: rgba(20, 60, 80, 0.9);
  background-image: radial-gradient(circle at center, rgba(244, 239, 228, 0.55) 0 22%, transparent 24%);
  z-index: 2;
}

/* Dominoes — правый низ у края текстового блока */
.hero-dominoes {
  right: var(--hero-rail);
  left: auto;
  top: auto;
  bottom: clamp(22px, 3.5vh, 42px);
  width: clamp(130px, 14vw, 200px);
  height: clamp(100px, 11vw, 152px);
  --deal-rot: -6deg;
  --deal-x: -12px;
  animation:
    dealIn 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    boardDrift 7.5s ease-in-out 1.1s infinite;
  animation-delay: 0.55s, 1.5s;
  z-index: 1;
}

.domino {
  position: absolute;
  border-radius: 7px;
  background: linear-gradient(160deg, #fffdf8, #ebe2d2);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(28, 26, 23, 0.12);
  display: flex;
  color: #1c1a17;
}

.domino.vt {
  flex-direction: column;
  width: 18%;
  height: 42%;
}

.domino.hz {
  flex-direction: row;
  width: 34%;
  height: 22%;
}

/* Лото — слева от текстового блока (в боковом поле) */
.hero-loto {
  right: calc((100% + var(--hero-content-w)) / 2 + clamp(0.25rem, 0.8vw, 0.5rem));
  left: auto;
  top: clamp(36%, 40vh, 44%);
  display: flex;
  align-items: center;
  gap: 10px;
  --deal-rot: -6deg;
  --deal-x: -14px;
  animation:
    dealIn 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    boardDrift 8.2s ease-in-out 1.15s infinite;
  animation-delay: 0.62s, 1.55s;
  z-index: 1;
}

.hero-loto-barrel {
  width: clamp(52px, 5.5vw, 72px);
  height: clamp(52px, 5.5vw, 72px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 35% 30%, #fff6e8, #f0c878 42%, #c8882a 78%, #8a5a18);
  border: 2px solid rgba(255, 236, 190, 0.85);
  box-shadow:
    inset 0 -6px 12px rgba(80, 40, 0, 0.28),
    0 10px 22px rgba(0, 0, 0, 0.3);
  color: #2a1608;
  font-family: 'Spectral', serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1;
}

.hero-loto-ticket {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 2px;
  width: clamp(132px, 14vw, 188px);
  padding: 5px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(244, 239, 228, 0.96), rgba(228, 220, 200, 0.92));
  border: 1px solid rgba(120, 90, 40, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.hero-loto-ticket .hl-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(60, 40, 10, 0.1);
  font-family: 'Spectral', serif;
  font-weight: 700;
  font-size: clamp(0.48rem, 0.85vw, 0.68rem);
  color: #1c1812;
  line-height: 1;
}

.hero-loto-ticket .hl-cell.is-blank {
  background: rgba(40, 70, 50, 0.14);
  border-color: transparent;
}

.hero-loto-ticket .hl-cell.is-hit {
  background: linear-gradient(180deg, #6ecf8e, #2f9e5b);
  color: #0f1f14;
  border-color: transparent;
}

/* Угадай слово — справа от текстового блока */
.hero-wordguess {
  left: calc((100% + var(--hero-content-w)) / 2 + clamp(0.25rem, 0.8vw, 0.5rem));
  right: auto;
  top: clamp(34%, 38vh, 44%);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(244, 239, 228, 0.14);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
  --deal-rot: -4deg;
  --deal-x: -10px;
  animation:
    dealIn 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    boardDrift 7.8s ease-in-out 1.2s infinite;
  animation-delay: 0.7s, 1.6s;
  z-index: 2;
}

.hero-wg-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
}

.hero-wg-row b {
  width: clamp(20px, 2.15vw, 26px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(0.58rem, 1vw, 0.74rem);
  line-height: 1;
  color: #f4efe4;
}

.hero-wg-row b.is-gray {
  background: rgba(80, 90, 85, 0.85);
}

.hero-wg-row b.is-yellow {
  background: linear-gradient(180deg, #e8c35a, #c9a03a);
  color: #1c1510;
}

.hero-wg-row b.is-green {
  background: linear-gradient(180deg, #6ecf8e, #2f9e5b);
  color: #0f1f14;
}

.domino.vt::after {
  content: '';
  position: absolute;
  left: 16%;
  right: 16%;
  top: 50%;
  height: 1px;
  background: rgba(28, 26, 23, 0.28);
  transform: translateY(-50%);
}

.domino.hz::after {
  content: '';
  position: absolute;
  top: 16%;
  bottom: 16%;
  left: 50%;
  width: 1px;
  background: rgba(28, 26, 23, 0.28);
  transform: translateX(-50%);
}

.domino .half {
  flex: 1;
  position: relative;
  background-repeat: no-repeat;
}

.domino .half[data-n="1"] {
  background-image: radial-gradient(circle, currentColor 45%, transparent 46%);
  background-size: 22% 22%;
  background-position: center;
}
.domino .half[data-n="2"] {
  background-image:
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%);
  background-size: 18% 18%, 18% 18%;
  background-position: 24% 24%, 76% 76%;
}
.domino .half[data-n="3"] {
  background-image:
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%);
  background-size: 17% 17%;
  background-position: 22% 20%, 50% 50%, 78% 80%;
}
.domino .half[data-n="4"] {
  background-image:
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%);
  background-size: 17% 17%;
  background-position: 24% 22%, 76% 22%, 24% 78%, 76% 78%;
}
.domino .half[data-n="5"] {
  background-image:
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%);
  background-size: 16% 16%;
  background-position: 22% 18%, 78% 18%, 50% 50%, 22% 82%, 78% 82%;
}
.domino .half[data-n="6"] {
  background-image:
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%),
    radial-gradient(circle, currentColor 45%, transparent 46%);
  background-size: 15% 15%;
  background-position: 28% 16%, 72% 16%, 28% 50%, 72% 50%, 28% 84%, 72% 84%;
}

/* Змейка: [6|6]—[6|3]—[3|1]
                      |
                   [1|4]
                      |
        [5|2]—[2|4]——┘  (стык по 2 и по 4) */
.domino.d1 { left: 2%; top: 4%; }
.domino.d2 { left: 20%; top: 14%; }
.domino.d3 { left: 52%; top: 14%; }
.domino.d4 { left: 80%; top: 14%; }
.domino.d5 { left: 64%; top: 56%; }
.domino.d6 { left: 30%; top: 56%; }

@keyframes dealIn {
  from {
    opacity: 0;
    transform: translate(var(--deal-x, 30px), 28px) rotate(calc(var(--deal-rot, 0deg) - 8deg)) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) rotate(var(--deal-rot, 0deg)) scale(1);
  }
}

@keyframes boardDrift {
  0%, 100% { transform: translate(0, 0) rotate(var(--deal-rot, 0deg)); }
  50% { transform: translate(0, -6px) rotate(var(--deal-rot, 0deg)); }
}

@keyframes tokenFloat {
  0%, 100% { transform: translate(0, 0) rotate(var(--deal-rot, 0deg)); }
  50% { transform: translate(0, -8px) rotate(var(--deal-rot, 0deg)); }
}

@keyframes piecePulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes seaShimmer {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

@keyframes hitFlash {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.08); }
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: var(--hero-content-w);
  max-width: 100%;
  margin-inline: auto;
  text-align: center;
  animation: fadeIn 0.7s ease both;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.08em 0.12em;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1;
  font-family: 'Spectral', serif;
  margin: 0;
}

.brand-mark .brand-stol {
  font-weight: 700;
  color: var(--ink);
}

.brand-mark .brand-ok {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.18em;
  padding: 0.12em 0.28em 0.14em 0.32em;
  border-radius: 0.28em;
  background:
    linear-gradient(160deg, rgba(232, 165, 75, 0.95), rgba(196, 125, 34, 0.92));
  color: #1c1510;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transform: rotate(-3deg);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.brand-mark .brand-ok:active {
  transform: rotate(-3deg) translateY(2px) scale(0.96);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.22),
    inset 0 3px 5px rgba(0, 0, 0, 0.16);
}

.brand-mark .brand-ok-text {
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.hero-brand {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  font-size: clamp(3.2rem, 10vw, 5.5rem);
  margin-bottom: 10px;
}

.hero-brand .brand-stol {
  animation: brandIn 0.75s ease both;
}

.hero-brand .brand-ok {
  cursor: pointer;
  user-select: none;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  animation:
    brandOkIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both,
    brandOkPress 4s ease-in-out 1.4s infinite;
}

.hero-brand .brand-ok:active {
  animation: none;
  transform: rotate(-3deg) translateY(3px) scale(0.94);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.2),
    inset 0 4px 7px rgba(0, 0, 0, 0.18);
}

.brand-mark-tab {
  font-size: 1.2rem;
  pointer-events: none;
}

.brand-mark-tab .brand-ok {
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes brandIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes brandOkIn {
  from {
    opacity: 0;
    transform: rotate(-8deg) scale(0.7) translateY(12px);
  }
  to {
    opacity: 1;
    transform: rotate(-3deg) scale(1) translateY(0);
  }
}

@keyframes brandOkPress {
  0%, 72%, 100% {
    transform: rotate(-3deg) translateY(0) scale(1);
    box-shadow:
      0 10px 28px rgba(0, 0, 0, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }
  8% {
    transform: rotate(-3deg) translateY(3px) scale(0.94);
    box-shadow:
      0 4px 10px rgba(0, 0, 0, 0.2),
      inset 0 4px 7px rgba(0, 0, 0, 0.18);
  }
  14% {
    transform: rotate(-3deg) translateY(0) scale(1);
    box-shadow:
      0 10px 28px rgba(0, 0, 0, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }
}

.hero-title {
  font-size: clamp(1.05rem, 2.6vw, 2.15rem);
  margin: 0 auto;
  color: var(--ink);
  font-weight: 600;
  max-width: none;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.hero-lede {
  margin: 14px auto 28px;
  color: var(--ink-dim);
  font-size: clamp(0.92rem, 1.5vw, 1.08rem);
  line-height: 1.5;
  max-width: 46ch;
}

.hero-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: min(100%, 26rem);
  margin-inline: auto;
  align-items: stretch;
}

.hero-cta > .btn,
.hero-cta > .btn-store {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.hero-cta > .btn {
  text-align: center;
}

.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 8px;
  border-radius: 14px;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.btn-store-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
}

.btn-store-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.12;
  min-width: 0;
  text-align: left;
}

.btn-store-kicker {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn-store-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.btn-android {
  --android-ink: #d7f5e6;
  --android-glow: rgba(61, 220, 132, 0.28);
  color: var(--android-ink);
  background:
    linear-gradient(135deg, rgba(20, 48, 36, 0.92), rgba(12, 28, 22, 0.96)),
    radial-gradient(120% 140% at 0% 0%, rgba(61, 220, 132, 0.22), transparent 55%);
  border-color: rgba(61, 220, 132, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25) inset,
    0 10px 28px rgba(0, 0, 0, 0.28),
    0 0 24px var(--android-glow);
}

.btn-android .btn-store-icon {
  color: #0b1a12;
  background: linear-gradient(160deg, #7dffb2 0%, #3dcc84 55%, #1f9a5c 100%);
  box-shadow: 0 4px 12px rgba(61, 204, 132, 0.35);
}

.btn-android .btn-store-kicker {
  color: rgba(215, 245, 230, 0.72);
}

.btn-android .btn-store-title {
  color: #f2fff8;
}

.btn-android:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  border-color: rgba(61, 220, 132, 0.55);
}

.btn-android:active {
  transform: translateY(1px);
}

.btn-ios {
  color: #f4efe4;
  background:
    linear-gradient(135deg, rgba(48, 48, 54, 0.94), rgba(18, 18, 22, 0.96));
  border-color: rgba(244, 239, 228, 0.22);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25) inset,
    0 10px 28px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  opacity: 1;
}

.btn-ios .btn-store-icon {
  color: #161412;
  background: linear-gradient(160deg, #f7f1e6 0%, #e4d8c4 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.btn-ios .btn-store-kicker {
  color: rgba(244, 239, 228, 0.68);
}

.btn-ios .btn-store-title {
  color: #f4efe4;
}

.btn-ios:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  border-color: rgba(244, 239, 228, 0.4);
}

.btn-ios:active {
  transform: translateY(1px);
}

.ios-install-steps {
  margin: 0 0 18px;
  padding: 0 0 0 1.15em;
  text-align: left;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

.ios-install-steps li + li {
  margin-top: 8px;
}

.ios-share-icon {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.15em;
  margin: 0 0.15em;
}

/* APK / установленное PWA: store-кнопки только в обычном браузере */
html.is-installed-app .btn-store,
body.is-installed-app .btn-store {
  display: none !important;
}

@media (display-mode: standalone),
       (display-mode: fullscreen),
       (display-mode: minimal-ui),
       (display-mode: window-controls-overlay) {
  .btn-store {
    display: none !important;
  }
}

/* Прелоадер только для APK/PWA */
.app-preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 35%, rgba(31, 122, 88, 0.35), transparent 55%),
    linear-gradient(165deg, #0c2b20 0%, #0a241c 55%, #071912 100%);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.app-preloader[hidden] {
  display: none !important;
}

.app-preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

html.is-preloading #app {
  visibility: hidden;
}

.app-preloader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(100%, 280px);
  text-align: center;
}

.app-preloader-brand {
  font-size: clamp(2.6rem, 12vw, 3.4rem);
  margin: 0;
  animation: brandIn 0.7s ease both;
}

.app-preloader-brand .brand-ok {
  animation: brandOkIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.app-preloader-caption {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.95rem;
}

.app-preloader-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(244, 239, 228, 0.12);
  overflow: hidden;
}

.app-preloader-bar {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), #f0c27a);
  animation: preloadBar 3s ease-in-out forwards;
}

@keyframes preloadBar {
  0% { width: 8%; transform: translateX(0); }
  50% { width: 55%; }
  100% { width: 100%; }
}

/* Auth modal */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 16, 12, 0.72);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(92vh, 720px);
  overflow: auto;
  padding: 28px 24px 24px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(22, 92, 67, 0.92), rgba(10, 36, 28, 0.96));
  border: 1px solid rgba(232, 165, 75, 0.28);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: modalIn 0.28s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal-panel h2 {
  margin: 0;
  font-size: 1.45rem;
}

.modal-lede {
  margin: 8px 0 18px;
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.4;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: var(--ink-dim);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-panel .tabs {
  margin-bottom: 14px;
}

.modal-panel .btn.primary {
  width: 100%;
}

.confirm-panel {
  width: min(100%, 360px);
  text-align: center;
  padding: 24px 22px 20px;
}

.confirm-panel h2 {
  font-size: 1.25rem;
}

.confirm-panel .modal-lede {
  margin: 10px 0 18px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-panel .confirm-actions .btn {
  width: auto;
  flex: 1;
}

@media (max-width: 1100px) and (min-width: 721px) {
  .hero-loto-barrel {
    width: clamp(44px, 4.8vw, 58px);
    height: clamp(44px, 4.8vw, 58px);
    font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  }

  .hero-loto-ticket {
    width: clamp(108px, 12vw, 148px);
    padding: 4px;
  }

  .hero-loto-ticket .hl-cell {
    font-size: clamp(0.4rem, 0.72vw, 0.56rem);
  }

  .hero-loto {
    gap: 7px;
  }
}

@media (max-width: 720px) {
  body.is-landing {
    min-height: 100dvh;
  }
  body.is-landing #app {
    min-height: 100dvh;
  }

  .screen.landing {
    min-height: 100dvh;
    padding: 0;
  }

  .landing-hero {
    min-height: 100dvh;
    padding: 112px 18px 128px;
  }

  .fan-card {
    width: 58px;
    height: 84px;
    font-size: 0.78rem;
    padding: 6px 7px;
  }
  .fan-card i { font-size: 1.15rem; }
  .fan-card.c1 { right: 2%; top: 20px; }
  .fan-card.c2 { right: 8%; top: 24px; }
  .fan-card.c3 { right: 14%; top: 28px; }
  .fan-card.c4 { right: 20%; top: 32px; opacity: 0.92; }
  .fan-card.c5 { right: 26%; top: 36px; opacity: 0.82; }
  .fan-card.c6 { right: 32%; top: 40px; opacity: 0.72; }

  .hero-chess {
    left: 12px;
    top: 22px;
    width: 108px;
  }
  .chess-board .cp {
    font-size: 0.72rem;
    -webkit-text-stroke-width: 0.45px;
  }

  .hero-sea {
    left: 14px;
    bottom: 24px;
    width: 146px;
  }
  .hero-dominoes {
    right: 12px;
    bottom: 26px;
    width: 140px;
    height: 108px;
  }

  .hero-loto,
  .hero-wordguess {
    display: none;
  }

  .hero-brand {
    font-size: clamp(2.6rem, 13vw, 3.4rem);
    margin-bottom: 6px;
  }
  .hero-title {
    font-size: clamp(0.92rem, 4.2vw, 1.2rem);
    white-space: nowrap;
    letter-spacing: -0.03em;
  }
  .hero-lede {
    margin: 10px auto 16px;
    font-size: 0.92rem;
    line-height: 1.4;
  }
  .hero-cta {
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .hero-cta > .btn {
    padding: 12px 10px;
    font-size: 0.95rem;
  }
  .btn-store {
    padding: 7px 8px 7px 6px;
    gap: 6px;
    border-radius: 12px;
  }
  .btn-store-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }
  .btn-store-kicker {
    font-size: 0.55rem;
  }
  .btn-store-title {
    font-size: 0.78rem;
  }

  @keyframes boardDrift {
    0%, 100% { transform: translate(0, 0) rotate(var(--deal-rot, 0deg)); }
    50% { transform: translate(0, -2px) rotate(var(--deal-rot, 0deg)); }
  }
  @keyframes tokenFloat {
    0%, 100% { transform: translate(0, 0) rotate(var(--deal-rot, 0deg)); }
    50% { transform: translate(0, -3px) rotate(var(--deal-rot, 0deg)); }
  }
}

@media (max-width: 400px) {
  .landing-hero {
    padding: 100px 14px 118px;
  }

  .fan-card {
    width: 52px;
    height: 76px;
    font-size: 0.72rem;
  }
  .fan-card i { font-size: 1.05rem; }
  .fan-card.c1 { right: 2%; top: 18px; }
  .fan-card.c2 { right: 8%; top: 22px; }
  .fan-card.c3 { right: 14%; top: 26px; }
  .fan-card.c4 { right: 20%; top: 30px; }
  .fan-card.c5 { right: 26%; top: 34px; }
  .fan-card.c6 { right: 32%; top: 38px; }

  .hero-chess {
    left: 10px;
    top: 20px;
    width: 96px;
  }
  .chess-board .cp {
    font-size: 0.64rem;
  }

  .hero-sea {
    left: 10px;
    bottom: 22px;
    width: 128px;
  }
  .hero-dominoes {
    right: 8px;
    bottom: 24px;
    width: 122px;
    height: 94px;
  }

  .hero-brand { font-size: 2.55rem; }
  .hero-title {
    font-size: clamp(0.82rem, 3.8vw, 1.05rem);
    white-space: nowrap;
  }
  .hero-lede {
    font-size: 0.88rem;
    margin: 8px auto 14px;
  }

  .sea-cols,
  .sea-rows {
    font-size: 0.4rem;
  }
}

.game-icons {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.game-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 112px;
  padding: 12px 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(244, 239, 228, 0.1);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
  box-sizing: border-box;
}

.game-icon.is-active {
  border-color: rgba(232, 165, 75, 0.55);
  background: rgba(232, 165, 75, 0.12);
  box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.15);
}

.game-icon.is-soon {
  opacity: 0.55;
  filter: grayscale(0.25);
}

.game-glyph {
  width: 100%;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  line-height: 1;
  color: inherit;
}

.game-glyph .icon-ship {
  width: 34px;
  height: 28px;
  display: block;
}

.game-name {
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1.2;
  min-height: 2.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-status {
  margin-top: auto;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}

.game-icon.is-active .game-status {
  color: var(--amber);
}

.account-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin-bottom: 12px;
}

.account-me {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.account-me-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 4px 6px 4px 4px;
  margin: -4px 0;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.account-me-btn:hover,
.account-me-btn:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.account-me-text {
  min-width: 0;
}

.account-name {
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 220px);
}

.account-stats {
  color: var(--ink-dim);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 220px);
}

.account-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-icon-logout {
  appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(244, 239, 228, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink-dim);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-icon-logout:hover,
.btn-icon-logout:focus-visible {
  color: var(--ink);
  border-color: rgba(232, 165, 75, 0.55);
  background: rgba(232, 165, 75, 0.12);
  outline: none;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #124533;
  border: 2px solid rgba(232, 165, 75, 0.45);
  flex-shrink: 0;
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
  line-height: 0;
}

.avatar-wrap .avatar {
  display: block;
}

.presence-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(12, 16, 12, 0.95);
  background: #9a4a42;
}

.avatar-wrap.is-online .presence-dot {
  background: #3ecf7a;
  box-shadow: 0 0 0 2px rgba(62, 207, 122, 0.25);
}

.avatar-wrap.is-offline .presence-dot {
  background: #d45a4a;
}

.invite-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 90;
  width: min(420px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(18, 24, 18, 0.96);
  border: 1px solid rgba(232, 165, 75, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invite-toast[hidden] {
  display: none !important;
}

.invite-toast-text {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
}

.invite-toast-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.avatar.lg {
  width: 88px;
  height: 88px;
}

.avatar.sm {
  width: 32px;
  height: 32px;
}

.avatar.xs {
  width: 22px;
  height: 22px;
}

.home-tabs {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto 14px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(244, 239, 228, 0.1);
}

.home-tab {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.home-tab-icon {
  flex: 0.72 1 0;
  min-height: 44px;
  padding: 10px 8px;
}

.home-tab-svg {
  display: block;
  flex-shrink: 0;
  opacity: 0.88;
  transition: opacity 0.15s, transform 0.15s;
}

.home-tab-svg-123 text {
  dominant-baseline: alphabetic;
}

.home-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.home-tab:hover .home-tab-svg {
  opacity: 1;
}

.home-tab.is-active {
  color: var(--ink);
  background: rgba(232, 165, 75, 0.18);
  box-shadow: inset 0 0 0 1px rgba(232, 165, 75, 0.35);
}

.home-tab.is-active .home-tab-svg {
  opacity: 1;
  color: var(--amber);
  transform: translateY(-0.5px);
}

.home-layout {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.home-tab-panel[hidden] {
  display: none !important;
}

.home-tab-panel.home-panel,
.home-tab-panel.side-block {
  width: 100%;
}

.side-block {
  padding: 22px 20px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 92, 67, 0.42), rgba(12, 43, 32, 0.7));
  border: 1px solid rgba(232, 165, 75, 0.18);
  box-shadow: var(--shadow);
  flex: 1;
}

.side-block h3 {
  margin: 0 0 12px;
  font-family: 'Spectral', serif;
  font-size: 1.25rem;
}

.game-pick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 12px;
}

.game-cat {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 8px;
  padding: 3px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(244, 239, 228, 0.1);
}

.game-cat-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.game-cat-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.game-cat-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.game-cat-btn.is-active {
  color: var(--ink);
  background: rgba(232, 165, 75, 0.18);
  box-shadow: inset 0 0 0 1px rgba(232, 165, 75, 0.35);
}

.game-cat-btn.is-active .game-cat-ico {
  color: var(--amber);
}

.game-pick-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 0;
  padding: 8px 4px 6px;
  border-radius: 12px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.game-pick-item[hidden] {
  display: none !important;
}

.game-pick-item:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(232, 165, 75, 0.4);
}

.game-pick-item.is-active {
  border-color: rgba(232, 165, 75, 0.65);
  background: rgba(232, 165, 75, 0.14);
  box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.12);
}

.game-pick-item.is-soon,
.game-pick-item:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.game-pick-glyph {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: inherit;
}

.game-pick-glyph svg {
  width: 34px;
  height: 34px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.game-pick-glyph svg .is-fill,
.game-pick-glyph svg circle.is-fill,
.game-pick-glyph svg text {
  fill: currentColor;
  stroke: none;
}

.game-pick-glyph svg .is-dim {
  fill: currentColor;
  stroke: none;
  opacity: 0.28;
}

.game-pick-glyph svg text.is-invert {
  fill: #1c1712;
  stroke: none;
}

.game-pick-item.is-active .game-pick-glyph {
  color: var(--amber);
}

.game-pick-name {
  font-weight: 700;
  font-size: 0.74rem;
  line-height: 1.2;
  text-align: center;
}

.game-pick-item[data-plus="1"]::after {
  content: '+';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
  line-height: 1;
  color: #2a1608;
  background: linear-gradient(180deg, #f0d090, #d4a04a);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.game-pick-status {
  display: none;
}

.home-panel .lede {
  margin-bottom: 12px;
}

.subhead {
  margin: 14px 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}

.friend-add {
  display: flex;
  gap: 8px;
}

.friend-add input {
  flex: 1;
  padding: 10px 12px;
}

.mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.mini-list .meta {
  flex: 1;
  min-width: 0;
}

.mini-list .meta strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-list .meta span {
  font-size: 0.78rem;
  color: var(--ink-dim);
}

.mini-list .row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.rating-table {
  margin-top: 2px;
}

#home-tab-rating.side-block {
  padding: 14px 10px 10px;
}

#home-tab-rating h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
}

.board-head,
.board-list .board-row {
  display: grid;
  grid-template-columns: 1.1rem 20px minmax(0, 1fr) 1.2rem 1.2rem 1.2rem;
  align-items: center;
  column-gap: 5px;
  padding: 4px 2px;
}

.board-head {
  margin-bottom: 2px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(244, 239, 228, 0.12);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.board-head .board-col.board-h-w,
.board-w {
  color: #b8e0c8;
}

.board-list {
  gap: 2px;
}

.board-list .board-row {
  display: grid;
  border-radius: 8px;
  padding: 4px 2px;
}

.board-list .board-row .avatar.xs {
  width: 20px;
  height: 20px;
}

.board-list .board-empty {
  display: block;
  padding: 8px 4px;
}

.board-rank {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-dim);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.board-av {
  width: 20px;
  height: 20px;
}

.board-who {
  min-width: 0;
  overflow: hidden;
}

.board-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-name .plus-badge {
  margin-left: 0.2em;
  vertical-align: 0.05em;
}

.board-col,
.board-w,
.board-l,
.board-d {
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
}

.board-w { color: #b8e0c8; }
.board-l { color: #ffb4a8; }
.board-d { color: #f0d090; }

.board-legend {
  margin: 6px 0 0;
  font-size: 0.68rem;
  color: var(--ink-dim);
  line-height: 1.3;
}

#screen-profile.screen.active {
  justify-content: flex-start;
  align-items: stretch;
  padding: 10px clamp(12px, 3vw, 28px) 18px;
}

#screen-profile .home-panel.profile-panel,
.profile-panel {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  height: auto;
  max-height: none;
  flex: 0 0 auto;
  gap: 10px;
  padding: 4px 4px 14px;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 2px;
}

.profile-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.btn-icon-back {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink-dim);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.btn-icon-back:hover,
.btn-icon-back:focus-visible {
  color: var(--ink);
  border-color: rgba(232, 165, 75, 0.45);
  outline: none;
}

.profile-head #btn-profile-back {
  margin-left: 0;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 8px 8px 8px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(244, 239, 228, 0.08);
}

.avatar-edit {
  position: relative;
  display: block;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
}

.avatar-edit input[type='file'] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.avatar-edit .avatar.lg {
  display: block;
  width: 64px;
  height: 64px;
  transition: filter 0.15s ease, box-shadow 0.2s ease;
}

.avatar-edit-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: rgba(12, 16, 12, 0.55);
  color: #f4efe4;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.avatar-edit:hover .avatar-edit-hint,
.avatar-edit:focus-within .avatar-edit-hint {
  opacity: 1;
}

.avatar-edit:hover .avatar.lg,
.avatar-edit:focus-within .avatar.lg {
  filter: brightness(0.85);
}

.avatar-edit.is-flash-ok {
  box-shadow: 0 0 0 3px rgba(110, 207, 142, 0.7);
}

.avatar-edit.is-flash-err {
  box-shadow: 0 0 0 3px rgba(216, 90, 74, 0.7);
}

.profile-hero-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  justify-content: center;
  flex: 1;
}

.profile-display {
  margin: 0;
  font-family: 'Spectral', serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-meta {
  margin: 0;
  font-size: 0.74rem;
  color: var(--ink-dim);
  line-height: 1.25;
  max-width: 100%;
}

.profile-meta #profile-login {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.profile-email {
  margin: 0;
  font-size: 0.68rem;
  color: var(--ink-dim);
  opacity: 0.85;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-email[hidden] {
  display: none !important;
}

.profile-rank-badge {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  box-sizing: border-box;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  background: #124533;
  border: 2px solid rgba(232, 165, 75, 0.45);
}

.profile-rank-badge[hidden] {
  display: none !important;
}

.profile-rank-n {
  font-family: 'Spectral', serif;
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.profile-rank-label {
  font-size: 0.48rem;
  font-weight: 700;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px 7px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(244, 239, 228, 0.08);
  text-align: center;
  min-width: 0;
}

.profile-stat-n {
  font-family: 'Spectral', serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.profile-stat-l {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.profile-stat.is-win {
  border-color: rgba(61, 204, 122, 0.28);
  background: linear-gradient(180deg, rgba(61, 204, 122, 0.12), rgba(0, 0, 0, 0.18));
}
.profile-stat.is-win .profile-stat-n { color: #b8e0c8; }

.profile-stat.is-loss {
  border-color: rgba(216, 90, 74, 0.28);
  background: linear-gradient(180deg, rgba(216, 90, 74, 0.12), rgba(0, 0, 0, 0.18));
}
.profile-stat.is-loss .profile-stat-n { color: #ffb4a8; }

.profile-stat.is-draw {
  border-color: rgba(232, 165, 75, 0.25);
  background: linear-gradient(180deg, rgba(232, 165, 75, 0.1), rgba(0, 0, 0, 0.18));
}
.profile-stat.is-draw .profile-stat-n { color: #f0d090; }

.profile-stat.is-rate {
  border-color: rgba(120, 180, 255, 0.25);
  background: linear-gradient(180deg, rgba(120, 180, 255, 0.1), rgba(0, 0, 0, 0.18));
}
.profile-stat.is-rate .profile-stat-n { color: #b7d4ff; }

.profile-name-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.profile-name-field {
  margin: 0 !important;
  gap: 4px;
}

.profile-name-field span {
  font-size: 0.74rem;
}

.profile-name-field input {
  padding: 9px 10px;
  font-size: 0.92rem;
}

.profile-name-field input:read-only {
  cursor: pointer;
}

#screen-profile .field {
  margin: 0;
}

#screen-profile #btn-profile-save {
  width: auto;
  min-width: 96px;
  margin: 0;
  height: 40px;
  padding: 0 14px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

#screen-profile #btn-profile-save.is-flash-ok {
  background: linear-gradient(180deg, #6ecf8e, #2f9e5b) !important;
  color: #0f1f14 !important;
  border-color: transparent !important;
  box-shadow: 0 0 0 2px rgba(110, 207, 142, 0.35);
}

#screen-profile #btn-profile-save.is-flash-err {
  background: linear-gradient(180deg, #e06b5c, var(--danger)) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 0 0 2px rgba(216, 90, 74, 0.35);
}

#screen-profile .skin-studio {
  margin: 2px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(244, 239, 228, 0.08);
}

#screen-profile .theme-picker-label {
  margin-bottom: 8px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#screen-profile .skin-tabs {
  margin-bottom: 8px;
  padding: 3px;
  border-radius: 12px;
}

#screen-profile .skin-tab {
  padding: 7px 4px;
  font-size: 0.72rem;
  border-radius: 9px;
}

#screen-profile .theme-option,
#screen-profile .table-option,
#screen-profile .chess-option {
  padding: 8px 6px 8px;
  border-radius: 12px;
}

#screen-profile .theme-preview {
  min-height: 54px;
  margin-bottom: 6px;
}

#screen-profile .theme-preview .card.mini,
#screen-profile .theme-preview .card-back.mini-back {
  width: 30px;
  height: 44px;
}

#screen-profile .table-preview {
  height: 40px;
  margin-bottom: 6px;
  border-radius: 8px;
}

#screen-profile .chess-preview,
#screen-profile .ck-preview,
#screen-profile .dm-preview {
  width: 52px;
  height: 52px;
  margin-bottom: 6px;
}

#screen-profile .dm-preview-tile {
  width: 46px;
  height: 24px;
}

#screen-profile .theme-option-name,
#screen-profile .table-option-name,
#screen-profile .chess-option-name {
  font-size: 0.7rem;
}

#screen-profile .theme-picker-grid,
#screen-profile .table-picker-grid,
#screen-profile .chess-picker-grid {
  gap: 7px;
}

#screen-profile #profile-error {
  margin: 0;
  font-size: 0.8rem;
}

@media (max-width: 420px) {
  .profile-panel {
    padding: 10px 10px 12px;
    gap: 8px;
  }

  .profile-stat-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }

  .profile-stat-n {
    font-size: 1rem;
  }

  .profile-stat-l {
    font-size: 0.52rem;
  }

  .profile-hero {
    gap: 10px;
  }

  .profile-name-row {
    grid-template-columns: 1fr;
  }

  #screen-profile #btn-profile-save {
    width: 100%;
  }

  #screen-profile .theme-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #screen-profile .table-picker-grid,
  #screen-profile .chess-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.file-btn {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

/* не использовать attribute hidden — на iOS/Safari label не открывает file picker */
.file-btn input[type='file'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.player-list li .who {
  display: flex;
  align-items: center;
  gap: 10px;
}

.opponent .name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.opponent .name {
  margin-bottom: 0;
}

.opponent .opp-text .role {
  margin-top: 2px;
}

@media (min-width: 901px) {
  #screen-home.screen.active {
    align-items: center;
  }

  #screen-home .account-bar,
  #screen-home .home-tabs,
  #screen-home .home-layout {
    width: 100%;
    max-width: 720px;
  }

  #screen-home .account-bar {
    margin-left: auto;
    margin-right: auto;
  }

  #screen-home .account-name,
  #screen-home .account-stats {
    max-width: none;
  }
}

@media (max-width: 900px) {
  .home-tabs {
    max-width: none;
  }
}

@media (max-width: 420px) {
  .home-tab {
    padding: 9px 6px;
    font-size: 0.8rem;
  }

  .home-tab-icon {
    min-height: 42px;
    padding: 9px 4px;
  }

  .home-tab-svg {
    width: 20px;
    height: 20px;
  }

  .game-cat-btn {
    font-size: 0.7rem;
    padding: 6px 3px;
    gap: 3px;
  }

  .home-join-panel .join-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .card {
    width: 58px;
    height: 84px;
    padding: 6px 7px;
  }
  .card .suit { font-size: 1.25rem; }
  .pair {
    width: 96px;
    height: 118px;
  }
  .pair .card.defend {
    left: 34px;
    top: 28px;
  }
  .deck-pile {
    width: 96px;
    height: 98px;
  }
  .deck-pile .card.trump-under {
    left: 34px;
    top: 18px;
  }
  .deck-pile .card-back {
    width: 58px;
    height: 84px;
    left: 0;
    top: 6px;
  }
  .table-area {
    flex-direction: column;
    min-height: 200px;
  }
  .status-line { font-size: 0.92rem; }
}

/* Дурак / домино: компактное поле под телефон (~400–480px) */
@media (max-width: 480px) {
  body.is-game #app {
    min-height: 100dvh;
  }

  #screen-game.screen,
  #screen-domino.screen {
    padding: 6px 8px 8px;
    gap: 4px;
    min-height: 100dvh;
  }

  #screen-game .status-line,
  #screen-game .game-turn-status,
  #screen-domino .status-line,
  #screen-domino .game-turn-status {
    font-size: 0.76rem;
    line-height: 1.25;
    min-height: 0;
    padding: 5px 8px;
    margin: 0;
    border-radius: 8px;
  }

  #screen-game #game-status {
    height: calc(1.25em * 2 + 10px);
    min-height: calc(1.25em * 2 + 10px);
    max-height: calc(1.25em * 2 + 10px);
    margin: 4px 0 0;
    padding: 5px 8px;
    line-height: 1.25;
  }

  #screen-game .actions,
  #screen-domino .actions {
    min-height: 0;
  }

  #screen-game .opponents,
  #screen-domino .opponents {
    gap: 4px;
    min-height: 0;
    margin-bottom: 2px;
    padding: 0;
    flex-shrink: 0;
    flex-wrap: nowrap;
    justify-content: center;
    overflow: visible;
  }

  #screen-game .opponent,
  #screen-domino .opponent {
    min-width: 0;
    max-width: 118px;
    flex: 0 1 auto;
    padding: 5px 6px;
    border-radius: 10px;
    text-align: left;
  }

  /* При нескольких соперниках делим ширину поровну, чтобы влезли */
  #screen-game .opponents[data-count="4"] .opponent,
  #screen-game .opponents[data-count="5"] .opponent,
  #screen-domino .opponents[data-count="2"] .opponent,
  #screen-domino .opponents[data-count="3"] .opponent {
    flex: 1 1 0;
    max-width: none;
  }

  #screen-game .opponent .name-row,
  #screen-domino .opponent .name-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 0;
    justify-content: flex-start;
  }

  #screen-game .opponent .avatar.sm,
  #screen-domino .opponent .avatar.sm {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  #screen-game .opponent .opp-text,
  #screen-domino .opponent .opp-text {
    flex: 1 1 auto;
    min-width: 0;
  }

  #screen-game .opponent .name,
  #screen-domino .opponent .name {
    font-size: 0.68rem;
    max-width: none;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.15;
  }

  #screen-game .opponent .role,
  #screen-domino .opponent .role {
    display: block;
    font-size: 0.55rem;
    margin-top: 1px;
    letter-spacing: 0.03em;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #screen-game .opponent .opp-count,
  #screen-domino .opponent .opp-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 24px;
    min-width: 18px;
    padding: 0;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 800;
    color: #f4efe4;
    line-height: 1;
    background:
      linear-gradient(145deg, rgba(244, 239, 228, 0.14), transparent 45%),
      repeating-linear-gradient(
        45deg,
        #1a4d38 0 3px,
        #163f2e 3px 6px
      );
    border: 1.5px solid rgba(232, 165, 75, 0.55);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  }

  #screen-game .opponents[data-count="4"] .opponent .name,
  #screen-game .opponents[data-count="5"] .opponent .name,
  #screen-domino .opponent .name {
    font-size: 0.62rem;
  }

  #screen-game .opponents[data-count="5"] .opponent,
  #screen-domino .opponent {
    padding: 4px 4px;
  }

  #screen-game .opponents[data-count="5"] .opponent .avatar.sm,
  #screen-domino .opponent .avatar.sm {
    width: 20px;
    height: 20px;
  }

  #screen-game .table-area {
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    min-height: 0;
    margin: 2px 0;
    padding: 8px 6px 6px;
    border-radius: 14px;
    overflow: hidden;
  }

  #screen-game .table-play {
    flex: 1 1 auto;
    min-height: 0;
    gap: 8px;
    justify-content: flex-start;
  }

  #screen-game .table-actions {
    min-height: 34px;
    padding: 0;
  }

  #screen-game .table-deck {
    min-width: 0;
    gap: 4px;
    align-self: center;
    flex: 0 0 auto;
  }

  #screen-game .table-discard {
    top: 6px;
    right: 6px;
  }

  #screen-game .discard-pile {
    padding: 3px 4px 4px;
    gap: 2px;
    border-radius: 8px;
  }

  #screen-game .discard-stack {
    width: 28px;
    height: 36px;
  }

  #screen-game .discard-sheet {
    width: 24px;
    height: 34px;
    left: 1px;
    top: 1px;
    border-radius: 4px;
  }

  #screen-game .discard-pile .deck-count-label {
    font-size: 0.58rem;
    padding: 0 4px;
  }

  #screen-game .deck-pile {
    width: 86px;
    height: 74px;
  }

  #screen-game .deck-pile .card.trump-under {
    left: 30px;
    top: 4px;
    width: 44px;
    height: 62px;
    padding: 4px 5px;
    transform: rotate(90deg);
    transform-origin: center center;
  }

  #screen-game .deck-pile .card.trump-under .rank {
    font-size: 0.78rem;
  }

  #screen-game .deck-pile .card.trump-under .suit {
    font-size: 0.95rem;
  }

  #screen-game .deck-pile .card-back {
    width: 44px;
    height: 62px;
    left: 0;
    top: 4px;
    border-radius: 7px;
    box-shadow:
      2px 2px 0 rgba(0, 0, 0, 0.16),
      4px 4px 0 rgba(0, 0, 0, 0.1),
      0 6px 12px rgba(0, 0, 0, 0.24);
  }

  #screen-game .deck-pile.only-trump .card.trump-under {
    left: 12px;
    top: 4px;
  }

  #screen-game .deck-count-label {
    font-size: 0.68rem;
    padding: 2px 7px;
  }

  #screen-game .deck-trump-name {
    font-size: 0.65rem;
    max-width: none;
    white-space: nowrap;
  }

  #screen-game .table-cards {
    flex: 1 1 auto;
    min-height: 0;
    gap: 8px 10px;
    padding: 2px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    align-content: center;
  }

  #screen-game .table-cards:empty::after {
    font-size: 0.95rem;
  }

  #screen-game .pair {
    width: 72px;
    height: 90px;
  }

  #screen-game .pair .card,
  #screen-game .table-cards > .card {
    width: 48px;
    height: 68px;
    padding: 5px 6px;
    border-radius: 8px;
  }

  #screen-game .pair .card .rank,
  #screen-game .table-cards > .card .rank {
    font-size: 0.88rem;
  }

  #screen-game .pair .card .suit,
  #screen-game .table-cards > .card .suit {
    font-size: 1.05rem;
  }

  #screen-game .pair .card.defend {
    left: 22px;
    top: 18px;
  }

  #screen-game .actions {
    min-height: 36px;
    gap: 6px;
    flex-shrink: 0;
    padding: 0 2px;
  }

  #screen-game .actions .btn {
    padding: 8px 12px;
    font-size: 0.82rem;
    border-radius: 10px;
  }

  #screen-game .actions .btn.sm {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  #screen-game .choice-bar {
    gap: 6px;
    padding: 4px 6px;
    border-radius: 12px;
    width: auto;
    max-width: 100%;
  }

  #screen-game .choice-bar.is-compact {
    padding: 0;
  }

  #screen-game .choice-label {
    font-size: 0.75rem;
    width: auto;
    text-align: center;
    margin: 0;
  }

  #screen-game .status-line.choice-hint {
    font-size: 0.78rem;
  }

  #screen-game .hand-wrap {
    flex-shrink: 0;
    padding-top: 2px;
    margin-top: 0;
  }

  #screen-game .hand {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 6px;
    min-height: 0;
    padding: 6px 4px 10px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  #screen-game .hand.is-fanned {
    gap: 0;
  }

  #screen-game .hand .card {
    width: 54px;
    height: 78px;
    padding: 5px 6px;
    border-radius: 8px;
    flex: 0 0 auto;
    margin-left: 0;
  }

  #screen-game .hand .card .rank {
    font-size: 0.95rem;
  }

  #screen-game .hand .card .suit {
    font-size: 1.15rem;
  }

  #screen-game .hand .card.playable:hover {
    transform: translateY(-8px);
  }

  #screen-game .hand .card.selected {
    transform: translateY(-10px);
  }

  .conn-dot {
    top: 8px;
    right: 8px;
    width: 9px;
    height: 9px;
  }
}

@media (max-width: 400px) {
  #screen-game.screen,
  #screen-domino.screen {
    padding: 4px 6px 6px;
    gap: 3px;
  }

  #screen-game .status-line,
  #screen-domino .status-line {
    font-size: 0.72rem;
    padding: 3px 6px;
  }

  #screen-game #game-status {
    height: calc(1.25em * 2 + 6px);
    min-height: calc(1.25em * 2 + 6px);
    max-height: calc(1.25em * 2 + 6px);
    padding: 3px 6px;
  }

  #screen-game .opponent,
  #screen-domino .opponent {
    padding: 4px 4px;
  }

  #screen-game .opponent .name,
  #screen-domino .opponent .name {
    font-size: 0.6rem;
  }

  #screen-game .opponent .opp-count,
  #screen-domino .opponent .opp-count {
    width: 16px;
    height: 22px;
    min-width: 16px;
    font-size: 0.58rem;
  }

  #screen-game .table-area {
    gap: 4px;
    padding: 6px 4px 4px;
    border-radius: 12px;
  }

  #screen-game .deck-pile {
    width: 78px;
    height: 66px;
  }

  #screen-game .deck-pile .card.trump-under {
    left: 26px;
    top: 4px;
    width: 40px;
    height: 56px;
    transform: rotate(90deg);
    transform-origin: center center;
  }

  #screen-game .deck-pile .card-back {
    width: 40px;
    height: 56px;
  }

  #screen-game .pair {
    width: 66px;
    height: 82px;
  }

  #screen-game .pair .card,
  #screen-game .table-cards > .card {
    width: 44px;
    height: 62px;
    padding: 4px 5px;
  }

  #screen-game .pair .card.defend {
    left: 20px;
    top: 16px;
  }

  #screen-game .hand .card {
    width: 52px;
    height: 74px;
  }

  #screen-game .actions .btn {
    padding: 7px 10px;
    font-size: 0.78rem;
  }
}

/* --- Морской бой --- */
#screen-seabattle {
  gap: 10px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

#screen-seabattle .status-line {
  text-align: center;
  margin: 0;
  font-size: 0.95rem;
}

.sb-boards {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: 'own turn enemy';
  gap: 14px 16px;
  align-items: center;
}

.sb-own-wrap { grid-area: own; }
.sb-enemy-wrap { grid-area: enemy; }
.sb-turn { grid-area: turn; }

.sb-board-wrap {
  min-width: 0;
}

.sb-turn {
  margin: 0;
  padding: 10px 12px;
  text-align: center;
  font-family: 'Spectral', serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(244, 239, 228, 0.12);
  min-width: 7.5rem;
  max-width: 11rem;
  justify-self: center;
}

.sb-turn.is-mine {
  color: #f4efe4;
  border-color: rgba(232, 165, 75, 0.55);
  background: rgba(232, 165, 75, 0.18);
}

.sb-turn.is-foe {
  color: var(--ink-dim);
  border-color: rgba(120, 180, 200, 0.28);
}

.sb-board-title {
  margin: 0 0 8px;
  font-family: 'Spectral', serif;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
}

.sb-grid {
  display: grid;
  grid-template-columns: 18px repeat(10, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.sb-cell {
  aspect-ratio: 1;
  border: 0;
  border-radius: 3px;
  padding: 0;
  background: rgba(10, 40, 55, 0.55);
  box-shadow: inset 0 0 0 1px rgba(120, 180, 200, 0.2);
  color: var(--ink);
  font: inherit;
  cursor: default;
}

.sb-cell.sb-label {
  background: transparent;
  box-shadow: none;
  aspect-ratio: auto;
  min-height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ink-dim);
}

.sb-cell.is-empty,
.sb-cell.is-fog {
  background: rgba(12, 48, 64, 0.65);
}

.sb-cell.is-ship {
  background: linear-gradient(160deg, #6f8fa3, #3d5a6e);
  box-shadow: inset 0 0 0 1px rgba(232, 165, 75, 0.35);
}

.sb-cell.is-hit {
  background: #c0392b;
  box-shadow: inset 0 0 0 1px rgba(255, 200, 180, 0.4);
}

.sb-cell.is-sunk {
  background: #5a1f1a;
  box-shadow: inset 0 0 0 1px rgba(255, 120, 100, 0.35);
}

.sb-cell.is-miss {
  background: rgba(20, 60, 80, 0.9);
  background-image: radial-gradient(circle at center, rgba(244, 239, 228, 0.55) 0 22%, transparent 24%);
}

.sb-cell.ghost-ok {
  outline: 2px solid rgba(120, 200, 150, 0.85);
  outline-offset: -1px;
  background: rgba(61, 204, 122, 0.35);
}

.sb-cell.ghost-bad {
  outline: 2px solid rgba(216, 90, 74, 0.85);
  outline-offset: -1px;
  background: rgba(216, 90, 74, 0.35);
}

.sb-cell.shootable {
  cursor: pointer;
}

.sb-cell.shootable:hover {
  background: rgba(232, 165, 75, 0.28);
}

.sb-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 4px;
}

.sb-hint {
  font-size: 0.82rem;
  color: var(--ink-dim);
  font-weight: 600;
  margin-right: 4px;
}

@media (max-width: 720px) {
  .sb-boards {
    grid-template-columns: 1fr;
    grid-template-areas:
      'own'
      'turn'
      'enemy';
    gap: 12px;
  }

  .sb-turn {
    max-width: none;
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.95rem;
  }

  .sb-grid {
    max-width: 100%;
    grid-template-columns: 16px repeat(10, minmax(0, 1fr));
  }

  .sb-toolbar {
    gap: 6px;
  }

  .sb-toolbar .btn {
    flex: 1 1 calc(50% - 6px);
  }
}


/* Домино: компактные чипы соперников и на широком экране */
#screen-domino .opponents {
  min-height: 0;
  margin-bottom: 6px;
  gap: 6px;
}

#screen-domino .opponent {
  min-width: 0;
  max-width: 140px;
  padding: 6px 8px;
  text-align: left;
}

#screen-domino .opponent .name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  justify-content: flex-start;
}

#screen-domino .opponent .name {
  margin: 0;
  font-size: 0.82rem;
}

#screen-domino .opponent .opp-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 28px;
  min-width: 20px;
  padding: 0;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #f4efe4;
  line-height: 1;
  background:
    linear-gradient(145deg, rgba(244, 239, 228, 0.14), transparent 45%),
    repeating-linear-gradient(
      45deg,
      #1a4d38 0 3px,
      #163f2e 3px 6px
    );
  border: 1.5px solid rgba(232, 165, 75, 0.55);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

#screen-domino .opponent .opp-cards {
  display: none;
}

/* --- Домино (в духе экрана дурака) --- */
#screen-domino {
  gap: 8px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

#screen-domino .dm-table-area {
  align-items: center;
  min-height: 200px;
}

.dm-chain-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 18px 4px;
}

.dm-chain {
  /* u = толщина кости; обычная = 2u×u, дубль вертикально = u×2u */
  --dm-u: 36px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  min-height: calc(var(--dm-u) * 2 + 8px);
}

.dm-chain-item {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.dm-chain-empty {
  color: var(--ink-dim);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 16px;
  opacity: 0.85;
}

.dm-end-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(232, 165, 75, 0.45);
  background: rgba(232, 165, 75, 0.18);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
}

.dm-end-btn:hover {
  background: rgba(232, 165, 75, 0.32);
}

.dm-tile {
  --dm-w: calc(var(--dm-u, 36px) * 2);
  --dm-h: var(--dm-u, 36px);
  display: inline-flex;
  flex-direction: row;
  align-items: stretch;
  width: var(--dm-w);
  height: var(--dm-h);
  padding: 0;
  border: 1px solid var(--dm-edge, rgba(40, 30, 20, 0.35));
  border-radius: 5px;
  background: var(--dm-face, linear-gradient(165deg, #fbf6ec 0%, #ebe2d2 55%, #e2d8c6 100%));
  color: var(--dm-pip, #1a1a1a);
  box-shadow:
    inset 0 1px 0 var(--dm-shine, rgba(255, 255, 255, 0.55)),
    0 2px 0 var(--dm-shadow, rgba(0, 0, 0, 0.14)),
    0 5px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  font: inherit;
  cursor: default;
  position: relative;
  overflow: hidden;
}

/* Разделитель половин */
.dm-tile::after {
  content: '';
  position: absolute;
  z-index: 2;
  background: var(--dm-split, rgba(30, 24, 18, 0.35));
  pointer-events: none;
}

.dm-tile.is-h::after {
  left: 50%;
  top: 10%;
  bottom: 10%;
  width: 1.5px;
  transform: translateX(-50%);
}

/* Дубль — вертикально поперек линии хода */
.dm-tile.is-v {
  flex-direction: column;
  width: var(--dm-h);
  height: var(--dm-w);
}

.dm-tile.is-v::after {
  left: 10%;
  right: 10%;
  top: 50%;
  bottom: auto;
  width: auto;
  height: 1.5px;
  transform: translateY(-50%);
}

/* На столе кости стыкуются вплотную — цифра к цифре */
.dm-tile.on-table {
  border-radius: 4px;
}

.dm-chain-item + .dm-chain-item .dm-tile.on-table {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.dm-chain-item:not(:last-child) .dm-tile.on-table.is-h {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.dm-chain-item.is-double .dm-tile.on-table {
  border-radius: 4px;
  z-index: 1;
  box-shadow:
    inset 0 1px 0 var(--dm-shine, rgba(255, 255, 255, 0.55)),
    0 2px 0 rgba(0, 0, 0, 0.16),
    0 6px 14px rgba(0, 0, 0, 0.28);
}

.dm-tile.playable {
  cursor: pointer;
  outline: 2px solid rgba(232, 165, 75, 0.55);
  outline-offset: 2px;
}

.dm-tile.playable:hover {
  transform: translateY(-3px);
}

.dm-tile.selected {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  transform: translateY(-4px);
}

.dm-tile.dim {
  opacity: 0.45;
  filter: grayscale(0.15);
}

.dm-half {
  flex: 1 1 50%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;
  padding: 3px;
  min-width: 0;
  min-height: 0;
}

.dm-pip {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
}

.dm-pip.on {
  background: var(--dm-pip, #1a1510);
  box-shadow: 0 0.5px 0 var(--dm-shine, rgba(255, 255, 255, 0.25));
}

.dm-hand {
  --dm-u: 38px;
  align-items: flex-end;
  gap: 8px;
}

.dm-hand .dm-tile.is-v {
  /* дубли в руке тоже стоят вертикально */
  align-self: center;
}

.dm-opp-back {
  width: 18px !important;
  height: 28px !important;
  border-radius: 4px;
}

#dm-actions {
  justify-content: center;
}

@media (max-width: 720px) {
  #screen-domino .dm-table-area {
    flex-direction: column;
    min-height: 0;
    gap: 10px;
    padding: 10px;
  }

  .dm-chain {
    --dm-u: 30px;
  }

  .dm-chain-wrap {
    width: 100%;
    order: 1;
    padding: 14px 2px;
  }

  #dm-bazar {
    order: 0;
  }

  .dm-hand {
    --dm-u: 30px;
    gap: 6px;
  }

  .dm-pip {
    width: 4px;
    height: 4px;
  }
}

/* --- Шахматы / шашки / пять в ряд --- */
#screen-chess,
#screen-checkers,
#screen-nardi,
#screen-gomoku,
#screen-hangman {
  gap: 8px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  align-items: center;
}

#screen-nardi {
  max-width: min(720px, 100%);
  min-height: 0;
  flex: 1;
}

.table-top {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  flex-shrink: 0;
  overflow: visible;
  z-index: 20;
}

.table-top .chat-anchor {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
}

#screen-chess .opponents,
#screen-checkers .opponents,
#screen-nardi .opponents,
#screen-gomoku .opponents,
#screen-hangman .opponents {
  width: 100%;
  min-height: 0;
  margin: 0;
  gap: 6px;
}

#screen-chess .opponent,
#screen-checkers .opponent,
#screen-nardi .opponent,
#screen-gomoku .opponent,
#screen-hangman .opponent {
  min-width: 0;
  max-width: 168px;
  padding: 5px 8px;
  text-align: left;
  border-radius: 12px;
}

#screen-chess .opponent .name-row,
#screen-checkers .opponent .name-row,
#screen-nardi .opponent .name-row,
#screen-gomoku .opponent .name-row,
#screen-hangman .opponent .name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  justify-content: flex-start;
}

#screen-chess .opponent .avatar.sm,
#screen-checkers .opponent .avatar.sm,
#screen-nardi .opponent .avatar.sm,
#screen-gomoku .opponent .avatar.sm,
#screen-hangman .opponent .avatar.sm {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

#screen-chess .opponent .name,
#screen-checkers .opponent .name,
#screen-nardi .opponent .name,
#screen-gomoku .opponent .name,
#screen-hangman .opponent .name {
  margin: 0;
  font-size: 0.82rem;
}

#screen-chess .opponent .role,
#screen-checkers .opponent .role,
#screen-nardi .opponent .role,
#screen-gomoku .opponent .role,
#screen-hangman .opponent .role {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.2;
  opacity: 0.82;
}

#screen-chess .opponent .opp-count,
#screen-checkers .opponent .opp-count,
#screen-nardi .opponent .opp-count,
#screen-gomoku .opponent .opp-count {
  display: inline-flex;
  width: 14px;
  height: 14px;
  min-width: 14px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid rgba(244, 239, 228, 0.35);
  background: #1a1a1a;
  box-shadow: none;
}

#screen-chess .opponent .opp-count.is-w,
#screen-checkers .opponent .opp-count.is-w,
#screen-nardi .opponent .opp-count.is-w,
#screen-gomoku .opponent .opp-count.is-w {
  background: #f4efe4;
}

#screen-chess .opponent .opp-count.is-b,
#screen-checkers .opponent .opp-count.is-b,
#screen-nardi .opponent .opp-count.is-b,
#screen-gomoku .opponent .opp-count.is-b {
  background: #1c1814;
}

#screen-chess .status-line,
#screen-checkers .status-line,
#screen-nardi .status-line,
#screen-gomoku .status-line {
  width: 100%;
  text-align: center;
  margin: 0;
}

.ch-board-wrap {
  width: min(100%, 520px);
  aspect-ratio: 1;
  padding: 10px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at center, var(--ch-wrap-glow, rgba(31, 122, 88, 0.28)), transparent 70%),
    rgba(0, 0, 0, 0.22);
  border: 2px solid var(--ch-wrap-border, rgba(232, 165, 75, 0.18));
  box-sizing: border-box;
}

.ch-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ch-sq {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  aspect-ratio: 1;
}

.ch-sq.is-light {
  background: var(--ch-light, #e8d5b5);
}

.ch-sq.is-dark {
  background: var(--ch-dark, #3d6b52);
}

.ch-sq.is-selected {
  box-shadow: inset 0 0 0 3px var(--ch-select, rgba(232, 165, 75, 0.95));
}

.ch-sq.is-last {
  box-shadow: inset 0 0 0 2px var(--ch-last, rgba(232, 165, 75, 0.45));
}

.ch-sq.is-target::after {
  content: '';
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.28);
}

.ch-sq.is-capture::after {
  content: '';
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  border: 3px solid rgba(192, 57, 43, 0.55);
  background: transparent;
  width: auto;
  height: auto;
}

.ch-board.is-check .ch-sq.is-selected,
.ch-piece {
  line-height: 1;
}

.ch-piece {
  font-size: clamp(1.5rem, 7vw, 2.75rem);
  pointer-events: none;
  user-select: none;
  font-weight: 700;
  paint-order: stroke fill;
}

.ch-piece.is-w {
  color: var(--ch-white, #fffdf6);
  -webkit-text-stroke: 2.4px var(--ch-white-stroke, #1a120c);
  text-stroke: 2.4px var(--ch-white-stroke, #1a120c);
  text-shadow:
    0 0 1px var(--ch-white-stroke, #1a120c),
    0 2px 3px rgba(0, 0, 0, 0.45);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.ch-piece.is-b {
  color: var(--ch-black, #0e0c0a);
  -webkit-text-stroke: 2.2px var(--ch-black-stroke, #f5f2ea);
  text-stroke: 2.2px var(--ch-black-stroke, #f5f2ea);
  text-shadow:
    0 0 1px var(--ch-black-stroke, #f5f2ea),
    0 2px 3px rgba(0, 0, 0, 0.5);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

/* Скины шахмат */
[data-chess-skin='classic'] {
  --ch-light: #e8d5b5;
  --ch-dark: #3d6b52;
  --ch-wrap-glow: rgba(31, 122, 88, 0.28);
  --ch-wrap-border: rgba(232, 165, 75, 0.18);
  --ch-select: rgba(232, 165, 75, 0.95);
  --ch-last: rgba(232, 165, 75, 0.45);
  --ch-white: #fffdf6;
  --ch-white-stroke: #1a120c;
  --ch-black: #0e0c0a;
  --ch-black-stroke: #f5f2ea;
}

[data-chess-skin='walnut'] {
  --ch-light: #e6c9a0;
  --ch-dark: #7a4a28;
  --ch-wrap-glow: rgba(122, 74, 40, 0.35);
  --ch-wrap-border: rgba(214, 168, 110, 0.28);
  --ch-select: rgba(255, 210, 140, 0.9);
  --ch-last: rgba(255, 210, 140, 0.4);
  --ch-white: #fff8ea;
  --ch-white-stroke: #2a180e;
  --ch-black: #1a1008;
  --ch-black-stroke: #fff3dc;
}

[data-chess-skin='frost'] {
  --ch-light: #e8eef6;
  --ch-dark: #4a6d8c;
  --ch-wrap-glow: rgba(90, 140, 180, 0.3);
  --ch-wrap-border: rgba(170, 210, 240, 0.25);
  --ch-select: rgba(120, 200, 255, 0.9);
  --ch-last: rgba(120, 200, 255, 0.4);
  --ch-white: #f7fbff;
  --ch-white-stroke: #14202c;
  --ch-black: #101820;
  --ch-black-stroke: #eef6ff;
}

[data-chess-skin='ink'] {
  --ch-light: #d9dde3;
  --ch-dark: #2a3038;
  --ch-wrap-glow: rgba(80, 90, 110, 0.28);
  --ch-wrap-border: rgba(180, 190, 210, 0.22);
  --ch-select: rgba(240, 200, 100, 0.9);
  --ch-last: rgba(240, 200, 100, 0.4);
  --ch-white: #f4f6f8;
  --ch-white-stroke: #0b0d10;
  --ch-black: #08090b;
  --ch-black-stroke: #f2f4f7;
}

[data-chess-skin='amber'] {
  --ch-light: #f3e0b8;
  --ch-dark: #8a5a22;
  --ch-wrap-glow: rgba(232, 165, 75, 0.28);
  --ch-wrap-border: rgba(232, 165, 75, 0.35);
  --ch-select: rgba(255, 220, 120, 0.95);
  --ch-last: rgba(255, 220, 120, 0.4);
  --ch-white: #fff7e4;
  --ch-white-stroke: #1e1208;
  --ch-black: #140c06;
  --ch-black-stroke: #fff4d8;
}

/* Скины шашек */
[data-ck-skin='classic'] {
  --ck-light: #e8d5b5;
  --ck-dark: #3d6b52;
  --ck-wrap-glow: rgba(31, 122, 88, 0.28);
  --ck-wrap-border: rgba(232, 165, 75, 0.18);
  --ck-select: rgba(232, 165, 75, 0.95);
  --ck-last: rgba(232, 165, 75, 0.45);
  --ck-man-w: radial-gradient(circle at 35% 30%, #fffef8, #e8dcc4 55%, #cbb896);
  --ck-man-w-edge: #6b5738;
  --ck-man-b: radial-gradient(circle at 35% 30%, #5a4334, #241812 62%, #140e0a);
  --ck-man-b-edge: #f0e6d2;
  --ck-king-w: rgba(232, 165, 75, 0.55);
  --ck-king-b: rgba(232, 165, 75, 0.35);
  --ck-dot-w: #f4efe4;
  --ck-dot-b: #1c1814;
}

[data-ck-skin='ruby'] {
  --ck-light: #f0dcc4;
  --ck-dark: #6b2a2a;
  --ck-wrap-glow: rgba(140, 40, 40, 0.32);
  --ck-wrap-border: rgba(220, 110, 90, 0.3);
  --ck-select: rgba(255, 170, 140, 0.95);
  --ck-last: rgba(255, 170, 140, 0.4);
  --ck-man-w: radial-gradient(circle at 35% 30%, #fff, #f2ebe0 55%, #d8cfc0);
  --ck-man-w-edge: #6a5a48;
  --ck-man-b: radial-gradient(circle at 35% 30%, #e07060, #9a2828 58%, #4a1010);
  --ck-man-b-edge: #ffd8d0;
  --ck-king-w: rgba(200, 60, 50, 0.55);
  --ck-king-b: rgba(255, 210, 180, 0.45);
  --ck-dot-w: #f4efe4;
  --ck-dot-b: #9a2828;
}

[data-ck-skin='frost'] {
  --ck-light: #e8eef6;
  --ck-dark: #4a6d8c;
  --ck-wrap-glow: rgba(90, 140, 180, 0.3);
  --ck-wrap-border: rgba(170, 210, 240, 0.25);
  --ck-select: rgba(120, 200, 255, 0.9);
  --ck-last: rgba(120, 200, 255, 0.4);
  --ck-man-w: radial-gradient(circle at 35% 30%, #fff, #e8f0f8 55%, #c8d6e4);
  --ck-man-w-edge: #4a6580;
  --ck-man-b: radial-gradient(circle at 35% 30%, #3a5570, #152030 62%, #0a1018);
  --ck-man-b-edge: #d8e8f8;
  --ck-king-w: rgba(90, 160, 220, 0.55);
  --ck-king-b: rgba(180, 220, 255, 0.4);
  --ck-dot-w: #eef6ff;
  --ck-dot-b: #152030;
}

[data-ck-skin='ink'] {
  --ck-light: #d9dde3;
  --ck-dark: #2a3038;
  --ck-wrap-glow: rgba(80, 90, 110, 0.28);
  --ck-wrap-border: rgba(180, 190, 210, 0.22);
  --ck-select: rgba(240, 200, 100, 0.9);
  --ck-last: rgba(240, 200, 100, 0.4);
  --ck-man-w: radial-gradient(circle at 35% 30%, #f6f7f8, #d8dce2 55%, #b8bec6);
  --ck-man-w-edge: #3a4048;
  --ck-man-b: radial-gradient(circle at 35% 30%, #3a3e46, #121418 62%, #060708);
  --ck-man-b-edge: #e8eaee;
  --ck-king-w: rgba(240, 200, 100, 0.55);
  --ck-king-b: rgba(240, 200, 100, 0.35);
  --ck-dot-w: #f4f6f8;
  --ck-dot-b: #121418;
}

[data-ck-skin='gold'] {
  --ck-light: #f3e0b8;
  --ck-dark: #8a5a22;
  --ck-wrap-glow: rgba(232, 165, 75, 0.28);
  --ck-wrap-border: rgba(232, 165, 75, 0.35);
  --ck-select: rgba(255, 220, 120, 0.95);
  --ck-last: rgba(255, 220, 120, 0.4);
  --ck-man-w: radial-gradient(circle at 35% 30%, #fff8e4, #f0dca8 55%, #d4b46a);
  --ck-man-w-edge: #6a4a18;
  --ck-man-b: radial-gradient(circle at 35% 30%, #5a3a18, #241408 62%, #100804);
  --ck-man-b-edge: #ffe8b8;
  --ck-king-w: rgba(232, 165, 75, 0.7);
  --ck-king-b: rgba(255, 220, 140, 0.4);
  --ck-dot-w: #fff7e4;
  --ck-dot-b: #241408;
}

/* Скины костей домино */
[data-dm-skin='classic'] {
  --dm-face: linear-gradient(165deg, #fbf6ec 0%, #ebe2d2 55%, #e2d8c6 100%);
  --dm-edge: rgba(40, 30, 20, 0.35);
  --dm-split: rgba(30, 24, 18, 0.35);
  --dm-pip: #1a1510;
  --dm-shine: rgba(255, 255, 255, 0.55);
  --dm-shadow: rgba(0, 0, 0, 0.14);
}

[data-dm-skin='noir'] {
  --dm-face: linear-gradient(165deg, #3a3a44 0%, #1c1c24 55%, #121218 100%);
  --dm-edge: rgba(212, 175, 95, 0.45);
  --dm-split: rgba(244, 239, 228, 0.35);
  --dm-pip: #f4efe4;
  --dm-shine: rgba(255, 255, 255, 0.12);
  --dm-shadow: rgba(0, 0, 0, 0.4);
}

[data-dm-skin='jade'] {
  --dm-face: linear-gradient(165deg, #eef8f0 0%, #d4ead8 55%, #c2dcc8 100%);
  --dm-edge: rgba(30, 70, 45, 0.35);
  --dm-split: rgba(20, 60, 38, 0.38);
  --dm-pip: #1a3a28;
  --dm-shine: rgba(255, 255, 255, 0.55);
  --dm-shadow: rgba(20, 50, 30, 0.18);
}

[data-dm-skin='ember'] {
  --dm-face: linear-gradient(165deg, #f8ead8 0%, #e8c8a0 55%, #d4a878 100%);
  --dm-edge: rgba(80, 40, 16, 0.4);
  --dm-split: rgba(70, 32, 12, 0.4);
  --dm-pip: #3a1808;
  --dm-shine: rgba(255, 236, 210, 0.5);
  --dm-shadow: rgba(80, 30, 8, 0.2);
}

[data-dm-skin='azure'] {
  --dm-face: linear-gradient(165deg, #f4f8fc 0%, #d8e6f4 55%, #c4d6ec 100%);
  --dm-edge: rgba(30, 50, 80, 0.32);
  --dm-split: rgba(24, 48, 80, 0.38);
  --dm-pip: #152038;
  --dm-shine: rgba(255, 255, 255, 0.65);
  --dm-shadow: rgba(20, 40, 70, 0.16);
}

.ch-promo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  padding: 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(232, 165, 75, 0.35);
}

.ch-promo-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-dim);
}

.ch-promo-btn {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(244, 239, 228, 0.2);
  background: rgba(244, 239, 228, 0.12);
  color: var(--ink);
  font-size: 1.6rem;
  cursor: pointer;
}

.ch-promo-btn:hover {
  border-color: rgba(232, 165, 75, 0.55);
  background: rgba(232, 165, 75, 0.18);
}

#ch-actions,
#ck-actions,
#gm-actions {
  justify-content: center;
  width: 100%;
}

#screen-checkers .ch-board-wrap {
  background:
    radial-gradient(ellipse at center, var(--ck-wrap-glow, rgba(31, 122, 88, 0.28)), transparent 70%),
    rgba(0, 0, 0, 0.22);
  border-color: var(--ck-wrap-border, rgba(232, 165, 75, 0.18));
}

#screen-checkers .ch-sq.is-light {
  background: var(--ck-light, #e8d5b5);
}

#screen-checkers .ch-sq.is-dark {
  background: var(--ck-dark, #3d6b52);
}

#screen-checkers .ch-sq.is-selected {
  box-shadow: inset 0 0 0 3px var(--ck-select, rgba(232, 165, 75, 0.95));
}

#screen-checkers .ch-sq.is-last {
  box-shadow: inset 0 0 0 2px var(--ck-last, rgba(232, 165, 75, 0.45));
}

#screen-checkers .opponent .opp-count.is-w {
  background: var(--ck-dot-w, #f4efe4);
}

#screen-checkers .opponent .opp-count.is-b {
  background: var(--ck-dot-b, #1c1814);
}

.ck-man {
  width: 68%;
  height: 68%;
  border-radius: 50%;
  pointer-events: none;
  box-sizing: border-box;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.28),
    0 2px 4px rgba(0, 0, 0, 0.35);
}

.ck-man.is-w {
  background: var(--ck-man-w);
  border: 2px solid var(--ck-man-w-edge);
}

.ck-man.is-b {
  background: var(--ck-man-b);
  border: 2px solid var(--ck-man-b-edge);
}

.ck-man.is-king::after {
  content: '';
  display: block;
  width: 42%;
  height: 42%;
  margin: 29% auto 0;
  border-radius: 50%;
  box-sizing: border-box;
}

.ck-man.is-w.is-king::after {
  border: 2px solid var(--ck-man-w-edge);
  background: var(--ck-king-w);
}

.ck-man.is-b.is-king::after {
  border: 2px solid var(--ck-man-b-edge);
  background: var(--ck-king-b);
}

.gm-board-wrap {
  width: min(100%, 540px);
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at center, rgba(232, 165, 75, 0.16), transparent 70%),
    #c49a5a;
  border: 2px solid rgba(232, 165, 75, 0.22);
  box-sizing: border-box;
}

.gm-board {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: #d2ae72;
  box-shadow: inset 0 0 0 1px rgba(70, 42, 18, 0.35);
}

.gm-sq {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: inset 0 0 0 0.5px rgba(70, 42, 18, 0.38);
  cursor: pointer;
}

.gm-sq:disabled {
  cursor: default;
}

.gm-sq:not(:disabled):hover {
  background: rgba(232, 165, 75, 0.22);
}

.gm-sq.is-last {
  background: rgba(232, 165, 75, 0.28);
}

.gm-sq.is-win {
  background: rgba(46, 160, 90, 0.38);
}

.gm-stone {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  pointer-events: none;
  box-sizing: border-box;
}

.gm-stone.is-b {
  background: radial-gradient(circle at 32% 28%, #5a5a5a, #111 58%, #000);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.gm-stone.is-w {
  background: radial-gradient(circle at 32% 28%, #fff, #e8e0d2 60%, #c9c0b0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(80, 60, 40, 0.25);
}

/* --- Нарды --- */
.nd-board-wrap {
  width: 100%;
  max-width: 640px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: stretch;
  min-height: 0;
}

.nd-off {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  padding: 8px 2px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(232, 165, 75, 0.18);
  min-height: 120px;
}

.nd-off.is-you {
  flex-direction: column;
}

.nd-off .nd-man {
  margin: 0;
}

.nd-off-count {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--amber);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.nd-board {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 1.38;
  border-radius: 14px;
  overflow: hidden;
  background: #1a3a2c;
  border: 2px solid rgba(232, 165, 75, 0.28);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
}

.nd-row {
  display: flex;
  flex: 1;
  min-height: 0;
}

.nd-quad {
  display: flex;
  flex: 1;
  min-width: 0;
}

.nd-bar {
  width: 11%;
  min-width: 28px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 2px;
  background: linear-gradient(180deg, #5c2a1a, #3a1810);
  border-left: 1px solid rgba(0, 0, 0, 0.35);
  border-right: 1px solid rgba(0, 0, 0, 0.35);
}

.nd-bar-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 42%;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.nd-bar-stack.is-top {
  flex-direction: column;
  justify-content: flex-start;
}

.nd-bar-stack.is-bot {
  flex-direction: column-reverse;
  justify-content: flex-start;
}

.nd-pt {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: default;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.nd-pt.is-click {
  cursor: pointer;
}

.nd-pt.is-source::before {
  box-shadow: inset 0 0 0 2px rgba(240, 200, 120, 0.85);
}

.nd-pt.is-source .nd-man {
  animation: nd-source-pulse 1.4s ease-in-out infinite;
}

@keyframes nd-source-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.nd-bar-stack.is-click,
.nd-bar-stack.is-selected,
.nd-bar-stack.is-source {
  cursor: pointer;
  outline: 2px solid #f0c878;
}

.nd-pt::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.nd-row.is-top .nd-pt::before {
  clip-path: polygon(50% 100%, 4% 0, 96% 0);
}

.nd-row.is-bot .nd-pt::before {
  clip-path: polygon(50% 0, 4% 100%, 96% 100%);
}

.nd-pt.is-a::before {
  background: #c47d22;
}

.nd-pt.is-b::before {
  background: #0d2a20;
}

.nd-pt.is-selected::before {
  filter: brightness(1.25);
  box-shadow: inset 0 0 0 2px #f0c878;
}

.nd-pt.is-target::before {
  background: #2f8f62;
}

.nd-pt.is-capture::before {
  background: #b44a32;
}

.nd-pt.is-last::after {
  content: '';
  position: absolute;
  inset: 18% 28%;
  border: 2px solid rgba(240, 200, 120, 0.7);
  border-radius: 50%;
  pointer-events: none;
}

.nd-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 4px 0;
  width: 100%;
  pointer-events: none;
}

.nd-row.is-top .nd-stack {
  justify-content: flex-start;
}

.nd-row.is-bot .nd-stack {
  flex-direction: column-reverse;
  justify-content: flex-start;
}

.nd-man {
  width: clamp(15px, 4.6vw, 22px);
  height: clamp(15px, 4.6vw, 22px);
  border-radius: 50%;
  flex-shrink: 0;
  margin: -2px 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.nd-man.is-w {
  background: radial-gradient(circle at 32% 28%, #fff8ea, #e8d7b8 58%, #c9b48a);
  border: 1px solid rgba(80, 50, 20, 0.35);
}

.nd-man.is-b {
  background: radial-gradient(circle at 32% 28%, #5a4336, #1c1410 60%, #0a0706);
  border: 1px solid rgba(0, 0, 0, 0.45);
}

.nd-more {
  position: relative;
  z-index: 2;
  font-size: 0.62rem;
  font-weight: 800;
  color: #f4efe4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.nd-hint {
  width: 100%;
  margin: 0;
  padding: 0 4px;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
  color: var(--ink-dim);
}

.nd-tray {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
}

.nd-dice {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.nd-die-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.nd-die-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  text-transform: lowercase;
}

.nd-die {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f4efe4;
  color: #1c1510;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.nd-die.is-used {
  opacity: 0.35;
}

.nd-die.is-left {
  outline: 2px solid #e8a54b;
}

.nd-off.is-target {
  box-shadow: 0 0 0 2px #2f8f62;
  cursor: pointer;
}

@media (max-width: 480px) {
  #screen-chess.screen,
  #screen-checkers.screen,
  #screen-nardi.screen,
  #screen-gomoku.screen,
  #screen-hangman.screen {
    padding: 6px 8px 8px;
    gap: 4px;
  }

  .table-top {
    min-height: 38px;
  }

  #screen-chess .opponents,
  #screen-checkers .opponents,
  #screen-nardi .opponents,
  #screen-gomoku .opponents,
  #screen-hangman .opponents {
    margin: 0;
  }

  #screen-chess .opponent,
  #screen-checkers .opponent,
  #screen-nardi .opponent,
  #screen-gomoku .opponent,
  #screen-hangman .opponent {
    max-width: 132px;
    padding: 4px 6px;
  }

  #screen-chess .opponent .name,
  #screen-checkers .opponent .name,
  #screen-nardi .opponent .name,
  #screen-gomoku .opponent .name,
  #screen-hangman .opponent .name {
    font-size: 0.62rem;
  }

  #screen-chess .opponent .role,
  #screen-checkers .opponent .role,
  #screen-nardi .opponent .role,
  #screen-gomoku .opponent .role,
  #screen-hangman .opponent .role {
    font-size: 0.58rem;
  }

  .nd-board-wrap {
    width: 100%;
    max-width: 100%;
  }

  .nd-man {
    width: clamp(14px, 5.2vw, 18px);
    height: clamp(14px, 5.2vw, 18px);
  }

  .ch-board-wrap,
  .gm-board-wrap {
    padding: 6px;
    border-radius: 14px;
    width: 100%;
  }

  .ch-piece {
    font-size: clamp(1.35rem, 9.5vw, 2.2rem);
  }
}

/* —— Room chat —— */
.chat-anchor {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 20;
  pointer-events: none;
  width: 44px;
  height: 44px;
}

.chat-anchor > * {
  pointer-events: auto;
}

.room-chat {
  position: fixed;
  left: calc(14px + env(safe-area-inset-left, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  right: auto;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 44px;
  max-width: 44px;
  pointer-events: none;
}

.room-chat > * {
  pointer-events: auto;
}

.chat-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(232, 165, 75, 0.45);
  background: rgba(18, 22, 28, 0.92);
  color: var(--ink, #f2efe8);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex-shrink: 0;
}

.chat-toggle:hover {
  border-color: rgba(232, 165, 75, 0.75);
}

.chat-toggle-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.chat-badge {
  display: none;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--amber, #e8a54b);
  color: #1a140c;
  font-size: 0.68rem;
  font-weight: 800;
  place-items: center;
  line-height: 1;
  position: absolute;
  top: -4px;
  right: -4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.chat-badge.is-on {
  display: inline-grid;
}

.chat-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  top: auto;
  width: 280px;
  max-width: calc(100dvw - 28px);
  height: min(320px, 42dvh);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(14, 17, 22, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  z-index: 90;
}

.chat-panel[hidden],
.room-chat[hidden] {
  display: none !important;
}

/* Стол сверху: иконка у соперника, панель поверх доски, без сдвига верстки */
.room-chat[data-place="game"],
.room-chat[data-place="domino"],
.room-chat[data-place="loto"],
.room-chat[data-place="chess"],
.room-chat[data-place="checkers"],
.room-chat[data-place="nardi"],
.room-chat[data-place="gomoku"],
.room-chat[data-place="hangman"] {
  position: relative;
  left: auto;
  bottom: auto;
  top: auto;
  z-index: 20;
}

.room-chat[data-place="game"] .chat-panel,
.room-chat[data-place="domino"] .chat-panel,
.room-chat[data-place="loto"] .chat-panel,
.room-chat[data-place="chess"] .chat-panel,
.room-chat[data-place="checkers"] .chat-panel,
.room-chat[data-place="nardi"] .chat-panel,
.room-chat[data-place="gomoku"] .chat-panel,
.room-chat[data-place="hangman"] .chat-panel {
  top: calc(100% + 6px);
  bottom: auto;
  height: min(240px, 36dvh);
}

.room-chat[data-place="seabattle"] {
  left: calc(12px + env(safe-area-inset-left, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.room-chat[data-place="wordguess"] {
  left: calc(10px + env(safe-area-inset-left, 0px));
  top: calc(10px + env(safe-area-inset-top, 0px));
  bottom: auto;
  right: auto;
}

.room-chat[data-place="wordguess"] .chat-panel {
  top: calc(100% + 6px);
  bottom: auto;
  height: min(200px, 30dvh);
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--ink-dim, #c9c3b8);
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg {
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--ink, #f2efe8);
}

.chat-msg .chat-name {
  font-weight: 700;
  color: var(--amber, #e8a54b);
  margin-right: 6px;
}

.chat-msg.is-me .chat-name {
  color: #8fd0ff;
}

.chat-msg .chat-text {
  word-break: break-word;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-form input {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
  padding: 8px 10px;
  font: inherit;
}

.chat-form input:focus {
  outline: none;
  border-color: rgba(232, 165, 75, 0.55);
}

@media (max-width: 480px) {
  .chat-anchor {
    top: 6px;
    left: 6px;
  }

  .room-chat {
    left: calc(8px + env(safe-area-inset-left, 0px));
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .chat-panel {
    width: 240px;
    height: min(260px, 38dvh);
  }

  .room-chat[data-place="wordguess"] {
    left: calc(8px + env(safe-area-inset-left, 0px));
    top: calc(8px + env(safe-area-inset-top, 0px));
    bottom: auto;
  }
}

/* —— Оформление в профиле: вкладки —— */
.skin-studio {
  margin: 4px 0 18px;
}

.skin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin: 0 0 12px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(244, 239, 228, 0.1);
}

.skin-tab {
  flex: 1 1 calc(20% - 6px);
  min-width: 0;
  padding: 9px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.skin-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.skin-tab.is-active {
  color: var(--ink);
  background: rgba(232, 165, 75, 0.16);
  box-shadow: inset 0 0 0 1px rgba(232, 165, 75, 0.35);
}

.skin-panel[hidden] {
  display: none !important;
}

.skin-panel .theme-picker,
.skin-panel .table-picker {
  margin: 0;
}

.skin-panel .theme-picker-label,
.skin-panel .table-picker-label {
  display: none;
}

/* —— Выбор темы карт (профиль) —— */
.theme-picker {
  margin: 4px 0 18px;
}

.theme-picker-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--ink-dim);
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.theme-option {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 14px;
  padding: 10px 8px 12px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.theme-option:hover {
  border-color: rgba(232, 165, 75, 0.45);
}

.theme-option.is-active {
  border-color: rgba(232, 165, 75, 0.85);
  background: rgba(232, 165, 75, 0.12);
}

.theme-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  margin-bottom: 8px;
  pointer-events: none;
}

.theme-preview .card.mini {
  width: 36px;
  height: 52px;
  padding: 3px 4px;
  border-radius: 5px;
  font-size: 0.65rem;
}

.theme-preview .card.mini .rank {
  font-size: 0.7rem;
}

.theme-preview .card.mini .suit {
  font-size: 0.85rem;
}

.theme-preview .card-back.mini-back {
  width: 36px;
  height: 52px;
  border-radius: 5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.theme-option-name {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
}

.theme-picker-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
}

@media (max-width: 420px) {
  .theme-picker-grid {
    grid-template-columns: 1fr;
  }
}

/* —— Выбор сукна стола (профиль) —— */
.table-picker {
  margin: 4px 0 18px;
}

.table-picker-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--ink-dim);
}

.table-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.table-option {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 14px;
  padding: 10px 8px 12px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.table-option:hover {
  border-color: rgba(232, 165, 75, 0.45);
}

.table-option.is-active {
  border-color: rgba(232, 165, 75, 0.85);
  background: rgba(232, 165, 75, 0.12);
}

.table-preview {
  height: 56px;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1.5px solid var(--table-rim);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.28);
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, var(--table-glow), transparent 70%),
    linear-gradient(160deg, var(--felt-mid), var(--felt-deep));
  pointer-events: none;
}

.table-option-name {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
}

.table-picker-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
}

@media (max-width: 420px) {
  .table-picker-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* —— Выбор скина шахмат (профиль) —— */
.chess-picker {
  margin: 0;
}

.chess-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.chess-option {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  border-radius: 14px;
  padding: 10px 8px 12px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.chess-option:hover {
  border-color: rgba(232, 165, 75, 0.45);
}

.chess-option.is-active {
  border-color: rgba(232, 165, 75, 0.85);
  background: rgba(232, 165, 75, 0.12);
}

.chess-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.chess-preview-sq {
  display: grid;
  place-items: center;
}

.chess-preview-sq.light {
  background: var(--ch-light, #e8d5b5);
}

.chess-preview-sq.dark {
  background: var(--ch-dark, #3d6b52);
}

.chess-preview-sq i {
  font-style: normal;
  font-size: 1.15rem;
  line-height: 1;
}

.chess-preview-sq i.is-w {
  color: var(--ch-white, #fffdf6);
  -webkit-text-stroke: 1.4px var(--ch-white-stroke, #1a120c);
  paint-order: stroke fill;
}

.chess-preview-sq i.is-b {
  color: var(--ch-black, #0e0c0a);
  -webkit-text-stroke: 1.4px var(--ch-black-stroke, #f5f2ea);
  paint-order: stroke fill;
}

.chess-option-name {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
}

.ck-preview,
.dm-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.ck-preview-sq {
  display: grid;
  place-items: center;
}

.ck-preview-sq.light {
  background: var(--ck-light, #e8d5b5);
}

.ck-preview-sq.dark {
  background: var(--ck-dark, #3d6b52);
}

.ck-preview .ck-man {
  width: 72%;
  height: 72%;
}

.dm-preview {
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.18);
}

.dm-preview-tile {
  width: 56px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--dm-edge);
  background: var(--dm-face);
  box-shadow:
    inset 0 1px 0 var(--dm-shine),
    0 2px 6px rgba(0, 0, 0, 0.28);
  position: relative;
}

.dm-preview-tile::before,
.dm-preview-tile::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dm-pip);
  box-shadow:
    0 -8px 0 var(--dm-pip),
    0 8px 0 var(--dm-pip);
  transform: translate(-50%, -50%);
}

.dm-preview-tile::before {
  left: 25%;
}

.dm-preview-tile::after {
  left: 75%;
  box-shadow: none;
}

@media (max-width: 420px) {
  .chess-picker-grid {
    grid-template-columns: 1fr 1fr;
  }
  .skin-tab {
    flex: 1 1 calc(33.33% - 6px);
    font-size: 0.78rem;
    padding: 8px 4px;
  }
}

/* —— Угадай слово —— */
#screen-wordguess {
  gap: 8px;
  padding-bottom: 12px;
  min-height: 0;
}

#screen-wordguess .wg-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.wg-len-block {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.wg-len-diff {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wg-duel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: min(100%, 360px);
  margin: 0 auto;
  flex: 0 0 auto;
}

.wg-duel.is-solo {
  grid-template-columns: 1fr;
  width: min(100%, 360px);
}

.wg-foe-dock {
  flex: 0 0 auto;
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding-top: 4px;
}

.wg-foe-dock[hidden] {
  display: none !important;
  min-height: 0;
  padding: 0;
}

.wg-home-dock {
  flex: 0 0 auto;
  width: 100%;
  margin-top: auto;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom, 0));
  display: flex;
  justify-content: center;
}

.wg-home-dock[hidden] {
  display: none !important;
  padding: 0;
}

.wg-home-btn {
  width: min(100%, 280px);
  border: 1px solid rgba(232, 165, 75, 0.85);
  background: var(--amber, #e8a54b);
  color: #1c1408;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.wg-foe-stat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.82rem;
  color: var(--ink-dim);
}

.wg-foe-stat-name {
  font-weight: 750;
  color: var(--ink);
}

.wg-foe-stat-item b {
  color: var(--ink);
  font-weight: 800;
}

.wg-board-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wg-board-title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-dim);
  text-align: center;
  flex: 0 0 auto;
}

.wg-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
}

.wg-row {
  display: grid;
  grid-template-columns: repeat(var(--wg-cols, 5), minmax(0, 1fr));
  gap: 5px;
}

.wg-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 2px solid rgba(244, 239, 228, 0.16);
  background: rgba(0, 0, 0, 0.28);
  font-weight: 800;
  font-size: clamp(0.85rem, 3.2vw, 1.15rem);
  text-transform: uppercase;
}

.wg-cell.is-filled {
  border-color: rgba(244, 239, 228, 0.35);
}

.wg-cell.is-green {
  background: #2f9e5b;
  border-color: #3ecf7a;
  color: #fff;
}

.wg-cell.is-yellow {
  background: #c4922a;
  border-color: #e8a54b;
  color: #1c1408;
}

.wg-cell.is-gray {
  background: #3a3f3c;
  border-color: #555;
  color: rgba(244, 239, 228, 0.75);
}

.wg-draft {
  min-height: 1.2em;
  text-align: center;
  color: var(--ink-dim);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.wg-keyboard {
  width: min(100%, 560px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}

.wg-key-row {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.wg-key {
  appearance: none;
  border: 1px solid rgba(244, 239, 228, 0.14);
  background: rgba(244, 239, 228, 0.1);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  font-size: 0.82rem;
  min-width: 28px;
  height: 42px;
  padding: 0 6px;
  border-radius: 8px;
  cursor: pointer;
}

.wg-key.is-wide {
  min-width: 52px;
  font-size: 0.72rem;
}

.wg-key.is-green {
  background: #2f9e5b;
  border-color: #3ecf7a;
  color: #fff;
}

.wg-key.is-yellow {
  background: #c4922a;
  border-color: #e8a54b;
  color: #1c1408;
}

.wg-key.is-gray {
  background: #2a2e2c;
  border-color: #444;
  color: rgba(244, 239, 228, 0.35);
}

.wg-key:disabled {
  opacity: 0.55;
  cursor: default;
}

#wg-actions {
  justify-content: center;
  flex: 0 0 auto;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 44px;
}

#wg-actions .btn {
  min-width: 120px;
}

@media (max-width: 520px) {
  #screen-wordguess.screen.active {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding: 4px 8px calc(6px + env(safe-area-inset-bottom, 0));
    gap: 4px;
    box-sizing: border-box;
  }

  #screen-wordguess #wg-status {
    font-size: 0.74rem;
    line-height: 1.25;
    padding: 4px 8px;
    margin: 0;
    min-height: 0;
    flex: 0 0 auto;
  }

  #screen-wordguess .wg-main {
    flex: 1 1 auto;
    min-height: 0;
    gap: 4px;
    justify-content: flex-start;
  }

  .wg-duel {
    flex: 0 0 auto;
    min-height: 0;
    width: 100%;
    gap: 6px;
    display: flex;
    max-width: none;
    justify-content: center;
    align-items: flex-start;
  }

  .wg-duel.is-solo {
    display: flex;
    width: 100%;
    max-width: none;
    justify-content: center;
    align-items: flex-start;
  }

  .wg-foe-dock {
    min-height: 48px;
    margin-top: 0;
    padding-top: 2px;
    padding-bottom: 0;
  }

  .wg-home-dock {
    margin-top: 4px;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0));
  }

  .wg-home-btn {
    width: min(100%, 100%);
    min-height: 44px;
  }

  .wg-foe-stat {
    width: 100%;
    max-width: 420px;
    padding: 6px 10px;
    font-size: 0.74rem;
    gap: 6px 10px;
  }

  .wg-board-wrap {
    width: auto;
    max-width: 100%;
  }

  .wg-board-title {
    margin: 0 0 6px;
    font-size: 0.72rem;
  }

  /* Квадратные клетки: размер от ширины и доступной высоты, не схлопываются в полоски */
  .wg-grid {
    --wg-gap: 5px;
    --cell: min(
      54px,
      calc((100vw - 40px - (var(--wg-cols) - 1) * var(--wg-gap)) / var(--wg-cols)),
      calc((100dvh - 230px - 5 * var(--wg-gap)) / 6)
    );
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: var(--wg-gap);
    width: calc(var(--wg-cols) * var(--cell) + (var(--wg-cols) - 1) * var(--wg-gap));
    margin: 0 auto;
  }

  .wg-row {
    gap: var(--wg-gap);
    height: var(--cell);
    grid-template-columns: repeat(var(--wg-cols), var(--cell));
  }

  .wg-cell {
    width: var(--cell);
    height: var(--cell);
    aspect-ratio: auto;
    border-width: 1.5px;
    border-radius: 6px;
    font-size: clamp(0.75rem, calc(var(--cell) * 0.45), 1.15rem);
  }

  .wg-draft {
    display: none;
  }

  .wg-keyboard {
    width: 100%;
    gap: 4px;
    flex: 0 0 auto;
  }

  .wg-key-row {
    gap: 4px;
  }

  .wg-key {
    min-width: 0;
    flex: 1 1 0;
    height: clamp(34px, 5.8dvh, 42px);
    padding: 0 2px;
    font-size: clamp(0.68rem, 2.9vw, 0.82rem);
    border-radius: 6px;
  }

  .wg-key.is-wide {
    flex: 1.35 1 0;
    min-width: 0;
    font-size: clamp(0.6rem, 2.5vw, 0.72rem);
  }

  #wg-actions {
    min-height: 0;
    padding: 0;
    gap: 4px;
  }

  #wg-actions .btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
}

/* —— Stolok Plus —— */
.plus-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 2px 0 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(232, 165, 75, 0.35);
  background:
    linear-gradient(135deg, rgba(232, 165, 75, 0.16), rgba(0, 0, 0, 0.18));
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.plus-entry:hover {
  border-color: rgba(232, 165, 75, 0.55);
}

.plus-entry-badge {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #2a1608;
  background: linear-gradient(180deg, #f0d090, #d4a04a);
}

.plus-entry-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plus-entry-text strong {
  font-size: 0.95rem;
}

.plus-entry-text span {
  font-size: 0.74rem;
  color: var(--ink-dim);
}

.plus-entry-arrow {
  font-size: 1.35rem;
  color: var(--ink-dim);
  line-height: 1;
}

.plus-mini {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  font-style: normal;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #2a1608;
  background: linear-gradient(180deg, #f0d090, #d4a04a);
  vertical-align: middle;
}

.plus-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #2a1608;
  background: linear-gradient(180deg, #f0d090, #d4a04a);
  vertical-align: middle;
}

[data-plus="1"].is-plus-locked {
  opacity: 0.55;
  position: relative;
}

.subscribe-panel {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  height: auto;
  flex: 0 0 auto;
  gap: 12px;
  padding: 12px 14px 16px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 48%),
    rgba(8, 22, 16, 0.72);
  border: 1px solid rgba(244, 239, 228, 0.1);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.brand-mark-subscribe {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.06em;
}

.brand-mark-subscribe .brand-ok {
  font-size: 1em;
}

.brand-mark-subscribe .brand-plus {
  margin-left: 0.02em;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 1.2em;
  line-height: 1;
  color: var(--amber);
  transform: translateY(-0.02em);
}

.subscribe-status {
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ink-dim);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(244, 239, 228, 0.08);
}

.subscribe-status.is-plus {
  color: var(--amber);
  border-color: rgba(232, 165, 75, 0.35);
  background: rgba(232, 165, 75, 0.12);
}

.subscribe-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.subscribe-plan {
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(244, 239, 228, 0.1);
}

.subscribe-plan.is-plus {
  border-color: rgba(232, 165, 75, 0.4);
  background:
    linear-gradient(180deg, rgba(232, 165, 75, 0.14), rgba(0, 0, 0, 0.2));
}

.subscribe-plan h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.subscribe-price {
  margin: 0 0 10px;
  font-family: 'Spectral', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

.subscribe-price span {
  margin-left: 2px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink-dim);
}

.subscribe-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subscribe-list li {
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--ink);
  padding-left: 14px;
  position: relative;
}

.subscribe-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(232, 165, 75, 0.75);
}

.subscribe-list li.is-muted {
  color: var(--ink-dim);
}

.subscribe-note {
  color: var(--ink-dim);
  font-size: 0.72rem;
}

#btn-subscribe-buy {
  width: 100%;
}

#btn-subscribe-buy:disabled {
  opacity: 0.72;
  cursor: default;
}

.subscribe-footnote {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--ink-dim);
}

@media (max-width: 520px) {
  .subscribe-plans {
    grid-template-columns: 1fr;
  }
}

/* —— Русское лото —— */
#screen-loto {
  gap: 10px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.loto-opponents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.loto-opponents .opponent.is-winner {
  border-color: rgba(232, 165, 75, 0.55);
  box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.2);
}

.loto-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 12px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232, 165, 75, 0.12), transparent 55%),
    rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(244, 239, 228, 0.1);
}

.loto-stage .chat-anchor {
  position: absolute;
  left: 10px;
  top: 10px;
}

.loto-barrel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.loto-barrel {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, #fff6e8, #f0c878 42%, #c8882a 78%, #8a5a18);
  border: 3px solid rgba(255, 236, 190, 0.85);
  box-shadow:
    inset 0 -8px 16px rgba(80, 40, 0, 0.28),
    0 10px 24px rgba(0, 0, 0, 0.28);
  color: #2a1608;
  font-family: 'Spectral', serif;
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.loto-barrel.is-empty {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(244, 239, 228, 0.14);
  box-shadow: none;
  color: var(--ink-dim);
  font-size: 1.6rem;
}

.loto-barrel.is-fresh {
  animation: loto-pop 0.35s ease;
}

@keyframes loto-pop {
  0% { transform: scale(0.82); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.loto-barrel-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.loto-meta-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-dim);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(244, 239, 228, 0.1);
}

.loto-history {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  max-width: 100%;
  min-height: 28px;
}

.loto-hist-chip {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(244, 239, 228, 0.12);
  color: var(--ink-dim);
}

.loto-hist-chip.is-last {
  color: #2a1608;
  background: linear-gradient(180deg, #f0d090, #d4a04a);
  border-color: transparent;
}

#loto-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

#loto-draw {
  min-width: 180px;
}

.loto-card-wrap {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.loto-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loto-ticket-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-dim);
  padding: 0 4px 2px;
}

.loto-ticket.is-complete .loto-ticket-label {
  color: var(--amber);
}

.loto-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: max(100%, 320px);
  margin: 0 auto;
  padding: 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(244, 239, 228, 0.96), rgba(228, 220, 200, 0.92));
  border: 1px solid rgba(120, 90, 40, 0.22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  color: #1c1812;
}

.loto-ticket.is-complete .loto-card {
  border-color: rgba(232, 165, 75, 0.7);
  box-shadow: 0 0 0 2px rgba(232, 165, 75, 0.28), 0 10px 28px rgba(0, 0, 0, 0.22);
}

.loto-row {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 3px;
}

.loto-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(60, 40, 10, 0.12);
  font-family: 'Spectral', serif;
  font-weight: 700;
  font-size: clamp(0.78rem, 2.8vw, 1rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.loto-cell.is-blank {
  background: rgba(40, 70, 50, 0.14);
  border-color: transparent;
}

.loto-cell.is-marked {
  background: linear-gradient(180deg, #6ecf8e, #2f9e5b);
  color: #0f1f14;
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

@media (max-width: 480px) {
  .loto-barrel {
    width: 78px;
    height: 78px;
    font-size: 1.75rem;
  }

  .loto-card {
    padding: 6px;
    gap: 3px;
  }

  .loto-row {
    gap: 2px;
  }

  .loto-cell {
    border-radius: 5px;
  }

  #loto-draw {
    min-width: 0;
    flex: 1;
  }
}

/* Виселица */
#screen-hangman {
  max-width: 640px;
}

#screen-hangman .opponent.is-winner {
  border-color: rgba(232, 165, 75, 0.55);
  box-shadow: 0 0 0 1px rgba(232, 165, 75, 0.2);
}

.hm-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(244, 239, 228, 0.1);
}

.hm-gallows-wrap {
  width: min(100%, 280px);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(ellipse at 50% 12%, rgba(240, 217, 164, 0.12), transparent 62%);
}

.hm-svg {
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

.hm-wood {
  stroke: #c4924a;
  stroke-width: 8;
}

.hm-noose {
  stroke-width: 5;
}

.hm-figure {
  stroke: #f4e4c1;
  stroke-width: 7;
}

.hm-head {
  fill: none;
}

.hm-static {
  opacity: 1;
}

.hm-part {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}

.hm-part.is-on {
  opacity: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.7s ease, opacity 0.15s ease;
}

.hm-face {
  stroke: #f4e4c1;
  stroke-width: 3;
  opacity: 0;
  transition: opacity 0.35s ease 0.45s;
}

.hm-svg.is-hanged .hm-figure {
  transform-origin: 164px 26px;
  animation: hm-swing 2.6s ease-in-out infinite;
}

.hm-svg.is-hanged .hm-face {
  opacity: 1;
}

.hm-svg.is-saved .hm-figure {
  animation: none;
  stroke: #9fe7b8;
}

.hm-svg.is-danger {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 14px rgba(216, 90, 74, 0.35));
}

.hm-guess-row[hidden] {
  display: none !important;
}

@keyframes hm-swing {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(6deg); }
}

.hm-think[hidden],
.hm-wait[hidden],
.hm-play[hidden] {
  display: none !important;
}

.hm-lives {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-dim);
}

.hm-word {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
}

.hm-slot {
  width: clamp(28px, 7vw, 42px);
  height: clamp(40px, 9vw, 54px);
  display: grid;
  place-items: center;
  border-bottom: 3px solid rgba(240, 217, 164, 0.55);
  font-family: 'Spectral', serif;
  font-weight: 700;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
  color: var(--ink);
  letter-spacing: 0.02em;
}

.hm-slot.is-open {
  color: #f4efe4;
  border-bottom-color: var(--amber);
}

.hm-slot.is-secret {
  color: var(--amber);
}

.hm-wrong {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
}

.hm-miss {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  background: rgba(216, 90, 74, 0.18);
  border: 1px solid rgba(216, 90, 74, 0.35);
  color: #ffb4a8;
}

.hm-think,
.hm-wait,
.hm-play {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.hm-set-label {
  font-weight: 700;
  color: var(--amber);
}

.hm-set-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-dim);
  text-align: center;
}

.hm-set-row,
.hm-guess-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}

.hm-word-input {
  flex: 1;
  min-width: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.hm-wait p {
  margin: 0;
  color: var(--ink-dim);
  font-weight: 600;
}

.hm-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.hm-key-row {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.hm-key {
  appearance: none;
  border: 1px solid rgba(244, 239, 228, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  min-width: 26px;
  height: 38px;
  padding: 0 4px;
  border-radius: 8px;
  cursor: pointer;
}

.hm-key:hover:not(:disabled) {
  border-color: var(--amber);
}

.hm-key.is-hit {
  background: rgba(47, 158, 91, 0.35);
  border-color: rgba(110, 207, 142, 0.45);
  color: #d9ffe6;
}

.hm-key.is-miss {
  background: rgba(80, 20, 16, 0.55);
  border-color: rgba(216, 90, 74, 0.4);
  color: #ffb4a8;
  opacity: 0.55;
}

.hm-key:disabled {
  cursor: default;
}

#hm-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .hm-key {
    min-width: 22px;
    height: 34px;
    font-size: 0.85rem;
  }
  .hm-gallows-wrap {
    width: min(100%, 220px);
  }
}

/* Лендинг: версия внизу */
.landing-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(12px, 2.2vh, 22px);
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 3;
  pointer-events: none;
}

.landing-version {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: rgba(244, 239, 228, 0.72);
  text-decoration: none;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(244, 239, 228, 0.12);
  backdrop-filter: blur(6px);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.landing-version:hover {
  color: var(--amber);
  border-color: rgba(232, 165, 75, 0.35);
  background: rgba(232, 165, 75, 0.1);
}

.landing-games {
  position: relative;
  z-index: 2;
  padding: 28px 18px 48px;
  background:
    linear-gradient(180deg, rgba(7, 25, 18, 0.35), rgba(10, 36, 28, 0.96)),
    #0a241c;
  border-top: 1px solid rgba(244, 239, 228, 0.08);
}

.landing-games h2 {
  margin: 0 0 18px;
  text-align: center;
  font-family: 'Spectral', serif;
  font-size: 1.35rem;
}

.landing-games-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 42rem;
  margin: 0 auto;
}

.landing-games h3 {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}

.landing-games ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.landing-games a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}

.landing-games a:hover {
  color: var(--amber);
}

html.is-installed-app .landing-games {
  display: none;
}

@media (max-width: 560px) {
  .landing-games-cols {
    grid-template-columns: 1fr;
    gap: 18px;
    max-width: 16rem;
  }
}

/* Changelog */
#screen-changelog.screen.active {
  display: flex;
  flex-direction: column;
  padding: 12px 14px 18px;
  overflow-y: auto;
}

.changelog-panel {
  width: min(100%, 36rem);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.changelog-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.changelog-head-copy h2 {
  margin: 0;
  font-family: 'Spectral', serif;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  line-height: 1.15;
  color: var(--ink);
}

.changelog-version {
  margin: 4px 0 0;
  font-family: 'Manrope', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--amber);
}

.changelog-list {
  --cl-cal: 54px;
  --cl-dot: 18px;
  --cl-gap: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-left: 0;
}

.changelog-list::before {
  content: '';
  position: absolute;
  left: calc(var(--cl-cal) + var(--cl-gap) + var(--cl-dot) / 2);
  transform: translateX(-50%);
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(232, 165, 75, 0.55),
    rgba(232, 165, 75, 0.08)
  );
}

.changelog-day {
  position: relative;
  display: grid;
  grid-template-columns: var(--cl-cal) var(--cl-dot) minmax(0, 1fr);
  column-gap: var(--cl-gap);
  align-items: start;
  opacity: 0;
  transform: translateY(12px);
  animation: changelogIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.changelog-cal {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: var(--cl-cal);
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid rgba(232, 165, 75, 0.38);
  background: rgba(8, 22, 16, 0.88);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  text-align: center;
  line-height: 1;
}

.changelog-cal-month {
  padding: 5px 0 4px;
  background: linear-gradient(180deg, #f0d090, #d4a04a);
  color: #2a1608;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.changelog-cal-day {
  padding: 7px 0 1px;
  font-size: 1.42rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.changelog-cal-year {
  padding: 0 0 7px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ink-dim);
}

.changelog-dot {
  z-index: 1;
  width: 12px;
  height: 12px;
  margin: 22px auto 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #f0d090, #d4a04a);
  box-shadow: 0 0 0 3px rgba(10, 36, 28, 0.95), 0 0 0 6px rgba(232, 165, 75, 0.22);
}

.changelog-day-body {
  min-width: 0;
  padding: 12px 14px 12px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 52%),
    rgba(8, 22, 16, 0.72);
  border: 1px solid rgba(244, 239, 228, 0.1);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.changelog-scope-title {
  margin: 0 0 6px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
}

.changelog-items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.changelog-items li {
  position: relative;
  padding-left: 14px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(244, 239, 228, 0.88);
}

.changelog-items li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0.85;
}

@keyframes changelogIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .landing-version {
    font-size: 0.72rem;
    padding: 5px 10px;
  }

  .changelog-list {
    --cl-cal: 48px;
    --cl-dot: 16px;
    --cl-gap: 8px;
    gap: 14px;
  }

  .changelog-cal-day {
    font-size: 1.22rem;
  }

  .changelog-day-body {
    padding: 10px 12px;
  }

  .changelog-items li {
    font-size: 0.86rem;
  }
}

/* Админка */
#screen-admin.screen.active {
  display: flex;
  flex-direction: column;
  padding: 12px 14px 18px;
  overflow-y: auto;
}

.admin-panel {
  width: min(100%, 40rem);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.admin-entry {
  border-color: rgba(244, 239, 228, 0.16);
  background: rgba(0, 0, 0, 0.22);
}

.admin-entry .plus-entry-badge {
  background: linear-gradient(180deg, #c9d4c4, #8ea38a);
  color: #142016;
}

.admin-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-search span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-filter {
  flex: 1 1 0;
  min-width: 4.8rem;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-filter.is-active {
  border-color: rgba(232, 165, 75, 0.55);
  background: rgba(232, 165, 75, 0.16);
  color: var(--amber);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-user {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(244, 239, 228, 0.1);
  background: rgba(8, 22, 16, 0.72);
}

.admin-user.is-plus {
  border-color: rgba(232, 165, 75, 0.35);
}

.admin-user .avatar {
  width: 44px;
  height: 44px;
}

.admin-user-main {
  min-width: 0;
}

.admin-user-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.95rem;
}

.admin-user-name .plus-badge {
  font-size: 0.62rem;
}

.admin-user-sub,
.admin-user-stats,
.admin-user-meta {
  margin: 2px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-stats {
  color: rgba(244, 239, 228, 0.82);
}

.admin-user-meta {
  white-space: normal;
}

.admin-plus-btn,
.admin-del-btn,
.admin-resend-btn {
  white-space: nowrap;
}

.admin-user-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.admin-empty {
  margin: 8px 0 0;
  color: var(--ink-dim);
  font-size: 0.9rem;
}

#admin-pane-users[hidden],
#admin-pane-mail[hidden] {
  display: none !important;
}

.admin-tabs {
  display: flex;
  gap: 6px;
}

.admin-tab {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(244, 239, 228, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.admin-tab.is-active {
  border-color: rgba(232, 165, 75, 0.55);
  background: rgba(232, 165, 75, 0.16);
  color: var(--amber);
}

.admin-mail-hint {
  margin: 0 0 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-dim);
}

.admin-mail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(244, 239, 228, 0.1);
  background: rgba(8, 22, 16, 0.72);
}

.admin-mail.is-error {
  border-color: rgba(232, 92, 75, 0.4);
}

.admin-mail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-mail-kind {
  font-weight: 800;
  font-size: 0.92rem;
}

.admin-mail-status {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 228, 0.16);
}

.admin-mail-status.is-sent {
  color: #b7e0b0;
  border-color: rgba(120, 180, 110, 0.45);
  background: rgba(80, 140, 70, 0.18);
}

.admin-mail-status.is-error {
  color: #f3b4aa;
  border-color: rgba(232, 92, 75, 0.45);
  background: rgba(180, 50, 40, 0.2);
}

.admin-mail-status.is-console {
  color: var(--amber);
  border-color: rgba(232, 165, 75, 0.4);
  background: rgba(232, 165, 75, 0.14);
}

.admin-mail-err {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #f3b4aa;
  white-space: normal;
  word-break: break-word;
}

#screen-game.is-poker #table-discard,
#screen-game.is-bura #table-discard,
#screen-game.is-twentyone #table-discard {
  display: none;
}

#screen-game.is-poker .table-cards,
#screen-game.is-bura .table-cards,
#screen-game.is-twentyone .table-cards {
  justify-content: center;
}

#screen-game.is-poker .opponents,
#screen-game.is-bura .opponents,
#screen-game.is-twentyone .opponents {
  width: 100%;
  min-height: 0;
  margin: 0;
  gap: 6px;
}

#screen-game.is-poker .opponent,
#screen-game.is-bura .opponent,
#screen-game.is-twentyone .opponent {
  min-width: 0;
  max-width: 168px;
  padding: 5px 8px;
  text-align: left;
  border-radius: 12px;
}

#screen-game.is-poker .opponent .name-row,
#screen-game.is-bura .opponent .name-row,
#screen-game.is-twentyone .opponent .name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  justify-content: flex-start;
}

#screen-game.is-poker .opponent .avatar.sm,
#screen-game.is-bura .opponent .avatar.sm,
#screen-game.is-twentyone .opponent .avatar.sm {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

#screen-game.is-poker .opponent .name,
#screen-game.is-bura .opponent .name,
#screen-game.is-twentyone .opponent .name {
  margin: 0;
  font-size: 0.82rem;
}

#screen-game.is-poker .opponent .role,
#screen-game.is-bura .opponent .role,
#screen-game.is-twentyone .opponent .role {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.2;
  opacity: 0.82;
}

#screen-game.is-bura .opponent .opp-count,
#screen-game.is-twentyone .opponent .opp-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 24px;
  min-width: 18px;
  padding: 0;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #f4efe4;
  line-height: 1;
  background:
    linear-gradient(145deg, rgba(244, 239, 228, 0.14), transparent 45%),
    repeating-linear-gradient(
      45deg,
      #1a4d38 0 3px,
      #163f2e 3px 6px
    );
  border: 1.5px solid rgba(232, 165, 75, 0.55);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

#screen-game.is-poker .opponent .opp-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: auto;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #f4efe4;
  line-height: 1;
  background: rgba(232, 165, 75, 0.22);
  border: 1px solid rgba(232, 165, 75, 0.5);
  box-shadow: none;
}

#screen-game.is-poker .opp-cards,
#screen-game.is-bura .opp-cards,
#screen-game.is-twentyone .opp-cards {
  height: 36px;
  margin: 2px 0 0;
}

#screen-game.is-poker .opp-cards .card,
#screen-game.is-twentyone .opp-cards .card {
  width: 22px;
  height: 32px;
}

.pk-pot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 4.5rem;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  color: #f4efe4;
}

.pk-pot-label {
  font-size: 0.72rem;
  opacity: 0.75;
}

.pk-pot strong {
  font-size: 1.15rem;
}

.pk-board {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.pk-slot {
  width: 52px;
  height: 74px;
  border-radius: 8px;
  border: 1px dashed rgba(244, 239, 228, 0.28);
  background: rgba(0, 0, 0, 0.12);
}

.pk-board .card {
  width: 52px;
}

.opponent.pk-folded {
  opacity: 0.55;
}

.poker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.poker-actions[hidden],
.poker-actions .btn[hidden] {
  display: none !important;
}

#screen-game:not([data-table="poker"]) #poker-actions,
#screen-game:not([data-table="bura"]) #bura-actions,
#screen-game:not([data-table="twentyone"]) #t21-actions {
  display: none !important;
}

#screen-game:not([data-table="durak"]) #btn-take,
#screen-game:not([data-table="durak"]) #btn-pass,
#screen-game:not([data-table="durak"]) #choice-bar {
  display: none !important;
}

@media (max-width: 560px) {
  .admin-user {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .admin-user-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .admin-plus-btn,
  .admin-del-btn,
  .admin-resend-btn {
    flex: 1 1 0;
    justify-self: stretch;
  }

  .admin-mail {
    grid-template-columns: minmax(0, 1fr);
  }
}
