/* 0.45 · Load LAST (after v44.css). The old logo again (one gold «Б» tile + «АБАЙ»), no
   shadows under or behind the characters, the courtyard Бабай turns to where he walks,
   the dash recharges as a ring, a centred beer in the apartment inventory, the difficulty
   card of a new game and the result sheets of the club night and the apartment attempt. */

/* ---------- logo: the ≤0.43 look ---------- */
body.location-shell .brand {
  gap:6px;
  font-size:23px;
  font-weight:850;
  letter-spacing:4px;
  color:var(--m-ink);
}
body.location-shell .brandmark {
  width:42px;
  height:42px;
  border-radius:10px;
  transform:rotate(-5deg);
  border:1px solid #ffd27a66;
  background:
    radial-gradient(120% 90% at 30% 0,#ffd27a38,transparent 60%),
    linear-gradient(160deg,#33293d,#17121d);
  color:#ffe3a3;
  font:900 29px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
  letter-spacing:0;
  text-shadow:0 0 10px #ffc65a8c,0 1px 0 #0009;
  box-shadow:inset 0 1px #ffffff26,inset 0 -2px #0006,0 0 0 1px #0006,0 6px 18px #ffb34726;
}
body.location-shell .brandmark::before,
body.location-shell .brandmark::after { content:none; animation:none; }
body.location-shell .brand:hover .brandmark,
body.location-shell .brand:focus-visible .brandmark {
  transform:rotate(-5deg);
  box-shadow:inset 0 1px #ffffff26,inset 0 -2px #0006,0 0 0 1px #0006,0 6px 18px #ffb34740;
}
body.location-shell .brandword { display:block; line-height:1; }
body.location-shell .brandword b {
  display:block;
  font:850 23px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
  letter-spacing:4px;
  background:none;
  -webkit-background-clip:border-box;
  background-clip:border-box;
  color:var(--m-ink);
  filter:none;
}
body.location-shell .brandword small { display:none; }
body.location-shell .brand .version { margin-left:4px; letter-spacing:0; }
@media (max-width:660px) {
  body.location-shell .brand { gap:5px; letter-spacing:2px; }
  body.location-shell .brandmark { width:36px; height:36px; font-size:24px; }
  body.location-shell .brandword b { font-size:20px; letter-spacing:2px; }
  body.location-shell .brand .version { margin-left:2px; }
}
@media (max-width:360px) {
  body.location-shell .brandmark { width:32px; height:32px; font-size:21px; }
  body.location-shell .brandword b { font-size:18px; letter-spacing:1.5px; }
}
@media (max-height:500px) and (orientation:landscape) {
  body.location-shell .brandmark { width:32px; height:32px; font-size:21px; }
  body.location-shell .brandword b { font-size:18px; }
}

/* ---------- no shadows under or behind the characters ---------- */
.yard-shadow { display:none!important; }
.yard-actor img,
#babayTap img,
.intro-portrait img,
.casino-babay-stage img,
.casino-redesign #bj #dealerPortrait,
.kiosk-seller { filter:none; }
.tutorial-portrait img { filter:contrast(1.06); }
#modal .babay-dialog-portrait img { filter:contrast(1.08) saturate(.86); }
#shop .kiosk-seller-button:is(:hover,:focus-visible) .kiosk-seller { filter:drop-shadow(0 0 7px #f6d39866); }

/* ---------- courtyard: Бабай (drawn looking right) mirrors when he walks left ---------- */
.yard-actor.facing-left {
  transform:translate(-50%,-100%) scale(calc(var(--actor-scale,1) * -1),var(--actor-scale,1));
}
.yard-actor.facing-left .yard-name { transform:translateX(-50%) scaleX(-1); }

/* ---------- «Рывок»: a recharge ring instead of the seconds ---------- */
body.club-live #clubGame .combat-controls #dodge.is-cooling:disabled { opacity:.82; }
body.club-live #clubGame .combat-controls #dodge.is-cooling::before {
  width:18px;
  height:18px;
  border-radius:50%;
  background:conic-gradient(currentColor calc(var(--cd-fill,0) * 360deg),#ffffff2e 0);
  mask:radial-gradient(farthest-side,transparent calc(100% - 3.5px),#000 calc(100% - 3px));
}
body.touch-ui #clubGame .touch-actions > #dodge.is-cooling:disabled { opacity:.9; filter:saturate(.55) brightness(.78); }
body.touch-ui #clubGame .touch-actions > #dodge.is-cooling::after {
  content:"";
  position:absolute;
  inset:-6px;
  border-radius:50%;
  background:conic-gradient(#e6fbff calc(var(--cd-fill,0) * 360deg),#ffffff2b 0);
  mask:radial-gradient(farthest-side,transparent calc(100% - 4px),#000 calc(100% - 3.5px));
  pointer-events:none;
}

/* ---------- apartment inventory: the beer sits in the middle of its cell ---------- */
.alimony-slot-icon { position:relative; }
.alimony-slot-icon > img.alimony-slot-img {
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  margin:0;
  object-fit:contain;
  object-position:50% 50%;
}

/* ---------- new game: the difficulty card ---------- */
#modal.intro-dialog.difficulty-dialog {
  width:min(640px,calc(100vw - 24px));
  max-height:calc(100dvh - 24px);
  padding:0;
  overflow:auto;
  border:1px solid #ffd27a4d;
  border-radius:20px;
  background:
    radial-gradient(120% 60% at 50% -10%,#ff5fcf1c,transparent 60%),
    radial-gradient(80% 50% at 100% 0,#5fd8ff12,transparent 60%),
    linear-gradient(180deg,#221c2a,#121015);
  box-shadow:0 24px 90px #000c,inset 0 1px #ffffff14;
  color:var(--m-ink);
}
#modal.intro-dialog.difficulty-dialog::backdrop { background:#07050ac4; backdrop-filter:blur(12px) brightness(.5); }
#modal.intro-dialog.difficulty-dialog #modalContent { display:block; min-height:0; }
.difficulty-card { display:grid; gap:16px; padding:24px 26px 20px; }
.difficulty-head { display:flex; align-items:center; gap:14px; }
.difficulty-face {
  flex:none;
  width:62px;
  height:62px;
  border-radius:50%;
  object-fit:cover;
  object-position:50% 18%;
  border:2px solid #ffd27a80;
  background:radial-gradient(circle at 50% 35%,#ffb34745,#1f1a26 72%);
  box-shadow:0 0 0 3px #0006,0 6px 16px #0008;
}
.difficulty-head .eyebrow { color:var(--m-amber); letter-spacing:.16em; font-size:11px; font-weight:800; }
#modal .difficulty-head h2 { margin:3px 0 0; font-size:28px; line-height:1.12; letter-spacing:-.5px; color:#fff1dc; }
.difficulty-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
#modal .difficulty-option {
  --dc:#ffd27a;
  position:relative;
  display:grid;
  align-content:start;
  justify-items:start;
  gap:7px;
  min-width:0;
  min-height:122px;
  margin:0;
  padding:16px 14px 14px;
  border:1px solid var(--m-line-2);
  border-radius:16px;
  background:linear-gradient(180deg,#2a2433,#1b1722);
  color:var(--m-ink);
  text-align:left;
  box-shadow:0 4px 0 #0b090e,inset 0 1px #ffffff14;
  cursor:pointer;
  transition:border-color .15s ease,box-shadow .15s ease,transform .1s ease,background .15s ease;
}
#modal .difficulty-option[data-difficulty=easy] { --dc:#c8e874; }
#modal .difficulty-option[data-difficulty=hard] { --dc:#ff6b7a; }
#modal .difficulty-option:hover { border-color:color-mix(in srgb,var(--dc) 55%,transparent); background:linear-gradient(180deg,#2e2738,#1d1824); }
#modal .difficulty-option:active { transform:translateY(2px); box-shadow:0 2px 0 #0b090e,inset 0 1px #ffffff14; }
#modal .difficulty-option[aria-checked=true] {
  border-color:var(--dc);
  background:
    radial-gradient(130% 100% at 0 0,color-mix(in srgb,var(--dc) 24%,transparent),transparent 62%),
    linear-gradient(180deg,#2e2738,#1d1824);
  box-shadow:0 4px 0 #0b090e,0 0 0 1px var(--dc),0 0 24px color-mix(in srgb,var(--dc) 28%,transparent),inset 0 1px #ffffff1f;
}
#modal .difficulty-option:focus-visible { outline:2px solid #fff3c4; outline-offset:3px; }
.difficulty-pips { display:flex; gap:4px; }
.difficulty-pips i { width:18px; height:5px; border-radius:3px; background:#ffffff1f; }
.difficulty-pips i.on { background:var(--dc); box-shadow:0 0 7px color-mix(in srgb,var(--dc) 70%,transparent); }
#modal .difficulty-option b { font-size:19px; line-height:1.15; font-weight:850; }
#modal .difficulty-option small { font-size:12.5px; line-height:1.3; color:var(--m-muted); }
#modal .difficulty-option[aria-checked=true] b { color:#fff6e6; }
.difficulty-check {
  position:absolute;
  top:12px;
  right:12px;
  width:20px;
  height:20px;
  border-radius:50%;
  border:2px solid #ffffff2e;
}
#modal .difficulty-option[aria-checked=true] .difficulty-check {
  border-color:var(--dc);
  background:var(--dc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%231b1520' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round' d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
}
#modal .difficulty-note { margin:0; font-size:13px; line-height:1.45; color:var(--m-muted); }
.difficulty-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
#modal #difficultyNext { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:48px; padding:10px 28px; }
#modal #difficultyNext svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2.3; stroke-linecap:round; stroke-linejoin:round; }
#modal .difficulty-actions .tutorial-skip { margin:0; }
@media (max-width:560px) {
  .difficulty-card { gap:13px; padding:20px 16px 16px; }
  .difficulty-face { width:52px; height:52px; }
  #modal .difficulty-head h2 { font-size:24px; }
  .difficulty-options { grid-template-columns:1fr; gap:8px; }
  #modal .difficulty-option {
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;
    column-gap:12px;
    row-gap:2px;
    min-height:0;
    padding:12px 44px 12px 14px;
  }
  #modal .difficulty-option .difficulty-pips { grid-row:1 / 3; flex-direction:column-reverse; gap:3px; }
  .difficulty-pips i { width:18px; height:5px; }
  #modal .difficulty-option b { font-size:17px; }
  .difficulty-check { top:50%; margin-top:-10px; right:14px; }
  .difficulty-actions { flex-direction:column; align-items:stretch; gap:4px; }
  #modal #difficultyNext { width:100%; }
}
@media (max-height:500px) and (orientation:landscape) {
  .difficulty-card { gap:10px; padding:16px 20px 14px; }
  .difficulty-face { width:46px; height:46px; }
  #modal .difficulty-head h2 { font-size:22px; }
  #modal .difficulty-option { min-height:92px; padding:12px 12px 10px; gap:5px; }
  #modal #difficultyNext { min-height:44px; }
}

/* ---------- result sheets: the club night and the apartment attempt ---------- */
#modal.result-dialog {
  width:min(600px,calc(100vw - 24px));
  max-height:calc(100dvh - 24px);
  padding:0;
  overflow:auto;
  border:1px solid #ffd27a4d;
  border-radius:20px;
  background:
    radial-gradient(120% 55% at 50% -12%,#ff5fcf1f,transparent 60%),
    radial-gradient(70% 45% at 100% 0,#5fd8ff14,transparent 62%),
    linear-gradient(180deg,#221c2a,#121015);
  box-shadow:0 24px 90px #000c,inset 0 1px #ffffff14;
  color:var(--m-ink);
}
#modal.result-dialog::backdrop { background:#07050abf; backdrop-filter:blur(9px) brightness(.6); }
#modal.result-dialog #modalContent { display:block; min-height:0; }
#modal.result-dialog #closeModal { top:14px; right:14px; }
.result-sheet {
  --rim:linear-gradient(90deg,#ffb547,#45e0ff 50%,#ff4fd8);
  position:relative;
  display:grid;
  gap:14px;
  padding:24px 24px 22px;
}
.result-sheet.rs-alimony { --rim:linear-gradient(90deg,#ffd27a,#ff9a6b 50%,#ff6b7a); }
.result-sheet::before {
  content:"";
  position:absolute;
  left:22px;
  right:22px;
  top:0;
  height:3px;
  border-radius:0 0 3px 3px;
  background:var(--rim);
  box-shadow:0 0 14px #ff5fcf55;
}
.rs-head { display:flex; align-items:center; gap:14px; padding-right:46px; min-width:0; }
.rs-face {
  flex:none;
  width:56px;
  height:56px;
  border-radius:50%;
  overflow:hidden;
  border:2px solid #ffd27a80;
  background:radial-gradient(circle at 50% 35%,#ffb34745,#1f1a26 72%);
  box-shadow:0 0 0 3px #0006,0 6px 16px #0008;
}
.rs-face img { display:block; width:100%; height:100%; object-fit:cover; object-position:50% 18%; }
.rs-title { flex:1; min-width:0; text-align:left; }
#modal .rs-title .eyebrow { display:block; color:var(--m-amber); font-size:11px; font-weight:800; letter-spacing:.14em; }
#modal .rs-title h2 { margin:3px 0 0; font-size:27px; line-height:1.12; letter-spacing:-.5px; color:#fff1dc; }
#modal .rs-lead { margin:0; font-size:15px; line-height:1.5; color:#e6deef; }
.rs-hero { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); gap:10px; }
.rs-hero:has(> :only-child) { grid-template-columns:1fr; }
.rs-hero-cell {
  --tone:var(--m-ink);
  display:grid;
  align-content:start;
  gap:2px;
  min-width:0;
  padding:12px 14px 11px;
  border:1px solid var(--m-line-2);
  border-radius:14px;
  background:#ffffff08;
}
.rs-hero-cell.is-main {
  border-color:#ffd27a55;
  background:radial-gradient(130% 120% at 0 0,#ffd27a24,transparent 62%),#ffffff0a;
}
.rs-hero-cell span { font-size:11px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; color:var(--m-muted); }
.rs-hero-cell b { font-size:28px; line-height:1.12; font-weight:900; letter-spacing:-.5px; color:var(--tone); font-variant-numeric:tabular-nums; white-space:nowrap; }
.rs-hero-cell.is-main[data-tone=gold] b {
  font-size:32px;
  background:linear-gradient(180deg,#fff7d1,#ffd25c 55%,#ff9d2b);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  filter:drop-shadow(0 0 10px #ffba4059);
}
.rs-hero-cell small { font-size:12px; line-height:1.3; color:var(--m-dim); }
#modal .rs-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:0; padding:0; list-style:none; }
#modal .rs-stats li {
  --tone:var(--m-ink);
  display:grid;
  align-content:center;
  gap:2px;
  min-width:0;
  margin:0;
  padding:9px 6px 8px;
  border:1px solid var(--m-line);
  border-radius:12px;
  background:#ffffff06;
  text-align:center;
  line-height:1.2;
}
#modal .rs-stats b { font-size:19px; font-weight:850; color:var(--tone); font-variant-numeric:tabular-nums; }
#modal .rs-stats span { font-size:11px; color:var(--m-muted); }
.rs-table {
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  border:1px solid var(--m-line-2);
  border-radius:14px;
  background:#0000002e;
  overflow:hidden;
}
.rs-table caption {
  caption-side:top;
  padding:0 2px 7px;
  text-align:left;
  font-size:11px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--m-muted);
}
.rs-row { --tone:#ffffff40; }
.rs-table th,
.rs-table td { padding:8px 14px; border-top:1px solid var(--m-line); font-size:14px; line-height:1.3; vertical-align:middle; }
.rs-table tr:first-child > * { border-top:0; }
.rs-table th { text-align:left; font-weight:600; color:#e9e1f2; }
.rs-table th i {
  display:inline-block;
  width:8px;
  height:8px;
  margin:0 10px 1px 0;
  border-radius:50%;
  background:var(--tone);
  box-shadow:0 0 8px color-mix(in srgb,var(--tone) 70%,transparent);
  vertical-align:middle;
}
.rs-table th small { display:block; margin:1px 0 0 18px; font-size:11px; font-weight:500; color:var(--m-dim); }
.rs-table td { text-align:right; white-space:nowrap; font-weight:800; color:var(--tone); font-variant-numeric:tabular-nums; }
.rs-row:not([data-tone]) td { color:var(--m-ink); }
.rs-row.rs-sum > * { background:#ffffff0b; border-top-color:var(--m-line-2); font-weight:850; color:var(--m-ink); }
.rs-row.rs-sum th i { background:var(--m-ink); box-shadow:none; }
.rs-row.rs-total > * { font-size:15px; font-weight:900; background:color-mix(in srgb,var(--tone) 9%,transparent); }
.rs-row.rs-total th { color:#fff6e6; }
.rs-row.rs-sum + .rs-row.rs-total > *,
.rs-row:not(.rs-total) + .rs-row.rs-total > * { border-top-color:var(--m-line-2); }
[data-tone=gold] { --tone:#ffd27a; }
[data-tone=lime] { --tone:#c8e874; }
[data-tone=dance] { --tone:#9ef0c0; }
[data-tone=fight] { --tone:#ff9a7a; }
[data-tone=bar] { --tone:#ffb547; }
[data-tone=dj] { --tone:#45e0ff; }
[data-tone=vip] { --tone:#ff6fe0; }
[data-tone=bad] { --tone:#ff6b7a; }
[data-tone=muted] { --tone:#9a90a9; }
.rs-row[data-tone=muted] th { color:#b9afc7; }
#modal .rs-note { margin:0; font-size:13px; line-height:1.45; color:var(--m-muted); }
#modal .rs-done { justify-self:start; min-height:48px; margin:2px 0 0; padding:10px 30px; }
@media (max-width:520px) {
  .result-sheet { gap:12px; padding:20px 14px 16px; }
  .result-sheet::before { left:14px; right:14px; }
  .rs-head { gap:12px; padding-right:52px; }
  .rs-face { width:46px; height:46px; }
  #modal .rs-title h2 { font-size:22px; }
  #modal .rs-lead { font-size:14px; }
  .rs-hero-cell { padding:10px 11px 9px; }
  .rs-hero-cell b { font-size:22px; }
  .rs-hero-cell.is-main[data-tone=gold] b { font-size:25px; }
  .rs-hero-cell small { font-size:11px; }
  #modal .rs-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
  #modal .rs-stats li { padding:7px 6px; }
  #modal .rs-stats b { font-size:17px; }
  .rs-table th,
  .rs-table td { padding:7px 10px; font-size:13px; }
  .rs-row.rs-total > * { font-size:14px; }
  #modal .rs-done { justify-self:stretch; }
}
@media (max-height:520px) and (min-width:620px) {
  #modal.result-dialog { width:min(900px,calc(100vw - 24px)); }
  .result-sheet { padding:18px 18px 14px; }
  .rs-head { padding-right:0; }
  .rs-face { width:44px; height:44px; }
  #modal .rs-title h2 { font-size:21px; }
  #modal .rs-lead { font-size:13px; }
  .rs-hero-cell { padding:8px 10px; }
  .rs-hero-cell b { font-size:21px; }
  .rs-hero-cell.is-main[data-tone=gold] b { font-size:24px; }
  #modal .rs-stats { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
  #modal .rs-stats li { padding:6px 4px; }
  #modal .rs-stats b { font-size:15px; }
  #modal .rs-stats span { font-size:10px; }
  .rs-table th,
  .rs-table td { padding:5px 10px; font-size:12.5px; }
  .rs-table caption { padding-bottom:4px; }
  .rs-row.rs-total > * { font-size:13px; }
  #modal .rs-note { font-size:12px; }
  #modal .rs-done { min-height:42px; }
  #modal.result-dialog #closeModal { top:8px; right:8px; }
}
@media (forced-colors:active) {
  .rs-table th i,
  .difficulty-pips i { forced-color-adjust:none; }
}

/* Two columns — the story on the left, the ledger on the right: always on short landscape
   screens, and on roomy desktops when the ledger is long (a full club night). */
@media (max-height:520px) and (min-width:620px) {
  .result-sheet {
    grid-template-columns:minmax(0,1fr) minmax(0,1.08fr);
    grid-template-rows:repeat(5,auto) 1fr;
    grid-template-areas:"head table" "lead table" "hero table" "stats table" "note table" "done table";
    column-gap:18px;
    row-gap:0;
    align-items:start;
  }
  #modal .result-sheet > * + * { margin-top:10px; }
  .result-sheet > .rs-head { grid-area:head; }
  .result-sheet > .rs-lead { grid-area:lead; }
  .result-sheet > .rs-hero { grid-area:hero; }
  .result-sheet > .rs-stats { grid-area:stats; }
  .result-sheet > .rs-note { grid-area:note; }
  .result-sheet > .rs-done { grid-area:done; align-self:start; }
  #modal .result-sheet > .rs-table { grid-area:table; margin-top:30px; }
  .result-sheet.rs-long .rs-table th,
  .result-sheet.rs-long .rs-table td { padding-top:3px; padding-bottom:3px; font-size:12px; }
  .result-sheet.rs-long .rs-table th small { font-size:10px; }
}
@media (min-width:880px) and (min-height:521px) {
  #modal.result-dialog:has(.rs-long) { width:min(920px,calc(100vw - 48px)); }
  .result-sheet.rs-long {
    grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);
    grid-template-rows:repeat(5,auto) 1fr;
    grid-template-areas:"head table" "lead table" "hero table" "stats table" "note table" "done table";
    column-gap:22px;
    row-gap:0;
    align-items:start;
  }
  #modal .result-sheet.rs-long > * + * { margin-top:14px; }
  .result-sheet.rs-long > .rs-head { grid-area:head; }
  .result-sheet.rs-long > .rs-lead { grid-area:lead; }
  .result-sheet.rs-long > .rs-hero { grid-area:hero; }
  .result-sheet.rs-long > .rs-stats { grid-area:stats; }
  .result-sheet.rs-long > .rs-note { grid-area:note; }
  .result-sheet.rs-long > .rs-done { grid-area:done; align-self:start; }
  #modal .result-sheet.rs-long > .rs-table { grid-area:table; margin-top:40px; }
}
@media (max-width:520px) {
  .result-sheet.rs-long { gap:10px; }
  #modal .result-sheet.rs-long .rs-stats { grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
  #modal .result-sheet.rs-long .rs-stats li { padding:6px 3px; }
  #modal .result-sheet.rs-long .rs-stats b { font-size:15px; }
  #modal .result-sheet.rs-long .rs-stats span { font-size:10px; line-height:1.2; }
  .result-sheet.rs-long .rs-table th,
  .result-sheet.rs-long .rs-table td { padding-top:5px; padding-bottom:5px; }
}
