/* ── UNO — өнгөлөг, текст багатай. Ширээ идэвхтэй өнгөөр гэрэлтэнэ. ── */
@property --cur { syntax: '<color>'; inherits: true; initial-value: #ff4757; }

:root {
  --R: #ff4757;
  --Y: #ffc312;
  --G: #2ed573;
  --B: #3d7bff;
  --W: #1b1433;
  --bg: #140c2e;
  --bg-2: #1d1442;
  --ink: #ffffff;
  --dim: rgba(255, 255, 255, .62);
  --glass: rgba(255, 255, 255, .08);
  --glass-2: rgba(255, 255, 255, .14);
  --line: rgba(255, 255, 255, .16);
  --cur: var(--R);
  --cw: 66px;   /* гарын хөзрийн өргөн */
  --ch: 98px;
}
body[data-color="R"] { --cur: var(--R); }
body[data-color="Y"] { --cur: var(--Y); }
body[data-color="G"] { --cur: var(--G); }
body[data-color="B"] { --cur: var(--B); }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
button, input { font-family: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }

html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  font-weight: 800;
  transition: --cur .6s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
img, svg, canvas { -webkit-user-drag: none; }

/* ── Арын гэрэл: идэвхтэй өнгөөр тодорно ── */
.glow { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.glow i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.glow i:nth-child(1) { width: 120vmax; height: 120vmax; left: 50%; top: 48%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--cur) 0%, transparent 55%); opacity: .5; }
.glow i:nth-child(2) { width: 60vmax; height: 60vmax; left: -20vmax; top: -18vmax; background: #6c3bff; opacity: .35; animation: drift 14s ease-in-out infinite alternate; }
.glow i:nth-child(3) { width: 55vmax; height: 55vmax; right: -22vmax; bottom: -20vmax; background: #ff2fb3; opacity: .22; animation: drift 17s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.1); } }

main#app {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px; height: 100%; margin: 0 auto;
  display: flex; flex-direction: column;
  padding: max(8px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
}
.screen { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }

/* ═════════ Хөзөр ═════════ */
.card {
  --c: var(--W);
  position: relative; flex: 0 0 auto;
  width: var(--cw); height: var(--ch);
  border-radius: calc(var(--cw) * .16);
  background: var(--c);
  border: calc(var(--cw) * .055) solid #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .08);
  color: #fff; overflow: hidden;
  font-size: calc(var(--cw) * .2);
}
.card.c-R { --c: var(--R); } .card.c-Y { --c: var(--Y); } .card.c-G { --c: var(--G); } .card.c-B { --c: var(--B); }
.card.c-W { --c: #15111f; }
.card .oval {
  position: absolute; left: 50%; top: 50%; width: 84%; height: 64%;
  transform: translate(-50%, -50%) rotate(-28deg);
  background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.card .oval b {
  transform: rotate(28deg);
  font-size: 2.7em; font-weight: 900; line-height: 1; letter-spacing: -.04em;
  color: var(--c);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .18);
  display: flex; align-items: center;
}
.card .oval b svg { width: 1em; height: 1em; }
.card .cv { position: absolute; font-weight: 900; line-height: 1; font-size: 1em; text-shadow: 1px 1px 0 rgba(0,0,0,.25); display: flex; }
.card .cv svg { width: 1em; height: 1em; }
.card .cv.tl { top: .32em; left: .38em; }
.card .cv.br { bottom: .32em; right: .38em; transform: rotate(180deg); }
.card .u { text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .08em; }
/* Wild: 4 өнгийн дугуй */
.card.c-W .oval { background: conic-gradient(var(--R) 0 25%, var(--B) 0 50%, var(--Y) 0 75%, var(--G) 0); }
.card.c-W .oval b { color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 6px rgba(0,0,0,.4); }
.card.c-W.w-called::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit;
  box-shadow: inset 0 0 0 calc(var(--cw) * .06) var(--cur);
}
.card-back {
  width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * .16);
  border: calc(var(--cw) * .055) solid #fff;
  background:
    radial-gradient(circle at 30% 30%, var(--R) 0 13%, transparent 14%),
    radial-gradient(circle at 70% 30%, var(--Y) 0 13%, transparent 14%),
    radial-gradient(circle at 30% 70%, var(--G) 0 13%, transparent 14%),
    radial-gradient(circle at 70% 70%, var(--B) 0 13%, transparent 14%),
    linear-gradient(150deg, #2a1d5c, #120b26);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}

/* ═════════ Хүлээлгийн өрөө ═════════ */
.hall { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 10px 6px; }
.hall-logo { display: flex; gap: 6px; }
.hall-logo span { width: 22px; height: 34px; border-radius: 6px; border: 3px solid #fff; transform: rotate(-10deg); box-shadow: 0 6px 14px rgba(0,0,0,.3); }
.hall-logo span:nth-child(2) { transform: rotate(-3deg) translateY(-4px); }
.hall-logo span:nth-child(3) { transform: rotate(4deg) translateY(-4px); }
.hall-logo span:nth-child(4) { transform: rotate(11deg); }
.c-R { background: var(--R); } .c-Y { background: var(--Y); } .c-G { background: var(--G); } .c-B { background: var(--B); }

.hall-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; width: 100%; max-width: 360px; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.seat .ava { width: 64px; height: 64px; font-size: 26px; }
.seat .nm { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.seat.me .nm { color: #fff; }
.seat .tick { position: absolute; top: 44px; right: calc(50% - 38px); width: 24px; height: 24px; border-radius: 50%;
  background: var(--G); border: 3px solid var(--bg); display: grid; place-items: center; transform: scale(0); transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.seat .tick svg { width: 13px; height: 13px; }
.seat.ready .tick { transform: scale(1); }
.seat.ready .ava { box-shadow: 0 0 0 3px var(--G), 0 8px 18px rgba(0,0,0,.35); }
.seat .crown { position: absolute; z-index: 2; top: -14px; left: 50%; transform: translateX(-50%); font-size: 16px; }
.seat .x { position: absolute; top: -4px; right: calc(50% - 40px); width: 22px; height: 22px; border-radius: 50%; background: var(--glass-2); font-size: 12px; display: grid; place-items: center; }
.seat.empty .ava { background: transparent !important; border: 2px dashed var(--line); box-shadow: none; }
.hall-hint { font-size: 13px; color: var(--dim); text-align: center; min-height: 18px; font-weight: 700; }
.hall-actions { display: flex; gap: 10px; }
.hall-main { display: flex; gap: 10px; width: 100%; max-width: 360px; }
.hall-main .big-btn { flex: 1; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 360px; }
.tile {
  position: relative; aspect-ratio: 1 / 1.05; border-radius: 26px; padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  font-size: 16px; line-height: 1.15; text-align: center; color: #fff; overflow: hidden;
  box-shadow: 0 14px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .12s;
}
.tile::after { content: ''; position: absolute; width: 120%; height: 60%; left: -10%; top: -30%; border-radius: 50%; background: rgba(255,255,255,.14); }
.tile.inv { background: linear-gradient(150deg, var(--B), #7b4dff); }
.tile.bots { background: linear-gradient(150deg, var(--G), #0fb5a0); }
.tile .tile-ic { width: 64px; height: 64px; border-radius: 22px; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.tile .tile-ic svg { width: 36px; height: 36px; }
.tile b { font-weight: 900; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.tile:active { transform: scale(.95); }
.tile:disabled { opacity: .4; }
.pill {
  height: 40px; padding: 0 16px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 7px; font-size: 14px;
}
.pill svg { width: 18px; height: 18px; }
.pill:active, .big-btn:active, .act:active { transform: scale(.95); }
.big-btn {
  height: 56px; border-radius: 18px; padding: 0 22px; font-size: 18px; font-weight: 900;
  background: #fff; color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3); transition: transform .12s, opacity .2s, background .2s;
}
.big-btn svg { width: 22px; height: 22px; }
.big-btn.on { background: var(--G); color: #062a14; }
.big-btn.go { background: linear-gradient(135deg, var(--Y), #ff7a18); color: #2a1300; }
.big-btn:disabled { opacity: .35; pointer-events: none; }
.link-btn { font-size: 13px; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; padding: 6px; }

.ava {
  width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; overflow: hidden;
  font-weight: 900; font-size: 20px; color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
  position: relative;
}
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava .bot { font-size: .9em; }

/* ═════════ Ширээ ═════════ */
.opps { position: relative; height: 26%; min-height: 140px; flex: 0 0 auto; }
.opp {
  position: absolute; transform: translate(-50%, 0);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: opacity .3s;
}
.opp .ava-wrap { position: relative; width: 54px; height: 54px; display: grid; place-items: center; }
.opp .ava { width: 48px; height: 48px; font-size: 20px; }
.opp .timer, .me-bar .timer {
  position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(var(--cur) calc(var(--p, 1) * 360deg), rgba(255,255,255,.12) 0);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%);
  opacity: 0; transition: opacity .2s;
}
.turn .timer { opacity: 1; }
.turn .timer.warn { animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.opp.turn .ava { transform: scale(1.08); box-shadow: 0 0 0 3px var(--cur), 0 0 26px var(--cur); }
.opp .ava { transition: transform .25s, box-shadow .25s; }
.opp .nm { font-size: 11.5px; color: var(--dim); max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp.turn .nm { color: #fff; }
.opp .count {
  position: absolute; right: -8px; bottom: -4px; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 12px; background: #fff; color: var(--bg); font-size: 13px; font-weight: 900;
  display: grid; place-items: center; box-shadow: 0 3px 8px rgba(0,0,0,.35);
}
.opp .count.one { background: var(--cur); color: #fff; animation: pulse 1s ease-in-out infinite; }
.opp .fan { display: flex; height: 22px; margin-top: 1px; }
.opp .fan i { width: 14px; height: 21px; border-radius: 3px; border: 1.5px solid #fff; margin-left: -9px;
  background: linear-gradient(150deg, #3a2a7a, #1a1236); box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.opp .fan i:first-child { margin-left: 0; }
.opp.off { opacity: .45; }
.opp .badge { position: absolute; top: -6px; left: -6px; font-size: 15px; }
@keyframes pulse { 50% { transform: scale(1.14); } }

.center { flex: 1; min-height: 190px; position: relative; display: flex; align-items: center; justify-content: center; gap: 26px; }
.ring {
  position: absolute; left: 50%; top: 50%; width: min(78vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%);
  color: var(--cur); opacity: .55; pointer-events: none;
}
.ring svg { width: 100%; height: 100%; animation: spin 9s linear infinite; overflow: visible; }
.ring marker path { stroke: none; }
.ring > svg > path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 9; }
.ring.ccw svg { animation-direction: reverse; transform: scaleX(-1); }
.ring.flip svg { animation-duration: .9s; }
@keyframes spin { to { rotate: 360deg; } }
.pile { position: relative; width: var(--cw); height: var(--ch); --cw: 72px; --ch: 106px; }
.pile .card-back { position: absolute; left: 0; top: 0; --cw: 72px; --ch: 106px; }
.pile.can { animation: nudge 1.4s ease-in-out infinite; }
.pile.can::after {
  content: ''; position: absolute; inset: -6px; border-radius: 16px; border: 3px solid var(--cur);
  box-shadow: 0 0 20px var(--cur); animation: pulseRing 1.4s ease-in-out infinite;
}
.pile .n { position: absolute; bottom: -24px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--dim); }
@keyframes nudge { 50% { transform: translateY(-4px); } }
@keyframes pulseRing { 50% { opacity: .35; } }
.discard { position: relative; width: 84px; height: 124px; }
.discard .card { --cw: 84px; --ch: 124px; position: absolute; left: 0; top: 0; }
.discard .card.under { opacity: .9; }
.discard .card.land { animation: land .34s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes land { from { transform: scale(1.25) rotate(var(--r, 0deg)); } }
.pending {
  position: absolute; left: calc(50% + 56px); top: calc(50% - 76px);
  min-width: 52px; height: 52px; padding: 0 10px; border-radius: 26px;
  background: #fff; color: var(--bg); font-size: 22px; font-weight: 900;
  display: grid; place-items: center; transform: rotate(12deg);
  box-shadow: 0 0 0 4px var(--cur), 0 10px 24px rgba(0,0,0,.4);
  animation: pop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop { from { transform: scale(0) rotate(12deg); } }

.me-bar { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; flex: 0 0 auto; }
.me-bar .ava-wrap { position: relative; width: 40px; height: 40px; display: grid; place-items: center; }
.me-bar .ava { width: 36px; height: 36px; font-size: 15px; }
.me-bar .turn-tag { font-size: 15px; font-weight: 900; padding: 6px 14px; border-radius: 16px; background: var(--cur); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.2); animation: pop .3s; }
.me-bar .score { font-size: 13px; color: var(--dim); }
.me-bar .chat-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--glass); border: 1px solid var(--line); font-size: 17px; }

.hand { position: relative; height: calc(var(--ch) + 40px); flex: 0 0 auto; touch-action: none; }
.hand .card {
  position: absolute; bottom: 18px; left: 50%;
  transform-origin: 50% 120%;
  transition: transform .22s cubic-bezier(.3,.7,.3,1), filter .2s, margin .2s;
  cursor: pointer;
}
.hand.mine .card.dim { filter: brightness(.45) saturate(.7); cursor: default; }
.hand.mine .card.ok { cursor: pointer; }
.hand .card.ok::before {
  content: ''; position: absolute; top: -10px; left: 50%; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; transform: translateX(-50%); box-shadow: 0 0 8px #fff;
}
.hand .card.new { animation: drawIn .4s cubic-bezier(.3,.7,.3,1); }
@keyframes drawIn { from { opacity: 0; translate: 0 -80px; } }

.controls { display: flex; align-items: center; justify-content: center; gap: 12px; height: 62px; flex: 0 0 auto; }
.act {
  height: 54px; min-width: 54px; padding: 0 18px; border-radius: 27px;
  background: var(--glass-2); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; font-weight: 900;
  transition: transform .12s, background .2s;
}
.act svg { width: 22px; height: 22px; }
.act.uno {
  background: linear-gradient(135deg, var(--R), #ff7a18); color: #fff; font-size: 20px; letter-spacing: .02em;
  box-shadow: 0 8px 22px rgba(255, 71, 87, .5); font-style: italic;
}
.act.uno.armed { background: #fff; color: var(--R); box-shadow: 0 0 0 4px var(--R), 0 0 30px var(--R); }
.act.uno.urgent { animation: pulse .6s ease-in-out infinite; }
.act.catch { background: linear-gradient(135deg, var(--Y), #ff9f1a); color: #2a1300; animation: pulse .7s ease-in-out infinite; }

/* ═════════ Нисэх / эффект ═════════ */
.fly, .fx { position: absolute; inset: 0; pointer-events: none; z-index: 40; overflow: visible; }
.fly .card, .fly .card-back { position: absolute; left: 0; top: 0; will-change: transform; }
.burst {
  position: absolute; transform: translate(-50%, -50%) scale(.3); opacity: 0;
  font-size: 40px; font-weight: 900; color: #fff; white-space: nowrap;
  text-shadow: 0 3px 0 rgba(0,0,0,.25), 0 0 24px var(--cur);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .25s;
  display: flex; align-items: center; gap: 6px;
}
.burst svg { width: 46px; height: 46px; }
.burst.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.burst.sm { font-size: 22px; }
.burst.uno-b { font-style: italic; color: #fff; background: var(--R); padding: 4px 14px; border-radius: 18px; font-size: 22px; box-shadow: 0 8px 20px rgba(0,0,0,.35); text-shadow: none; }
.bubble {
  position: absolute; transform: translate(-50%, -100%) scale(.6); opacity: 0;
  max-width: 160px; padding: 7px 12px; border-radius: 16px; background: #fff; color: var(--bg);
  font-size: 13px; font-weight: 800; transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s;
  box-shadow: 0 8px 20px rgba(0,0,0,.35); text-align: center; overflow-wrap: anywhere;
}
.bubble.emoji { background: none; box-shadow: none; font-size: 36px; padding: 0; }
.bubble.show { transform: translate(-50%, -100%) scale(1); opacity: 1; }

/* ═════════ Өнгө сонгогч ═════════ */
.color-picker {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(10, 6, 24, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  grid-template-columns: 96px 96px; grid-template-rows: 96px 96px; gap: 12px; place-content: center;
  animation: fade .2s;
}
.cp { width: 96px; height: 96px; border: 4px solid #fff; box-shadow: 0 10px 24px rgba(0,0,0,.4); transition: transform .12s; }
.cp:nth-child(1) { border-radius: 96px 18px 18px 18px; }
.cp:nth-child(2) { border-radius: 18px 96px 18px 18px; }
.cp:nth-child(3) { border-radius: 18px 18px 18px 96px; }
.cp:nth-child(4) { border-radius: 18px 18px 96px 18px; }
.cp:active { transform: scale(.92); }
@keyframes fade { from { opacity: 0; } }

/* ═════════ Overlay ═════════ */
.overlay {
  position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(10, 6, 24, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade .25s;
}
.sheet {
  width: 100%; max-width: 380px; max-height: 100%; overflow-y: auto;
  background: linear-gradient(170deg, var(--bg-2), var(--bg)); border: 1px solid var(--line);
  border-radius: 26px; padding: 22px 18px; display: flex; flex-direction: column; align-items: center; gap: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.hero { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero .ava { width: 84px; height: 84px; font-size: 34px; box-shadow: 0 0 0 4px var(--Y), 0 0 40px var(--Y); }
.hero .big { font-size: 26px; font-weight: 900; }
.hero .plus { font-size: 34px; font-weight: 900; color: var(--Y); }
.ranks { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.rk { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: var(--glass); }
.rk.me { background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); }
.rk .ava { width: 34px; height: 34px; font-size: 14px; }
.rk .pos { width: 20px; text-align: center; color: var(--dim); }
.rk .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.rk .bar { position: relative; flex: 1.2; height: 10px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; }
.rk .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: linear-gradient(90deg, var(--Y), #ff7a18); transition: width .8s cubic-bezier(.3,.7,.3,1); }
.rk .pts { min-width: 40px; text-align: right; font-size: 15px; }
.rk .minis { display: flex; }
.rk .minis .card { --cw: 22px; --ch: 32px; margin-left: -10px; border-width: 1.5px; font-size: 5px; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.rk .minis .card:first-child { margin-left: 0; }
.rk .minis .card .cv { display: none; }
.countdown { width: 100%; height: 4px; border-radius: 2px; background: rgba(255,255,255,.1); overflow: hidden; }
.countdown i { display: block; height: 100%; background: var(--cur); animation: shrink 6s linear forwards; }
@keyframes shrink { from { width: 100%; } to { width: 0; } }

.records { width: 100%; }
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--glass); margin-bottom: 8px; }
.tab { flex: 1; height: 34px; border-radius: 10px; font-size: 13px; color: var(--dim); }
.tab.on { background: #fff; color: var(--bg); }
.rec-list { display: flex; flex-direction: column; gap: 6px; min-height: 60px; }
.rec { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; font-size: 13px; }
.rec.me { background: var(--glass-2); }
.rec .ava { width: 28px; height: 28px; font-size: 12px; }
.rec .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-empty { text-align: center; color: var(--dim); font-size: 13px; padding: 14px 0; font-weight: 700; }
.rec-empty button { margin-top: 6px; }

/* ═════════ Чат ═════════ */
.chat {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 75;
  width: min(94vw, 420px); padding: 12px; border-radius: 22px;
  background: rgba(29, 20, 66, .96); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 10px; animation: fade .18s;
}
.chat-emojis { display: flex; justify-content: space-between; }
.chat-emojis button { font-size: 28px; width: 42px; height: 42px; border-radius: 12px; }
.chat-emojis button:active { background: var(--glass-2); }
.chat-phrases { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-phrases button { padding: 8px 12px; border-radius: 14px; background: var(--glass); font-size: 13px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input {
  flex: 1; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); padding: 0 12px;
  font-size: 16px; outline: none; -webkit-user-select: text; user-select: text;
}
.chat-form button { width: 42px; height: 42px; border-radius: 14px; background: #fff; color: var(--bg); font-size: 18px; }

/* ═════════ Toast / offline ═════════ */
.toast {
  position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); z-index: 90;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 16px; background: #fff; color: var(--bg); font-size: 14px;
  box-shadow: 0 10px 26px rgba(0,0,0,.4); transition: transform .25s, opacity .25s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.offline { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 91; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.5); display: grid; place-items: center; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; }

/* Жижиг өндөртэй дэлгэц */
@media (max-height: 640px) {
  :root { --cw: 56px; --ch: 84px; }
  .opps { min-height: 128px; height: 28%; }
  .discard { width: 72px; height: 106px; }
  .discard .card { --cw: 72px; --ch: 106px; }
  .pile, .pile .card-back { --cw: 62px; --ch: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
