/* Лингора — shared game-over screen (result.js) */
.rs { flex: 1 1 auto; width: 100%; max-width: 460px; margin: 0 auto; min-height: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: stretch; gap: 12px; text-align: center; padding: 4px 2px max(6px, env(safe-area-inset-bottom)); }
.rs-hero { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.rs-say { position: relative; max-width: 92%; padding: 10px 16px; border-radius: 18px; background: linear-gradient(135deg, #8B2FD9, #C2268E); color: #fff; font-weight: 800; font-size: 16px; line-height: 1.25; box-shadow: 0 8px 24px rgba(139, 47, 217, .35); margin-bottom: clamp(16px, 3.6vh, 32px); animation: rsSay .45s var(--spring, cubic-bezier(.2, .9, .3, 1.3)) both .15s; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.rs-say::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px; margin-left: -8px; background: #B02AA8; transform: rotate(45deg); border-radius: 3px; }
.rs-say.pop { animation: rsSay .45s var(--spring, cubic-bezier(.2, .9, .3, 1.3)) both; }
.rs.lose .rs-say { background: var(--surface-2, #2a1d4a); color: var(--text, #fff); box-shadow: none; border: 1px solid var(--line-2, rgba(255,255,255,.12)); }
.rs.lose .rs-say::after { background: var(--surface-2, #2a1d4a); border-right: 1px solid var(--line-2, rgba(255,255,255,.12)); border-bottom: 1px solid var(--line-2, rgba(255,255,255,.12)); }
.rs-lori.mascot { width: min(100%, 220px); height: clamp(88px, 20vh, 180px); max-height: 180px; min-height: 84px; flex: 0 1 auto; }
.rs-lori.mascot svg { width: 100%; height: 100%; }
.rs-lori.jump { animation: gmJump .8s var(--spring, ease) .2s both, onbBob 2.4s ease-in-out 1s infinite; }
.rs-title { font-size: clamp(26px, 4.2vh, 34px); font-weight: 900; line-height: 1.1; margin-top: 2px; }
.rs-sub { font-size: 15px; color: var(--muted); font-weight: 600; line-height: 1.3; margin-top: 2px; margin-bottom: 4px; }
.rs-card { background: var(--surface, rgba(255,255,255,.06)); border: 1px solid var(--line-2, rgba(255,255,255,.1)); border-radius: 18px; padding: 12px 10px; }
.rs-stake { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 12px; }
.rs-stake .mp-res-st.win b { font-size: clamp(34px, 6vh, 48px); }
.rs-bal { font-size: 14px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.rs-bal b { color: #FFD66B; font-weight: 900; }
.rs-stats { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; }
.rs-stats.n1 { --n: 1; } .rs-stats.n2 { --n: 2; } .rs-stats.n3 { --n: 3; } .rs-stats.n4 { --n: 4; gap: 6px; }
.rs-stats.n4 .rs-st b { font-size: 18px; } .rs-stats.n4 .rs-st span { font-size: 11px; }
.rs-st { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 68px; min-width: 0; }
.rs-st b { font-size: 22px; font-weight: 900; line-height: 1.1; white-space: nowrap; }
.rs-st span { font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.2; }
.rs-st.up b { color: #4FE0A0; } .rs-st.down b { color: #FF8A94; } .rs-st.gold b { color: #FFD66B; }
.rs-acts { display: flex; flex-direction: column; gap: 10px; }
.rs-acts > .btn { min-height: 54px; }
.rs-row { display: flex; gap: 10px; }
.rs-row .btn { flex: 1 1 0; min-height: 56px; font-size: 17px; }
@keyframes rsSay { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }
@media (max-height: 700px) {
  .rs { gap: 9px; }
  .rs-say { font-size: 14px; padding: 7px 12px; margin-bottom: 18px; }
  .rs-title { font-size: 26px; }
  .rs-stake .mp-res-st.win b { font-size: 32px; }
  .rs-row .btn, .rs-acts > .btn { min-height: 50px; }
  .rs-st { min-height: 58px; padding: 8px 6px; }
  .rs-st b { font-size: 19px; }
  .rs-stake { padding: 10px; }
}
/* UNO / billiards: the game-over layer covers the whole table */
.uno-res.rs-host { align-items: stretch; justify-content: center; background: var(--bg, #140a2a); background-image: radial-gradient(120% 60% at 100% 0%, var(--bg-glow-2, rgba(194,38,142,.18)), transparent 60%), radial-gradient(100% 50% at 0% 100%, var(--bg-glow-1, rgba(139,47,217,.18)), transparent 60%); padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); overflow-y: auto; }
/* checkers: result fills the body under the header */
.rs-body { display: flex; flex-direction: column; padding-bottom: 0; }
.rs-body > .rs { flex: 1 1 auto; min-height: 0; }
@media (prefers-reduced-motion: reduce) { .rs-say, .rs-lori.jump { animation: none !important; } }
.rs-slot:empty { display: none; }
.rs-party { padding: 10px 8px 12px; }
.rs-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.rs-party .rs-stats { gap: 0; }
.rs-party .rs-st { min-height: 52px; padding: 2px 4px; }
.rs-party .rs-st + .rs-st { border-left: 1px solid var(--line-2, rgba(255,255,255,.1)); }
.rs-party .rs-st b { font-size: 24px; }
.rs-stats.n4 .rs-st b { font-size: 19px; }
@media (max-height: 700px) { .rs-party .rs-st b { font-size: 20px; } .rs-party .rs-st { min-height: 46px; } .rs-eyebrow { margin-bottom: 4px; } }
/* light theme: readable accents */
html[data-theme="light"] .rs-st.gold b, html[data-theme="light"] .rs-bal b { color: #B87800; }
html[data-theme="light"] .rs-st.up b { color: #0E9A57; }
html[data-theme="light"] .rs-st.down b { color: #D2334A; }
html[data-theme="light"] .rs-stake .mp-res-st.win span { color: #B87800; }
/* billiards is always dark: keep its game-over screen dark in both themes */
.pool .uno-res.rs-host { --bg: #140A2A; --surface: rgba(255, 255, 255, .06); --surface-2: rgba(255, 255, 255, .1); --line-2: rgba(255, 255, 255, .12); --muted: rgba(253, 247, 255, .66); --ink: #FDF7FF; color: #FDF7FF;
  background: #140A2A; background-image: radial-gradient(120% 60% at 100% 0%, rgba(194, 38, 142, .2), transparent 60%), radial-gradient(100% 50% at 0% 100%, rgba(139, 47, 217, .22), transparent 60%); }
.pool .uno-res.rs-host .rs-st.gold b, .pool .uno-res.rs-host .rs-bal b { color: #FFD66B; }
.pool .uno-res.rs-host .rs-st.up b { color: #4FE0A0; } .pool .uno-res.rs-host .rs-st.down b { color: #FF8A94; }
.pool .uno-res.rs-host .btn-ghost { color: #FDF7FF; border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); }
.pool .uno-res.rs-host .mp-res-st.win span { color: #FFD66B; }
/* rd8: the outfit-aware viewBox (result.js fit) keeps hats inside the box; Лори's motion never rises into the bubble */
.rs-lori.jump { animation: rsPop .55s var(--spring, ease) .15s both; transform-origin: 50% 100%; }
@keyframes rsPop { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
.rs-say { margin-bottom: clamp(20px, 3.2vh, 30px); }
@media (max-height: 700px) { .rs-say { margin-bottom: 18px; } }
@media (min-height: 760px) { .rs-lori.mascot { width: min(100%, 240px); height: clamp(104px, 22vh, 210px); max-height: 210px; } }
