/* The meta screens: title, Rejtek (hideout) and the shops, map select, lobby, the receipt summary, settings and
   the loading overlay. Tokens come from style.css; the grids and tiles from inv.css. */

/* ---------- shared screen frame */
.screen {
  position: absolute;
  inset: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  background:
    var(--grain),
    radial-gradient(120% 80% at 70% -10%, rgba(255, 180, 90, 0.13), transparent 60%),
    linear-gradient(180deg, var(--a850), var(--a950));
  padding: calc(var(--st) + 0px) calc(var(--sr) + 0px) calc(var(--sb) + 0px) calc(var(--sl) + 0px);
}
body[data-screen='raid'] .screen { display: none; }
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--a600);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.tag.bad { background: var(--bad-deep); color: #fff; }
.tag.warn { background: var(--warn); color: #241600; }
.tag.good { background: var(--good-deep); color: #fff; }
[hidden] { display: none !important; }

/* ---------- loading overlay */
.loading {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--grain), rgba(10, 12, 14, 0.92);
}
.ld-box { display: grid; justify-items: center; gap: 14px; max-width: 420px; text-align: center; }
.ld-t { font-family: var(--font-head); font-weight: 400; font-size: clamp(1.4rem, 4vw, 2rem); color: var(--bkv); letter-spacing: 0.02em; }
.ld-tip { color: var(--text-dim); font-size: 1.05rem; min-height: 2.6em; }

/* ---------- title */
.title { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.ti-sky { position: absolute; inset: 0; pointer-events: none; }
.ti-moon {
  position: absolute; right: 12%; top: 9%; width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff7d6, #e9d9a0 60%, #c9b780);
  box-shadow: 0 0 60px rgba(255, 236, 170, 0.35);
}
.ti-lamp {
  position: absolute; left: 10%; bottom: 31%; width: 6px; height: 34vh; background: #2a2d31; border-radius: 3px;
}
.ti-lamp::before {
  content: ''; position: absolute; top: -8px; left: -22px; width: 50px; height: 14px; border-radius: 8px 8px 3px 3px; background: #33373c;
}
.ti-lamp::after {
  content: ''; position: absolute; top: 2px; left: -90px; width: 186px; height: 34vh;
  background: radial-gradient(60% 100% at 50% 0%, rgba(255, 180, 90, 0.22), transparent 70%);
}
.ti-lamp.b { left: auto; right: 22%; height: 28vh; }
.ti-street { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(180deg, #23262a, #15171a); border-top: 3px solid #3b3f44; pointer-events: none; }
.ti-rails { position: absolute; left: 0; right: 0; top: 30%; height: 16px; border-top: 3px solid #5a5f66; border-bottom: 3px solid #5a5f66; opacity: 0.7; }
.ti-tram { position: absolute; top: calc(30% - 62px); left: 0; display: flex; gap: 6px; animation: tram 18s linear infinite; }
.ti-car {
  position: relative; display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px 0; width: 230px; height: 70px;
  background: linear-gradient(180deg, var(--bkv) 0 72%, #c99f00 72%); border-radius: 14px 14px 6px 6px; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}
.ti-car::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -10px; height: 12px; background: repeating-linear-gradient(90deg, #111 0 26px, transparent 26px 160px); border-radius: 6px; }
.ti-win { flex: 1; height: 26px; border-radius: 4px; background: linear-gradient(180deg, #ffe9a8, #f4b860); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25); }
.ti-num { position: absolute; right: 10px; top: 42px; font-family: var(--font-head); color: var(--bkv-ink); font-size: 1rem; }
@keyframes tram { from { transform: translateX(-520px); } to { transform: translateX(calc(100vw + 40px)); } }
.ti-main { position: relative; z-index: 1; display: grid; justify-items: center; gap: 12px; width: min(560px, 100% - 32px); padding: 24px 0 90px; }
.ti-logo { display: grid; line-height: 0.92; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.6); transform: rotate(-2deg); }
.ti-l1 { font-size: clamp(1.6rem, 6vw, 2.6rem); color: var(--text); letter-spacing: 0.08em; }
.ti-l2 {
  font-size: clamp(3.2rem, 15vw, 6.8rem); color: var(--bkv-ink); background: var(--bkv); padding: 0.02em 0.18em 0.06em;
  border-radius: 8px; box-shadow: var(--sticker);
}
.ti-sub { margin: 4px 0 4px; font-weight: 800; font-size: 1.15rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sodium); }
.ti-who { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; justify-content: center; }
.ti-name { display: grid; gap: 2px; text-align: left; font-size: 0.85rem; color: var(--text-dim); }
.ti-name .field { width: 210px; font-size: 1.15rem; }
.ti-fig { position: relative; display: block; width: 36px; height: 60px; flex: none; }
.ti-fig > span { position: absolute; left: 50%; transform: translateX(-50%); }
.ti-cap { top: 0; width: 22px; height: 9px; border-radius: 10px 10px 2px 2px; background: var(--accent, var(--bkv)); z-index: 2; }
.ti-head { top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--skin, #d9a77f); }
.ti-top { top: 22px; width: 30px; height: 20px; border-radius: 8px 8px 3px 3px; background: var(--top, #456); }
.ti-bot { top: 41px; width: 24px; height: 14px; background: var(--bottom, #234); }
.ti-shoe { top: 54px; width: 28px; height: 6px; border-radius: 3px; background: var(--shoes, #111); }
.ti-prog { color: var(--text-dim); margin: 0; }
.ti-btns { display: grid; gap: 12px; width: min(340px, 100%); margin-top: 6px; }
.ti-btns .btn.big { font-size: 1.5rem; }
.ti-status { color: var(--warn); }
.ti-foot {
  position: absolute; left: 0; right: 0; bottom: calc(var(--sb) + 8px); z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px;
  padding: 0 16px; color: var(--text-faint); font-size: 0.82rem;
}

/* ---------- hideout (Rejtek) */
.hideout { display: flex; flex-direction: column; overflow: hidden; }
.ho-top {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; flex: none;
  background: rgba(10, 12, 14, 0.75); border-bottom: 2px solid var(--line-2);
}
.ho-title { display: grid; line-height: 1; margin-right: auto; }
.ho-title h1 { font-size: 2rem; color: var(--bkv); }
.ho-title span { font-size: 0.85rem; color: var(--text-faint); }
.ho-wallet { display: flex; align-items: center; gap: 12px; font-size: 1.15rem; }
.ho-money b { color: var(--bkv); font-size: 1.25rem; }
.ho-bottles { color: var(--good); }
.ho-stars { color: var(--bkv); letter-spacing: 0.1em; }
.ho-name { color: var(--text-dim); max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ho-tabs { display: none; }
.ho-main {
  flex: 1; min-height: 0; display: grid; gap: 14px; padding: 12px 14px 14px;
  grid-template-columns: auto auto minmax(300px, 1fr);
  align-items: start;
}
.ho-col { min-height: 0; max-height: 100%; overflow: hidden auto; background: var(--panel-bg); border: 1px solid var(--line); border-radius: var(--r-l); padding: 10px 12px 12px; }
.ho-h { font-size: 1.25rem; color: var(--text); margin-bottom: 8px; letter-spacing: 0.04em; }
.ho-hrow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ho-hrow small { color: var(--text-faint); }
.ho-sub { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 10px 0 4px; font-weight: 800; color: var(--text-dim); text-transform: uppercase; font-size: 0.82rem; letter-spacing: 0.06em; }
.ho-sub small { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text-faint); }
.ho-sub b { color: var(--bkv); font-size: 1rem; }
.ho-kit .ri-slots { display: grid; grid-template-columns: auto auto; gap: 8px; align-items: start; justify-content: start; }
.ho-kit .ri-slots > :nth-child(1) { grid-column: 1; grid-row: 1; }
.ho-kit .ri-slots > :nth-child(2) { grid-column: 1; grid-row: 2; }
.ho-kit .ri-slots > :nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
.ho-small { display: flex; gap: 14px; flex-wrap: wrap; }
.ho-kg { margin-top: 8px; color: var(--text-dim); font-size: 0.92rem; }
.ho-kg.over { color: var(--warn); }
.ho-cash { margin-top: 10px; padding-top: 6px; border-top: 1px dashed var(--line-2); }
.ho-cash-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ho-cash-btns .btn.small { min-height: var(--tap); }
.ho-cash-note { display: block; margin-top: 6px; color: var(--text-faint); }
.ho-warn { margin: 8px 0 0; padding: 6px 9px; border-radius: var(--r); background: rgba(255, 176, 58, 0.14); border: 1px solid var(--warn); color: var(--warn); font-size: 0.95rem; }
.ho-stash-scroll { max-width: 100%; overflow-x: auto; }
.ho-hint { margin: 8px 0 0; color: var(--text-faint); font-size: 0.85rem; max-width: calc(10 * var(--cell)); }
.ho-shops { display: flex; flex-direction: column; padding: 0; }
.ho-shoptabs { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--a850); border-bottom: 1px solid var(--line); }
.ho-shoptabs button, .ho-tabs button {
  flex: 1 1 auto; min-height: var(--tap); padding: 0 10px; border: 2px solid transparent; border-radius: var(--r); background: var(--a700);
  color: var(--text-dim); font-weight: 800; cursor: pointer; white-space: nowrap;
}
.ho-shoptabs button[aria-selected='true'], .ho-tabs button[aria-selected='true'] { background: var(--bkv); color: var(--bkv-ink); }
.ho-shopbody { padding: 10px 12px 12px; }
.ho-bar { display: none; }
.ho-statlist { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; margin: 6px 0 12px; }
.ho-statlist dt { color: var(--text-dim); }
.ho-statlist dd { margin: 0; text-align: right; }
.ho-h4 { font-size: 1.05rem; margin: 6px 0 4px; }
.ho-maps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ho-maps li.locked { color: var(--text-faint); }
.ho-maps small { color: var(--text-faint); }
.ho-star { color: var(--bkv); margin-top: 10px; }
.split-box { display: grid; gap: 8px; min-width: min(300px, 70vw); }

/* the shops */
.tr-head { margin-bottom: 10px; }
.tr-who { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tr-who h3 { font-size: 1.5rem; color: var(--bkv); }
.tr-who span { color: var(--text-dim); }
.tr-blurb { margin: 4px 0 0; color: var(--text-dim); font-style: italic; font-weight: 600; }
.tr-wallet { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; padding: 6px 9px; background: var(--a800); border-radius: var(--r); font-size: 0.95rem; }
.tr-wallet b { color: var(--bkv); }
.tr-wallet small { flex-basis: 100%; color: var(--text-faint); }
.tr-list { display: grid; gap: 6px; }
.tr-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 6px 8px;
  background: var(--a800); border: 1px solid var(--line); border-radius: var(--r);
}
.tr-row.out { opacity: 0.55; }
.tr-name { display: grid; line-height: 1.15; min-width: 0; }
.tr-name b { font-weight: 800; overflow-wrap: anywhere; }
.tr-name small { color: var(--text-faint); }
.tr-name .tag { justify-self: start; margin-top: 2px; }
.tr-buy { display: grid; gap: 4px; justify-items: stretch; }
.tr-buy .btn.small { min-height: 38px; white-space: nowrap; }
.tr-none { color: var(--text-faint); }
.tr-ico {
  --cell: 18px;
  position: relative; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: var(--r);
  background: rgba(0, 0, 0, 0.35); cursor: pointer;
}
.tile.mini { position: relative; left: auto; top: auto; cursor: pointer; }
.tile.mini .nm, .tile.mini .cond { display: none; }
.tr-zone {
  display: grid; justify-items: center; gap: 2px; padding: 18px 12px; margin-bottom: 10px; text-align: center;
  border: 3px dashed var(--a400); border-radius: var(--r-l); color: var(--text-dim); background: rgba(0, 0, 0, 0.2);
}
.tr-zone b { color: var(--text); font-size: 1.1rem; }
.tr-zone-i { font-size: 1.8rem; color: var(--bkv); line-height: 1; }
.tr-zone.hover.ok { border-color: var(--good); background: rgba(113, 211, 107, 0.12); }
.tr-zone.hover.bad { border-color: var(--bad); background: rgba(255, 91, 77, 0.1); }
.tr-allrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tr-allrow small { color: var(--text-faint); }
.tr-prices { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0 0 8px; font-size: 0.92rem; }
.tr-prices dt { color: var(--text-dim); }
.tr-prices dd { margin: 0; }
.tr-stash { display: none; }

/* desktop: three columns side by side, each scrolls on its own */
@media (min-width: 1100px) {
  .ho-main { height: 100%; }
  .ho-col { max-height: 100%; }
  .ho-shops { align-self: stretch; }
}

/* narrow: the Felszerelés / Boltok tabs and the sticky bottom bar */
@media (max-width: 1099px) {
  .ho-top { gap: 6px 10px; padding: 6px 10px; }
  .ho-top .ho-go { display: none; }
  .ho-title h1 { font-size: 1.6rem; }
  .ho-title span { display: none; }
  .ho-name { display: none; }
  .ho-tabs { display: flex; gap: 6px; padding: 6px 10px; flex: none; background: var(--a850); border-bottom: 1px solid var(--line); }
  .ho-main { display: block; overflow: hidden auto; padding: 10px 10px 12px; }
  .ho-col { max-height: none; overflow: visible; margin-bottom: 12px; }
  .hideout[data-tab='gear'] .ho-shops { display: none; }
  .hideout[data-tab='shops'] .ho-kit, .hideout[data-tab='shops'] .ho-stash { display: none; }
  .hideout[data-tab='shops'] .tr-stash { display: block; margin-top: 10px; }
  .ho-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none;
    padding: 8px calc(12px + var(--sr)) calc(8px + var(--sb)) calc(12px + var(--sl));
    background: rgba(10, 12, 14, 0.96); border-top: 2px solid var(--bkv);
  }
  .ho-bar-m { display: grid; line-height: 1.1; }
  .ho-bar-m b { color: var(--bkv); font-size: 1.2rem; }
  .ho-bar-m small { color: var(--warn); }
  .ho-shoptabs { position: static; }
}
@media (min-width: 760px) and (max-width: 1099px) {
  .hideout[data-tab='gear'] .ho-main { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
}
@media (max-width: 430px) {
  .ho-top { gap: 6px; }
  .ho-title h1 { font-size: 1.4rem; }
  .ho-wallet { font-size: 0.95rem; gap: 6px; }
  .ho-money b { font-size: 1.05rem; }
  .ho-col { padding: 8px; border-radius: var(--r); }
  .tr-row { grid-template-columns: auto 1fr; }
  .tr-buy { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}

/* ---------- map select */
.mapselect { display: flex; flex-direction: column; }
.ms-top, .lb-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex: none; }
.ms-top h1, .lb-top h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--bkv); }
.ms-main { flex: 1; display: grid; gap: 16px; align-content: start; width: min(1100px, 100%); margin: 0 auto; padding: 4px 16px 16px; }
.ms-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ms-card {
  position: relative; display: grid; gap: 4px; align-content: start; min-height: 190px; padding: 14px 16px; text-align: left;
  border: 3px solid var(--line-2); border-radius: var(--r-l); background: linear-gradient(160deg, var(--a700), var(--a850)); color: var(--text);
  cursor: pointer; box-shadow: var(--sticker); transition: transform 0.12s, border-color 0.12s;
}
.ms-card:hover:not(:disabled) { transform: translateY(-2px); }
.ms-card.on { border-color: var(--bkv); background: linear-gradient(160deg, #3a3418, var(--a850)); }
.ms-card.locked { cursor: not-allowed; filter: grayscale(0.8); opacity: 0.6; }
.ms-card.wip { opacity: 0.75; }
.ms-tier { justify-self: start; padding: 0 8px; border-radius: 999px; background: var(--bkv); color: var(--bkv-ink); font-weight: 800; font-size: 0.8rem; text-transform: uppercase; }
.ms-name { font-family: var(--font-head); font-size: 1.6rem; line-height: 1.05; }
.ms-sub { color: var(--sodium); font-size: 0.9rem; }
.ms-text { color: var(--text-dim); }
.ms-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; color: var(--text-dim); }
.ms-status { color: var(--warn); font-weight: 800; }
.ms-lock { position: absolute; right: 12px; top: 10px; font-size: 1.4rem; }
.ms-opts { display: grid; gap: 10px; }
.ms-opt { display: grid; grid-template-columns: 170px auto 1fr; align-items: center; gap: 8px 14px; padding: 8px 12px; background: var(--panel-bg); border-radius: var(--r); }
.ms-opt-l { font-weight: 800; }
.ms-opt small { color: var(--text-faint); }
.ms-opt .btn[aria-pressed='true'] { --b-bg: var(--bkv); --b-fg: var(--bkv-ink); --b-edge: #6b5600; }
.ms-opt .seg > button { min-height: var(--tap); padding: 0 14px; }
.ms-bar, .lb-actions {
  position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 10px calc(16px + var(--sr)) calc(10px + var(--sb)) calc(16px + var(--sl)); background: rgba(10, 12, 14, 0.94); border-top: 2px solid var(--line-2);
}
@media (max-width: 640px) {
  .ms-opt { grid-template-columns: 1fr auto; }
  .ms-opt small { grid-column: 1 / -1; }
  .ms-card { min-height: 0; }
  .ms-bar .btn { flex: 1; }
}

/* ---------- lobby */
.lobby { display: flex; flex-direction: column; }
.lb-status { margin: 0 0 0 auto; color: var(--text-dim); text-align: right; }
.lb-status[data-tone='bad'] { color: var(--bad); }
.lb-main { position: relative; flex: 1; width: min(1000px, 100%); margin: 0 auto; padding: 4px 16px 16px; }
.lb-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lb-pub { grid-column: 1 / -1; }
.lb-card { padding: 12px 14px; background: var(--panel-bg); border: 1px solid var(--line); border-radius: var(--r-l); display: grid; gap: 8px; align-content: start; }
.lb-card h2 { font-size: 1.3rem; }
.lb-card small { color: var(--text-faint); }
.lb-joinrow { display: flex; gap: 8px; }
.lb-joinrow .field { width: 8.5em; font-size: 1.4rem; }
.lb-hrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lb-rooms { display: grid; gap: 6px; }
.lb-roomrow { display: grid; grid-template-columns: 4.5em 1fr auto auto auto; align-items: center; gap: 10px; padding: 6px 10px; background: var(--a800); border-radius: var(--r); }
.lb-rcode { color: var(--bkv); font-size: 1.1rem; letter-spacing: 0.12em; }
.lb-rmap small { color: var(--text-faint); }
.lb-rhost { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9em; }
.lb-none { color: var(--text-faint); margin: 0; }
.lb-room { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lb-room > .lb-card:nth-child(3) { grid-column: 1 / -1; }
.lb-actions { grid-column: 1 / -1; margin: 0 -16px -16px; }
.lb-codebox { justify-items: start; }
.lb-code-l { font-weight: 800; text-transform: uppercase; color: var(--text-dim); font-size: 0.85rem; letter-spacing: 0.08em; }
.lb-code {
  font-size: clamp(2.4rem, 9vw, 3.6rem); letter-spacing: 0.25em; color: var(--bkv-ink); background: var(--bkv);
  padding: 0 0.15em 0 0.4em; border-radius: var(--r); box-shadow: var(--sticker); transform: rotate(-1.5deg);
}
.lb-info { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.lb-map { font-family: var(--font-head); font-size: 1.4rem; margin-right: 4px; }
.lb-hostopts { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-hostopts .btn.small { min-height: var(--tap); }
.lb-players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lb-players li { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 4px 10px; background: var(--a800); border-radius: var(--r); }
.lb-players li.me { box-shadow: inset 3px 0 0 var(--bkv); }
.lb-players li.off { opacity: 0.6; }
.lb-players li.empty { background: transparent; border: 1px dashed var(--line-2); color: var(--text-faint); }
.lb-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--a600); font-weight: 900; }
.lb-players li.ready .lb-mark { background: var(--good-deep); color: #fff; }
.lb-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-pname small { color: var(--text-faint); }
.lb-list.under, .lb-room.under { display: none; }
.lb-sub { position: fixed; inset: 0; z-index: 5; }
@media (max-width: 700px) {
  .lb-list, .lb-room { grid-template-columns: 1fr; }
  .lb-roomrow { grid-template-columns: 4em 1fr auto; }
  .lb-rhost, .lb-rn { display: none; }
  .lb-actions .btn { flex: 1 1 45%; }
  .lb-top { flex-wrap: wrap; }
  .lb-status { flex-basis: 100%; text-align: left; margin: 0; }
}

/* ---------- summary: a till receipt */
.summary { display: grid; place-items: start center; padding: 20px 16px calc(24px + var(--sb)); }
.rc-wrap { display: grid; justify-items: center; gap: 16px; width: min(420px, 100%); }
.receipt {
  position: relative; width: 100%; padding: 22px 22px 18px; background: var(--paper); color: var(--paper-ink);
  font-family: var(--font-mono); font-size: 0.92rem; font-weight: 500; line-height: 1.35;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); transform: rotate(-0.6deg);
  -webkit-mask: radial-gradient(circle 6px at 50% 0, transparent 98%, #000) 0 0 / 14px 51% repeat-x,
                radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 100% / 14px 51% repeat-x;
  mask: radial-gradient(circle 6px at 50% 0, transparent 98%, #000) 0 0 / 14px 51% repeat-x,
        radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 100% / 14px 51% repeat-x;
  animation: print 0.6s ease-out both;
}
@keyframes print { from { clip-path: inset(0 0 100% 0); transform: translateY(-14px) rotate(-0.6deg); } to { clip-path: inset(0 0 0 0); } }
.rc-head { display: grid; justify-items: center; text-align: center; gap: 1px; margin-bottom: 10px; }
.rc-shop { font-weight: 800; letter-spacing: 0.08em; }
.rc-addr, .rc-stamp { color: #6f675b; font-size: 0.82rem; }
.rc-title { font-family: var(--font-head); font-size: clamp(2.2rem, 10vw, 3rem); text-align: center; margin: 4px 0 6px; letter-spacing: 0.03em; }
.rc-title.good { color: var(--good-deep); }
.rc-title.bad { color: var(--bad-deep); }
.rc-line { font-family: var(--font-body); font-weight: 600; font-size: 1.02rem; text-align: center; }
.rc-note { font-family: var(--font-body); font-size: 0.95rem; color: #6a5a3a; text-align: center; }
.rc-star, .rc-unlock { margin: 6px 0; padding: 5px 8px; text-align: center; border: 2px dashed currentColor; font-weight: 800; }
.rc-star { color: #8a6a00; }
.rc-unlock { color: var(--bkk); }
.rc-sep { border-top: 2px dashed rgba(0, 0, 0, 0.3); margin: 10px 0; }
.rc-rows { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin: 0; }
.rc-rows dt { color: #4d463c; }
.rc-rows dd { margin: 0; text-align: right; font-weight: 700; }
.rc-rows dd.good { color: var(--good-deep); font-size: 1.1rem; }
.rc-rows dd.bad { color: var(--bad-deep); font-size: 1.1rem; }
.rc-h { font-family: var(--font-mono); font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; margin: 8px 0 3px; }
.rc-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.rc-items li { display: flex; justify-content: space-between; gap: 10px; }
.rc-none { margin: 0; color: #8b8273; }
.rc-thanks { margin: 14px 0 6px; text-align: center; font-weight: 800; }
.rc-barcode { height: 40px; margin: 0 10px; background: repeating-linear-gradient(90deg, #222 0 2px, transparent 2px 4px, #222 4px 7px, transparent 7px 9px, #222 9px 10px, transparent 10px 13px); }
.summary[data-outcome='extract'] .rc-done { --b-bg: var(--good-deep); --b-fg: #fff; --b-edge: #173f14; }
.rc-done { width: min(320px, 100%); }

/* ---------- settings */
.settings { z-index: 1300; position: fixed; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 8, 0.75); }
.st-box {
  width: min(560px, 100%); max-height: calc(100% - 8px); overflow: hidden auto; padding: 14px 18px 0; background: var(--a850);
  border: 2px solid var(--line-2); border-radius: var(--r-l); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.st-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.st-top h1 { color: var(--bkv); font-size: 2rem; }
.st-sec { display: grid; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.st-sec h2 { font-size: 1.15rem; color: var(--text-dim); }
.st-row { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 12px; }
.st-row .seg { justify-self: start; flex-wrap: wrap; }
.st-row .seg > button { min-height: var(--tap); padding: 0 12px; }
.st-val { min-width: 3.5em; text-align: right; color: var(--bkv); }
.st-note { color: var(--text-faint); }
.st-keys { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; margin: 0; }
.st-keys dt { color: var(--text-dim); }
.st-keys dd { margin: 0; text-align: right; }
kbd { font-family: var(--font-mono); font-size: 0.85rem; padding: 1px 6px; border-radius: 4px; background: var(--a700); border-bottom: 2px solid var(--a950); }
.st-danger p { color: var(--text-dim); }
.st-danger .btn { justify-self: start; }
.st-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; padding: 10px 0 14px; background: var(--a850); border-top: 1px solid var(--line); }
@media (max-width: 480px) {
  .st-row { grid-template-columns: 1fr auto; }
  .st-row > input[type='range'], .st-row > .seg { grid-column: 1 / -1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .ti-tram, .receipt { animation: none; }
}
