/* Three-seat table: presentation only. The V1 game engine is unchanged. */
.mj-main .mj-table {
 container-type:inline-size;
 display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.36fr) minmax(0,1fr);
 grid-template-areas:'west center south' 'west river south' 'player player player' 'kans kans kans' 'hand hand hand' 'message message message' 'actions actions actions';
 align-items:stretch; column-gap:clamp(4px,1.4vw,16px); row-gap:8px;
 padding:18px; border:12px solid #966535;
 border-image:none; border-radius:24px;
 background:radial-gradient(ellipse at 50% 38%,#286b4d 0,#17543e 65%,#0c372a 100%);
 box-shadow:0 6px 0 #50321a,0 12px 24px #233d3033,inset 0 0 0 2px #dab57a,inset 0 0 24px #001f16aa;
}
.mj-main .mj-table:before{inset:5px;border:1px solid #d5b16b80;border-radius:12px}
.mj-main .mj-table .mj-opponents{display:contents!important}
.mj-main .mj-table .mj-opponent{
 --cpu-w:clamp(18px,4.1cqw,35px); --cpu-h:calc(var(--cpu-w)*.72);
 display:grid;grid-template-columns:var(--cpu-w) minmax(0,1fr);grid-template-rows:auto 1fr;
 column-gap:6px;align-items:start;min-width:0;align-content:start;
}
.mj-main .mj-table .mj-opponent:first-child{grid-area:west;grid-template-areas:'label label' 'hand river'}
.mj-main .mj-table .mj-opponent:last-child{grid-area:south;grid-template-columns:minmax(0,1fr) var(--cpu-w);grid-template-areas:'label label' 'river hand'}
.mj-main .mj-table .mj-opponent .mj-player{grid-area:label;justify-content:center;min-height:36px;margin:0 0 5px;gap:4px;font-size:12px;line-height:1.25;text-align:center;align-content:center}
.mj-main .mj-table .mj-opponent .mj-seat{width:25px;height:25px;flex:none}
.mj-main .mj-table .mj-opponent .mj-player strong{white-space:nowrap}
.mj-main .mj-table .mj-opponent .mj-north,.mj-main .mj-table .mj-opponent .mj-riichi{font-size:10px;white-space:nowrap}
.mj-main .mj-table .mj-opponent .mj-hand.cpu{
 grid-area:hand;display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:repeat(14,var(--cpu-h));
 width:var(--cpu-w)!important;max-width:none!important;gap:1px;padding:0;margin:0;align-content:start;align-self:start;justify-items:stretch;
}
.mj-main .mj-table .mj-opponent .mj-hand.cpu .mj-tile{
 width:100%!important;height:var(--cpu-h)!important;aspect-ratio:auto!important;border-radius:3px;min-height:0;
}
.mj-main .mj-table .mj-opponent .mj-hand.cpu .mj-tile img{position:absolute;left:50%;top:50%;width:var(--cpu-h);height:var(--cpu-w);transform:translate(-50%,-50%) rotate(90deg)}
.mj-main .mj-table .mj-opponent:last-child .mj-hand.cpu .mj-tile img{transform:translate(-50%,-50%) rotate(-90deg)}
.mj-main .mj-table .mj-opponent .mj-river{
 grid-area:river;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:auto;gap:2px;
 align-content:start;justify-content:center;max-width:112px;width:100%;min-height:0;margin:0 auto;padding:4px;
 border:1px solid #b7d6a836;border-radius:6px;background:#072c212e;
}
.mj-main .mj-table .mj-opponent .mj-river .mj-tile{width:100%;max-width:32px;aspect-ratio:.74;justify-self:center}
.mj-main .mj-table .mj-center{
 grid-area:center;align-self:end;display:grid;grid-template-columns:1fr;gap:7px;padding:12px 5px;
 min-height:0;border:2px solid #c1a063;border-radius:12px;background:linear-gradient(155deg,#164536,#08291f);box-shadow:inset 0 0 16px #051c17,0 3px 8px #05281b55;
}
.mj-main .mj-table .mj-center>div{min-width:0}
.mj-main .mj-table .mj-center small{font-size:11px;margin:0 0 3px;color:#e3cc92}
.mj-main .mj-table .mj-center strong{font-size:clamp(12px,2.4cqw,21px);white-space:normal;line-height:1.15;color:#fff4ce}
.mj-main .mj-table .mj-center .mj-dora{border-block:1px solid #a88c4f66;padding:6px 0}
.mj-main .mj-table .mj-center #mj-dora{display:flex;flex-wrap:wrap;min-height:25px;gap:2px}
.mj-main .mj-table .mj-center #mj-dora .mj-tile{width:clamp(14px,3.6cqw,28px);max-width:100%;flex:0 0 auto}
.mj-main .mj-table > #mj-river{
 --rw:clamp(14px,3.45cqw,30px); --rh:calc(var(--rw)/.74);
 grid-area:river;display:grid;grid-template-columns:repeat(6,minmax(0,var(--rw)));grid-template-rows:repeat(4,var(--rh));grid-auto-rows:var(--rh);
 min-height:0;margin:0;padding:4px;gap:2px;align-self:start;justify-content:center;align-content:start;
 border:1px solid #c2d1ab44;background:#082c2233;
}
.mj-main .mj-table > #mj-river .mj-tile{width:100%;max-width:100%;align-self:start}
.mj-main .mj-table > .mj-player{grid-area:player;justify-content:center;border-top:1px solid #c6ab6666;padding-top:6px;margin:0;min-height:36px}
.mj-main .mj-table > .mj-player .mj-ready{margin-left:0}
.mj-main .mj-table > #mj-kans{grid-area:kans;justify-content:center}
.mj-main .mj-table > #mj-hand{grid-area:hand;grid-template-columns:repeat(13,minmax(0,1fr)) minmax(0,1fr)!important;gap:3px;margin:0 auto;padding:0;max-width:838px;min-height:0;align-items:end}
.mj-main .mj-table > #mj-hand .mj-tile.drawn{width:calc(100% - 4px)!important;justify-self:end;outline:2px solid #e5ca7b;outline-offset:-2px}
/* Reserve the last tile's gap even when the drawn tile is absent; keep its actual size equal to other tiles. */
.mj-main .mj-table > #mj-hand{grid-template-columns:repeat(13,minmax(0,1fr)) minmax(0,1fr) !important;column-gap:3px}
.mj-main .mj-table > #mj-hand .mj-tile.drawn{width:100%!important;transform:translateX(0)}
.mj-main .mj-table > #mj-hand .mj-tile.drawn:not(:disabled):hover{transform:translateY(-7px)}
.mj-main .mj-table > .mj-message{grid-area:message;margin:2px 0;min-height:2.8em}
.mj-main .mj-table > .mj-actions{grid-area:actions;align-self:start}
.mj-main .mj-table > .mj-result{z-index:5}
@media(max-width:540px){
 .mj-main .mj-table{padding:7px;border-width:7px;border-radius:15px;column-gap:3px;row-gap:5px;grid-template-columns:minmax(0,1fr) minmax(0,1.55fr) minmax(0,1fr)}
 .mj-main .mj-table .mj-opponent{column-gap:2px}
 .mj-main .mj-table .mj-opponent .mj-player{min-height:33px;margin-bottom:3px;gap:2px}
 .mj-main .mj-table .mj-opponent .mj-player strong{font-size:10px}
 .mj-main .mj-table .mj-opponent .mj-seat{width:17px;height:17px;font-size:10px}
 .mj-main .mj-table .mj-opponent .mj-riichi,.mj-main .mj-table .mj-opponent .mj-north{font-size:9px}
 .mj-main .mj-table .mj-opponent .mj-river{padding:2px;gap:1px}
 .mj-main .mj-table .mj-center{padding:6px 3px;gap:4px;border-width:1px}
 .mj-main .mj-table .mj-center small{font-size:9px}
 .mj-main .mj-table > #mj-river{padding:2px;gap:1px}
 .mj-main .mj-table > #mj-hand{gap:1px}
 .mj-main .mj-table > .mj-player{min-height:25px;padding-top:3px;gap:5px;font-size:12px}
 .mj-main .mj-table > .mj-player .mj-seat{width:22px;height:22px}
 .mj-main .mj-table > .mj-message{font-size:12px}
 .mj-main .mj-table > .mj-actions{gap:4px}
 .mj-main .mj-table > .mj-actions button{padding:7px 9px;font-size:12px}
}
/* Dedicated draw slot, separated from the thirteen regular slots. */
.mj-main .mj-table > #mj-hand{grid-template-columns:repeat(13,minmax(0,1fr)) 5px minmax(0,1fr)!important}
.mj-main .mj-table > #mj-hand .mj-tile.drawn{grid-column:15;outline:2px solid #e5ca7b;outline-offset:-2px}
@media(max-width:540px){.mj-main .mj-table > #mj-hand{grid-template-columns:repeat(13,minmax(0,1fr)) 3px minmax(0,1fr)!important}}
