*{box-sizing:border-box} [hidden]{display:none!important}
:root{color-scheme:light;--ink:#132b28;--muted:#45615a;--paper:#fff9e9;--green:#114b40;--gold:#edc879;font-family:system-ui,"Microsoft YaHei",sans-serif;color:var(--ink);background:#e6ebe1}
body{margin:0;background:radial-gradient(ellipse at top left,#f2e4bf,transparent 50%),#e6ebe1;min-height:100vh}
.mast{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px max(18px,calc((100% - 1080px)/2));background:#f9f2df;border-bottom:1px solid #c7c9ad}.mast a{color:var(--green);font-weight:700}.brand{display:flex;gap:10px;align-items:center}.brand small{display:block;color:var(--muted)}.mark{display:grid;place-items:center;background:var(--green);color:var(--paper);border-radius:8px;width:41px;height:44px;font:700 23px serif}
main{max-width:1120px;margin:auto;padding:24px 18px}.lobby{display:grid;grid-template-columns:1.25fr 1fr;gap:16px;align-items:start}.card{background:var(--paper);border:1px solid #c7c9ad;border-radius:14px;padding:20px}.card h1,.card h2,h2{margin:0 0 8px}p{line-height:1.55;margin:8px 0 14px} label{display:grid;gap:6px;min-width:0} input,select,button{font:inherit;border-radius:8px;min-height:42px}input,select{width:100%;padding:8px;border:1px solid #aeb8a9;background:#fff;color:var(--ink)}button{padding:7px 14px;border:1px solid transparent;background:var(--green);color:#fff;font-weight:650;cursor:pointer}button:disabled{opacity:.65;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #c98b29;outline-offset:2px}.quiet{background:#edf1e6;color:var(--green);border-color:#b4c3ac}form,.fields{display:grid;gap:10px;margin-top:12px}.fields{grid-template-columns:2fr 1fr}.entry form+form{padding-top:12px;border-top:1px solid #dbddcd}.room-head,.hand-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.room-head p{margin:0}.actions{display:flex;gap:8px;flex-wrap:wrap}

.table {
  display:grid;
  grid-template-columns:minmax(130px,1fr) minmax(190px,1.25fr) minmax(130px,1fr);
  grid-template-areas:". north ." "west center east" "south south south";
  align-items:start;
  gap:12px;
  margin-top:14px;
  padding:16px;
  background:radial-gradient(ellipse at 50% 42%,#24674f,#153e33 69%,#103026);
  color:#fff5d7;
  border:5px solid #674c31;
  border-radius:19px;
  box-shadow:inset 0 0 0 2px #315c40, 0 8px 20px #1d332126;
}
.table[data-capacity="3"] {grid-template-areas:"west center east" "south south south"}
.table[data-capacity="2"] {grid-template-areas:". north ." ". center ." "south south south"}
.table-center {
  grid-area:center;
  align-self:stretch;
  min-height:170px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  text-align:center;
  border:1px solid #78a68865;
  border-radius:11px;
  background:#10392cb3;
  padding:12px;
}
.table-center p {margin:4px 0 10px;font-size:.84rem}
#status {min-height:1.5rem;font-weight:750;word-break:normal;overflow-wrap:anywhere}
.last-play {display:grid;justify-items:center;gap:6px;color:#f5d592;font-size:.78rem}
.seats {display:contents}
.seat {min-width:0;background:#102f29d9;border:1px solid #71968895;border-radius:9px;padding:10px;overflow-wrap:anywhere}
.seat.current {border-color:var(--gold);box-shadow:inset 0 0 0 1px var(--gold)}
.seat-north {grid-area:north}
.seat-west {grid-area:west}
.seat-east {grid-area:east}
.seat-south {grid-area:south;justify-self:center;width:min(100%,790px)}
.seat-title {display:flex;flex-wrap:wrap;align-items:center;gap:4px 7px;margin-bottom:6px;line-height:1.35}
.seat-title strong {font-size:.92rem}
.seat-title small {flex-basis:100%;color:#c7dece;font-size:.75rem}
.wind {display:grid;place-items:center;flex:none;width:24px;height:24px;border:1px solid #9d8253;border-radius:6px;color:#f5d592;background:#244539;font-size:.87rem;font-weight:750}
.tile-backs {display:flex;flex-wrap:wrap;gap:2px;margin-block:7px}
.tile-backs i {width:11px;height:17px;border:1px solid #aeb297;border-bottom:3px solid #648677;border-radius:3px;background:linear-gradient(135deg,#d5e3d6,#659483)}
.river {min-width:0;background:#0c3029;border:1px solid #74988a60;border-radius:6px;padding:6px;margin-top:6px}
.river h3 {margin:0 0 4px;color:#f2d18d;font-size:.75rem;font-weight:650}
.empty-seat {margin:6px;color:#c7dece;font-size:.84rem}
.hand-head {margin-top:12px}
.hand-head h2 {font-size:1rem;margin:0}
.tiles {display:flex;gap:5px;flex-wrap:wrap;margin:7px 0 10px}
.compact {gap:3px;margin:3px 0}
.melds {display:flex;flex-wrap:wrap;gap:5px}
.melds .tiles {background:#71968827;border-radius:4px;padding:2px}
.tile {
  display:inline-grid;
  place-items:center;
  flex:none;
  width:37px;
  min-width:0;
  height:49px;
  min-height:0;
  color:#18332c;
  background:linear-gradient(155deg,#fffef2,#e4dfcf 88%);
  border:1px solid #c4bfaa;
  border-top:3px solid #a6c9dd;
  border-bottom:5px solid #938c76;
  border-radius:7px;
  padding:3px;
  box-shadow:0 2px 3px #0007,inset 0 1px 0 #fff;
}
.tile:not(:disabled):is(button):hover {translate:0 -3px;background:#fff4cc}
.tile:disabled {opacity:1;cursor:default}
.tile.hinted {outline:3px solid #ffc959;outline-offset:1px}
.tile-face {display:grid;justify-items:center;align-content:center;line-height:.93;font-family:"Noto Serif SC","SimSun",serif}
.tile-face b {font-size:1.14rem;font-weight:800}
.tile-face small {font-size:.84rem;color:#a22a2a;font-weight:900}
.tile-face:is(.bamboo,.dots) {width:84%;height:86%;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);align-items:center;justify-items:center}
.tile-face i {display:block}
.dots i {width:6px;height:6px;border:1.5px solid #275a53;border-radius:50%;background:#faf2d8}
.dots i.accent {border-color:#9f322d}
.bamboo i {width:3px;height:7px;border-radius:2px;background:#2d7153;box-shadow:inset 0 1px #acc9a7}
.bamboo i.accent {background:#9e342e;box-shadow:none}
.red-dragon {color:#a3282b}
.green-dragon {color:#246a48}
.white-dragon {border:2px solid #31597d;border-radius:2px;color:transparent;font-size:.75rem!important}
.compact .tile {width:24px;height:32px;padding:2px;border-top-width:2px;border-bottom-width:3px;border-radius:4px}
.compact .tile-face b {font-size:.82rem}
.compact .tile-face small {font-size:.62rem}
.compact .dots i {width:4px;height:4px;border-width:1px}
.compact .bamboo i {width:2px;height:4px}
#leaderboard {padding-left:24px}
#leaderboard li {padding:8px 0;border-bottom:1px solid #dddac7}
#error {padding:10px;margin-bottom:12px;background:#ffe6dd;color:#842521;border-radius:8px}
#result {width:100%;border-top:1px solid #548171;padding-top:9px}
#result h2 {font-size:1rem;margin:0 0 5px}

@media(max-width:640px) {
  main {padding:12px 10px}
  .lobby {grid-template-columns:1fr}
  .card {padding:13px}
  .room-head h1 {font-size:1.3rem}
  .table,.table[data-capacity="3"] {
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-areas:"north north" "west east" "center center" "south south";
    padding:9px;
    gap:7px;
    border-width:3px;
  }
  .table[data-capacity="3"] {grid-template-areas:"west east" "center center" "south south"}
  .table[data-capacity="2"] {grid-template-areas:"north north" "center center" "south south"}
  .table-center {min-height:93px;padding:9px}
  .seat {padding:7px}
  .tile {width:34px;height:46px}
}
