:root {
  --bg: #0d0a17;
  --surface: #151024;
  --raised: #1e1733;
  --raised-2: #271e42;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f4f1ff;
  --muted: #a59cc4;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-ink: #fff;
  --red: #ef4444;
  --yellow: #f5b014;
  --green: #22c55e;
  --blue: #3b82f6;
  --current: var(--blue);
  --radius: 14px;
  --bar-h: 60px;
  --card-w: clamp(62px, 7.4vw, 104px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px;
  background: var(--raised); border: 1px solid var(--line); color: var(--text);
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--raised-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn.icon { width: 38px; padding: 0; position: relative; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; height: 44px; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn-primary:hover { background: #7c4df0; border-color: transparent; }
.btn.danger { color: #fca5a5; }
.btn[aria-pressed="true"] { background: rgba(139, 92, 246, .22); border-color: rgba(139, 92, 246, .55); color: #ddd2ff; }
.btn .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
#btn-sound[aria-pressed="false"] .wave { opacity: .2; }
.site-bar {
  height: var(--bar-h); display: flex; align-items: center; gap: 24px; padding: 0 20px;
  border-bottom: 1px solid var(--line); background: rgba(13, 10, 23, .9); backdrop-filter: blur(14px);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 17px; }
.brand img { border-radius: 9px; }
.site-nav { display: flex; gap: 4px; margin-right: auto; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; padding: 7px 12px; border-radius: 9px; }
.site-nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.site-nav a[aria-current="page"] { color: var(--text); background: rgba(139, 92, 246, .18); }
.app {
  height: calc(100dvh - var(--bar-h));
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; padding: 16px;
}
.table {
  position: relative; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 20px 14px; border-radius: 22px; border: 1px solid var(--line);
  background:
    radial-gradient(60% 55% at 50% 45%, color-mix(in srgb, var(--current) 22%, transparent), transparent 70%),
    radial-gradient(80% 60% at 50% 0%, rgba(139, 92, 246, .18), transparent 70%),
    linear-gradient(180deg, #171029, #100b1d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02), inset 0 -80px 120px rgba(0, 0, 0, .35);
  transition: background .5s;
  overflow: hidden;
}
.table-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.title img { border-radius: 11px; }
.title h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.title p { margin: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.panel-toggle { display: none; }
.opponents { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.opponent {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; min-width: 190px;
  border-radius: 16px; background: rgba(21, 16, 36, .78); border: 1px solid var(--line);
  transition: border-color .2s, transform .25s var(--ease), box-shadow .2s;
}
.opponent.turn { border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(139, 92, 246, .16); transform: translateY(2px); }
.opponent .avatar { position: relative; width: 44px; height: 44px; flex: none; }
.opponent .avatar img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--raised); }
.opponent .avatar.speaking img { box-shadow: 0 0 0 3px var(--green); }
.opponent .who { min-width: 0; flex: 1; }
.opponent .name { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.opponent .name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); color: var(--muted); }
.tag.uno { background: var(--red); color: #fff; }
.opponent .count { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.mini-fan { display: flex; height: 22px; }
.mini-fan i { width: 15px; height: 22px; margin-left: -9px; border-radius: 3px; background: linear-gradient(160deg, #3b2a6b, #1b1333); border: 1px solid rgba(255, 255, 255, .25); }
.mini-fan i:first-child { margin-left: 0; }
.tactic { font-size: 11.5px; color: var(--accent-2); font-weight: 600; }
.center { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: clamp(20px, 5vw, 64px); }
.pile { position: relative; background: none; border: 0; padding: 0; width: calc(var(--card-w) * 1.18); }
.pile img { width: 100%; border-radius: 10px; box-shadow: 0 18px 30px -14px rgba(0, 0, 0, .8); }
.draw-pile { transition: transform .15s var(--ease); }
.draw-pile:hover { transform: translateY(-3px); }
.draw-pile .pile-stack { position: absolute; inset: 0; transform: translate(5px, 5px); border-radius: 10px; background: #2a1f48; box-shadow: 5px 5px 0 #1d1534; }
.draw-pile img { position: relative; }
.draw-pile.ready img { box-shadow: 0 0 0 3px var(--accent-2), 0 0 32px rgba(167, 139, 250, .5); animation: pulse 1.6s ease-in-out infinite; }
.pile-label { position: absolute; left: 0; right: 0; bottom: -26px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.discard-pile { width: calc(var(--card-w) * 1.32); }
.color-halo { position: absolute; inset: -18px; border-radius: 24px; background: var(--current); filter: blur(26px); opacity: .45; transition: background .4s; }
.discard-pile img { position: relative; transform: rotate(var(--tilt, -3deg)); }
.discard-pile img.landed { animation: land .35s var(--ease); }
.table-info { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; background: rgba(21, 16, 36, .8); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--current); box-shadow: 0 0 10px var(--current); }
.dir { transition: transform .4s var(--ease); }
.dir.ccw { transform: scaleX(-1); }
.chip.penalty { background: var(--red); border-color: transparent; color: #fff; font-size: 15px; animation: pop .3s var(--ease); }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px var(--accent-2), 0 0 48px rgba(167, 139, 250, .75); } }
@keyframes land { from { transform: translateY(70px) rotate(14deg) scale(.85); opacity: .3; } }
@keyframes pop { from { transform: scale(.4); } 70% { transform: scale(1.12); } }
.status { text-align: center; font-weight: 700; font-size: 15px; min-height: 22px; color: var(--muted); }
.status.mine { color: #ddd2ff; }
.timer { display: block; width: min(360px, 70%); height: 4px; margin: 8px auto 0; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--accent-2); transform-origin: left; }
.hand-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sort { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 11px; background: rgba(21, 16, 36, .8); border: 1px solid var(--line); }
.sort span { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.sort button { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 6px 11px; border-radius: 8px; }
.sort button.on { background: var(--raised-2); color: var(--text); }
.hand-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uno-btn {
  height: 44px; padding: 0 22px; border-radius: 12px; border: 0; font-weight: 800; font-size: 17px; letter-spacing: .04em;
  background: var(--raised); color: var(--muted); position: relative; overflow: hidden;
}
.uno-btn:not(:disabled) { background: linear-gradient(135deg, #ef4444, #f97316); color: #fff; box-shadow: 0 8px 24px -8px rgba(239, 68, 68, .8); animation: nudge 1s ease-in-out infinite; }
.uno-btn:disabled { cursor: default; opacity: .6; }
.uno-btn .fuse { position: absolute; left: 0; bottom: 0; height: 3px; background: #fff; animation: fuse var(--fuse, 2.5s) linear forwards; }
@keyframes nudge { 50% { transform: translateY(-2px) scale(1.03); } }
@keyframes fuse { from { width: 100%; } to { width: 0; } }
.hand {
  --overlap: 0px;
  display: flex; justify-content: center; align-items: flex-end;
  min-height: calc(var(--card-w) * 1.55 + 26px); padding: 22px 8px 4px;
}
.card {
  position: relative; flex: none; width: var(--card-w); margin-left: var(--overlap);
  border: 0; padding: 0; background: none; border-radius: 9px;
  transition: transform .18s var(--ease), filter .18s, margin .2s;
}
.card:first-child { margin-left: 0; }
.card img { width: 100%; border-radius: 9px; box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .9); pointer-events: none; }
.card.playable { transform: translateY(-12px); }
.card.playable img { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 14px 26px -10px rgba(0, 0, 0, .9); }
.card.playable:hover, .card.playable:focus-visible { transform: translateY(-26px) scale(1.05); z-index: 3; }
.card.dim { filter: brightness(.55) saturate(.6); cursor: default; }
.card.hint img { box-shadow: 0 0 0 3px #facc15, 0 0 22px rgba(250, 204, 21, .6); }
.card.selected { transform: translateY(-30px); z-index: 2; }
.card.selected img { box-shadow: 0 0 0 3px var(--accent-2), 0 0 26px rgba(167, 139, 250, .7); }
.card .order { position: absolute; top: -10px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.card.new { animation: deal .45s var(--ease) both; }
@keyframes deal { from { transform: translateY(-80px) rotate(-12deg); opacity: 0; } }
.panel { min-height: 0; display: flex; flex-direction: column; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { flex: 1; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13.5px; padding: 9px 0; border-radius: 9px; position: relative; }
.tabs [role="tab"][aria-selected="true"] { background: var(--raised); color: var(--text); }
.tabs [role="tab"].unread::after { content: ""; position: absolute; top: 7px; right: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.tabs .close { display: none; border: 0; background: none; font-size: 22px; color: var(--muted); padding: 0 10px; }
.tab-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px; gap: 10px; overflow: hidden; }
.empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 28px 12px; }
.feed { list-style: none; margin: 0; padding: 0 4px 0 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.feed li { padding: 7px 10px; border-radius: 9px; color: var(--muted); display: flex; gap: 10px; }
.feed li time { flex: none; font-variant-numeric: tabular-nums; font-size: 12px; opacity: .6; padding-top: 1px; }
.feed li.you { color: var(--text); }
.feed li.alert { color: #fca5a5; background: rgba(239, 68, 68, .07); }
.feed li.big { color: #ddd2ff; background: rgba(139, 92, 246, .1); }
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; }
.msg img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; background: var(--raised); }
.msg b { font-size: 13.5px; } .msg time { font-size: 11.5px; color: var(--muted); margin-left: 6px; }
.msg p { margin: 2px 0 0; font-size: 14px; word-break: break-word; }
.composer { display: flex; gap: 8px; }
.composer input { flex: 1; min-width: 0; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); padding: 0 12px; }
.composer input:focus { outline: none; border-color: var(--accent); }
.voice-self { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.roster { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.roster li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--raised); }
.roster img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.roster li.speaking img { box-shadow: 0 0 0 3px var(--green); }
.roster span { flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster input[type="range"] { width: 80px; accent-color: var(--accent); }
.leader { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px; border: 1px dashed var(--line-strong); }
.leader > span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.leader div { display: flex; gap: 6px; flex-wrap: wrap; }
.modal { border: 0; padding: 0; background: none; color: var(--text); max-width: calc(100vw - 32px); }
.modal::backdrop { background: rgba(6, 4, 12, .72); backdrop-filter: blur(4px); }
.modal[open] .modal-body { animation: rise .25s var(--ease); }
@keyframes rise { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.modal-body { width: 480px; max-width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); }
.modal-body.narrow { width: 400px; text-align: center; align-items: center; }
.modal header { display: flex; align-items: center; justify-content: space-between; }
.modal h2 { margin: 0; font-size: 20px; font-weight: 800; }
.modal .close { border: 0; background: none; color: var(--muted); font-size: 26px; line-height: 1; padding: 0 4px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; width: 100%; }
.modal-body.narrow footer { justify-content: center; }
.muted { color: var(--muted); margin: 0; font-size: 14px; }
.rule { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 12px; background: var(--raised); cursor: pointer; }
.rule b { display: block; font-size: 14.5px; } .rule small { color: var(--muted); font-size: 12.5px; }
.rule input { appearance: none; width: 40px; height: 22px; border-radius: 999px; background: #3a3058; position: relative; flex: none; cursor: pointer; transition: background .15s; }
.rule input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease); }
.rule input:checked { background: var(--accent); }
.rule input:checked::after { transform: translateX(18px); }
.rule-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rule-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.rule-row select, .custom-size input { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); padding: 0 10px; color: var(--text); }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.modes button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.modes button small { color: var(--muted); font-size: 11.5px; }
.modes button[aria-checked="true"] { border-color: var(--accent); background: rgba(139, 92, 246, .16); }
.custom-size { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.custom-size input { width: 90px; }
.share { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.share-head { display: flex; justify-content: space-between; font-size: 13.5px; }
.share-head span { font-variant-numeric: tabular-nums; color: var(--yellow); font-weight: 700; }
.share label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { flex: 1; min-width: 0; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); padding: 0 10px; font-size: 12.5px; color: var(--text); }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 4px; }
.colors button { height: 82px; border: 0; border-radius: 14px; color: #fff; font-weight: 800; font-size: 16px; transition: transform .12s; }
.colors button:hover { transform: scale(1.04); }
.c-red { background: var(--red); } .c-yellow { background: var(--yellow); color: #2b1c00 !important; } .c-green { background: var(--green); } .c-blue { background: var(--blue); }
.badge { position: relative; width: 220px; aspect-ratio: 1; }
.badge-art { width: 100%; height: 100%; }
.badge-logo { position: absolute; left: 50%; top: 46%; width: 35%; height: 35%; transform: translate(-50%, -50%); border-radius: 50%; object-fit: cover; }
.result .badge { width: 240px; margin-top: -8px; }
.result h2 { font-size: 26px; }
.popup {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: radial-gradient(circle at 50% 45%, rgba(13, 10, 23, .55), rgba(13, 10, 23, .82));
  pointer-events: none; animation: fade-in .18s ease;
}
.popup .badge { width: min(300px, 70vw); animation: slam .55s cubic-bezier(.2, 1.5, .4, 1) both; }
.popup-title { margin: 0; font-size: clamp(26px, 4.4vw, 40px); font-weight: 800; letter-spacing: -.01em; animation: rise .4s .12s var(--ease) both; }
.popup-text { margin: 0; max-width: 460px; padding: 0 20px; text-align: center; color: #d7cff5; font-size: 16px; font-weight: 600; animation: rise .4s .2s var(--ease) both; }
.popup.leaving { animation: fade-out .25s ease forwards; }
@keyframes slam { from { transform: scale(2.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); z-index: 60; padding: 11px 16px; border-radius: 12px; background: var(--raised-2); border: 1px solid var(--line-strong); font-weight: 600; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 4, 12, .62);
  backdrop-filter: blur(3px);
  z-index: 25;
}
.modal-body {
  width: 480px;
  max-width: 100%;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
}
@media (max-width: 1180px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .panel { position: fixed; top: calc(var(--bar-h) + 8px); right: 10px; bottom: 10px; width: min(370px, calc(100vw - 20px)); z-index: 30;
    transform: translateX(calc(100% + 24px)); transition: transform .25s var(--ease); box-shadow: -20px 0 60px rgba(0, 0, 0, .65); }
  .panel.open { transform: none; }
  .panel-toggle { display: inline-flex; position: relative; border-color: rgba(139, 92, 246, .5); background: rgba(139, 92, 246, .15); color: #f3eeff; }
  .tabs .close { display: block; }
}
@media (max-width: 760px) {
  :root { --bar-h: 74px; --card-w: clamp(52px, 14.5vw, 66px); }
  html, body { height: auto; min-height: 100dvh; overflow-x: hidden; overflow-y: auto; }
  .site-bar {
    height: auto;
    min-height: 44px;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 8px;
    padding: 6px 10px;
  }
  .brand { font-size: 14.5px; gap: 7px; }
  .brand img { width: 24px; height: 24px; }
  .site-nav {
    display: flex;
    order: 3;
    width: 100%;
    margin: 0;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1px;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a {
    flex: none;
    font-size: 12px;
    padding: 4px 9px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .03);
  }
  .user-pill { padding: 3px 8px 3px 4px; gap: 6px; max-width: 190px; }
  .user-pill img { width: 24px !important; height: 24px !important; }
  .user-pill-info { min-width: 0; }
  .user-pill-info b, .user-pill-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 115px; font-size: 11.5px; }
  .app {
    height: auto;
    min-height: calc(100dvh - var(--bar-h));
    padding: 6px;
    gap: 8px;
  }
  .table {
    min-height: calc(100dvh - var(--bar-h) - 12px);
    padding: 8px 8px 10px;
    border-radius: 14px;
    gap: 6px;
    overflow: visible;
    justify-content: space-between;
  }
  .table-top {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .title { gap: 8px; }
  .title img { width: 26px; height: 26px; }
  .title h1 { font-size: 15px; }
  .title p { display: block; font-size: 11px; }
  .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  .toolbar .btn {
    flex: 1 1 auto;
    height: 30px;
    padding: 0 9px;
    font-size: 12px;
    gap: 5px;
    border-radius: 9px;
    width: auto;
  }
  .toolbar .btn.icon {
    flex: 0 0 30px;
    width: 30px;
    padding: 0;
  }
  .opponents {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding: 1px 2px 2px;
  }
  .opponents::-webkit-scrollbar { display: none; }
  .opponent {
    flex: 1 0 auto;
    min-width: 135px;
    max-width: 210px;
    padding: 4px 9px 4px 6px;
    gap: 7px;
    border-radius: 11px;
  }
  .opponent .avatar, .opponent .avatar img, .opponents img {
    width: 30px !important;
    height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
  }
  .opponent .name { font-size: 12px; }
  .opponent .count { font-size: 11px; margin-top: 1px; }
  .opponent .tactic, .mini-fan { display: none; }
  .center {
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 8px 16px;
    padding: 2px 0 8px;
  }
  .pile { width: calc(var(--card-w) * 1.02); }
  .discard-pile { width: calc(var(--card-w) * 1.1); }
  .pile-label { bottom: -16px; font-size: 9.5px; }
  .table-info {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    order: 3;
    gap: 5px;
    margin-top: 8px;
  }
  .chip { height: 24px; padding: 0 9px; font-size: 11px; gap: 5px; }
  .status {
    font-size: 12px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
     justify-content: center;
    align-items: center;
    gap: 4px 8px;
    line-height: 1.25;
  }
  .vip-advisor { margin-left: 0; font-size: 11px; padding: 2px 8px; }
  .hand-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }
  .self-seat {
    width: 100%;
    justify-content: flex-start;
    padding: 4px 8px;
    gap: 8px;
    border-radius: 11px;
  }
  .self-seat img {
    width: 28px !important;
    height: 28px !important;
  }
  .self-seat b { font-size: 12px; }
  .self-seat small { font-size: 11px; }
  .sort {
    width: 100%;
    justify-content: space-between;
    padding: 2px;
  }
  .sort span { font-size: 10px; padding: 0 6px; }
  .sort button { flex: 1; text-align: center; padding: 4px 6px; font-size: 11.5px; }
  .hand-actions {
    width: 100%;
    justify-content: space-between;
    gap: 5px;
  }
  .hand-actions .btn {
    flex: 1 1 auto;
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
    gap: 5px;
  }
  .uno-btn {
    flex: 1.2 1 auto;
    height: 32px;
    padding: 0 14px;
    font-size: 14px;
  }
  .hand {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    min-height: calc(var(--card-w) * 1.48 + 18px);
    padding: 16px 8px 6px;
    width: 100%;
  }
  .panel {
    top: auto;
    left: 6px;
    right: 6px;
    bottom: 6px;
    width: auto;
    height: min(76dvh, 520px);
    border-radius: 18px;
    transform: translateY(calc(100% + 24px));
  }
  .panel.open { transform: none; }
  .modal { max-width: calc(100vw - 16px); width: 100%; }
  .modal-body, .lobby-body, .modal-body.narrow {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 16px;
    border-radius: 16px;
  }
  .modes { grid-template-columns: repeat(2, 1fr); }
  .rule-row { grid-template-columns: 1fr; }
  .lobby-rules-summary { flex-direction: column; align-items: flex-start; gap: 4px; }
  .lobby-actions-group { flex-direction: column; }
}
@media (max-height: 720px) and (min-width: 761px) {
  :root { --card-w: clamp(56px, 6vw, 84px); }
  .opponent { padding-top: 6px; padding-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.modal.lobby { max-width: 520px; }
.lobby-body { width: 500px; max-width: 100%; display: flex; flex-direction: column; gap: 14px; }
.lobby-meta { display: flex; gap: 8px; margin-top: 4px; }
.badge-pill { display: inline-flex; align-items: center; padding: 3px 9px; font-size: 11.5px; font-weight: 600; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); color: var(--text); }
.badge-pill.timer { color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.1); font-family: monospace; font-size: 12.5px; }
.lobby-alerts { display: flex; flex-direction: column; gap: 6px; empty-cells: hide; }
.lobby-alert { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.35); border-radius: 10px; font-size: 13px; color: #e2e8f0; animation: rise .25s var(--ease); }
.lobby-alert img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.lobby-players-wrap { display: flex; flex-direction: column; gap: 8px; }
.lobby-players-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.lobby-roster { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.lobby-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.lobby-item-left { display: flex; align-items: center; gap: 10px; }
.lobby-slot { font-size: 11px; font-weight: 800; padding: 3px 6px; border-radius: 6px; background: var(--surface); color: var(--muted); min-width: 24px; text-align: center; }
.lobby-item-left img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--surface); }
.lobby-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.lobby-crown { color: #f59e0b; font-size: 13px; }
.lobby-item-right { display: flex; align-items: center; gap: 6px; }
.btn-reorder { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.btn-reorder:hover { background: var(--line); }
.btn-kick { width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.12); color: #ef4444; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.btn-kick:hover { background: rgba(239, 68, 68, 0.25); }
.lobby-rules-summary { font-size: 12px; color: var(--muted); background: var(--surface); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.lobby-waiting { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; font-size: 13.5px; color: var(--muted); background: var(--surface); border-radius: 12px; text-align: center; width: 100%; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { opacity: 0.3; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0.3; transform: scale(0.9); } }
.lobby-actions-group { display: flex; gap: 8px; width: 100%; }
.challenge-settings { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; max-height: 220px; overflow-y: auto; padding-right: 4px; }
.card.vip-must-play { box-shadow: 0 0 0 3px #10b981, 0 8px 24px rgba(16, 185, 129, 0.65) !important; transform: translateY(-16px) scale(1.08) !important; z-index: 25 !important; }
.card.vip-must-play::after { content: "MUST PLAY"; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: #10b981; color: #fff; font-size: 9.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,0.5); pointer-events: none; letter-spacing: 0.5px; }
.vip-advisor { display: inline-flex; align-items: center; gap: 6px; background: rgba(16, 185, 129, 0.16); border: 1px solid rgba(16, 185, 129, 0.45); color: #34d399; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-left: 10px; }
.speaking, .player.speaking .avatar, .roster li.speaking img { box-shadow: 0 0 0 3px #10b981, 0 0 16px rgba(16, 185, 129, 0.8) !important; border-color: #10b981 !important; }

.opponents img, .opponent .avatar img, .player .avatar img, .avatar img {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex: none !important;
}

.colors button { position: relative; }
.colors button.vip-must-play {
  box-shadow: 0 0 0 4px #10b981, 0 10px 24px rgba(16, 185, 129, 0.7) !important;
  transform: scale(1.06) !important;
  z-index: 10 !important;
}
.colors button.vip-must-play::after {
  content: "MUST PLAY";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  letter-spacing: 0.5px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  text-decoration: none;
  color: var(--text);
  transition: background .15s, border-color .15s;
}
.user-pill:hover {
  background: var(--raised-2);
  border-color: var(--accent-2);
}
.user-pill img {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  object-fit: cover;
  background: var(--surface);
}
.user-pill-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.user-pill-info b {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.user-pill-info small {
  font-size: 11px;
  color: var(--muted);
}
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.self-seat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: 14px;
  background: rgba(21, 16, 36, 0.85);
  border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s;
}
.self-seat.turn {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
.self-seat .avatar {
  width: 36px;
  height: 36px;
  flex: none;
}
.self-seat .avatar img {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  background: var(--raised);
}
.self-seat .who {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.self-seat .name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13.5px;
}
.self-seat .count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.tag.discord-tag {
  background: rgba(88, 101, 242, 0.22);
  color: #a5b4fc;
  border: 1px solid rgba(88, 101, 242, 0.4);
}
