/* =========================================================
   红中血流 · mahjong table & tiles
   ========================================================= */
.mj-screen { background: #041c18; }
.mj-body { overflow: hidden; }
.mj-arena { position: absolute; inset: 0; z-index: 2; isolation: isolate; }
.mj-arena::before {
  content: "";
  position: absolute;
  inset: 11px 18px 0;
  border-radius: 45% 45% 12% 12% / 31% 31% 7% 7%;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(51, 153, 122, .35), transparent 64%),
    radial-gradient(ellipse at 50% 99%, rgba(0, 12, 9, .6), transparent 53%),
    linear-gradient(158deg, #0f4a3c 0%, #0a3b30 45%, #06261f 100%);
  border: 7px solid #3e2a1a;
  box-shadow:
    0 0 0 2px rgba(175, 137, 75, .5),
    0 0 0 3px rgba(49, 29, 13, .8),
    inset 0 0 140px rgba(0, 0, 0, .4);
}
.mj-arena::after {
  content: "";
  position: absolute;
  inset: 28px 33px 10px;
  border-radius: inherit;
  border: 1px solid rgba(194, 234, 213, .12);
  box-shadow: inset 0 0 100px rgba(0, 0, 0, .2);
  pointer-events: none;
}
.mj-screen .felt::before { opacity: .7; }
.mj-screen .felt::after { opacity: .07; }
.mj-bamboo {
  position: absolute;
  z-index: 1;
  width: 220px;
  height: 280px;
  opacity: .16;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 280'%3E%3Cg fill='none' stroke='%2383c1a2' stroke-width='2'%3E%3Cpath d='M64 280C56 213 72 143 115 62'/%3E%3Cpath d='M109 123C74 105 47 82 40 50'/%3E%3Cpath d='M95 164C128 151 159 123 175 88'/%3E%3Cpath d='M81 207C51 194 31 170 23 145'/%3E%3C/g%3E%3Cg fill='%2383c1a2' opacity='.8'%3E%3Cpath d='M112 79c-17-12-21-31-8-36 13-5 25 16 8 36Z'/%3E%3Cpath d='M78 127c-5-19 5-31 16-25 11 6-2 25-16 25Z'/%3E%3Cpath d='M153 122c5-18 19-24 25-14 6 10-10 20-25 14Z'/%3E%3Cpath d='M56 219c-18-5-26-19-15-26 11-7 24 10 15 26Z'/%3E%3Cpath d='M123 158c16 9 22 25 12 30-10 5-21-13-12-30Z'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
}
.mj-bamboo {
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 50%, #000 10%, transparent 70%);
}
.mj-bamboo-a { left: 8px; bottom: 100px; transform: rotate(-7deg); opacity: .1; }
.mj-bamboo-b { right: 4px; top: 120px; transform: scaleX(-1) rotate(-6deg); opacity: .075; }

/* =========================================================
   Seats
   ========================================================= */
.mj-seat {
  position: absolute;
  z-index: 35;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas: "main rack" "melds melds";
  gap: 4px 6px;
  align-items: start;
  min-width: 0;
}
.mj-seat-main { grid-area: main; display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.mj-seat .seat-avatar-wrap { width: 55px; height: 55px; flex: 0 0 auto; }
.mj-seat .seat-avatar { border-width: 2px; }
.mj-seat .level-pill { bottom: -4px; height: 16px; padding: 0 6px; font-size: 8px; }
.mj-seat .seat-info { padding-top: 2px; min-width: 0; }
.mj-seat .seat-name-row { display: flex; align-items: center; gap: 4px; }
.mj-seat .seat-name { font-size: 11px; color: #eee1c6; max-width: 92px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mj-seat .seat-meta { display: flex; align-items: center; gap: 4px; font-size: 7.5px; color: rgba(198, 190, 164, .45); margin-top: 4px; white-space: nowrap; }
.mj-seat .seat-meta .coin-icon { width: 11px; height: 11px; }
.mj-seat .seat-meta .coin-icon::before { inset: 3.2px; }
.mj-seat .mj-count { color: rgba(226, 200, 143, .58); }
.mj-seat-score { display: flex; gap: 7px; margin-top: 4px; font-size: 8px; color: rgba(193, 184, 159, .42); }
.mj-seat-score span:last-child { color: rgba(116, 215, 176, .66); }
.mj-seat-score span:last-child.negative, .mj-net.negative { color: #d99580; }
.mj-seat-top {
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  grid-template-columns: auto auto;
  background: linear-gradient(90deg, transparent, rgba(4, 29, 23, .2) 20%, rgba(4, 29, 23, .2) 80%, transparent);
  padding: 3px 12px;
  border-radius: 30px;
}
.mj-seat-top .seat-avatar-wrap { width: 48px; height: 48px; }
.mj-seat-top .seat-meta { margin-top: 3px; }
.mj-seat-left { left: 2.4%; top: 30%; }
.mj-seat-right { right: 2.4%; top: 30%; grid-template-columns: auto auto; justify-items: end; }
.mj-seat-right .mj-seat-main { flex-direction: row-reverse; text-align: right; }
.mj-seat-right .seat-name-row { justify-content: flex-end; }
.mj-seat-right .mj-seat-score { justify-content: flex-end; }
.mj-seat-right .mj-seat-rack { grid-column: 2; }
.mj-seat-right .mj-melds { justify-content: flex-end; }
.mj-seat.is-turn::before {
  content: "";
  position: absolute;
  inset: -10px -15px -10px -8px;
  border-radius: 42px;
  background: radial-gradient(ellipse, rgba(245, 204, 118, .1), transparent 69%);
  pointer-events: none;
  z-index: -1;
}
.mj-seat.is-turn .seat-avatar { border-color: rgba(255, 221, 143, .92); box-shadow: 0 0 0 3px rgba(241, 202, 120, .12), 0 0 23px rgba(241, 196, 97, .22), 0 6px 15px rgba(0, 0, 0, .4); }
.mj-seat.is-turn .seat-time-ring,
.mj-user-seat.is-turn .seat-time-ring { opacity: 1; }
.mj-seat.is-turn .seat-name,
.mj-user-seat.is-turn .seat-name { color: #ffe4ae; }
.mj-dealer-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-kai);
  font-size: 9px;
  color: #4b2b08;
  background: radial-gradient(circle at 35% 28%, #fff3c5, #e9c574 45%, #b9812c);
  border: 1px solid rgba(255, 241, 189, .7);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  z-index: 5;
}
.mj-miss {
  font-size: 6.5px;
  padding: 2px 4px;
  border-radius: 3px;
  color: #ffcfae;
  background: rgba(133, 49, 31, .44);
  border: 1px solid rgba(240, 159, 110, .25);
  white-space: nowrap;
}
.mj-seat-rack { grid-area: rack; display: flex; align-items: center; gap: 4px; margin-top: 7px; }
.mj-racket { display: flex; }
.mj-rack { display: flex; gap: 1px; }
.mj-rack-tile {
  display: block;
  width: 11px;
  height: 16px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(45deg, transparent 0 3px, rgba(223, 206, 157, .14) 3px 4px),
    linear-gradient(145deg, #3b725e, #214b3e);
  border: 1px solid rgba(193, 218, 182, .25);
  box-shadow: 0 2px 0 rgba(2, 16, 12, .35);
  transform: translateY(0);
}
.mj-rack-tile:nth-child(2) { transform: translateY(-1px); }
.mj-rack-tile:nth-child(3) { transform: translateY(0); }
.mj-rack-tile:nth-child(4) { transform: translateY(-2px); }
.mj-seat-rack small { font-size: 7.5px; color: rgba(210, 198, 169, .36); }
.mj-seat-bubble-slot, .seat-bubble-slot { position: absolute; z-index: 70; width: 170px; pointer-events: none; }
.mj-seat .seat-bubble-slot { top: 52px; left: 60px; }
.mj-seat-top .seat-bubble-slot { top: 50px; left: 50%; transform: translateX(-50%); display: flex; justify-content: center; }
.mj-seat-right .seat-bubble-slot { top: 52px; right: 60px; left: auto; display: flex; justify-content: flex-end; }
.mj-seat-right .mj-speech { text-align: right; border-radius: 10px 10px 2px 10px; }
.mj-seat-right .mj-speech::after { left: auto; right: 0; border-width: 0 0 7px 8px; border-color: transparent transparent transparent #e9dbb9; }
.mj-seat .mj-speech { display: inline-block; position: relative; font-size: 9px; }

/* user seat */
.mj-user-seat {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 55;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 8px 3px 3px;
  border-radius: 36px 12px 12px 36px;
  transition: background .25s;
  min-width: 154px;
}
.mj-user-seat .seat-avatar-wrap { width: 54px; height: 54px; }
.mj-user-seat .seat-name { font-size: 10px; max-width: 94px; }
.mj-user-seat .seat-meta { font-size: 7px; }
.mj-user-seat .seat-info { padding-top: 3px; }
.mj-user-seat .mj-win-count { color: rgba(226, 199, 136, .6); }
.mj-net { font-size: 7.5px; color: rgba(116, 215, 176, .64); margin-top: 3px; white-space: nowrap; }
.mj-user-seat.is-turn { background: linear-gradient(90deg, rgba(68, 78, 38, .26), transparent); }
.mj-user-seat.is-turn .seat-avatar { border-color: rgba(255, 222, 146, .95); box-shadow: 0 0 0 3px rgba(241, 202, 120, .13), 0 0 22px rgba(241, 196, 97, .2); }
.mj-user-seat .seat-bubble-slot { left: 0; bottom: 69px; top: auto; width: 180px; }
.mj-user-seat .mj-speech { display: inline-block; }

/* melds */
.mj-melds {
  grid-area: melds;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 230px;
  margin-top: 3px;
  align-items: flex-end;
}
.mj-seat-right .mj-melds { margin-left: auto; }
.mj-seat-top .mj-melds { justify-content: center; }
.mj-meld { display: flex; gap: 1px; align-items: flex-end; padding: 1px; border-radius: 3px; background: rgba(0, 0, 0, .12); }
.mj-meld .mj-tile-meld { --tw: 20px; }
.mj-user-melds {
  position: absolute;
  z-index: 47;
  left: 170px;
  bottom: 87px;
  display: flex;
  gap: 5px;
  align-items: flex-end;
}
.mj-user-melds .mj-tile-meld { --tw: 24px; }
.mj-tile-meld { --tw: 22px; }

/* =========================================================
   Wall
   ========================================================= */
.mj-wall {
  position: absolute;
  z-index: 20;
  left: 50%;
  top: 45.5%;
  transform: translate(-50%, -50%);
  width: 94px;
  height: 94px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(225, 195, 128, .18);
  background:
    radial-gradient(circle at 50% 40%, rgba(93, 177, 140, .16), transparent 62%),
    rgba(4, 29, 22, .44);
  box-shadow: 0 0 0 7px rgba(232, 199, 127, .025), inset 0 0 24px rgba(0, 0, 0, .18);
  pointer-events: none;
}
.mj-wall::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(230, 197, 128, .13);
  border-radius: 50%;
}
.mj-wall::after {
  content: "發";
  position: absolute;
  top: -8px;
  right: -4px;
  font-family: var(--font-kai);
  font-size: 11px;
  color: rgba(235, 208, 146, .6);
}
.mj-wall-top { font-family: var(--font-kai); font-size: 6.5px; letter-spacing: 2.5px; color: rgba(235, 208, 146, .5); margin-bottom: 2px; }
.mj-wall b { font-family: "Georgia", serif; font-size: 25px; line-height: 1; color: #f1dba5; font-weight: 600; }
.mj-wall small { font-size: 6px; letter-spacing: 2px; color: rgba(183, 187, 156, .35); margin-top: 2px; }

/* =========================================================
   Discard rivers
   ========================================================= */
.mj-river {
  position: absolute;
  z-index: 22;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-content: flex-start;
  justify-content: center;
  pointer-events: none;
}
.mj-river-top { top: 17%; left: 50%; transform: translateX(-50%); width: min(310px, 28vw); }
.mj-river-bottom { bottom: 164px; left: 50%; transform: translateX(-50%); width: min(340px, 31vw); }
.mj-river-left { left: 20.5%; top: 44%; transform: translate(-50%, -50%); width: 136px; }
.mj-river-right { right: 20.5%; top: 44%; transform: translate(50%, -50%); width: 136px; }
.mj-river .mj-tile { --tw: 28px; border-radius: 3px; }
.mj-river .mj-tile .mj-corner-num { font-size: 5px; }
.mj-river .mj-tile .mj-face { border-radius: 2px; }
.mj-river .mj-tile.is-last { box-shadow: 0 0 0 1.5px rgba(249, 211, 129, .62), 0 4px 7px rgba(0, 0, 0, .32); }
.mj-river .mj-tile .mj-stick { width: 12%; }
.mj-river .mj-tile .mj-dot { border-width: 1px; }
.mj-river .mj-tile .mj-dot b { width: 30%; height: 30%; }
.mj-river .mj-tile .mj-suit-mini { font-size: 4px; }
.mj-river .mj-tile .mj-wan-num { font-size: calc(var(--tw) * .48); }
.mj-river .mj-tile .mj-wan-char { font-size: calc(var(--tw) * .29); }

/* =========================================================
   Tiles
   ========================================================= */
.mj-tile {
  --tw: 46px;
  width: var(--tw);
  height: calc(var(--tw) * 1.36);
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: calc(var(--tw) * .075);
  background: linear-gradient(160deg, #faf5e7, #e5d8bf);
  box-shadow:
    0 3px 0 #bcae8e,
    0 5px 4px rgba(0, 0, 0, .27),
    inset 0 1px 0 rgba(255, 255, 255, .85);
  transition: transform .15s var(--ease-out), filter .15s, box-shadow .15s;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.mj-tile-body {
  position: absolute;
  inset: 0 0 3px;
  border-radius: inherit;
  overflow: hidden;
  background:
    radial-gradient(circle at 33% 22%, rgba(255, 255, 255, .95), transparent 18%),
    linear-gradient(155deg, #fffdf6 0%, #f8f2e3 58%, #e5d7bd 100%);
  border: 1px solid #cfc1a4;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), inset 0 -7px 11px rgba(164, 143, 105, .11);
  display: block;
}
.mj-tile-edge {
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 0;
  height: 4px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(180deg, #cbbd9e, #a99879);
}
.mj-tile.is-clickable { cursor: pointer; }
.mj-tile.is-clickable:hover { transform: translateY(-5px); box-shadow: 0 4px 0 #bcae8e, 0 9px 12px rgba(0, 0, 0, .28); z-index: 10; }
.mj-tile.is-selected {
  transform: translateY(-12px);
  box-shadow: 0 0 0 2px rgba(249, 210, 125, .88), 0 0 24px rgba(243, 191, 91, .42), 0 7px 13px rgba(0, 0, 0, .3);
  z-index: 20;
}
.mj-tile.is-dingque .mj-tile-body::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-left: 9px solid #b64132;
  border-bottom: 9px solid transparent;
}
.mj-tile.is-dingque .mj-tile-body::before {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b64132;
  box-shadow: 0 0 5px rgba(193, 57, 44, .4);
  z-index: 2;
}
.mj-river .mj-tile.is-dingque .mj-tile-body::after { border-left-width: 5px; border-bottom-width: 5px; }
.mj-hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2px;
  min-height: calc(var(--hand-tw, 60px) * 1.36 + 12px);
  --hand-tw: clamp(40px, 4.15vw, 60px);
}
.mj-hand-inner {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}
.mj-hand .mj-tile { --tw: var(--hand-tw); }
.mj-hand .mj-tile.is-drawn { margin-left: 13px; }
.mj-tile.is-wild { box-shadow: 0 0 0 1px rgba(177, 48, 39, .55), 0 3px 0 #b7a582, 0 0 17px rgba(199, 56, 43, .25); }
.mj-tile.is-wild .mj-tile-body { border-color: #cbae78; }
.mj-face {
  position: absolute;
  inset: 5% 7%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #24322b;
  border-radius: 2px;
}
.mj-corner-num {
  position: absolute;
  top: 1%;
  left: 3%;
  font-family: "Georgia", serif;
  font-size: calc(var(--tw) * .145);
  font-weight: 600;
  color: rgba(66, 72, 54, .78);
  line-height: 1;
}
.mj-suit-mini {
  position: absolute;
  right: 2%;
  bottom: 0;
  font-family: var(--font-kai);
  font-size: calc(var(--tw) * .14);
  color: rgba(42, 91, 62, .62);
  line-height: 1;
}
.mj-face-wan { flex-direction: column; gap: 0; color: #a33128; }
.mj-wan-num { font-family: var(--font-kai); font-size: calc(var(--tw) * .52); line-height: .98; font-weight: 700; text-shadow: 0 1px 0 rgba(255, 255, 255, .65); }
.mj-wan-char { font-family: var(--font-kai); font-size: calc(var(--tw) * .29); color: #a4382c; line-height: 1.05; letter-spacing: .03em; }
.mj-wan-seal { position: absolute; right: 2%; bottom: 1%; font-family: var(--font-kai); font-size: calc(var(--tw) * .1); color: rgba(160, 49, 38, .27); font-style: normal; }
.mj-face-tiao { color: #1d7149; }
.mj-face-tong { color: #2a5e91; }
.mj-stick {
  position: absolute;
  width: 12%;
  height: 25%;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  border-radius: 2px;
  background: linear-gradient(90deg, #145b38, #3ba270 45%, #105330);
  box-shadow: 0 0 0 .5px rgba(12, 63, 38, .45), 1px 1px 2px rgba(19, 62, 40, .18);
}
.mj-stick::before, .mj-stick::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  height: 24%;
  border-radius: 2px;
  background: rgba(241, 233, 204, .65);
}
.mj-stick::before { top: 27%; }
.mj-stick::after { bottom: 27%; }
.mj-stick:nth-child(odd) { filter: brightness(1.08); }
.mj-bird {
  position: relative;
  width: 48%;
  aspect-ratio: 1;
  display: block;
}
.mj-bird::before {
  content: "";
  position: absolute;
  left: 43%;
  top: 22%;
  width: 37%;
  height: 53%;
  border-radius: 55% 42% 50% 44%;
  background: linear-gradient(145deg, #3c9c6c, #165f3e);
  transform: rotate(-24deg);
  box-shadow: 0 1px 2px rgba(16, 77, 48, .3);
}
.mj-bird::after {
  content: "";
  position: absolute;
  left: 8%;
  bottom: 10%;
  width: 54%;
  height: 28%;
  background: linear-gradient(135deg, #3f9b6b, #1a6643);
  clip-path: polygon(0 100%, 65% 12%, 100% 72%, 54% 66%, 24% 100%);
  transform: rotate(12deg);
  opacity: .9;
}
.mj-bird i {
  position: absolute;
  right: 19%;
  top: 17%;
  width: 19%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #1c6743;
  z-index: 2;
}
.mj-bird b {
  position: absolute;
  right: 5%;
  top: 24%;
  width: 20%;
  height: 9%;
  background: #c19645;
  clip-path: polygon(0 13%, 100% 50%, 0 100%);
  z-index: 3;
}
.mj-dot {
  position: absolute;
  width: 17%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: calc(var(--tw) * .04) solid #24598f;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .2) 35%, rgba(199, 222, 240, .55));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .28);
  box-sizing: border-box;
}
.mj-dot b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 31%;
  aspect-ratio: 1;
  background: #2a6095;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.mj-dot.single { width: 39%; border-width: calc(var(--tw) * .045); box-shadow: 0 0 0 calc(var(--tw) * .022) rgba(40, 92, 141, .2); }
.mj-dot.single b { width: 35%; }
.mj-face-wild {
  flex-direction: column;
  gap: calc(var(--tw) * .01);
  color: #b42922;
}
.mj-wild-ring {
  position: absolute;
  left: 5%;
  top: 3%;
  bottom: 3%;
  right: 5%;
  border: 1px solid rgba(178, 44, 35, .36);
  border-radius: 2px;
}
.mj-face-wild b { position: relative; z-index: 1; font-family: var(--font-kai); font-size: calc(var(--tw) * .56); line-height: .95; text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 0 12px rgba(185, 43, 34, .18); }
.mj-face-wild small { position: relative; z-index: 1; font-family: var(--font-kai); font-size: calc(var(--tw) * .11); letter-spacing: .16em; color: rgba(164, 45, 35, .65); }
.mj-tile.is-wild .mj-tile-body { background: radial-gradient(circle at 38% 26%, #fffdf4, #f6edd9 45%, #e7d3ac); }
.mj-tile-back {
  background:
    repeating-linear-gradient(45deg, transparent 0 4px, rgba(225, 207, 158, .08) 4px 5px),
    linear-gradient(145deg, #3d7c61, #1e4a39 65%, #123226);
  border: 1px solid rgba(207, 219, 178, .3);
  box-shadow: 0 2px 0 #102b21, 0 3px 4px rgba(0, 0, 0, .25);
}
.mj-tile-back .mj-back-gem {
  position: absolute;
  inset: 0;
  display: none;
}

/* =========================================================
   Hand area / buttons
   ========================================================= */
.mj-hand-wrap {
  position: absolute;
  z-index: 50;
  left: 138px;
  right: 138px;
  bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.mj-hand.is-locked .mj-tile { pointer-events: none; }
.mj-hand-info {
  position: absolute;
  z-index: 49;
  right: 154px;
  bottom: 84px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 7px;
  color: rgba(207, 198, 173, .42);
  pointer-events: none;
}
.mj-miss-big { color: #e0b784; font-size: 8px; }
.mj-listen { color: rgba(198, 190, 166, .4); }
.mj-listen.has-wait { color: #e9c578; text-shadow: 0 0 12px rgba(235, 191, 101, .18); }
.mj-hand-tools {
  position: absolute;
  z-index: 51;
  right: 20px;
  bottom: 16px;
  font-size: 8px;
  color: rgba(210, 195, 160, .4);
}
.mj-actions {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: 112px;
  transform: translateX(-50%);
  display: none;
}
.mj-actions.visible { display: block; }
.mj-actions .game-actionbar { position: static; transform: none; gap: 8px; }
.mj-actionbar .action-btn { min-width: 80px; height: 38px; }
.mj-actionbar .action-btn.primary { min-width: 102px; }
.mj-actionbar .hu-btn {
  color: #fff1d3;
  border-color: rgba(255, 218, 141, .5);
  background: linear-gradient(180deg, #d25b3e, #9e2b23 60%, #711b19);
  box-shadow: 0 4px 0 #4f1110, 0 8px 18px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 225, 178, .26);
  min-width: 92px;
  font-weight: 700;
}
.mj-actionbar .hu-btn small { font-size: 7px; font-weight: 400; opacity: .7; margin-left: 2px; }
.mj-actions .kbd { font-size: 6px; }
.mj-screen .icon-sound-off { display: none; }
body.is-muted .mj-screen .icon-sound-on { display: none; }
body.is-muted .mj-screen .icon-sound-off { display: block; }

/* =========================================================
   Turn status, phase card, claim banner
   ========================================================= */
.mj-turn-status {
  position: absolute;
  z-index: 48;
  left: 50%;
  top: 76px;
  transform: translateX(-50%);
  height: 24px;
  padding: 0 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(4, 29, 23, .64);
  border: 1px solid rgba(225, 195, 128, .14);
  color: rgba(224, 211, 183, .63);
  font-size: 8px;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(5px);
  max-width: 310px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mj-turn-status i { width: 4px; height: 4px; border-radius: 50%; background: #73d4ae; animation: pulseDot 1.8s infinite; flex: 0 0 auto; }
.mj-turn-status.your-turn { color: #f6d99d; border-color: rgba(242, 204, 128, .3); }
.mj-turn-status.your-turn i { background: #f0c875; box-shadow: 0 0 7px #f0c875; }
.mj-turn-status.hu { color: #ffcfa7; border-color: rgba(227, 148, 92, .35); }

.mj-phase-card {
  position: absolute;
  z-index: 65;
  left: 50%;
  top: 31%;
  transform: translate(-50%, -50%);
  min-width: 310px;
  max-width: 470px;
  padding: 14px 28px 13px;
  border-radius: 13px;
  border: 1px solid rgba(231, 198, 129, .25);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(98, 167, 127, .25), transparent 63%),
    linear-gradient(180deg, rgba(10, 53, 41, .87), rgba(4, 27, 21, .82));
  box-shadow: 0 16px 34px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 247, 212, .06);
  backdrop-filter: blur(7px);
  text-align: center;
  pointer-events: none;
}
.mj-phase-kicker { font-size: 6px; letter-spacing: 3px; color: rgba(224, 197, 143, .42); }
.mj-phase-card h3 { font-family: var(--font-display); font-size: 28px; font-weight: 400; letter-spacing: 4px; color: #f7e5bd; margin-top: 3px; }
.mj-phase-card p { font-size: 8.5px; color: rgba(195, 188, 164, .53); line-height: 1.7; margin-top: 4px; }
.mj-phase-card p b { color: #efd18f; font-weight: 500; }
.mj-claim-banner {
  position: absolute;
  z-index: 66;
  left: 50%;
  top: 36%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px 9px 11px;
  border-radius: 11px;
  border: 1px solid rgba(236, 201, 131, .3);
  background: linear-gradient(180deg, rgba(14, 61, 47, .95), rgba(4, 27, 21, .94));
  box-shadow: 0 15px 36px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 247, 214, .07);
  backdrop-filter: blur(8px);
  animation: claimIn .3s var(--ease-out) both;
  min-width: 270px;
  max-width: 420px;
}
.mj-claim-banner .mj-tile-claim { --tw: 32px; flex: 0 0 auto; }
.mj-claim-label { font-family: var(--font-kai); font-size: 9px; color: #f0cf8d; letter-spacing: 1px; flex: 0 0 auto; }
.mj-claim-banner > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mj-claim-banner > div b { font-size: 10px; color: #f3dfb8; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mj-claim-banner > div small { font-size: 7.5px; color: rgba(187, 178, 152, .48); white-space: nowrap; }
@keyframes claimIn { from { opacity: 0; transform: translate(-50%, 7px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

/* =========================================================
   Dingque overlay
   ========================================================= */
.mj-dingque-overlay {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(1, 13, 10, .65);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn .25s ease both;
}
.mj-dq-panel {
  width: min(600px, calc(100vw - 32px));
  padding: 26px 28px 23px;
  border-radius: 18px;
  border: 1px solid rgba(232, 198, 128, .38);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(74, 146, 111, .28), transparent 55%),
    linear-gradient(165deg, #0e4234, #061f1a);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 247, 213, .1);
  text-align: center;
  position: relative;
  animation: dqIn .45s var(--ease-spring) both;
}
@keyframes dqIn { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.mj-dq-kicker { font-size: 7px; letter-spacing: 3px; color: rgba(226, 197, 139, .45); }
.mj-dq-head h2 { font-family: var(--font-display); font-size: 37px; font-weight: 400; letter-spacing: 5px; color: #f7e4b9; margin-top: 4px; text-indent: 5px; }
.mj-dq-head p { font-size: 9px; line-height: 1.7; color: rgba(195, 186, 160, .5); margin-top: 6px; }
.mj-dq-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 20px 0 13px; }
.mj-dq-option {
  position: relative;
  min-height: 134px;
  border-radius: 10px;
  border: 1px solid rgba(228, 194, 124, .16);
  background: rgba(255, 255, 255, .025);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: .2s;
}
.mj-dq-option:hover { background: rgba(229, 193, 121, .08); border-color: rgba(238, 202, 132, .44); transform: translateY(-2px); }
.mj-dq-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-kai); font-size: 28px; border: 1px solid rgba(232, 201, 137, .2); background: rgba(255, 255, 255, .035); }
.mj-dq-option.suit-wan .mj-dq-icon { color: #eb9b84; }
.mj-dq-option.suit-tiao .mj-dq-icon { color: #8addb2; }
.mj-dq-option.suit-tong .mj-dq-icon { color: #8fc7ee; }
.mj-dq-option b { font-size: 13px; font-weight: 500; color: #e9dcc1; }
.mj-dq-option small { font-size: 8px; color: rgba(187, 179, 157, .45); }
.mj-dq-rec { position: absolute; top: 8px; right: 8px; font-size: 7px; font-style: normal; color: #4b2c08; background: linear-gradient(180deg, #f4dfa5, #cfa350); padding: 2px 5px; border-radius: 3px; }
.mj-dq-note { font-size: 7.5px; color: rgba(184, 176, 153, .33); }

/* =========================================================
   Win flashes & log
   ========================================================= */
.mj-win-layer { position: absolute; inset: 0; z-index: 100; pointer-events: none; }
.mj-win-flash {
  position: absolute;
  z-index: 110;
  transform: translate(-50%, -50%);
  min-width: 230px;
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(105deg, rgba(72, 25, 20, .94), rgba(31, 37, 25, .92));
  border: 1px solid rgba(246, 207, 134, .4);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .52);
  animation: mjWinFlash 2.1s var(--ease-out) both;
}
.mj-win-flash.is-me { background: linear-gradient(105deg, rgba(111, 35, 26, .96), rgba(42, 41, 21, .94)); border-color: rgba(255, 221, 147, .6); min-width: 300px; }
@keyframes mjWinFlash {
  0% { opacity: 0; transform: translate(-50%, -38%) scale(.8); }
  13%, 76% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -65%) scale(.97); }
}
.mj-win-seal {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 19px;
  color: #50130f;
  background: radial-gradient(circle at 35% 28%, #fff3c8, #f1cf80 42%, #c68e32);
  box-shadow: 0 0 0 3px rgba(241, 203, 125, .08);
}
.mj-win-main { min-width: 0; }
.mj-win-by { font-size: 6.5px; letter-spacing: 1.4px; color: rgba(239, 204, 133, .55); }
.mj-win-main h3 { font-family: var(--font-kai); font-size: 15px; font-weight: 500; color: #f7e4bc; letter-spacing: 1px; margin-top: 1px; white-space: nowrap; }
.mj-win-main p { font-size: 7.5px; color: #dfc68f; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.mj-win-fan { display: flex; align-items: baseline; gap: 1px; margin-left: auto; border-left: 1px solid rgba(241, 207, 137, .14); padding-left: 9px; }
.mj-win-fan b { font-family: "Georgia", serif; font-size: 23px; color: #ffdf96; line-height: 1; }
.mj-win-fan small { font-size: 6.5px; color: rgba(226, 201, 151, .5); }
.mj-win-coins { display: flex; align-items: center; gap: 3px; font-family: "Georgia", serif; font-size: 12px; color: #ffe0a0; white-space: nowrap; border-left: 1px solid rgba(241, 207, 137, .14); padding-left: 9px; }
.mj-win-coins .coin-icon { width: 15px; height: 15px; }
.mj-win-coins .coin-icon::before { inset: 4px; }

.mj-win-log {
  position: absolute;
  right: 17px;
  top: 70px;
  z-index: 45;
  width: 176px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
}
.mj-log-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(4, 28, 22, .48);
  border: 1px solid rgba(227, 193, 122, .1);
  backdrop-filter: blur(4px);
  animation: logIn .28s ease both;
}
@keyframes logIn { from { opacity: 0; transform: translateX(7px); } to { opacity: 1; transform: translateX(0); } }
.mj-log-entry > span { width: 17px; height: 17px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-kai); font-size: 8px; color: #4a2610; background: linear-gradient(145deg, #f3d99d, #c99541); }
.mj-log-entry > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mj-log-entry b { font-size: 8px; color: #e6d6b6; font-weight: 500; }
.mj-log-entry small { font-size: 6.5px; color: rgba(183, 174, 150, .45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========================================================
   Start banner
   ========================================================= */
.mj-start-banner {
  position: absolute;
  z-index: 100;
  left: 50%;
  top: 43%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  animation: mjStart 2.1s var(--ease-out) both;
}
.mj-start-banner span { display: block; font-family: var(--font-display); font-size: clamp(42px, 6vw, 82px); letter-spacing: 9px; color: #f7e1ac; text-shadow: 0 0 32px rgba(237, 192, 100, .35), 0 3px 0 rgba(61, 42, 13, .7); text-indent: 9px; }
.mj-start-banner small { display: block; margin-top: 6px; font-size: 8px; letter-spacing: 3px; color: rgba(223, 203, 160, .52); }
@keyframes mjStart {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(.9); }
  18%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -57%) scale(1.03); }
}

/* =========================================================
   Result
   ========================================================= */
.mj-result-card { width: min(570px, calc(100vw - 32px)); }
.mj-ranking { margin: 4px 0 17px; display: flex; flex-direction: column; gap: 3px; position: relative; z-index: 1; }
.mj-rank-row { display: flex; align-items: center; gap: 8px; min-height: 33px; padding: 4px 8px; border-radius: 6px; background: rgba(255, 255, 255, .023); }
.mj-rank-row.me { background: rgba(221, 181, 97, .06); border: 1px solid rgba(221, 181, 97, .13); }
.mj-rank-index { width: 14px; font-family: "Georgia", serif; font-size: 10px; font-style: italic; color: rgba(205, 186, 148, .45); }
.mj-rank-row .mini-avatar { width: 24px; height: 24px; }
.mj-rank-row > b { font-size: 9px; font-weight: 500; color: #ded1b8; min-width: 56px; }
.mj-rank-row > small { font-size: 7.5px; color: #847d6d; }
.mj-rank-row > em { margin-left: auto; font-style: normal; font-family: "Georgia", serif; font-size: 10px; }
.mj-rank-row > em.gain { color: #7bdcb3; }
.mj-rank-row > em.loss { color: #d9917e; }
.mj-result-card .result-stats { margin-top: 2px; }
.mj-result-card .result-badges { margin-top: -3px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .mj-win-flash {
    animation: none !important;
    opacity: 1 !important;
    transform: translate(-50%, -50%) !important;
  }
}
@media (max-width: 1180px) {
  .mj-seat-rack { display: none; }
  .mj-seat { grid-template-areas: "main" "melds"; grid-template-columns: auto; }
  .mj-seat-left { left: 1.7%; }
  .mj-seat-right { right: 1.7%; }
  .mj-river-left { left: 19%; }
  .mj-river-right { right: 19%; }
  .mj-river-top, .mj-river-bottom { width: min(310px, 34vw); }
  .mj-hand-wrap { left: 116px; right: 116px; }
  .mj-hand { --hand-tw: clamp(35px, 3.4vw, 50px); }
  .mj-win-log { display: none; }
  .mj-hand-info { right: 132px; }
}
@media (max-width: 900px) {
  .mj-arena::before { inset: 8px 10px 0; border-width: 5px; }
  .mj-arena::after { inset: 19px 20px 8px; }
  .mj-seat-top { top: 6px; }
  .mj-seat-top .seat-avatar-wrap { width: 40px; height: 40px; }
  .mj-seat-top .seat-name { font-size: 9px; }
  .mj-seat-top .seat-meta { display: none; }
  .mj-seat-top .mj-seat-score { display: none; }
  .mj-seat-left, .mj-seat-right { top: 28%; }
  .mj-seat .seat-avatar-wrap { width: 47px; height: 47px; }
  .mj-seat .seat-name { font-size: 9px; max-width: 68px; }
  .mj-seat .seat-meta { font-size: 6.5px; }
  .mj-seat-score { font-size: 7px; }
  .mj-seat .level-pill { display: none; }
  .mj-seat .mj-melds { max-width: 150px; }
  .mj-seat .mj-tile-meld { --tw: 16px; }
  .mj-turn-status { top: 56px; font-size: 7px; height: 21px; max-width: 240px; }
  .mj-wall { width: 71px; height: 71px; }
  .mj-wall b { font-size: 19px; }
  .mj-wall-top { font-size: 5px; letter-spacing: 1.5px; }
  .mj-river .mj-tile { --tw: 23px; }
  .mj-river-top { top: 14.5%; width: min(265px, 37vw); gap: 1.5px; }
  .mj-river-bottom { bottom: 143px; width: min(285px, 39vw); gap: 1.5px; }
  .mj-river-left { left: 17.5%; top: 40%; width: 120px; gap: 1.5px; }
  .mj-river-right { right: 17.5%; top: 40%; width: 120px; gap: 1.5px; }
  .mj-hand-wrap { left: 83px; right: 83px; }
  .mj-hand { --hand-tw: clamp(30px, 4.4vw, 44px); }
  .mj-hand .mj-tile.is-drawn { margin-left: 8px; }
  .mj-user-seat { left: 7px; bottom: 5px; min-width: 0; padding: 2px; background: none !important; }
  .mj-user-seat .seat-avatar-wrap { width: 44px; height: 44px; }
  .mj-user-seat .seat-info { display: none; }
  .mj-user-seat .seat-bubble-slot { bottom: 51px; }
  .mj-user-melds { left: 70px; bottom: 72px; }
  .mj-user-melds .mj-tile-meld { --tw: 19px; }
  .mj-actions { bottom: 88px; }
  .mj-actionbar .action-timer { display: grid; }
  .mj-actionbar .action-btn { min-width: 63px; height: 33px; padding: 0 12px; font-size: 9.5px; }
  .mj-actionbar .action-btn.primary { min-width: 78px; }
  .mj-actionbar .hu-btn { min-width: 72px; }
  .mj-hand-info { right: 91px; bottom: 70px; font-size: 6.5px; }
  .mj-hand-tools { right: 8px; bottom: 7px; }
  .mj-phase-card { top: 27%; min-width: 250px; padding: 10px 18px; }
  .mj-phase-card h3 { font-size: 22px; }
  .mj-phase-card p { font-size: 7.5px; }
  .mj-claim-banner { top: 31%; min-width: 235px; padding: 7px 12px 7px 8px; }
  .mj-claim-banner .mj-tile-claim { --tw: 27px; }
  .mj-screen .game-bean-pill { display: none; }
  .mj-dq-panel { padding: 20px 18px; }
  .mj-dq-head h2 { font-size: 30px; }
  .mj-dq-option { min-height: 110px; }
  .mj-dq-icon { width: 45px; height: 45px; font-size: 23px; }
}
@media (max-width: 680px) {
  .mj-seat-top .seat-info { display: none; }
  .mj-seat-top .seat-avatar-wrap { width: 35px; height: 35px; }
  .mj-seat-left, .mj-seat-right { top: 24%; }
  .mj-seat .seat-avatar-wrap { width: 39px; height: 39px; }
  .mj-seat .seat-name { font-size: 8px; max-width: 58px; }
  .mj-seat .seat-meta { display: none; }
  .mj-seat-score { display: none; }
  .mj-seat .mj-melds { max-width: 105px; }
  .mj-seat .mj-tile-meld { --tw: 14px; }
  .mj-turn-status { max-width: 200px; font-size: 6.5px; top: 43px; }
  .mj-wall { width: 58px; height: 58px; top: 44%; }
  .mj-wall b { font-size: 16px; }
  .mj-wall-top, .mj-wall small { display: none; }
  .mj-river .mj-tile { --tw: 19px; }
  .mj-river-top { top: 13%; width: 190px; }
  .mj-river-bottom { bottom: 121px; width: 210px; }
  .mj-river-left { left: 15%; top: 38%; width: 90px; }
  .mj-river-right { right: 15%; top: 38%; width: 90px; }
  .mj-hand-wrap { left: 46px; right: 46px; }
  .mj-hand { --hand-tw: clamp(23px, 5.3vw, 34px); gap: 1px; }
  .mj-actions { bottom: 72px; }
  .mj-actionbar .action-btn { min-width: 50px; height: 29px; padding: 0 8px; font-size: 8.5px; }
  .mj-actionbar .action-btn.primary { min-width: 62px; }
  .mj-actionbar .hu-btn { min-width: 56px; }
  .mj-actionbar .kbd { display: none; }
  .mj-user-seat .seat-avatar-wrap { width: 36px; height: 36px; }
  .mj-user-seat .seat-bubble-slot { bottom: 42px; }
  .mj-user-melds { left: 47px; bottom: 57px; }
  .mj-user-melds .mj-tile-meld { --tw: 15px; }
  .mj-hand-info { right: 52px; bottom: 55px; }
  .mj-hand-tools { display: none; }
  .mj-phase-card { top: 24%; min-width: 220px; }
  .mj-phase-card h3 { font-size: 19px; }
  .mj-claim-banner { top: 26%; min-width: 210px; }
  .mj-claim-banner > div b { font-size: 8px; }
  .mj-claim-banner > div small { font-size: 6px; }
  .mj-claim-label { display: none; }
  .mj-win-flash { min-width: 200px; }
  .mj-win-flash.is-me { min-width: 230px; }
  .mj-win-main p { max-width: 110px; }
  .mj-win-fan b { font-size: 18px; }
  .mj-dq-options { grid-template-columns: 1fr; }
  .mj-dq-option { min-height: 58px; flex-direction: row; justify-content: flex-start; padding: 0 13px; gap: 10px; }
  .mj-dq-icon { width: 36px; height: 36px; font-size: 18px; }
  .mj-dq-option > small { margin-left: auto; }
  .mj-dq-icon + b { min-width: 75px; text-align: left; }
  .mj-dq-head h2 { font-size: 26px; }
  .mj-dq-head p { font-size: 8px; }
  .mj-ranking .mj-rank-row > small { display: none; }
}
@media (max-height: 720px) and (min-width: 900px) {
  .mj-seat-left, .mj-seat-right { top: 27%; }
  .mj-river-top { top: 15%; }
  .mj-river-left, .mj-river-right { top: 41%; }
  .mj-river-bottom { bottom: 150px; }
  .mj-actions { bottom: 99px; }
  .mj-hand { --hand-tw: clamp(32px, 3.1vw, 45px); }
}

/* =========================================================
   红中血流 · 手机竖屏
   ========================================================= */
@media (max-width: 560px) and (orientation: portrait) {
  .mj-screen .game-topbar {
    height: calc(48px + env(safe-area-inset-top));
    flex-basis: calc(48px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
    gap: 5px;
  }
  .mj-screen .game-back { width: 29px; height: 29px; }
  .mj-screen .game-back svg { width: 15px; height: 15px; }
  .mj-screen .game-brand-mini { gap: 5px; }
  .mj-screen .game-brand-mini .brand-coin { width: 27px; height: 27px; }
  .mj-screen .game-brand-mini .brand-coin::before { inset: 8px; }
  .mj-screen .game-brand-mini .brand-coin span { font-size: 9px; }
  .mj-screen .game-brand-mini .brand-coin i { top: 5px; left: 8px; width: 7px; height: 4px; }
  .mj-screen .game-brand-mini h2 { font-size: 13.5px; letter-spacing: .4px; }
  .mj-screen .game-brand-mini p, .mj-screen .game-divider-v, .mj-screen .game-room-info { display: none; }
  .mj-screen .game-top-center { flex: 0 0 auto; margin-left: 2px; gap: 2px; }
  .mj-screen .game-top-stat { min-width: 42px; min-height: 28px; padding: 2px 5px; }
  .mj-screen .game-top-stat:nth-child(2) { display: none; }
  .mj-screen .game-top-stat span { font-size: 5.5px; letter-spacing: 0; }
  .mj-screen .game-top-stat b { font-size: 10px; }
  .mj-screen .game-top-actions { gap: 0; }
  .mj-screen .game-top-actions .icon-btn { width: 27px; height: 27px; }
  .mj-screen .game-top-actions .icon-btn svg { width: 16px; height: 16px; }
  .mj-screen .game-top-actions .icon-btn[data-mj-rules] { display: none; }
  .mj-screen .game-top-actions .icon-btn[data-mj-sound] { display: grid; }
  .mj-screen .game-top-actions .game-bean-pill { display: none; }

  .mj-arena::before {
    inset: 2px 6px 0;
    border-width: 3px;
    border-radius: 46% 46% 2% 2% / 18% 18% 2% 2%;
    box-shadow: 0 0 0 1px rgba(162, 119, 59, .6), inset 0 0 80px rgba(0, 0, 0, .32);
  }
  .mj-arena::after { inset: 10px 11px 4px; border-radius: 46% 46% 3% 3%; }
  .mj-bamboo { opacity: .055; }

  .mj-seat-top {
    top: 3px;
    padding: 2px 7px;
    transform: translateX(-50%) scale(.9);
    transform-origin: top center;
  }
  .mj-seat-top .seat-avatar-wrap { width: 34px; height: 34px; }
  .mj-seat-top .seat-name { font-size: 8px; max-width: 72px; }
  .mj-seat-top .seat-meta, .mj-seat-top .mj-seat-score { display: none; }
  .mj-seat-top .seat-name-row { gap: 2px; }
  .mj-seat-top .mj-miss { font-size: 5.5px; padding: 1px 3px; }
  .mj-turn-status {
    top: 41px;
    height: 20px;
    max-width: 230px;
    font-size: 6.5px;
    padding: 2px 8px;
  }
  .mj-seat-left { left: 3px; top: 16%; }
  .mj-seat-right { right: 3px; top: 16%; }
  .mj-seat-left .seat-avatar-wrap, .mj-seat-right .seat-avatar-wrap { width: 37px; height: 37px; }
  .mj-seat-left .seat-name, .mj-seat-right .seat-name { font-size: 8px; max-width: 55px; }
  .mj-seat-left .seat-meta, .mj-seat-right .seat-meta { display: none; }
  .mj-seat-left .level-pill, .mj-seat-right .level-pill { display: none; }
  .mj-seat-left .mj-seat-score, .mj-seat-right .mj-seat-score { display: flex; font-size: 6px; }
  .mj-seat-left .seat-bubble-slot { left: 41px; top: 35px; width: 108px; }
  .mj-seat-right .seat-bubble-slot { right: 41px; top: 35px; width: 108px; }
  .mj-speech { font-size: 7.5px; padding: 4px 7px; max-width: 108px; }
  .mj-seat-rack { display: none; }
  .mj-seat .mj-melds { max-width: 108px; gap: 2px; }
  .mj-seat .mj-tile-meld { --tw: 14px; }

  .mj-wall {
    top: 45.5%;
    width: 56px;
    height: 56px;
    border-color: rgba(224, 194, 127, .13);
  }
  .mj-wall b { font-size: 17px; }
  .mj-wall-top, .mj-wall small, .mj-wall::after { display: none; }

  .mj-river { gap: 1px; }
  .mj-river .mj-tile { --tw: 21px; }
  .mj-river-top {
    top: 64px;
    width: calc(100vw - 26px);
    max-width: 330px;
  }
  .mj-river-bottom {
    bottom: calc(150px + env(safe-area-inset-bottom));
    width: calc(100vw - 26px);
    max-width: 330px;
  }
  .mj-river-left {
    left: 5px;
    top: 29%;
    width: 104px;
    transform: none;
  }
  .mj-river-right {
    right: 5px;
    top: 29%;
    width: 104px;
    transform: none;
  }

  .mj-user-seat { display: none; }
  .mj-me-seat { display: none; }
  .mj-user-melds {
    left: 7px;
    bottom: calc(64px + env(safe-area-inset-bottom));
    right: auto;
    max-width: calc(100vw - 90px);
    flex-wrap: nowrap;
    overflow: hidden;
    gap: 2px;
    z-index: 51;
  }
  .mj-user-melds .mj-tile-meld { --tw: 17px; }
  .mj-hand-wrap {
    left: 0;
    right: 0;
    bottom: max(6px, env(safe-area-inset-bottom));
    height: 58px;
  }
  .mj-hand {
    --hand-tw: clamp(22px, calc((100vw - 12px) / 14), 31px);
    min-height: 48px;
    height: 56px;
  }
  .mj-hand-inner { gap: 0; }
  .mj-hand .mj-tile { --tw: clamp(22px, calc((100vw - 12px) / 14), 31px); }
  .mj-hand .mj-tile.is-drawn { margin-left: 4px; }
  .mj-hand-info {
    left: auto;
    right: 7px;
    bottom: calc(68px + env(safe-area-inset-bottom));
    align-items: flex-end;
    max-width: 96px;
    font-size: 6px;
    z-index: 61;
    text-align: right;
  }
  .mj-miss-big { font-size: 7px; }
  .mj-listen { display: none; }
  .mj-hand-tools { display: none; }

  .mj-actions {
    bottom: calc(91px + env(safe-area-inset-bottom));
    width: 100%;
    left: 0;
    transform: none;
    display: none;
    justify-content: center;
    z-index: 62;
  }
  .mj-actions.visible { display: flex; }
  .mj-actions .game-actionbar {
    width: 100%;
    justify-content: center;
    gap: 5px;
    padding: 0 7px;
  }
  .mj-actionbar .action-timer { display: grid; width: 28px; height: 28px; font-size: 10px; }
  .mj-actionbar .action-btn {
    min-width: 52px;
    height: 33px;
    padding: 0 9px;
    font-size: 9px;
  }
  .mj-actionbar .action-btn.primary { min-width: 66px; }
  .mj-actionbar .hu-btn { min-width: 60px; }
  .mj-actions .kbd { display: none; }

  .mj-phase-card {
    top: 26%;
    min-width: 230px;
    max-width: calc(100vw - 34px);
    padding: 9px 15px 8px;
  }
  .mj-phase-card h3 { font-size: 20px; letter-spacing: 2px; margin-top: 2px; }
  .mj-phase-card p { font-size: 7px; margin-top: 2px; }
  .mj-phase-kicker { font-size: 5px; }
  .mj-claim-banner {
    top: 25%;
    min-width: 220px;
    max-width: calc(100vw - 24px);
    padding: 6px 10px 6px 7px;
    gap: 6px;
  }
  .mj-claim-banner .mj-tile-claim { --tw: 26px; }
  .mj-claim-banner > div b { font-size: 8.5px; }
  .mj-claim-banner > div small { font-size: 6.5px; }

  .mj-meld { padding: 0; }
  .mj-meld-row { gap: 2px; }
  .mj-result-host .result-screen { padding: 14px; }
  .mj-result-card { width: calc(100vw - 28px); padding: 20px 17px 17px; }
  .mj-result-card .result-title { font-size: 30px; letter-spacing: 3px; }
  .mj-result-card .result-score b { font-size: 28px; }
  .mj-result-card .result-stat b { font-size: 11px; }
  .mj-result-card .result-actions .gold-btn,
  .mj-result-card .result-actions .ghost-btn { min-height: 37px; padding: 0 14px; font-size: 10px; }
  .mj-win-flash {
    min-width: 230px;
    width: calc(100vw - 28px);
    max-width: 320px;
    padding: 8px 10px;
    gap: 7px;
  }
  .mj-win-flash.is-me { min-width: 250px; }
  .mj-win-seal { width: 29px; height: 29px; font-size: 16px; }
  .mj-win-main h3 { font-size: 13px; }
  .mj-win-main p { font-size: 6.5px; max-width: 120px; }
  .mj-win-fan b { font-size: 19px; }
  .mj-win-coins { font-size: 10px; padding-left: 6px; }
  .mj-win-fan { padding-left: 6px; }
  .mj-dq-panel { width: calc(100vw - 20px); padding: 18px 14px 16px; }
  .mj-dq-head h2 { font-size: 27px; letter-spacing: 3px; }
  .mj-dq-head p { font-size: 8px; }
  .mj-dq-options { grid-template-columns: 1fr; gap: 6px; margin: 13px 0 10px; }
  .mj-dq-option { min-height: 53px; flex-direction: row; justify-content: flex-start; padding: 0 12px; gap: 9px; }
  .mj-dq-icon { width: 34px; height: 34px; font-size: 18px; }
  .mj-dq-option > small { margin-left: auto; }
  .mj-dq-icon + b { min-width: 70px; text-align: left; }
  .mj-screen .chat-drawer { width: calc(100vw - 16px); left: 8px; right: 8px; bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* compact opponent tile counts on phone / tablet */
@media (max-width: 950px) {
  .mj-seat .seat-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    margin-top: 2px;
    font-size: 6px;
  }
  .mj-seat .seat-meta .coin-icon,
  .mj-seat .seat-meta > span:nth-child(2),
  .mj-seat .seat-meta .mj-win-count { display: none; }
  .mj-seat .seat-meta .mj-count {
    display: inline;
    color: rgba(231, 205, 150, .66);
    font-size: 6.5px;
    letter-spacing: .2px;
  }
  .mj-seat-top .seat-meta { justify-content: center; margin-top: 1px; }
  .mj-seat-score { display: none !important; }
}

