@font-face { font-family: Jura; src: url(fonts/jura-light.woff2) format('woff2'); font-weight: 300; }
@font-face { font-family: Jura; src: url(fonts/jura-regular.woff2) format('woff2'); font-weight: 400; }
@font-face { font-family: Jura; src: url(fonts/jura-semibold.woff2) format('woff2'); font-weight: 600; }
@font-face { font-family: Jura; src: url(fonts/jura-bold.woff2) format('woff2'); font-weight: 700; }

:root {
  --void: #05070d;
  --night: #0a1020;
  --glass: rgba(14, 22, 40, .72);
  --glass-hi: rgba(28, 42, 70, .55);
  --line: rgba(143, 196, 230, .18);
  --brass: #cfae6a;
  --brass-hi: #f1d79a;
  --brass-dim: #6f5a31;
  --holo: #8ee8ff;
  --ink: #e8eef7;
  --muted: #8b98ae;
  --main: #3fe0a5;
  --plus: #4aa3ff;
  --minus: #ff5168;
  --gold: #e9c46a;
  --ok: #5ef0b4;
  --bad: #ff6b7d;
  --circuit: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 100' preserveAspectRatio='none'><g fill='none' stroke='#fff' stroke-width='1' stroke-linejoin='round'><path d='M0 14 L8 14 L14 20 L14 30'/><path d='M0 30 L5 30 L10 35 L10 49 L7 52'/><path d='M0 62 L9 62 L14 57 L14 49'/><path d='M0 84 L6 84 L14 92'/><path d='M70 18 L63 18 L58 23 L58 35'/><path d='M70 44 L61 44 L61 54 L65 58'/><path d='M70 70 L64 70 L58 76 L58 84'/><path d='M70 88 L60 88 L56 84'/><path d='M22 0 L22 6 L26 10 L36 10'/><path d='M48 0 L48 5 L43 10 L37 10'/><path d='M18 100 L18 93 L24 87 L32 87'/><path d='M52 100 L52 94 L48 90 L48 84'/><path d='M4 4 L66 4 L66 96 L4 96 Z' stroke-width='.6' opacity='.7'/></g><g fill='#fff'><circle cx='14' cy='30' r='1.7'/><circle cx='7' cy='52' r='1.7'/><circle cx='14' cy='49' r='1.7'/><circle cx='14' cy='92' r='1.7'/><circle cx='58' cy='35' r='1.7'/><circle cx='65' cy='58' r='1.7'/><circle cx='58' cy='84' r='1.7'/><circle cx='56' cy='84' r='1.7'/><circle cx='36' cy='10' r='1.7'/><circle cx='37' cy='10' r='1.7'/><circle cx='32' cy='87' r='1.7'/><circle cx='48' cy='84' r='1.7'/></g></svg>");
  --font: Jura, "Roboto", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--void); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; overflow: hidden; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--holo); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- фон бара ---------- */
.bar-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(40% 26% at 12% 8%, rgba(255, 170, 80, .16), transparent 70%),
    radial-gradient(46% 30% at 92% 18%, rgba(70, 200, 255, .13), transparent 70%),
    radial-gradient(60% 40% at 50% 110%, rgba(160, 90, 255, .12), transparent 70%),
    linear-gradient(180deg, #0a1222 0%, #060a14 55%, #04060c 100%);
}
.bar-bg::before { content: ""; position: absolute; inset: -10%; opacity: .5;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 196, 120, .22) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 22%, rgba(140, 230, 255, .2) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 60%, rgba(255, 140, 200, .16) 0 2px, transparent 3px),
    radial-gradient(circle at 34% 74%, rgba(140, 255, 200, .14) 0 2px, transparent 3px);
  background-size: 170px 190px, 230px 210px, 260px 240px, 200px 260px;
  filter: blur(2.5px);
}

.screen { position: fixed; inset: 0; z-index: 1; display: none; flex-direction: column; }
.screen.on { display: flex; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 24px; }

/* ---------- кнопки ---------- */
.btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 50px; padding: 10px 18px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(36, 52, 84, .7), rgba(14, 22, 40, .8));
  box-shadow: inset 0 0 0 1px rgba(143, 196, 230, .22), inset 0 1px 0 rgba(255, 255, 255, .08), 0 6px 16px rgba(0, 0, 0, .35);
  font-weight: 600; font-size: 17px; letter-spacing: .02em; transition: transform .1s ease, filter .15s ease;
}
.btn small { font-weight: 400; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.btn:active { transform: scale(.98); filter: brightness(1.2); }
.btn:disabled { opacity: .38; filter: grayscale(.5); }
.btn.primary { color: #1b1305;
  background: linear-gradient(180deg, #f3dca2 0%, #cfae6a 52%, #a8853f 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 200, .6), inset 0 -2px 0 rgba(90, 60, 10, .35), 0 0 22px rgba(207, 174, 106, .25), 0 6px 16px rgba(0, 0, 0, .4);
}
.btn.primary small { color: rgba(40, 26, 4, .75); }
.btn.danger { color: #ffd3d9; box-shadow: inset 0 0 0 1px rgba(255, 81, 104, .55), 0 6px 16px rgba(0, 0, 0, .35); }
.btn.wide { width: 100%; }
.icon-btn { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; font-size: 24px; line-height: 1;
  background: rgba(14, 22, 40, .7); box-shadow: inset 0 0 0 1px var(--line); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { filter: brightness(1.3); }

.topbar { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; padding: max(env(safe-area-inset-top), 12px) 14px 10px; }
.topbar h2 { font-size: 21px; flex: 1; }
.purse-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(207, 174, 106, .1); box-shadow: inset 0 0 0 1px rgba(207, 174, 106, .4); color: var(--brass-hi); font-weight: 600; font-size: 15px; white-space: nowrap; }
.purse-chip .cr { width: 14px; height: 14px; }

/* ---------- карты: прозрачные нано-планшеты ---------- */
.card {
  --c: var(--main); --c2: var(--c); --rgb: 63, 224, 165; --rgb2: var(--rgb);
  position: relative; flex: none; width: var(--cw, 56px); height: calc(var(--cw, 56px) * 1.38);
  border-radius: calc(var(--cw, 56px) * .12);
  display: grid; place-items: center; overflow: hidden; isolation: isolate;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .03) 38%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, .06) 100%),
    radial-gradient(90% 70% at 50% 50%, rgba(var(--rgb), 0.26), rgba(var(--rgb2), 0.06) 75%),
    rgba(8, 14, 26, .62);
  box-shadow:
    inset 0 0 0 1px rgba(var(--rgb), 0.7),
    inset 0 0 calc(var(--cw, 56px) * .22) rgba(var(--rgb), 0.3),
    0 0 calc(var(--cw, 56px) * .2) rgba(var(--rgb), 0.22),
    0 4px 10px rgba(0, 0, 0, .45);
}
.card .tr { position: absolute; inset: 0; z-index: -1; opacity: .42;
  background: linear-gradient(115deg, var(--c) 0 38%, #fff 47%, var(--c2) 56% 100%) 0 0 / 260% 260%;
  -webkit-mask: var(--circuit) center / 100% 100% no-repeat; mask: var(--circuit) center / 100% 100% no-repeat;
}
.card::before { /* контакты чипа */
  content: ""; position: absolute; left: 32%; right: 32%; top: 6%; height: 5.5%; border-radius: 2px; opacity: .85;
  background: repeating-linear-gradient(90deg, var(--brass) 0 2px, transparent 2px 4px);
}
.card .v { position: relative; font-weight: 600; font-size: calc(var(--cw, 56px) * .42); line-height: 1; letter-spacing: -.02em; color: #fff;
  text-shadow: 0 0 6px rgba(var(--rgb), 0.9), 0 0 14px rgba(var(--rgb), 0.7); }
.card .v.small { font-size: calc(var(--cw, 56px) * .32); }
.card .tag { position: absolute; right: 7%; bottom: 5%; font-size: calc(var(--cw, 56px) * .2); font-weight: 700; color: #fff; opacity: .75; }
.card.main { --c: var(--main); --rgb: 63, 224, 165; --rgb2: 63, 224, 165; }
.card.main.neg { --c: #9ff5d4; --rgb: 159, 245, 212; --rgb2: 159, 245, 212; }
.card.plus { --c: var(--plus); --rgb: 74, 163, 255; --rgb2: 74, 163, 255; }
.card.minus { --c: var(--minus); --rgb: 255, 81, 104; --rgb2: 255, 81, 104; }
.card.flip { --c: var(--plus); --c2: var(--minus); --rgb: 74, 163, 255; --rgb2: 255, 81, 104;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .03) 38%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, .06) 100%),
    linear-gradient(180deg, rgba(74, 163, 255, .28) 0 50%, rgba(255, 81, 104, .28) 50% 100%),
    rgba(8, 14, 26, .62);
  box-shadow: inset 0 0 0 1px rgba(170, 150, 255, .7), inset 0 0 12px rgba(150, 120, 255, .3), 0 0 10px rgba(150, 120, 255, .2), 0 4px 10px rgba(0, 0, 0, .45); }
.card.flip .v { text-shadow: 0 -2px 8px rgba(74, 163, 255, .9), 0 3px 8px rgba(255, 81, 104, .9); }
.card.gold { --c: var(--gold); --rgb: 233, 196, 106; --rgb2: 233, 196, 106; }
.card.back { --c: #b79558; --rgb: 183, 149, 88; --rgb2: 183, 149, 88;
  background:
    repeating-linear-gradient(60deg, rgba(207, 174, 106, .09) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-60deg, rgba(207, 174, 106, .09) 0 1px, transparent 1px 7px),
    linear-gradient(160deg, rgba(40, 32, 16, .7), rgba(8, 10, 18, .9));
}
.card.back::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34%; height: 24%; transform: translate(-50%, -30%);
  border: 1.5px solid rgba(241, 215, 154, .75); border-radius: 3px; }
.card.back::before { top: auto; bottom: 50%; left: 41%; right: 41%; height: 14%; border-radius: 99px 99px 0 0; background: none; border: 1.5px solid rgba(241, 215, 154, .75); border-bottom: 0; }

.card.live .tr { animation: energy 5.5s linear infinite; animation-delay: var(--d, 0s); opacity: .55; }
.card.deal { animation: deal .38s cubic-bezier(.2, .8, .3, 1.1) both; }
.card.deal .tr { animation: energy 1.1s ease-out 1; opacity: .7; }
@keyframes energy { from { background-position: 100% 100%; } to { background-position: 0 0; } }
@keyframes deal { from { opacity: 0; transform: translateY(-14px) scale(.86) rotateX(30deg); filter: brightness(2.2) blur(2px); } to { opacity: 1; transform: none; filter: none; } }

.slot { flex: none; width: var(--cw, 56px); height: calc(var(--cw, 56px) * 1.38); border-radius: calc(var(--cw, 56px) * .12);
  box-shadow: inset 0 0 0 1px rgba(207, 174, 106, .13); background: rgba(255, 255, 255, .015); }

/* ---------- главное меню ---------- */
.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none; }
#s-menu { overflow-y: auto; background: var(--void); }
.menu-body { position: relative; z-index: 1; flex: 1 0 auto; padding: calc(var(--sill, 40vh) - 96px) 22px max(env(safe-area-inset-bottom), 16px);
  display: flex; flex-direction: column; gap: 14px; }
.brand { text-align: center; }
.hero-cards { position: relative; height: 104px; --cw: 64px; perspective: 600px; }
.hero-cards .card { position: absolute; left: 50%; top: 0; margin-left: -32px; }
.hero-cards .card:nth-child(1) { transform: translate(-64px, 14px) rotate(-13deg); }
.hero-cards .card:nth-child(2) { z-index: 1; animation: hover 6s ease-in-out infinite; }
.hero-cards .card:nth-child(3) { transform: translate(64px, 14px) rotate(13deg); }
@keyframes hover { 50% { transform: translateY(-5px); } }
.logo { margin-top: 20px; font-size: 46px; font-weight: 300; letter-spacing: .18em; line-height: 1; text-indent: .18em;
  background: linear-gradient(180deg, #fff7df 0%, #f1d79a 40%, #b38c45 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(207, 174, 106, .28)); }
.logo { font-size: min(44px, 11vw); letter-spacing: .14em; text-indent: .14em; }
.logo-pre { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 600; letter-spacing: .5em; text-indent: .5em; text-transform: none; }
.menu-list { display: grid; gap: 10px; }
.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.quiet { color: var(--muted); background: rgba(10, 14, 26, .55); }
.purse { display: flex; justify-content: center; }
.talk { min-height: 4.2em; margin: 10px auto 0; max-width: 34ch; color: #b9c3d3; font-size: 14px; line-height: 1.4; font-style: italic; text-align: center;
  transition: opacity .6s ease; padding: 0 4px; cursor: pointer; text-wrap: balance; }
.talk.fade { opacity: 0; }

/* ---------- выбор соперника ---------- */
.opp-list { display: grid; gap: 10px; }
.opp-row { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 10px 10px 14px; text-align: left;
  border-radius: 16px; overflow: hidden; background: linear-gradient(90deg, var(--glass) 45%, rgba(var(--acc-rgb), .13));
  box-shadow: inset 0 0 0 1px var(--line); transition: transform .1s ease; }
.opp-row:active { transform: scale(.985); }
.opp-row.flip { flex-direction: row-reverse; padding: 10px 14px 10px 10px; background: linear-gradient(270deg, var(--glass) 45%, rgba(var(--acc-rgb), .13)); }
.opp-row .av { flex: none; width: 78px; height: 78px; border-radius: 14px; overflow: hidden; background: #0a0e18;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 0 16px rgba(var(--acc-rgb), .35); }
.opp-row .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.opp-row .nm { display: flex; align-items: center; gap: 8px; }
.opp-row h3 { font-size: 16.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-row .doing { font-size: 13.5px; line-height: 1.35; color: #c4cede; font-style: italic; }
.opp-row .meta { display: flex; align-items: center; gap: 12px; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.opp-row .tag { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: rgb(var(--acc-rgb)); }
.opp-row .won { flex: none; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 600; color: #04140c; background: var(--ok); }
.opp-row .lock-note { color: var(--brass-hi); opacity: .8; }
.opp-row.boss { box-shadow: inset 0 0 0 1px rgba(207, 174, 106, .4), 0 0 22px rgba(207, 174, 106, .08); }
.opp-row.boss .av { width: 90px; height: 90px; }
.opp-row.locked .av img { filter: grayscale(.85) brightness(.4) blur(2px); transform: scale(1.08); }
.opp-row.locked .doing { color: #9aa6b8; }
.opp-row.guest { box-shadow: inset 0 0 0 1px rgba(var(--acc-rgb), .55), 0 0 24px rgba(var(--acc-rgb), .14); }
.opp-row.guest::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(var(--acc-rgb), .16) 50%, transparent 65%); background-size: 260% 100%; animation: guest 5.5s ease-in-out infinite; }
@keyframes guest { 0% { background-position: 120% 0; } 60%, 100% { background-position: -40% 0; } }
.pimg { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.diff.wild i { animation: wild 2.6s steps(1) infinite; }
.diff.wild i:nth-child(2) { animation-delay: -.7s; } .diff.wild i:nth-child(3) { animation-delay: -1.5s; }
.diff.wild i:nth-child(4) { animation-delay: -1.1s; } .diff.wild i:nth-child(5) { animation-delay: -2.1s; }
@keyframes wild { 0%, 45% { background: var(--brass-hi); box-shadow: 0 0 6px rgba(241, 215, 154, .6); } 46%, 100% { background: rgba(207, 174, 106, .22); box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .opp-row.guest::after, .diff.wild i { animation: none; } }
.diff { display: inline-flex; gap: 3px; }
.diff i { width: 7px; height: 7px; transform: rotate(45deg); background: rgba(207, 174, 106, .22); }
.diff i.on { background: var(--brass-hi); box-shadow: 0 0 6px rgba(241, 215, 154, .6); }
.hint { color: var(--muted); font-size: 14px; margin: 2px 0 14px; }
.loan:not(:empty) { margin-bottom: 14px; padding: 12px 14px 14px; border-radius: 16px; background: rgba(255, 157, 60, .08); box-shadow: inset 0 0 0 1px rgba(255, 157, 60, .3); }
.loan .hint { margin: 0 0 10px; }

/* ---------- досье ---------- */
.dossier .ph { width: 150px; height: 150px; margin: 2px auto 14px; border-radius: 22px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 0 30px var(--glow, rgba(207, 174, 106, .3)); }
.wild-note { margin: -4px 0 12px; font-size: 13.5px; color: var(--brass-hi); }
.guest-note { margin: 12px 0 2px; font-size: 14.5px; color: #9fe8ff; }
.dossier h2 { font-size: 24px; }
.dossier .sub { color: var(--muted); font-size: 14.5px; margin: 2px 0 10px; }
.dossier .story { font-size: 15px; line-height: 1.55; color: #cdd6e3; text-align: left; }
.dossier .facts .diff { margin-left: 6px; }
.dossier .facts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0 10px; font-size: 14px; color: var(--muted); }
.dossier .facts b { color: var(--ink); font-weight: 600; }
.mini-deck { display: flex; flex-wrap: wrap; gap: 5px; --cw: min(30px, calc((min(100vw, 420px) - 136px) / 10)); margin-bottom: 4px; }
.mini-deck .card .v { font-size: calc(var(--cw) * .38); }
.mini-deck .card::before { display: none; }

/* ---------- колода ---------- */
.deck-count { font-weight: 600; color: var(--ok); font-size: 15px; }
.deck-count.short { color: var(--bad); }
.deck-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; justify-items: center; --cw: min(15vw, 60px); }
.deck-slots button { padding: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.chip { padding: 8px 14px; border-radius: 999px; background: rgba(28, 42, 70, .55); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.chip:active { filter: brightness(1.3); }
.coll-group h3 { font-size: 15px; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }
.coll-row { display: flex; flex-wrap: wrap; gap: 8px; --cw: min(13.5vw, 54px); }
.coll-row button { position: relative; padding: 0; }
.coll-row .count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--brass); color: #1b1305; font-size: 12px; font-weight: 700; display: grid; place-items: center; z-index: 2; }
.legend { display: grid; gap: 10px; margin-top: 20px; --cw: 34px; }
.legend > div { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #c3cddb; }
.legend .card::before { display: none; }
.bottombar { padding: 10px 16px max(env(safe-area-inset-bottom), 12px); background: linear-gradient(180deg, transparent, rgba(5, 7, 13, .95) 30%); }

/* ---------- правила и настройки ---------- */
.prose h3 { font-size: 18px; color: var(--brass-hi); margin: 20px 0 6px; }
.prose p, .prose li { color: #cdd6e3; font-size: 15px; }
.prose ul { padding-left: 20px; margin: 6px 0; }
.prose li { margin: 4px 0; }
.prose .lore { font-style: normal; color: var(--muted); border-left: 2px solid var(--brass-dim); padding-left: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row .lbl { font-size: 16px; }
.set-row .lbl small { display: block; color: var(--muted); font-size: 13px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(14, 22, 40, .8); box-shadow: inset 0 0 0 1px var(--line); flex: none; }
.seg button { padding: 7px 11px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--brass); color: #1b1305; font-weight: 600; }

/* ---------- игровой стол ---------- */
#s-game { --cw: min(calc((100vw - 86px) / 5), calc((100vh - 320px) / 7.1), 72px); --hw: calc(var(--cw) * 1.14);
  padding: max(env(safe-area-inset-top), 8px) 10px max(env(safe-area-inset-bottom), 10px); gap: 8px; }
.opp-bar { position: relative; z-index: 4; display: flex; align-items: center; gap: 10px; min-height: 64px; }
.opp-bar .portrait { width: 62px; height: 62px; border-radius: 14px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 0 18px var(--glow, rgba(207, 174, 106, .3)); }
.portrait svg, .portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.opp-meta { flex: 1; min-width: 0; }
.opp-name { font-weight: 600; font-size: 18px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-sub { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.pips { display: inline-flex; gap: 6px; }
.pips i { width: 10px; height: 10px; transform: rotate(45deg); box-shadow: inset 0 0 0 1.5px var(--brass-dim); }
.pips i.on { background: var(--brass-hi); box-shadow: 0 0 8px rgba(241, 215, 154, .7); }
.opp-hand { display: flex; gap: 4px; --cw: 19px; }
.opp-hand .card::before, .opp-hand .card::after { display: none; }
.opp-hand .card.gone { opacity: .14; }
.bubble { position: absolute; z-index: 6; left: 54px; top: 64px; max-width: calc(100% - 64px); padding: 10px 13px; border-radius: 4px 14px 14px 14px;
  background: rgba(10, 18, 34, .94); box-shadow: inset 0 0 0 1px rgba(var(--glow-rgb, 142, 232, 255), 0.6), 0 0 20px rgba(var(--glow-rgb, 142, 232, 255), 0.2), 0 8px 20px rgba(0, 0, 0, .5);
  font-size: 14.5px; line-height: 1.4; opacity: 0; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.bubble.show { opacity: 1; transform: none; }

.table { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 8px; border-radius: 28px; isolation: isolate;
  background: radial-gradient(120% 90% at 50% 40%, #121a2a 0%, #070a12 62%, #030408 100%);
  box-shadow: inset 0 0 0 1px rgba(207, 174, 106, .28), inset 0 0 0 5px rgba(0, 0, 0, .5), inset 0 0 0 6px rgba(207, 174, 106, .12), inset 0 0 60px rgba(0, 0, 0, .8), 0 18px 40px rgba(0, 0, 0, .6); }
.table .veins { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; border-radius: inherit; opacity: .9; }
.board { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 8px; border-radius: 16px; transition: background .3s ease, box-shadow .3s ease; }
.board.active { background: radial-gradient(80% 90% at 50% 50%, rgba(142, 232, 255, .07), transparent 80%); box-shadow: inset 0 0 0 1px rgba(142, 232, 255, .2); }
.board-head { display: flex; align-items: center; gap: 8px; min-height: 24px; padding: 0 4px; }
.board-head .who { font-size: 14px; color: var(--muted); }
.stood-tag { display: none; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; color: #1b1305; background: var(--brass); }
.board.stood .stood-tag { display: inline-block; }
.total { margin-left: auto; min-width: 54px; padding: 1px 10px; border-radius: 10px; text-align: center; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--holo); background: rgba(142, 232, 255, .06); box-shadow: inset 0 0 0 1px rgba(142, 232, 255, .25); text-shadow: 0 0 10px rgba(142, 232, 255, .7); }
.total.over { color: var(--bad); box-shadow: inset 0 0 0 1px rgba(255, 81, 104, .55); text-shadow: 0 0 10px rgba(255, 81, 104, .8); }
.total.twenty { color: var(--brass-hi); box-shadow: inset 0 0 0 1px rgba(241, 215, 154, .6); text-shadow: 0 0 12px rgba(241, 215, 154, .9); }
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: calc(var(--cw) * 5 + 24px); margin: 0 auto; }
#board-opp .slots { flex-wrap: wrap-reverse; }
.midline { display: flex; align-items: center; gap: 10px; min-height: 26px; padding: 0 8px; }
.midline::before, .midline::after { content: ""; height: 1px; flex: 0 0 18px; background: linear-gradient(90deg, transparent, rgba(207, 174, 106, .5)); }
.midline::after { background: linear-gradient(90deg, rgba(207, 174, 106, .5), transparent); }
.set-no { font-weight: 600; color: var(--brass-hi); font-size: 14px; white-space: nowrap; }
.status { flex: 1; font-size: 14px; color: var(--muted); text-align: center; }
.status.warn { color: var(--bad); font-weight: 600; }
.status.mine { color: var(--ink); }

.hand { display: flex; justify-content: center; gap: 10px; padding: 2px 0; min-height: calc(var(--hw) * 1.38 + 6px); --cw: var(--hw); }
.hand button { padding: 0; transition: transform .12s ease; }
.hand button:active { transform: translateY(-5px); }
.hand button:disabled { opacity: .42; filter: saturate(.5); }
.hand .empty { color: var(--muted); font-size: 14px; align-self: center; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.result { position: absolute; z-index: 5; left: 10px; right: 10px; bottom: max(env(safe-area-inset-bottom), 10px); padding: 16px 16px 14px; border-radius: 18px; text-align: center;
  background: rgba(8, 13, 24, .95); box-shadow: inset 0 0 0 1px rgba(207, 174, 106, .4), 0 -10px 40px rgba(0, 0, 0, .6); }
.result h2 { font-size: 24px; }
.result .reason { color: var(--muted); font-size: 14.5px; margin: 4px 0 6px; }
.result .score { font-size: 30px; font-weight: 600; letter-spacing: .1em; margin-bottom: 10px; }
.result .score small { display: block; font-size: 12.5px; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.win { color: var(--ok); }
.lose { color: var(--bad); }

/* ---------- всплывающие окна ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(2, 4, 9, .66); display: flex; align-items: flex-end; justify-content: center; }
.sheet-panel { width: 100%; max-width: 560px; padding: 18px 16px max(env(safe-area-inset-bottom), 16px); border-radius: 22px 22px 0 0; display: grid; gap: 10px;
  background: rgba(10, 16, 30, .97); box-shadow: inset 0 1px 0 rgba(207, 174, 106, .45), 0 -20px 50px rgba(0, 0, 0, .6); animation: up .22s ease-out; }
.sheet-head { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; --cw: 52px; }
.sheet-head h3 { font-size: 19px; }
.sheet-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.res { font-size: 13px; }
.res.bad { color: var(--bad); }
.res.gold { color: var(--brass-hi); }
.btn.primary .res.gold { color: #3a2706; }
.modal-wrap { align-items: center; padding: 18px; }
.modal { width: 100%; max-width: 420px; max-height: calc(100vh - 36px); overflow-y: auto; padding: 18px; border-radius: 22px; text-align: center;
  background: rgba(10, 16, 30, .97); box-shadow: inset 0 0 0 1px rgba(207, 174, 106, .38), 0 20px 60px rgba(0, 0, 0, .7); animation: pop .22s ease-out; }
.modal > .portrait { width: 112px; height: 112px; margin: 2px auto 12px; border-radius: 22px; overflow: hidden; box-shadow: 0 0 26px var(--glow, rgba(207, 174, 106, .3)); }
.modal h2 { font-size: 26px; }
.modal .sub { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.modal .quote { margin: 14px 0 4px; font-size: 15.5px; color: #dbe3ee; }
.modal .reason { color: var(--muted); margin-top: 6px; }
.modal .score.wage { color: var(--ok); font-size: 30px; }
.modal .quote .who { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.modal .score { font-size: 34px; font-weight: 600; letter-spacing: .1em; margin: 6px 0; }
.modal .money { font-size: 16px; font-weight: 600; margin-top: 4px; }
.modal .btns { display: grid; gap: 10px; margin-top: 16px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }

.toast { position: fixed; z-index: 40; left: 50%; bottom: max(calc(env(safe-area-inset-bottom) + 90px), 100px); transform: translate(-50%, 10px); max-width: calc(100% - 40px);
  padding: 10px 16px; border-radius: 12px; background: rgba(14, 22, 40, .97); box-shadow: inset 0 0 0 1px rgba(207, 174, 106, .4); font-size: 14.5px; text-align: center; opacity: 0; transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-height: 640px) {
  .hero-cards { height: 88px; --cw: 54px; }
  .hero-cards .card { margin-left: -27px; }
  .logo { font-size: min(36px, 10vw); }
  .opp-bar { min-height: 54px; }
  .opp-bar .portrait { width: 52px; height: 52px; }
  .bubble { top: 56px; }
  .actions .btn { font-size: 15px; min-height: 44px; padding: 8px 10px; }
}
@media (max-height: 720px) {
  .menu-body { gap: 10px; padding-top: calc(var(--sill, 34vh) - 92px); }
  .logo { margin-top: 14px; }
  .talk { min-height: 4.2em; font-size: 13px; margin-top: 6px; }
}
@media (min-width: 600px) {
  .scroll, .menu-body { max-width: 620px; margin-left: auto; margin-right: auto; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .card.live .tr, .hero-cards .card, .card.deal, .card.deal .tr { animation: none !important; }
}

/* ---------- Сетевая игра ---------- */
.web [data-action="exit"] { display: none; }
.web .menu-row:has([data-action="exit"]) { grid-template-columns: 1fr; }
html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
input { font: inherit; font-size: 16px; color: var(--ink); user-select: text; -webkit-user-select: text; }
.opp-row.net-row .av img { filter: saturate(1.2); }
.net-av { position: relative; }
.net-conn { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.net-conn::before { content: "●"; margin-right: 6px; }
.net-conn.on::before { color: var(--ok); } .net-conn.connecting::before { color: var(--brass-hi); } .net-conn.off::before { color: #ff6b6b; }
.net-block { margin: 0 0 18px; padding: 12px; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.label { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--brass-hi); letter-spacing: .02em; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.label-row .label { margin: 0; }
.small { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 14px; flex: none; }
.search-row { display: flex; gap: 8px; }
.search-row input, .auth-form input, .chat-input input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border: 0; border-radius: 12px; background: rgba(5, 8, 16, .85); box-shadow: inset 0 0 0 1px var(--line); outline: none; }
.search-row input:focus, .auth-form input:focus, .chat-input input:focus { box-shadow: inset 0 0 0 1.5px var(--brass); }
.net-player { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 2px; border-bottom: 1px solid rgba(143, 196, 230, .1); text-align: left; }
.net-player:last-child { border-bottom: 0; }
.net-player .av { position: relative; flex: none; width: 46px; height: 46px; border-radius: 12px; overflow: visible; }
.net-player .av img { width: 46px; height: 46px; border-radius: 12px; display: block; }
.dot { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; box-shadow: 0 0 0 2.5px #0b1020; background: #59637a; }
.dot.lobby { background: var(--ok); box-shadow: 0 0 0 2.5px #0b1020, 0 0 8px rgba(94, 240, 180, .7); } .dot.online { background: var(--brass-hi); } .dot.busy { background: #ff9d3c; }
.net-player .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.net-player .txt b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-player .txt small { font-size: 12.5px; color: var(--muted); }
.badge { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #ff6b6b; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.me-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 46%; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(127, 200, 255, .08); box-shadow: inset 0 0 0 1px rgba(127, 200, 255, .35); font-weight: 600; font-size: 14px; }
.me-chip:empty { display: none; }
.me-chip img { width: 30px; height: 30px; border-radius: 50%; }
.me-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-tabs { display: flex; margin-bottom: 16px; width: 100%; }
.auth-tabs button { flex: 1; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.auth-form .btn { margin-top: 6px; }
.auth-err { color: #ff8a8a; font-size: 14px; margin: 4px 0 6px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.av-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 6px; }
.av-pick { aspect-ratio: 1; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); opacity: .75; transition: opacity .15s, box-shadow .15s, transform .1s; }
.av-pick img { width: 100%; height: 100%; display: block; }
.av-pick.on { opacity: 1; box-shadow: 0 0 0 2.5px var(--brass), 0 0 16px rgba(207, 174, 106, .45); }
.av-pick:active { transform: scale(.96); }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 4px; }
.codes code { padding: 10px 6px; border-radius: 10px; background: rgba(5, 8, 16, .85); box-shadow: inset 0 0 0 1px var(--line); font-family: ui-monospace, Menlo, monospace; font-size: 16px; letter-spacing: .08em; color: var(--brass-hi); user-select: text; -webkit-user-select: text; }
.net-modal-av { width: 84px !important; height: 84px !important; border-radius: 18px; margin: 0 auto 8px; display: block; box-shadow: 0 0 0 1px rgba(127, 200, 255, .35), 0 0 24px rgba(127, 200, 255, .25); }
.emote-btn { position: relative; font-size: 20px; }
.emo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px; }
.emo { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px; border-radius: 12px; background: rgba(14, 22, 40, .9); box-shadow: inset 0 0 0 1px var(--line); font-size: 14.5px; }
.emo:active { transform: scale(.97); }
.emo-ic { display: inline-flex; width: 28px; height: 28px; color: var(--brass-hi); flex: none; }
.emo-ic svg { width: 100%; height: 100%; }
.emo-ic.big { width: 40px; height: 40px; }
.bubble.emo-bubble { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.turn-timer { position: relative; display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-width: 88px; height: 22px; padding: 0 8px; border-radius: 11px; overflow: hidden; background: rgba(5, 8, 16, .7); box-shadow: inset 0 0 0 1px var(--line); }
.turn-timer i { position: absolute; inset: 0; transform-origin: left center; background: linear-gradient(90deg, rgba(143, 196, 230, .25), rgba(143, 196, 230, .45)); transition: transform .1s linear; }
.turn-timer.mine i { background: linear-gradient(90deg, rgba(207, 174, 106, .35), rgba(241, 215, 154, .6)); }
.turn-timer.low i { background: linear-gradient(90deg, rgba(255, 107, 107, .45), rgba(255, 140, 140, .7)); }
.turn-timer b { position: relative; font-size: 12.5px; margin-left: auto; }
.chat-input { display: flex; gap: 8px; align-items: center; }
.chat-input .btn { width: 52px; min-height: 46px; padding: 0; flex: none; font-size: 20px; }
.chat-log { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.msg { align-self: flex-start; max-width: 82%; padding: 9px 12px 7px; border-radius: 4px 14px 14px 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); user-select: text; -webkit-user-select: text; }
.msg.mine { align-self: flex-end; border-radius: 14px 4px 14px 14px; background: rgba(207, 174, 106, .14); box-shadow: inset 0 0 0 1px rgba(207, 174, 106, .35); }
.msg span { display: block; font-size: 15px; word-wrap: break-word; }
.msg small { display: block; text-align: right; font-size: 11px; color: var(--muted); }
