:root {
  --bg: #1d2a2b;
  --panel: rgba(28, 36, 34, 0.86);
  --panel-line: rgba(255, 255, 255, 0.09);
  --text: #f2ead8;
  --muted: #b9b09b;
  --accent: #e9a82a;
  --accent-2: #7fb069;
  --danger: #d0533f;
  --G: #7a9a3a; --B: #7b4a2e; --S: #8a8d93; --Y: #e9a82a; --R: #c8352e; --W: #2f8fa6;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: 'Nunito', system-ui, sans-serif; font-size: 14px;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
input, textarea { user-select: text; -webkit-user-select: text; }
img { -webkit-user-drag: none; }
.hidden { display: none !important; }
#scene { position: fixed; inset: 0; }
#scene canvas { display: block; }

button { font-family: inherit; }
.btn { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--panel-line); border-radius: 10px;
  padding: 8px 14px; cursor: pointer; font-weight: 600; transition: background .15s, transform .1s; }
.btn:hover { background: rgba(255,255,255,0.16); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #2a1d05; border-color: transparent; }
.btn.primary:hover { background: #f4b940; }
.btn.primary:disabled { background: #6b6250; color: #a99f88; cursor: default; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.big { padding: 13px 30px; font-size: 17px; }

/* ---------- menu ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; overflow: auto;
  background: radial-gradient(ellipse at 50% 30%, rgba(30,45,44,0.55), rgba(10,16,16,0.92)); z-index: 5; padding: 16px; }
.menu-inner { width: min(760px, 100%); background: var(--panel); border: 1px solid var(--panel-line); border-radius: 20px;
  padding: 28px 30px; box-shadow: 0 20px 60px rgba(0,0,0,.45); backdrop-filter: blur(6px); }
h1 { margin: 0; font-size: 40px; letter-spacing: .5px; }
h1 span { color: var(--accent); }
.sub { color: var(--muted); margin: 4px 0 18px; }
.variants { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.variant { border: 2px solid var(--panel-line); border-radius: 14px; padding: 12px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.variant h2 { margin: 0 0 4px; font-size: 20px; }
.variant p { margin: 0; color: var(--muted); font-size: 13px; }
.variant.selected { border-color: var(--accent); background: rgba(233,168,42,0.08); }
.opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.opt { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.opt > label { width: 170px; color: var(--muted); font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: rgba(0,0,0,.25); padding: 3px; border-radius: 10px; }
.seg button { background: transparent; color: var(--text); border: 0; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--accent); color: #2a1d05; }
#names { padding-left: 182px; gap: 6px; }
#names input { background: rgba(0,0,0,.3); border: 1px solid var(--panel-line); color: var(--text); border-radius: 8px;
  padding: 6px 10px; width: 130px; font-family: inherit; }
#continue-box { margin-bottom: 14px; }
@media (max-width: 640px) {
  .variants { grid-template-columns: 1fr; }
  .opt > label { width: 100%; }
  #names { padding-left: 0; }
}

/* ---------- hud ---------- */
#topbar { position: fixed; top: 0; left: 0; right: 0; height: 46px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; background: linear-gradient(rgba(14,20,19,.85), rgba(14,20,19,0)); z-index: 3; gap: 10px; }
.tb-left { color: var(--muted); white-space: nowrap; }
.tb-left b { color: var(--text); margin-right: 8px; }
.tb-center { font-weight: 800; font-size: 16px; }
.tb-right { display: flex; gap: 6px; }
.panel { position: fixed; top: 52px; bottom: 10px; width: 286px; background: var(--panel); border: 1px solid var(--panel-line);
  border-radius: 16px; padding: 10px 12px; overflow-y: auto; z-index: 2; backdrop-filter: blur(4px); }
#left { left: 10px; }
#right { right: 10px; }
.panel h3 { margin: 6px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.panel h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; }

#central { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.slot { background: rgba(0,0,0,.28); border-radius: 12px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; border: 2px solid transparent; transition: border-color .15s, transform .1s; min-height: 98px; }
.slot:hover { border-color: var(--accent); transform: translateY(-2px); }
.slot.disabled { cursor: default; opacity: .55; }
.slot.disabled:hover { border-color: transparent; transform: none; }
.tok { width: 28px; height: 28px; border-radius: 50%; display: inline-block; background-size: cover; background-position: center; flex: none; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.card { font-size: 10px; position: relative; aspect-ratio: 5 / 7; border-radius: 1.1em; overflow: hidden; cursor: pointer;
  background: #2b2a26; box-shadow: 0 0.3em 0.8em rgba(0,0,0,.45), inset 0 0 0 0.25em #f3e6c9; transition: transform .12s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 0.5em 1.2em rgba(0,0,0,.5), inset 0 0 0 0.25em #f3e6c9, 0 0 0 2px rgba(233,168,42,.8); }
.card.sel { box-shadow: 0 0 0 3px var(--accent), 0 0 1.6em rgba(233,168,42,.6), inset 0 0 0 0.25em #f3e6c9; }
.card.disabled { cursor: default; filter: saturate(.55) brightness(.8); }
.card.disabled:hover { transform: none; }
.card .art { position: absolute; inset: 0.25em; border-radius: 0.9em; overflow: hidden; }
.card .art img, .card .art svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .cname { position: absolute; left: 0.25em; right: 0.25em; top: 0.25em; padding: 0.5em 3.4em 1.4em 0.8em; font-weight: 800; font-size: 1.15em;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); background: linear-gradient(rgba(0,0,0,.45), transparent); border-radius: 0.8em 0.8em 0 0;
  line-height: 1.1; }
.card .ctrack { position: absolute; right: 0.25em; top: 0.25em; bottom: 0.25em; width: 2.9em; background: var(--env);
  border-radius: 0 0.9em 0.9em 0; display: flex; flex-direction: column; align-items: center; padding: 0.6em 0; gap: 0.35em;
  box-shadow: inset 0.2em 0 0.4em rgba(0,0,0,.25); }
.card .tv { position: relative; width: 2.2em; height: 2.2em; border-radius: 0.5em; background: rgba(0,0,0,.28);
  display: flex; align-items: center; justify-content: center; }
.card .tv b { color: #fff; font-size: 1.15em; font-weight: 800; opacity: .45; }
.card .tv.open b { opacity: 1; }
.card .tv.cur { background: #fff3; box-shadow: 0 0 0 0.15em #fff; }
.card .tv .cube { position: absolute; width: 1.45em; height: 1.45em; border-radius: 0.25em; left: 50%; top: 50%; transform: translate(-50%, -55%) rotate(8deg);
  background: linear-gradient(135deg, #ffb070 0%, #ee7a2e 45%, #b9541a 100%); box-shadow: 0 0.15em 0.2em rgba(0,0,0,.45), inset 0 0.1em 0 #ffd3a8; }
.card .cpat { position: absolute; left: 0.5em; right: 3.3em; bottom: 0.5em; height: 42%; display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(ellipse at 50% 70%, rgba(243,230,201,.85) 0%, rgba(243,230,201,.55) 55%, transparent 75%); border-radius: 0.8em; }
.card .cpat img, .card .cpat svg { max-width: 100%; max-height: 100%; display: block; }
.card.spirit .ctrack { display: none; }
.card.spirit .cname { padding-right: 3.4em; }
.card.spirit .cpat { right: 0.5em; bottom: 3.9em; height: 34%; }
.card.spirit .ctext { position: absolute; left: 0.25em; right: 0.25em; bottom: 0.25em; padding: 0.35em 0.6em; font-size: 0.7em; line-height: 1.15;
  background: rgba(240,246,250,.92); color: #2c3a44; border-radius: 0 0 0.9em 0.9em; font-weight: 700; }
.card.spirit::after { content: 'ДУХ'; position: absolute; right: 0.8em; top: 0.7em; font-size: 0.85em; font-weight: 800; color: #fff;
  background: rgba(110,140,170,.7); padding: 0.1em 0.5em; border-radius: 0.6em; }
#cardzoom { position: fixed; z-index: 8; pointer-events: none; width: 250px; }
#cardzoom .card { font-size: 20px; width: 100%; transform: none; }
.empty-note { color: var(--muted); font-size: 12px; }

#players .pl { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; cursor: pointer; margin-bottom: 4px;
  border: 1px solid transparent; }
#players .pl:hover { background: rgba(255,255,255,.06); }
#players .pl.cur { border-color: var(--accent); background: rgba(233,168,42,.08); }
#players .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
#players .nm { flex: 1; font-weight: 700; }
#players .sc { font-weight: 800; font-size: 18px; }
#players .bd { font-size: 11px; color: var(--muted); width: 100%; }
#donecards { font-size: 12px; color: var(--muted); margin-top: 6px; }

#bottom { position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px; display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 18px; padding: 10px 14px; z-index: 3; max-width: calc(100vw - 632px); }
#hint { color: var(--muted); max-width: 300px; font-size: 13px; }
#hand { display: flex; gap: 8px; min-height: 52px; align-items: center; }
#hand .tok { width: 50px; height: 50px; cursor: pointer; border: 3px solid transparent; transition: transform .1s; }
#hand .tok:hover { transform: translateY(-3px); }
#hand .tok.sel { border-color: var(--accent); transform: translateY(-5px); }

#tooltip { position: fixed; pointer-events: none; background: rgba(15,20,20,.92); border: 1px solid var(--panel-line); padding: 5px 9px;
  border-radius: 8px; font-size: 12.5px; z-index: 6; white-space: nowrap; }
#toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); background: rgba(208,83,63,.95); color: #fff; padding: 8px 16px;
  border-radius: 10px; z-index: 7; font-weight: 700; }
#toast.info { background: rgba(60,110,90,.95); }

#modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.modal-box { background: #232d2b; border: 1px solid var(--panel-line); border-radius: 18px; padding: 22px 26px; max-width: 760px; width: 100%;
  max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal-box h2 { margin-top: 0; }
.modal-box table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.modal-box td, .modal-box th { padding: 6px 8px; border-bottom: 1px solid var(--panel-line); text-align: center; }
.modal-box th:first-child, .modal-box td:first-child { text-align: left; }
.modal-box .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.modal-box .cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rules p, .rules li { color: #ddd3bd; line-height: 1.45; }
.rules h3 { margin-bottom: 4px; color: var(--accent); }

/* the side panels go down to the bottom edge; the card grids are sized by fitCards() in app.js */
#river.cards, #mycards.cards { justify-content: center; }
#river .card, #mycards .card { font-size: calc(var(--cw, 127px) / 12.7); }
@media (max-width: 1100px) {
  .panel { width: 230px; }
  #bottom { max-width: calc(100vw - 520px); }
}
@media (max-width: 1000px) {
  .tb-right .btn { padding: 4px 7px; font-size: 11.5px; }
}
.modal-box .cards2 { grid-template-columns: repeat(auto-fit, minmax(200px, 240px)); justify-content: center; }
.modal-box .cards2 .card { font-size: 17px; }

/* ---------- online lobby / table ---------- */
.online-btn { background: #2f6f73; color: #fff; border-color: transparent; }
.online-btn:hover { background: #3a8589; }
.lobby { width: min(1060px, 100%); background: var(--panel); border: 1px solid var(--panel-line); border-radius: 20px;
  padding: 22px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.45); backdrop-filter: blur(6px); }
.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lobby-head h1 { font-size: 32px; }
.lh-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lh-right label { color: var(--muted); font-weight: 600; }
.lh-right input, .code-row input, .link-row input, .chatform input { background: rgba(0,0,0,.3); border: 1px solid var(--panel-line); color: var(--text);
  border-radius: 8px; padding: 6px 10px; font-family: inherit; font-size: 14px; }
.lh-right input { width: 140px; margin-left: 6px; }
.muted { color: var(--muted); }
.net-status { color: var(--muted); min-height: 18px; margin: 6px 0; }
.net-status.warn { color: #f0a07a; }
.lobby-cols { display: grid; grid-template-columns: 1fr 1.15fr; gap: 16px; margin-top: 8px; }
.lobby-box { background: rgba(0,0,0,.18); border: 1px solid var(--panel-line); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.lobby-box h2 { font-size: 17px; margin: 4px 0 10px; }
.lobby-box h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.lobby-box .opt > label { width: 140px; }
.btn.quick { background: #7fb069; color: #14240c; border-color: transparent; }
.btn.quick:hover { background: #93c47c; }
.trow { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,.04); margin-bottom: 6px; }
.trow.mine { background: rgba(233,168,42,.1); border: 1px solid rgba(233,168,42,.35); }
.tinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tinfo small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 11px; background: rgba(255,255,255,.1); padding: 1px 7px; border-radius: 8px; margin-left: 4px; font-weight: 700; }
.seats { display: flex; gap: 4px; }
.sd { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); }
.sd.on { border-color: transparent; }
.code-row, .link-row { display: flex; gap: 6px; margin-top: 10px; }
.code-row input { width: 110px; text-transform: uppercase; letter-spacing: 2px; }
.link-row input { flex: 1; min-width: 0; }
.seat { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,.05); margin-bottom: 6px; }
.seat .dot { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.15); flex: none; }
.seat.empty { color: var(--muted); border: 1px dashed rgba(255,255,255,.18); background: transparent; }
.seat .online { margin-left: auto; font-size: 12px; color: var(--muted); }
.seat .online.on { color: #8fd07a; }
.share { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.sh { border: 0; border-radius: 10px; padding: 8px 14px; color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; font-family: inherit; font-size: 14px; }
.sh.tg { background: #2aa3df; } .sh.wa { background: #25b05a; } .sh.vb { background: #7c58c6; } .sh.nat { background: #5b6670; }
.sh:hover { filter: brightness(1.1); }
.small-note { font-size: 12px; }
.chatlog { height: 170px; overflow-y: auto; background: rgba(0,0,0,.25); border-radius: 10px; padding: 8px 10px; font-size: 13px;
  user-select: text; -webkit-user-select: text; }
.cm { margin-bottom: 4px; line-height: 1.3; }
.cm.me b { color: var(--accent); }
.chatform { display: flex; gap: 6px; margin-top: 6px; }
.chatform input { flex: 1; min-width: 0; }
#chatdrawer { position: fixed; right: 306px; top: 52px; width: 300px; background: var(--panel); border: 1px solid var(--panel-line);
  border-radius: 14px; padding: 10px; z-index: 4; backdrop-filter: blur(4px); }
.badge { background: var(--danger); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 3px; }
#hud:not(.online) .online-only { display: none; }
.pl .net { width: 8px; height: 8px; border-radius: 50%; background: #666; flex: none; }
.pl .net.on { background: #8fd07a; }
.pl .you { font-size: 11px; color: var(--accent); }
@media (max-width: 800px) {
  .lobby-cols { grid-template-columns: 1fr; }
  .lobby { padding: 16px; }
  #chatdrawer { right: 10px; width: calc(100vw - 20px); }
}

/* turn handover banner */
#turnbanner { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%) scale(.85); z-index: 60; pointer-events: none;
  background: rgba(20, 26, 22, .88); border: 2px solid var(--c, #e9a82a); border-radius: 18px; padding: 14px 34px; text-align: center;
  font-size: 26px; font-weight: 800; color: #f3ead6; box-shadow: 0 0 40px color-mix(in srgb, var(--c, #e9a82a) 45%, transparent);
  opacity: 0; transition: opacity .25s, transform .25s; }
#turnbanner.big { font-size: 40px; padding: 20px 48px; }
#turnbanner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#turnbanner small { display: block; font-size: 15px; font-weight: 600; color: #cfc4a8; margin-top: 6px; }
#players .firstp { font-size: 11px; font-weight: 800; color: #2a2112; background: #e9c46a; border-radius: 9px; padding: 1px 7px; flex: none; }
#players .turnmark { font-size: 11px; color: var(--accent); margin-left: auto; }
#players .turnmark + .sc, #players .net + .sc { margin-left: auto; }
/* online: your turn — the topbar and the token slots glow */
#hud.myturn #tb-turn { animation: myturn 1.6s ease-in-out infinite; }
#hud.myturn #central .slot:not(.disabled) { animation: slotglow 1.6s ease-in-out infinite; }
@keyframes myturn { 50% { text-shadow: 0 0 14px #9be07f; } }
@keyframes slotglow { 50% { box-shadow: 0 0 0 2px #9be07f, 0 0 14px rgba(155,224,127,.6); } }

/* completed cards lying on the table under each board (CSS3D layer over the 3D scene) */
#css3d { position: absolute; inset: 0; pointer-events: none; }
#css3d .done3d { pointer-events: auto; }
#css3d .done3d .card { font-size: 20px; width: 100%; cursor: default; }
#css3d .done3d .card:hover { transform: none; }
/* game over: switch between the final table and the boards */
#endbar { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 14px; padding: 7px 12px; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
#endbar span { font-weight: 800; color: var(--accent); }
.tb-right .btn.on { border-color: var(--accent); color: var(--accent); }

.btn.danger { border-color: #c45a4a; color: #f0b3a8; }
.btn.danger:hover { background: rgba(196,90,74,.18); }
.modal-box .conceded { color: #f0b3a8; font-weight: 700; margin: 0 0 6px; }

/* rules: token pictures inline; a stack is drawn bottom-up */
.rules .tok.rt { width: 24px; height: 24px; vertical-align: middle; }
.rules .rstk { display: inline-flex; flex-direction: column-reverse; vertical-align: middle; margin: 0 2px; }
.rules .rstk .tok.rt + .tok.rt { margin-bottom: -13px; }
.rules .rrow { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; color: #f3ead6; font-weight: 700; }
.rules .ror { font-size: 11px; color: var(--muted); font-weight: 400; margin: 0 3px; }
.rules .rtab { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
.rules .rtab td { border-bottom: 1px solid var(--panel-line); padding: 6px 8px; text-align: left; vertical-align: middle; color: #ddd3bd; }
.rules .rtab td:first-child { white-space: nowrap; width: 1%; }
.rules .rcube { display: inline-block; width: 16px; height: 16px; border-radius: 3px; vertical-align: middle;
  background: linear-gradient(135deg, #ffb36b, #e8742b); box-shadow: inset -2px -2px 0 rgba(0,0,0,.25); }
.rules .rcube.spirit { background: linear-gradient(135deg, #ffffff, #b9d4ff); }

/* ---------- phone (body.mob, set by app.js for narrow portrait screens) ---------- */
#mtabs { display: none; }
body.mob { --barH: 62px; --tabsH: 38px; --dockH: 40vh; }
body.mob #topbar { height: auto; flex-wrap: wrap; padding: 5px 8px 6px; gap: 4px 8px; background: rgba(14,20,19,.94); }
body.mob .tb-left { order: 1; font-size: 12px; }
body.mob .tb-left b { margin-right: 4px; }
body.mob .tb-center { order: 2; margin-left: auto; font-size: 14px; }
body.mob .tb-right { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
body.mob .tb-right::-webkit-scrollbar { display: none; }
body.mob .tb-right .btn { flex: none; white-space: nowrap; padding: 5px 9px; font-size: 12.5px; }
body.mob .panel { display: none; left: 0; right: 0; width: auto; top: auto; bottom: var(--barH); height: var(--dockH);
  border-radius: 0; border-left: 0; border-right: 0; padding: 8px 10px; }
body.mob .panel.mshow { display: block; }
body.mob #mtabs { display: flex; position: fixed; left: 0; right: 0; bottom: calc(var(--barH) + var(--dockH)); height: var(--tabsH); z-index: 3; }
body.mob #mtabs button { flex: 1; border: 1px solid var(--panel-line); border-bottom: 0; background: rgba(20,28,26,.92); color: var(--muted);
  font: 700 13px Nunito, sans-serif; border-radius: 12px 12px 0 0; margin: 0 2px; }
body.mob #mtabs button.on { background: var(--panel); color: var(--accent); }
body.mob #bottom { left: 0; right: 0; bottom: 0; transform: none; max-width: none; height: var(--barH); border-radius: 0; padding: 6px 10px;
  justify-content: space-between; gap: 8px; }
body.mob #hint { font-size: 11.5px; line-height: 1.25; max-width: none; flex: 1; }
body.mob #bottom:has(#hand .tok) #hint { display: none; }
body.mob #hand { min-height: 0; }
body.mob #hand .tok { width: 42px; height: 42px; }
body.mob #btn-end { padding: 10px 14px; }
body.mob #central { gap: 4px; margin-bottom: 6px; }
body.mob .slot { min-height: 0; padding: 4px 2px; }
body.mob .slot .tok { width: 24px; height: 24px; }
body.mob .panel h3 { margin: 2px 0 6px; font-size: 12px; }
body.mob #players .pl { padding: 5px 7px; }
body.mob #endbar { top: 84px; max-width: calc(100vw - 16px); }
body.mob #turnbanner { font-size: 20px; padding: 10px 20px; max-width: calc(100vw - 32px); }
body.mob #turnbanner.big { font-size: 28px; padding: 14px 26px; }
body.mob #toast { top: 88px; max-width: calc(100vw - 24px); text-align: center; }
body.mob #chatdrawer { top: 84px; bottom: calc(var(--barH) + 8px); }
body.mob #tooltip { display: none !important; }
/* a card opened full size on a touch screen */
.zoomcard { display: flex; justify-content: center; }
.zoomcard .card { font-size: min(22px, 5.4vw); width: min(320px, 78vw); cursor: default; }
.zoomcard .card:hover { transform: none; }

/* phone: the top bar buttons shrink to short labels so they all fit; «Закончить партию» keeps its words */
body.mob .tb-right { gap: 4px; }
body.mob .tb-right .btn[data-short] { font-size: 0; padding: 5px 8px; }
body.mob .tb-right .btn[data-short]::before { content: attr(data-short); font-size: 14px; }
body.mob .tb-right .btn .badge { font-size: 11px; }
body.mob #btn-concede { margin-left: auto; border-color: #c45a4a; color: #f0b3a8; padding: 5px 7px; font-size: 12px; }

/* card score track: the number stays readable over the cube that still covers it */
.card .tv b { position: relative; z-index: 1; text-shadow: 0 0 0.25em rgba(0,0,0,.8); }
.card .tv:not(.open) b { opacity: .8; }
.card .tv .cube { opacity: .72; }
