/* Atelier — luxury club lounge layer (v8). Loaded last.
   Original ornaments and lighting only. Respects [data-gfx="low"] and reduced motion. */

:root {
  --bg: #06110d;
  --bg-elev: #0e1c17;
  --felt: #145c45;
  --felt-mid: #0e4a36;
  --felt-dark: #0a3226;
  --gold: #f0d78c;
  --gold-hi: #fff6d0;
  --gold-dim: #c9a44a;
  --gold-deep: #8a6a22;
  --ivory: #f7f2e6;
  --muted: #d5ccb8;
  --line: rgba(232, 204, 130, .28);
  --danger: #e07060;
  --ok: #5dbe8a;
  --wood: #4a2c16;
  --wood-hi: #6e4324;
  --wood-lo: #1a0e08;
  --shadow: 0 16px 40px rgba(0,0,0,.45);
  --radius: 16px;
  --focus: 0 0 0 3px #06110d, 0 0 0 6px var(--gold);
}

[data-theme="salon"] {
  --bg: #f3efe3; --bg-elev: #fffdf6; --felt: #6b1e2a; --felt-mid: #5a1824; --felt-dark: #4a121c;
  --gold: #6a420e; --gold-hi: #c9a44a; --gold-dim: #a36b1c; --ivory: #1a1410; --muted: #3f352e;
  --line: #d9cbb6; --wood: #5a3a1e; --wood-hi: #8a5a2a; --wood-lo: #2a180c;
}
[data-theme="midnight"] {
  --bg: #070b16; --bg-elev: #12182a; --felt: #102044; --felt-mid: #0c1838; --felt-dark: #0a152e;
  --gold: #d7e4ff; --gold-hi: #f2f6ff; --gold-dim: #8aa4d6; --ivory: #eef2ff; --muted: #d0d6ea; --line: #243056;
}
[data-theme="amber"] {
  --bg: #1a120a; --bg-elev: #2a1c10; --felt: #5a3a18; --felt-mid: #4a2e14; --felt-dark: #3a2410;
  --gold: #ffd58a; --gold-hi: #ffe8bc; --gold-dim: #d4a24a; --ivory: #fff4e0; --muted: #e2d0b0; --line: #5a4030;
}
[data-theme="imperial"] {
  --bg: #140c16; --bg-elev: #241428; --felt: #3a1840; --felt-mid: #2e1236; --felt-dark: #220c28;
  --gold: #f0d48a; --gold-hi: #fff0c4; --ivory: #f8f0e8; --muted: #d8c8d0; --line: #4a3050;
}
[data-theme="arctic"] {
  --bg: #0c1418; --bg-elev: #152228; --felt: #1a3a42; --felt-mid: #143038; --felt-dark: #102830;
  --gold: #c8f0ea; --gold-hi: #eefaf8; --ivory: #eef8f6; --muted: #c5d8d4; --line: #2a4a50;
}
[data-theme="rose"] {
  --bg: #180c10; --bg-elev: #28141a; --felt: #5a2030; --felt-mid: #4a1a28; --felt-dark: #3a1420;
  --gold: #f3c4c8; --gold-hi: #ffe4e6; --ivory: #fff0f0; --muted: #e0c8c8; --line: #5a3038;
}

/* ---- Atmosphere ---- */
html, body {
  background-color: var(--bg);
}
body {
  background:
    radial-gradient(ellipse 80% 42% at 50% -6%, rgba(255, 220, 150, .16), transparent 58%),
    radial-gradient(ellipse 70% 40% at 50% 118%, rgba(0,0,0,.55), transparent 60%),
    radial-gradient(ellipse at 12% 88%, rgba(14, 70, 50, .35), transparent 42%),
    var(--bg);
}
.salon-lights {
  background:
    radial-gradient(ellipse 50% 26% at 50% 0%, rgba(255, 228, 170, .22), transparent 64%),
    radial-gradient(circle at 16% 10%, rgba(232, 212, 139, .1), transparent 30%),
    radial-gradient(circle at 84% 92%, rgba(60, 16, 24, .16), transparent 40%);
  opacity: 1;
}
.salon-lights::before {
  content: "";
  position: absolute;
  inset: -10%;
  background: url("../assets/ui/damask.svg") center / 420px 420px repeat;
  opacity: .07;
  pointer-events: none;
}
body.in-game .salon-lights::before { opacity: .035; }
body::after {
  background:
    radial-gradient(ellipse at center, transparent 46%, rgba(0,0,0,.46) 100%);
}

/* ---- Header: slim club bar ---- */
.app-header {
  background: linear-gradient(180deg, rgba(14, 28, 23, .92), rgba(6, 17, 13, .78));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  gap: .6rem;
}
.brand-mark {
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
}
.brand-mark svg, .brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}
.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(0,0,0,.55);
}
.header-actions {
  gap: .3rem;
}
.nav-btn, .app-header .btn, .app-header .icon-btn {
  border-color: rgba(232, 204, 130, .32);
  background: rgba(8, 20, 16, .45);
  color: var(--ivory);
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .01em;
}
.nav-btn {
  gap: .35rem;
  padding-inline: .8rem;
}
.nav-ico {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
  background: currentColor;
  flex: 0 0 auto;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}
.nav-quests .nav-ico {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M6 3h12a1 1 0 0 1 1 1v17l-7-4-7 4V4a1 1 0 0 1 1-1z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M6 3h12a1 1 0 0 1 1 1v17l-7-4-7 4V4a1 1 0 0 1 1-1z'/></svg>");
}
.nav-profile .nav-ico {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 12a4.5 4.5 0 1 0-4.5-4.5A4.5 4.5 0 0 0 12 12zm0 2c-4.2 0-8 2.1-8 5v1h16v-1c0-2.9-3.8-5-8-5z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 12a4.5 4.5 0 1 0-4.5-4.5A4.5 4.5 0 0 0 12 12zm0 2c-4.2 0-8 2.1-8 5v1h16v-1c0-2.9-3.8-5-8-5z'/></svg>");
}
.nav-settings .nav-ico {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M19.4 13a7.7 7.7 0 0 0 .1-2l2.1-1.6-2-3.5-2.5.6a7.6 7.6 0 0 0-1.7-1L15 3h-6l-.4 2.5a7.6 7.6 0 0 0-1.7 1L3.4 5.9l-2 3.5L3.5 11a7.7 7.7 0 0 0 0 2l-2.1 1.6 2 3.5 2.5-.6a7.6 7.6 0 0 0 1.7 1L9 21h6l.4-2.5a7.6 7.6 0 0 0 1.7-1l2.5.6 2-3.5zM12 15.5A3.5 3.5 0 1 1 15.5 12 3.5 3.5 0 0 1 12 15.5z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M19.4 13a7.7 7.7 0 0 0 .1-2l2.1-1.6-2-3.5-2.5.6a7.6 7.6 0 0 0-1.7-1L15 3h-6l-.4 2.5a7.6 7.6 0 0 0-1.7 1L3.4 5.9l-2 3.5L3.5 11a7.7 7.7 0 0 0 0 2l-2.1 1.6 2 3.5 2.5-.6a7.6 7.6 0 0 0 1.7 1L9 21h6l.4-2.5a7.6 7.6 0 0 0 1.7-1l2.5.6 2-3.5zM12 15.5A3.5 3.5 0 1 1 15.5 12 3.5 3.5 0 0 1 12 15.5z'/></svg>");
}
.nav-about .nav-ico {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm1 15h-2v-6h2zm0-8h-2V7h2z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm1 15h-2v-6h2zm0-8h-2V7h2z'/></svg>");
}

/* ---- Buttons: metal and glass ---- */
.btn, .icon-btn, .chip {
  border-radius: 12px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.btn.primary, .icon-btn.primary, .dev-promo-cta {
  color: #1a1208 !important;
  background: linear-gradient(180deg, #fff3c0 0%, #e8c56a 46%, #c9a227 100%) !important;
  border-color: #f0d78c !important;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  box-shadow:
    0 1px 0 rgba(255,255,255,.5),
    0 2px 0 #8a6a18,
    0 8px 16px rgba(0,0,0,.28);
}
.btn.primary:hover, .icon-btn.primary:hover, .dev-promo-cta:hover {
  filter: brightness(1.06);
}
.btn:not(.primary):not(.ghost), .icon-btn:not(.ghost) {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0) 55%), var(--bg-elev);
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 4px 10px rgba(0,0,0,.22);
}
.btn.ghost, .icon-btn.ghost {
  background: rgba(8, 20, 16, .28);
  border-color: rgba(232, 204, 130, .28);
}
.btn:active, .icon-btn:active { transform: translateY(1px); }

/* ---- Lobby hero ---- */
body.menu-lobby .hero {
  padding: 1.6rem .6rem 1.2rem;
  position: relative;
}
.hero-mark {
  width: 5.4rem;
  height: 5.4rem;
  margin: 0 auto .7rem;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.4)) drop-shadow(0 0 18px rgba(232, 200, 120, .22));
}
.hero-mark svg { width: 100%; height: 100%; display: block; }
body.menu-lobby .hero h1 {
  font-weight: 700;
  font-size: clamp(1.85rem, 5.6vw, 3.35rem);
  line-height: 1.12;
  letter-spacing: .045em;
  color: #f3e0a6;
  text-wrap: balance;
  max-width: 18ch;
  margin-inline: auto;
  text-shadow:
    0 1px 0 #8a6a22,
    0 2px 0 #3a2808,
    0 0 28px rgba(232, 200, 120, .3);
  background: none;
  -webkit-text-fill-color: unset;
}
.hero-ornament {
  width: min(22rem, 78%);
  height: 14px;
  margin: .85rem auto .7rem;
  background:
    linear-gradient(90deg, transparent, rgba(232,200,120,.15) 12%, rgba(232,200,120,.15) 88%, transparent),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 14' preserveAspectRatio='xMidYMid meet'><path d='M8 7 H168' stroke='%23e8c86a' stroke-width='1' opacity='.7'/><path d='M232 7 H392' stroke='%23e8c86a' stroke-width='1' opacity='.7'/><path d='M200 1 L206 7 L200 13 L194 7 Z' fill='%23e8c86a'/><circle cx='186' cy='7' r='1.6' fill='%23e8c86a'/><circle cx='214' cy='7' r='1.6' fill='%23e8c86a'/></svg>") center / contain no-repeat;
}
body.menu-lobby .hero p {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 36rem;
  margin-inline: auto;
  text-wrap: balance;
  font-weight: 500;
}

/* ---- Section titles ---- */
.section-title, h2.section-title {
  display: flex;
  align-items: center;
  gap: .8rem;
  justify-content: center;
  text-align: center;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold);
  margin: 1.8rem 0 .9rem;
}
.section-title .sec-label { font-family: var(--font-display); }
.section-title .sec-rule {
  flex: 1 1 2rem;
  height: 1px;
  max-width: 8rem;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  opacity: .75;
}

/* ---- Game tiles ---- */
body.menu-lobby .game-grid {
  perspective: none;
  grid-template-columns: repeat(auto-fill, minmax(11.2rem, 1fr));
  gap: 1rem;
}
body.menu-lobby .game-card,
.game-card {
  transform: none;
  transform-style: flat;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(232, 204, 130, .28);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), transparent 40%),
    var(--bg-elev);
  box-shadow:
    0 1px 0 rgba(255,255,255,.08),
    0 12px 24px rgba(0,0,0,.32);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
body.menu-lobby .game-card:hover,
body.menu-lobby .game-card:focus-visible,
.game-card:hover {
  transform: translateY(-5px) !important;
  border-color: var(--gold-dim);
  box-shadow:
    0 0 0 1px rgba(232, 200, 120, .35),
    0 16px 32px rgba(0,0,0,.42),
    0 0 24px rgba(232, 200, 120, .12);
}
.game-thumb {
  height: 7.1rem;
  margin: 0;
  border-radius: 0;
  background: #0a2a21;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}
.game-thumb svg { width: 100%; height: 100%; display: block; object-fit: cover; }
body.menu-lobby .game-thumb { transform: none; }
body.menu-lobby .game-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%);
  transform: translateX(-140%);
  pointer-events: none;
}
body.menu-lobby .game-card:hover .game-thumb::after,
body.menu-lobby .game-card:focus-visible .game-thumb::after {
  transform: translateX(140%);
  transition: transform .75s ease;
}
.game-card-copy {
  padding: .7rem .8rem .8rem;
  display: flex;
  flex-direction: column;
  gap: .28rem;
}
body.menu-lobby .game-card h3,
body.menu-lobby .game-card p,
body.menu-lobby .badge { transform: none; }
.game-card h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: .015em;
  color: var(--ivory);
  line-height: 1.25;
}
.game-card p {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.4;
}
.badge {
  font-size: .68rem;
  letter-spacing: .06em;
  color: var(--gold);
  border-color: rgba(232, 204, 130, .35);
  background: rgba(8, 20, 16, .4);
  font-weight: 700;
}

/* Staggered entrance */
@keyframes tileIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
body.menu-lobby .game-card {
  animation: tileIn .45s ease backwards;
}
body.menu-lobby .game-grid .game-card:nth-child(1) { animation-delay: .02s; }
body.menu-lobby .game-grid .game-card:nth-child(2) { animation-delay: .06s; }
body.menu-lobby .game-grid .game-card:nth-child(3) { animation-delay: .1s; }
body.menu-lobby .game-grid .game-card:nth-child(4) { animation-delay: .14s; }
body.menu-lobby .game-grid .game-card:nth-child(5) { animation-delay: .18s; }
body.menu-lobby .game-grid .game-card:nth-child(n+6) { animation-delay: .22s; }

/* ---- Promo as a club card ---- */
.dev-promo {
  margin: .4rem auto 1.2rem;
  max-width: 52rem;
  background:
    linear-gradient(160deg, rgba(8,8,10,.92) 0%, rgba(27,42,65,.9) 58%, rgba(42,26,32,.92) 100%);
  border: 1px solid rgba(232, 212, 139, .32);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.08);
  padding: 1rem 1.1rem 1.05rem;
}
.dev-promo-kicker {
  letter-spacing: .14em;
  color: var(--gold);
}

/* ---- Felt table: thick walnut rail + gold inlay + spotlight ---- */
.felt-table {
  border: 22px solid transparent;
  border-radius: 28px;
  background-color: var(--felt-dark);
  background-image:
    var(--tex-felt, none),
    radial-gradient(ellipse 72% 50% at 50% 26%, rgba(255, 245, 210, .16), transparent 62%),
    radial-gradient(ellipse 90% 70% at 50% 120%, rgba(0,0,0,.5), transparent 55%),
    linear-gradient(180deg, var(--felt) 0%, var(--felt-mid) 55%, var(--felt-dark) 100%),
    var(--tex-wood, none),
    linear-gradient(180deg, #7a4a28 0%, #4a2c16 42%, #2a160c 100%);
  background-origin: padding-box, padding-box, padding-box, padding-box, border-box, border-box;
  background-clip: padding-box, padding-box, padding-box, padding-box, border-box, border-box;
  background-size: 180px 180px, auto, auto, auto, cover, auto;
  background-blend-mode: overlay, normal, normal, normal, multiply, normal;
  box-shadow:
    0 0 0 1px #120806,
    0 0 0 3px rgba(201, 162, 39, .7),
    0 0 0 5px #1a0c06,
    0 26px 50px rgba(0,0,0,.55),
    inset 0 0 0 2px rgba(201, 162, 39, .5),
    inset 0 0 0 5px rgba(26, 12, 6, .85),
    inset 0 0 90px rgba(0,0,0,.28),
    inset 0 2px 0 rgba(255,255,255,.1);
}
.felt-table .felt-table {
  border: 0;
  box-shadow: none;
  background: transparent;
  background-image: none;
  padding: .2rem;
  border-radius: 8px;
}

/* In-game: let the table own the screen */
body.in-game .app-header {
  background: linear-gradient(180deg, rgba(6,17,13,.88), rgba(6,17,13,.55));
}
body.in-game .play-actions .btn.ghost {
  background: rgba(8,20,16,.4);
}
body.in-game .header-compact .brand-title { display: none; }
body.in-game .header-compact .header-actions > a.btn { display: none; }
body.in-game .header-compact .header-actions > a[href="#/settings"] {
  display: inline-flex;
  padding-inline: .55rem;
}

/* Soften the previous hard 3D table tilt — keep a hint only */
[data-gfx="high"] body.in-game .game-mount.felt-table {
  transform: rotateX(3.5deg);
}

/* ---- Cards ---- */
.playing-card {
  border-radius: .42rem;
  background:
    linear-gradient(165deg, #fffefb 0%, #f7f1e0 58%, #efe4c8 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.7),
    1px 0 0 #d4c4a0,
    2px 1px 0 #bca67a,
    3px 3px 0 #6a5428,
    7px 14px 18px rgba(0,0,0,.38);
}
.playing-card.face::before {
  inset: 3px;
  border: 1px solid rgba(150, 110, 40, .28);
  border-radius: .26rem;
}
.corner .rk {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: 0;
  font-style: normal;
  line-height: 1;
}
.playing-card.rank-10 .corner .rk { font-size: .72rem; }
.corner .sy { font-size: .82rem; line-height: 1; }
.corner .sy svg,
.pip-dot svg,
.ace-pip svg {
  width: 1em;
  height: 1em;
  display: block;
}
.ace-pip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 78%;
  height: 78%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: inherit;
}
.ace-pip svg { width: 100%; height: 100%; display: block; }
.pip-dot {
  width: 1.05em;
  height: 1.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
}
.pip-dot svg { width: 100%; height: 100%; display: block; }
.corner .sy {
  width: .82em;
  height: .82em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.corner .sy svg { width: 100%; height: 100%; display: block; }
.playing-card.small .pip-dot { font-size: .78rem; }
.playing-card.small .ace-pip { width: 72%; height: 72%; }
.pip-dot { font-size: .9rem; width: .9em; height: .9em; }
.playing-card.rank-8 .pip-dot,
.playing-card.rank-9 .pip-dot,
.playing-card.rank-10 .pip-dot { font-size: .78rem; width: .78em; height: .78em; }
.playing-card.small .pip-dot { font-size: .7rem; width: .7em; height: .7em; }
.playing-card.small.rank-8 .pip-dot,
.playing-card.small.rank-9 .pip-dot,
.playing-card.small.rank-10 .pip-dot { font-size: .58rem; width: .58em; height: .58em; }
.playing-card .court-art { inset: 7% 6% 6%; }
.playing-card.back, .card-back {
  background: #4a1520;
}
.back-pattern {
  border: 2px solid rgba(232, 212, 139, .5);
  background:
    repeating-linear-gradient(45deg, rgba(232,212,139,.16) 0 5px, transparent 5px 10px),
    repeating-linear-gradient(-45deg, rgba(232,212,139,.12) 0 5px, transparent 5px 10px),
    #6b1e2e;
}

/* Fan the player's durak hand; overlap opponent backs */
.durak-hand, .opp-hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
}
.durak-hand { min-height: 7.1rem; padding-top: .35rem; }
.durak-hand .playing-card {
  margin-inline-end: -1.05rem;
  transform-origin: 50% 130%;
  z-index: 1;
}
.durak-hand .playing-card:last-child { margin-inline-end: 0; }
.durak-hand { flex-wrap: nowrap; }
.durak-hand .playing-card.playable:hover,
.durak-hand .playing-card.playable:focus-visible,
.durak-hand .playing-card.selected {
  z-index: 8;
}
.opp-hand .playing-card {
  margin-inline-end: -1.35rem;
}
.opp-hand .playing-card:last-child { margin-inline-end: 0; }

[data-gfx="high"] .playing-card {
  transform: rotateX(4deg);
}
[data-gfx="high"] .playing-card.playable:hover,
[data-gfx="high"] .playing-card.playable:focus-visible {
  transform: translateY(-10px) rotateX(1deg) scale(1.05);
}
[data-gfx="high"] .playing-card.selected {
  transform: translateY(-14px) rotateX(0);
}
[data-gfx="high"] .durak-hand .playing-card { transform: rotateX(5deg); }
[data-gfx="high"] .durak-hand .playing-card.playable:hover,
[data-gfx="high"] .durak-hand .playing-card.selected {
  transform: translateY(-12px) rotateX(1deg) scale(1.04);
}

/* ---- Chess / checkers frame ---- */
.chess-board, .checkers-board {
  border: 16px solid transparent;
  border-radius: 6px;
  background-clip: padding-box, border-box, border-box;
  background-origin: padding-box, border-box, border-box;
  background-image:
    linear-gradient(#3a2414, #3a2414),
    var(--tex-wood, none),
    linear-gradient(#7a4a24, #3a2210);
  background-size: auto, cover, auto;
  box-shadow:
    0 0 0 2px rgba(201, 162, 39, .65),
    0 0 0 8px #1a0e08,
    0 22px 36px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.2);
}
.sq.light {
  background-image:
    var(--tex-wood, none),
    linear-gradient(145deg, #f6ead0, #e0c894);
  background-blend-mode: soft-light, normal;
}
.sq.dark {
  background-image:
    var(--tex-wood, none),
    linear-gradient(145deg, #7a4a28, #4a2c16);
  background-blend-mode: multiply, normal;
}
[data-gfx="high"] .chess-board:not(.flipped),
[data-gfx="high"] .checkers-board {
  transform: rotateX(9deg);
}
[data-gfx="high"] .chess-board.flipped {
  transform: rotateX(9deg) rotateZ(180deg);
}
[data-gfx="high"] .piece,
[data-gfx="high"] .man {
  filter: drop-shadow(0 10px 6px rgba(0,0,0,.45));
}

/* ---- Nardy ---- */
.nardy-board {
  border: 14px solid transparent;
  border-radius: 10px;
  background-clip: padding-box, padding-box, border-box, border-box;
  background-origin: padding-box, padding-box, border-box, border-box;
  background-image:
    var(--tex-wood, none),
    linear-gradient(#3a2416, #24140c),
    var(--tex-wood, none),
    linear-gradient(#6a4224, #2a160c);
  background-blend-mode: multiply, normal, multiply, normal;
  box-shadow:
    0 0 0 2px rgba(201, 162, 39, .6),
    0 0 0 8px #140a06,
    0 22px 36px rgba(0,0,0,.5),
    inset 0 0 28px rgba(0,0,0,.35);
}
.nardy-man.w {
  background: radial-gradient(circle at 32% 28%, #fffaf0, #e8d5a8 40%, #b8944a 72%, #5a3a14);
  box-shadow:
    0 3px 0 rgba(0,0,0,.45),
    inset 0 0 0 2px rgba(90,60,20,.4),
    inset 0 5px 0 rgba(255,255,255,.38),
    inset 0 -4px 6px rgba(0,0,0,.25);
}
.nardy-man.b {
  background: radial-gradient(circle at 32% 28%, #8a8a90, #2c2c32 55%, #0a0a0c);
  box-shadow:
    0 3px 0 rgba(0,0,0,.55),
    inset 0 0 0 2px rgba(220,200,160,.3),
    inset 0 5px 0 rgba(255,255,255,.2),
    inset 0 -4px 6px rgba(0,0,0,.4);
}
[data-gfx="high"] body.in-game .nardy-board { transform: rotateX(6deg); }

/* ---- Dice / dominoes ---- */
.d3-face {
  background:
    radial-gradient(circle at 28% 24%, #fff, transparent 40%),
    linear-gradient(145deg, #fffdf8, #e8dcc6);
  border: 2px solid #c9b896;
  border-radius: .5rem;
}
.domino-tile {
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.65), transparent 42%),
    linear-gradient(180deg, #fffdf8, #f0e6d0 70%, #e2d4b6);
  border-radius: 8px;
  box-shadow:
    0 2px 0 #c9b896,
    1px 3px 0 #8a7048,
    3px 6px 0 #5a4828,
    8px 14px 16px rgba(0,0,0,.35),
    inset 0 1px 0 #fff;
}

/* ---- Puzzles sit on a desk blotter ---- */
.sudoku-board,
.crossword-grid,
.fifteen-board,
.g2048-board {
  box-shadow:
    0 0 0 10px #5a3a1e,
    0 0 0 12px rgba(201, 162, 39, .45),
    0 20px 36px rgba(0,0,0,.38),
    inset 0 1px 0 #fff;
}
.su-n { font-size: 1.4rem; font-weight: 700; }

/* ---- Speech / bots ---- */
.speech-bubble {
  background: #fffdf8;
  border: 1px solid rgba(201, 162, 39, .45);
  box-shadow: 0 8px 18px rgba(0,0,0,.22);
  color: #1a1410;
}
.bot-avatar { box-shadow: 0 4px 0 rgba(0,0,0,.28), 0 0 0 2px rgba(232,200,120,.3); }

/* ---- Settings / modals ---- */
.modal-card, .consent-card, .comm-panel, .settings-list, .daily-spin, .stat-card {
  box-shadow: 0 16px 36px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.06);
}
.modal-card, .consent-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 40%), var(--bg-elev);
  border-color: var(--line);
}

/* ---- Low quality / reduced motion ---- */
[data-gfx="low"] .salon-lights,
[data-gfx="low"] body::after { display: none; }
[data-gfx="low"] .felt-table,
[data-gfx="low"] .nardy-board,
[data-gfx="low"] .chess-board,
[data-gfx="low"] .checkers-board {
  background-image: none;
  background-blend-mode: normal;
  border: 12px solid #4a2c16;
  background-color: var(--felt-dark);
  background: linear-gradient(180deg, var(--felt), var(--felt-dark));
}
[data-gfx="low"] .chess-board,
[data-gfx="low"] .checkers-board,
[data-gfx="low"] .nardy-board {
  background: #3a2414;
}
[data-gfx="low"] body.menu-lobby .game-card,
[data-gfx="low"] .game-card { transform: none !important; animation: none; }
[data-gfx="low"] body.menu-lobby .game-thumb::after { display: none; }
[data-gfx="low"] .app-header {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .salon-lights { transform: none; }
  body.menu-lobby .game-card,
  body.menu-lobby .game-card .game-thumb::after,
  .playing-card.deal-in { animation: none !important; transition: none !important; }
  body.menu-lobby .game-card { transform: none !important; }
}

/* ---- Mobile ---- */
@media (max-width: 430px) {
  .hero-mark { width: 3.7rem; height: 3.7rem; margin-bottom: .45rem; }
  body.menu-lobby .hero { padding: .7rem .2rem .5rem; }
  body.menu-lobby .hero h1 { font-size: 1.58rem; letter-spacing: .03em; }
  .hero-ornament { margin: .45rem auto .4rem; }
  .game-card p { display: none; }
  .game-thumb { height: 6.6rem; }
  body.menu-lobby .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
  }
  .dev-promo { padding: .7rem .8rem .75rem; margin: .15rem auto .7rem; }
  .app-header .nav-btn { padding-inline: .65rem; }
  .felt-table { border-width: 12px; border-radius: 18px; }
  [data-gfx="high"] body.in-game .game-mount.felt-table { transform: none; }
  [data-gfx="high"] .chess-board:not(.flipped),
  [data-gfx="high"] .checkers-board { transform: rotateX(6deg); }
  [data-gfx="high"] .chess-board.flipped { transform: rotateX(6deg) rotateZ(180deg); }
  body.in-game .header-compact .nav-btn .btn-label { display: none; }
  body.in-game .header-compact .nav-btn { padding-inline: .55rem; min-width: var(--tap); }
  body.in-game .game-mount.felt-table {
    padding-bottom: 1.15rem;
    margin-bottom: .85rem;
  }
  .durak-hand { min-height: 5.6rem; padding-bottom: .15rem; }
  .kl-col { min-width: 2.5rem !important; }
  .kl-tabs .playing-card,
  .found-pile .playing-card,
  .stock-pile .playing-card { width: 2.5rem; height: 3.55rem; }
  .found-pile, .stock-pile { min-width: 2.5rem; min-height: 3.55rem; }

  /* Lobby header: brand + fullscreen on row 1, four nav pills on row 2 */
  body.menu-lobby .app-header {
    flex-wrap: wrap;
    position: relative;
    padding-inline-end: 3.6rem;
  }
  body.menu-lobby .fs-toggle {
    position: absolute;
    top: max(.45rem, env(safe-area-inset-top, 0px));
    inset-inline-end: max(.45rem, env(safe-area-inset-right, 0px));
  }
  body.menu-lobby .header-actions {
    width: 100%;
    justify-content: space-between;
    gap: .3rem;
  }
  body.menu-lobby .header-actions .nav-btn {
    flex: 1 1 auto;
    min-width: var(--tap);
    justify-content: center;
    padding-inline: .45rem;
  }
  body.menu-lobby .header-actions .nav-btn .btn-label { display: none; }
}

@media (min-width: 900px) {
  body.menu-lobby .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 1.15rem;
  }
  .game-thumb { height: 8rem; }
}

/* Keep type sharp */
.speech-bubble, .toast, .brand-title, .section-title, .game-status, .btn, .game-card h3, .game-card p {
  -webkit-font-smoothing: antialiased;
}


/* ---- Atelier v8: lighting, furniture, premium actions, avatars ---- */
.modal-overlay {
  z-index: 200;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(20, 40, 32, .45), rgba(0,0,0,.72));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal-card, .consent-card {
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(232, 200, 120, .28),
    0 24px 48px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.08);
}

/* Richer baize: lamp, oval glow, corner vignette — keeps the walnut rail from .felt-table */
body.in-game .game-mount.felt-table {
  background-image:
    radial-gradient(ellipse 58% 30% at 50% 12%, rgba(255, 236, 190, .28), transparent 68%),
    radial-gradient(ellipse 70% 54% at 50% 46%, rgba(255, 250, 230, .09), transparent 72%),
    radial-gradient(ellipse 92% 84% at 50% 58%, transparent 40%, rgba(0,0,0,.4) 100%),
    var(--tex-felt, none),
    radial-gradient(ellipse 72% 50% at 50% 26%, rgba(255, 245, 210, .16), transparent 62%),
    radial-gradient(ellipse 90% 70% at 50% 120%, rgba(0,0,0,.5), transparent 55%),
    linear-gradient(180deg, var(--felt) 0%, var(--felt-mid) 55%, var(--felt-dark) 100%),
    var(--tex-wood, none),
    linear-gradient(180deg, #7a4a28 0%, #4a2c16 42%, #2a160c 100%);
  background-origin: padding-box, padding-box, padding-box, padding-box, padding-box, padding-box, padding-box, border-box, border-box;
  background-clip: padding-box, padding-box, padding-box, padding-box, padding-box, padding-box, padding-box, border-box, border-box;
  background-size: auto, auto, auto, 180px 180px, auto, auto, auto, cover, auto;
  background-blend-mode: normal, normal, normal, overlay, normal, normal, normal, multiply, normal;
}

/* Premium in-game action row — «Взять», «Бить», «Новая игра» */
.play-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  padding: .15rem .2rem .35rem;
}
.play-wrap > .play-actions {
  justify-content: flex-start;
}
.game-shell > .play-actions,
.puzzle-shell > .play-actions,
.puzzle-toolbar {
  justify-content: center;
}
.play-actions .btn,
.puzzle-toolbar .btn {
  min-height: var(--tap);
  padding-inline: 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .02em;
}
.play-actions .btn:not(.primary):not(.ghost),
.puzzle-toolbar .btn:not(.primary):not(.ghost),
body.in-game .play-actions .btn.ghost {
  background: linear-gradient(180deg, rgba(255, 240, 200, .14), rgba(8, 20, 16, .62));
  border: 1px solid rgba(232, 200, 120, .48);
  color: var(--ivory);
  box-shadow:
    0 1px 0 rgba(255,255,255,.14),
    0 2px 0 rgba(80, 56, 16, .35),
    0 8px 16px rgba(0,0,0,.3);
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}

/* Card backs: sheen, gold frame, tighter damask */
.playing-card.back, .card-back {
  background:
    linear-gradient(155deg, rgba(255,255,255,.16), transparent 42%),
    #4a1520;
}
.back-pattern {
  border: 2px solid rgba(232, 212, 139, .62);
  box-shadow:
    inset 0 0 0 3px #3a1018,
    inset 0 0 0 4px rgba(232, 212, 139, .28),
    inset 0 10px 16px rgba(255,255,255,.08);
  background:
    radial-gradient(circle at 50% 50%, rgba(232, 200, 120, .2) 0 12%, transparent 13% 100%),
    repeating-linear-gradient(45deg, rgba(232,212,139,.18) 0 5px, transparent 5px 10px),
    repeating-linear-gradient(-45deg, rgba(232,212,139,.12) 0 5px, transparent 5px 10px),
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.14), transparent 46%),
    #6b1e2e;
}

/* Stacked deck + chip counters */
.durak-stock .stock-backs .playing-card {
  box-shadow:
    0 1px 0 #2a0c12,
    2px 3px 0 #5a2030,
    4px 6px 0 #3a1018,
    6px 10px 14px rgba(0,0,0,.4);
}
.durak-stock .trump-peek {
  box-shadow:
    0 1px 0 rgba(255,255,255,.35),
    2px 6px 14px rgba(0,0,0,.4);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.3));
}
.stock-count {
  background:
    radial-gradient(circle at 32% 28%, #fff3c0, #e8c56a 42%, #8a6a18 100%) !important;
  color: #1a1208 !important;
  border: 1px solid #f0d78c !important;
  box-shadow:
    0 1px 0 rgba(255,255,255,.55),
    0 2px 0 #8a6a18,
    0 6px 10px rgba(0,0,0,.35) !important;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
}

/* Bot portraits: skin, rim light, better glasses */
.bot-avatar {
  overflow: hidden;
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(232, 200, 120, .42),
    0 6px 0 rgba(0,0,0,.3),
    0 10px 16px rgba(0,0,0,.28);
}
.av-bg {
  background:
    radial-gradient(circle at 32% 22%, rgba(255,255,255,.32), transparent 44%),
    radial-gradient(circle at 70% 80%, rgba(0,0,0,.28), transparent 50%),
    var(--bot-accent, #3a5a3c);
  box-shadow: inset 0 -10px 0 rgba(0,0,0,.2), inset 0 0 0 2px rgba(232,200,120,.2);
}
.av-face {
  background: radial-gradient(circle at 32% 28%, #ffe4cc, #e8b894 58%, #c48860);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.4),
    0 2px 3px rgba(0,0,0,.2);
}
.av-eye {
  background:
    radial-gradient(circle at 35% 32%, #fff 0 28%, #1a1a1a 30% 72%, #000 73%);
  box-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.look-scholar .av-acc::after {
  height: 11%;
  top: 40%;
  border: 1.5px solid #1a1a1a;
  background: rgba(255,255,255,.12);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255,255,255,.25);
}
.look-crown .av-hat {
  filter: drop-shadow(0 1px 0 #fff6d0) drop-shadow(0 2px 2px rgba(0,0,0,.35));
}
.speech-bubble {
  background: linear-gradient(180deg, #fffdf8, #f4ead0);
  border: 1px solid rgba(201, 162, 39, .55);
  border-radius: 14px 14px 14px 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,.26), inset 0 1px 0 #fff;
  color: #1a1410;
}
.speech-bubble::after { border-inline-end-color: #f4ead0; }
html[dir="rtl"] .speech-bubble::after { border-inline-start-color: #f4ead0; }

/* Wheel: deeper rim, ivory letter plaques */
.wheel-stage { filter: drop-shadow(0 18px 22px rgba(0,0,0,.4)); }
.wheel-rotor {
  box-shadow:
    0 0 0 6px #2a1a0c,
    0 0 0 8px rgba(232, 200, 120, .7),
    0 0 0 14px #1a0e08,
    0 0 0 16px rgba(232, 200, 120, .35),
    0 18px 32px rgba(0,0,0,.45),
    inset 0 0 28px rgba(0,0,0,.28);
}
.wheel-pointer {
  border-top-color: #f0d78c;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.45));
}
.wheel-letter {
  background:
    linear-gradient(180deg, #1c2a22, #0c1612);
  border: 1px solid rgba(232, 200, 120, .5);
  border-bottom-width: 3px;
  border-bottom-color: #c9a44a;
  border-radius: 6px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.45), 0 2px 0 rgba(232,200,120,.2);
  color: #f0d78c;
  min-width: 1.85rem;
  min-height: 2.3rem;
}

/* Puzzle desk: tactile keys and pads */
.sudoku-pad {
  width: 100%;
  max-width: min(28rem, 100%);
  grid-template-columns: repeat(5, minmax(2.35rem, 1fr));
  gap: .35rem;
}
.su-key {
  min-width: 2.35rem;
  min-height: var(--tap);
  border-radius: 10px;
  box-shadow:
    0 1px 0 #fff,
    0 3px 0 #b8a078,
    0 6px 10px rgba(0,0,0,.25);
}
.su-key:active { transform: translateY(1px); }
.sudoku-board,
.crossword-grid,
.fifteen-board,
.g2048-board {
  box-shadow:
    0 0 0 10px #5a3a1e,
    0 0 0 12px rgba(201, 162, 39, .55),
    0 22px 40px rgba(0,0,0,.42),
    inset 0 1px 0 #fff,
    inset 0 0 18px rgba(90, 60, 20, .12);
}

/* Spider: 10 columns must fit a 390px phone without clipping */
.sp-row {
  display: flex;
  gap: .2rem;
  width: 100%;
  max-width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: .2rem;
}
.sp-col {
  flex: 1 1 0;
  min-width: 0;
}
.sp-col .playing-card {
  width: 100%;
  max-width: 3.2rem;
  height: auto;
  aspect-ratio: 2.5 / 3.55;
}
@media (max-width: 430px) {
  .sp-row { gap: .1rem; }
  .sp-col .playing-card { max-width: none; }
  .sudoku-board { width: min(88vw, 21rem); }
  .sudoku-pad {
    grid-template-columns: repeat(6, minmax(2.1rem, 1fr));
    gap: .28rem;
    margin-top: .45rem;
  }
  .su-key { min-width: 2.1rem; min-height: 2.45rem; }
}

/* Deal / flip / win celebration */
[data-gfx="high"] .playing-card.deal-in {
  animation: dealInAtelier .55s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes dealInAtelier {
  from {
    opacity: 0;
    transform: translateY(-28px) rotate(-8deg) scale(.86);
  }
  to { opacity: 1; transform: none; }
}
[data-gfx="high"] .playing-card.flip-in {
  animation: cardFlipIn .5s ease both;
}
@keyframes cardFlipIn {
  from { transform: rotateY(90deg); }
  to { transform: none; }
}
.table-win {
  animation: tableWinPulse 1.4s ease;
}
@keyframes tableWinPulse {
  0%, 100% { filter: none; }
  30% { filter: drop-shadow(0 0 22px rgba(232, 200, 120, .55)); }
}

/* Economy / reduced motion stay light */
[data-gfx="low"] .modal-overlay {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(0,0,0,.7);
}
[data-gfx="low"] body.in-game .game-mount.felt-table {
  background-image: none;
  background: linear-gradient(180deg, var(--felt), var(--felt-dark));
  border: 12px solid #4a2c16;
}
[data-gfx="low"] .playing-card.deal-in,
[data-gfx="low"] .playing-card.flip-in,
[data-gfx="low"] .table-win { animation: none !important; }
[data-gfx="low"] .wheel-stage { filter: none; }
[data-gfx="low"] .bot-avatar { box-shadow: 0 2px 0 rgba(0,0,0,.3); }
@media (prefers-reduced-motion: reduce) {
  .playing-card.deal-in, .playing-card.flip-in, .table-win { animation: none !important; }
}


/* ---- v9: reliable touch selection, styles, highlights ---- */
.playing-card, .sq, .nardy-pt, .domino-tile, .kl-col, .sp-col, .found-pile, .stock-pile, .card-fan {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.durak-hand, .card-fan {
  flex-wrap: nowrap !important;
  overflow: visible;
}
.playing-card.selected,
.domino-tile.selected {
  box-shadow:
    0 0 0 3px #f0d78c,
    0 0 18px rgba(232, 200, 120, .7),
    0 14px 22px rgba(0, 0, 0, .42) !important;
  z-index: 12 !important;
  filter: brightness(1.06);
}
.playing-card.legal:not(.selected) {
  box-shadow: 0 0 0 2px rgba(232, 200, 120, .6), 0 8px 14px rgba(0, 0, 0, .28);
}
.playing-card.playable:not(.legal):not(.selected) { opacity: .92; }
.drop-target {
  box-shadow: 0 0 0 3px rgba(232, 200, 120, .75), inset 0 0 14px rgba(232, 200, 120, .18);
  border-radius: 8px;
}
.sq.sel, .nardy-pt.sel {
  outline: 3px solid #f0d78c;
  outline-offset: -3px;
  box-shadow: inset 0 0 0 3px #f0d78c, 0 0 16px rgba(232, 200, 120, .55);
  z-index: 2;
}
.sq.dest, .nardy-pt.dest {
  box-shadow: inset 0 0 0 3px rgba(232, 200, 120, .85);
  background-image: radial-gradient(circle at 50% 50%, rgba(232, 200, 120, .62) 0 26%, transparent 30%);
}
.sq.sel .piece, .nardy-pt.sel .checker, .nardy-pt.sel .chip {
  filter: drop-shadow(0 0 6px #f0d78c);
}
.sq.cap {
  box-shadow: inset 0 0 0 3px #c45a4a;
  background-image: radial-gradient(circle at 50% 50%, rgba(196, 90, 74, .5) 0 26%, transparent 30%);
}
.sq, .nardy-pt { min-height: 2.2rem; }

/* Hover lift only on fine pointers — sticky :hover on phones used to shift the fan mid-tap. */
@media (hover: none), (pointer: coarse) {
  .playing-card.playable:hover:not(.selected),
  [data-gfx="high"] .playing-card.playable:hover:not(.selected),
  [data-gfx="high"] .durak-hand .playing-card.playable:hover:not(.selected),
  .domino-tile.playable:hover:not(.selected) {
    transform: none !important;
    margin-inline-end: inherit;
    margin-inline-start: inherit;
  }
  [data-gfx="high"] .durak-hand,
  [data-gfx="high"] .kl-col,
  [data-gfx="high"] .sp-col,
  [data-gfx="high"] .card-stack { perspective: none; }
  [data-gfx="high"] .playing-card:not(.selected) { transform: none !important; }
}

/* Card faces */
.playing-card[data-face="large"] .corner .rk {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -.04em;
}
.playing-card[data-face="large"] .corner .sy { font-size: 1.02rem; }
.playing-card[data-face="large"] .corner.tl { transform: scale(1.12); transform-origin: top left; }
.playing-card[data-face="large"] .corner.br { transform: scale(1.12) rotate(180deg); transform-origin: bottom right; }
.playing-card[data-face="fourcolor"].suit-c { color: #0a7a3a; }
.playing-card[data-face="fourcolor"].suit-d { color: #d06000; }
.playing-card[data-face="fourcolor"].suit-s { color: #152033; }
.playing-card[data-face="fourcolor"].suit-h { color: #9b1c1c; }

/* Extra always-unlocked backs */
[data-card-back="ink"] .back-pattern {
  background-image:
    radial-gradient(circle at 50% 50%, rgba(232, 212, 139, .18) 0 18%, transparent 19%),
    repeating-linear-gradient(30deg, rgba(200, 220, 255, .12) 0 5px, transparent 5px 12px);
  background-color: #0c1424;
  border-color: rgba(160, 190, 230, .45);
}
[data-card-back="ivory"] .back-pattern {
  background-image:
    repeating-linear-gradient(135deg, rgba(120, 80, 30, .12) 0 8px, transparent 8px 16px);
  background-color: #efe4c8;
  border-color: rgba(120, 80, 30, .45);
}

/* Board themes */
[data-board-style="walnut"] .chess-board,
[data-board-style="walnut"] .checkers-board { --board-light: #e8d5a8; --board-dark: #7a4a28; }
[data-board-style="walnut"] .sq.light { background: #e8d5a8; }
[data-board-style="walnut"] .sq.dark { background: #7a4a28; }
[data-board-style="marble"] .chess-board,
[data-board-style="marble"] .checkers-board {
  border-color: #6a6a70;
}
[data-board-style="marble"] .sq.light { background: linear-gradient(135deg, #f4f0ea, #ddd8d0); }
[data-board-style="marble"] .sq.dark { background: linear-gradient(135deg, #8a8a92, #5a5a62); }
[data-board-style="emerald"] .chess-board,
[data-board-style="emerald"] .checkers-board { border-color: #0a3226; }
[data-board-style="emerald"] .sq.light { background: #d8ead0; }
[data-board-style="emerald"] .sq.dark { background: #1a5a40; }
[data-board-style="marble"] .nardy-board { filter: saturate(.6) contrast(1.05); }
[data-board-style="emerald"] .nardy-board { filter: hue-rotate(18deg) saturate(1.15); }

/* Settings style picker */
.style-picker { margin: .6rem 0 1rem; }
.style-preview {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: flex-end;
  padding: .85rem;
  margin: .35rem 0 .7rem;
  background: linear-gradient(180deg, rgba(10, 40, 30, .65), rgba(6, 22, 16, .85));
  border: 1px solid rgba(232, 200, 120, .28);
  border-radius: 12px;
  min-height: 7.2rem;
}
.style-preview-pieces.mini-board {
  display: flex;
  width: auto;
  aspect-ratio: auto;
  border-width: 6px;
  gap: 0;
  margin-inline-start: auto;
}
.style-preview-pieces.mini-board .sq {
  width: 2.15rem;
  height: 2.15rem;
  min-height: 0;
}
.style-choices { flex-wrap: wrap; gap: .35rem; }
.style-swatch {
  min-width: 6.4rem;
}
.style-swatch.face.large, .style-swatch.face.fourcolor, .style-swatch.face.classic { font-weight: 650; }
.style-swatch.board.walnut { background: linear-gradient(135deg, #e8d5a8, #7a4a28); color: #1a1006; }
.style-swatch.board.marble { background: linear-gradient(135deg, #f4f0ea, #5a5a62); color: #111; }
.style-swatch.board.emerald { background: linear-gradient(135deg, #d8ead0, #1a5a40); color: #07140e; }

/* ---- 3.3.1 Brickline developer plate + strip (gold/dark, logical properties for RTL) ---- */
.dev-promo { position: relative; overflow: hidden; border-color: rgba(232,212,139,.5);
  box-shadow: 0 12px 28px rgba(0,0,0,.35), 0 0 0 1px rgba(232,212,139,.12), inset 0 1px 0 rgba(255,255,255,.1); }
.dev-promo::before { content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 3px;
  background: linear-gradient(90deg, transparent, #e8d48b 25%, #c9a24a 50%, #e8d48b 75%, transparent); }
.dev-promo-logo { width: 3rem; height: 3rem; border: 1px solid rgba(232,212,139,.45); box-shadow: 0 0 14px rgba(232,212,139,.2); }
.dev-promo-made { margin: 0 0 .2rem; font-weight: 800; font-size: 1.05rem; color: #f6e7a8; letter-spacing: .01em; text-wrap: balance; }
.dev-promo-line { font-size: .88rem; opacity: .88; line-height: 1.35; }
.dev-promo-domain { margin: .25rem 0 0; font-size: .74rem; letter-spacing: .08em; color: #e8d48b; opacity: .8; direction: ltr; unicode-bidi: isolate; text-align: start; }
.dev-promo-cta { box-shadow: 0 6px 16px rgba(232,212,139,.25); }
.dev-strip { display: flex; align-items: center; justify-content: center; gap: .4rem; box-sizing: border-box;
  min-height: 22px; margin: 0 auto; padding: 2px .6rem; max-width: 100%;
  font-size: .72rem; line-height: 1.2; color: #e8d48b; text-decoration: none; letter-spacing: .02em;
  background: linear-gradient(90deg, rgba(8,8,10,0), rgba(27,42,65,.55) 20%, rgba(27,42,65,.55) 80%, rgba(8,8,10,0));
  border-block-end: 1px solid rgba(232,212,139,.18); }
.dev-strip:hover, .dev-strip:focus-visible { color: #f6e7a8; text-decoration: underline; }
.dev-strip-logo { width: 14px; height: 14px; border-radius: 3px; flex: 0 0 auto; }
.dev-strip-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dev-strip-arrow { font-size: .95rem; line-height: 1; }
[dir="rtl"] .dev-strip-arrow { transform: scaleX(-1); }
.modal-card .dev-strip { margin-top: .6rem; border-radius: 8px; border: 1px solid rgba(232,212,139,.2); min-height: 32px; }
@media (max-width: 420px) { .dev-promo-made { font-size: .98rem; } .dev-strip { font-size: .68rem; } }
/* 3.3.1 bottom placement: lobby/category plate sits last; game pages get a slim bottom strip */
.promo-slot { margin-block: 1.2rem 3.2rem; } /* room above the host deed.page badge */
.dev-strip-game { margin-top: 2px; padding-inline-end: 8.2rem; justify-content: flex-start; flex: 0 0 auto; border-block-end: 0; border-block-start: 1px solid rgba(232,212,139,.18); }
html.is-fullscreen .dev-strip-game, body.in-game.fs-active .dev-strip-game { display: none; }
@media (min-width: 900px) { .dev-strip-game { justify-content: center; padding-inline-end: .6rem; } }
