.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;direction:ltr;box-shadow:none;padding:0}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:5px 35px 5px 10px;overflow:hidden;border-width:0 0 1px;font-weight:700}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;border-color:transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-titlebar .ui-icon,.qtip-icon .ui-icon{display:block;text-indent:-1000em;direction:ltr}.qtip-icon,.qtip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;line-height:14px;text-align:center;text-indent:0;font:normal bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em}.qtip-default{border-width:1px;border-style:solid;border-color:#F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111}/*! Light tooltip style */.qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1}/*! Dark tooltip style */.qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030}/*! Cream tooltip style */.qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0}/*! Red tooltip style */.qtip-red{background-color:#F78B83;border-color:#D95252;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-red .qtip-icon{border-color:#D95252}.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252}/*! Green tooltip style */.qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0}/*! Blue tooltip style */.qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-rounded,.qtip-tipsy,.qtip-bootstrap{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.qtip-rounded .qtip-titlebar{-moz-border-radius:4px 4px 0 0;-webkit-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.qtip-youtube{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;color:#fff;border-width:0;background:#4A4A4A;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4a4a4a),color-stop(100%,#000));background-image:-webkit-linear-gradient(top,#4a4a4a 0,#000 100%);background-image:-moz-linear-gradient(top,#4a4a4a 0,#000 100%);background-image:-ms-linear-gradient(top,#4a4a4a 0,#000 100%);background-image:-o-linear-gradient(top,#4a4a4a 0,#000 100%)}.qtip-youtube .qtip-titlebar{background-color:#4A4A4A;background-color:rgba(0,0,0,0)}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#4a4a4a,EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-linear-gradient(top,#717171,#232323);background-image:-ms-linear-gradient(top,#717171,#232323);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid #f1f1f1;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4a4a4a);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4a4a4a, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323)"}.qtip-jtools .qtip-titlebar,.qtip-jtools .qtip-content{background:0 0;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,.4);box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px #000}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10px;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10px}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-webkit-gradient(linear,left top,left bottom,from(#3a79b8),to(#2e629d));background-image:-webkit-linear-gradient(top,#3a79b8,#2e629d);background-image:-moz-linear-gradient(top,#3a79b8,#2e629d);background-image:-ms-linear-gradient(top,#3a79b8,#2e629d);background-image:-o-linear-gradient(top,#3a79b8,#2e629d);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3a79b8, endColorstr=#2e629d);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:0 0}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}html{color:#000;width:100%;font-family:"Lucida Grande",'Helvetica Neue',Helvetica,Arial}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0}table{border-collapse:collapse;border-spacing:0}fieldset,img{border:0}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:400}li{list-style:none}caption,th{text-align:left}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:300;font-family:"Lucida Grande",'Helvetica Neue',Helvetica,Arial}q:before,q:after{content:''}abbr,acronym{border:0;font-variant:normal}sup{vertical-align:text-top}sub{vertical-align:text-bottom}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit}input,textarea,select{*font-size:100%}legend{color:#000}b,u,s,i{font-style:normal;font-weight:400;text-decoration:none}h1,h2{font-size:30px;line-height:40px}h3{font-size:18px}body{padding:50px;background-color:#275001;color:#FFFBE9}body.mobile{padding:30px 2px}a{color:#00B7FF}a.tile-holder{color:#00B7FF;background:#FFFBE9;padding:4px;border-radius:8px;margin:4px;-moz-box-shadow:4px 4px 0 #000;-webkit-box-shadow:4px 4px 0 #000;box-shadow:4px 4px 0 #000;width:55px;height:75px}.mobile a.tile-holder{margin:1px}.other-player a.tile-holder{width:30.555555555555557px;height:41.666666666666664px;padding:3px;margin:2px}.mobile .other-player a.tile-holder{width:19.18518px;height:25.9259px;padding:3px;margin:1px}.mobile .other-player .hand-tiles{display:none}.tile-row{font-size:71px}.other-player .tile-row{font-size:35.5px}.mobile a.tile-holder{width:24.66666px;height:33.3333px}h3 a.tile-holder{width:13.2px;height:18px;padding:3px;margin:0;border-radius:4px}.mobile .tile-row{font-size:53px}a.selected{border:4px solid red;margin-top:2px;margin-left:2px;padding:1px}.mobile a.selected{margin:2px;padding:2px}.left{float:left}.right{float:right}.clr{overflow:hidden;zoom:1}.small{font-size:12px}.dim{color:#999}.br-top{padding-top:8px}.br{padding-bottom:8px}.hide{display:none}.tile{width:55px;height:75px;background-size:55px 75px;background-repeat:no-repeat}.other-player .tile{width:30.555555555555557px;height:41.666666666666664px;background-size:29.555555555555557px 40.666666666666664px}.mobile .other-player .tile{width:19.18518px;height:25.9259px;background-size:18.18518px 24.9259px}.mobile .tile{width:24.66666px;height:33.3333px;background-size:24.66666px 33.3333px}h3 .tile{width:13.2px;height:18px;background-size:13.2px 18px}.padded{padding:8px}.br-top{margin-top:8px}.br{margin-bottom:8px}.center{text-align:center}.tile-8{background-image:url(../../img/tiles/bamboo_9.png)}.tile-7{background-image:url(../../img/tiles/bamboo_8.png)}.tile-6{background-image:url(../../img/tiles/bamboo_7.png)}.tile-5{background-image:url(../../img/tiles/bamboo_6.png)}.tile-4{background-image:url(../../img/tiles/bamboo_5.png)}.tile-3{background-image:url(../../img/tiles/bamboo_4.png)}.tile-2{background-image:url(../../img/tiles/bamboo_3.png)}.tile-1{background-image:url(../../img/tiles/bamboo_2.png)}.tile-0{background-image:url(../../img/tiles/bamboo_1.png)}.tile-17{background-image:url(../../img/tiles/ball_9.png)}.tile-16{background-image:url(../../img/tiles/ball_8.png)}.tile-15{background-image:url(../../img/tiles/ball_7.png)}.tile-14{background-image:url(../../img/tiles/ball_6.png)}.tile-13{background-image:url(../../img/tiles/ball_5.png)}.tile-12{background-image:url(../../img/tiles/ball_4.png)}.tile-11{background-image:url(../../img/tiles/ball_3.png)}.tile-10{background-image:url(../../img/tiles/ball_2.png)}.tile-9{background-image:url(../../img/tiles/ball_1.png)}.tile-18{background-image:url(../../img/tiles/wind_east.png)}.tile-19{background-image:url(../../img/tiles/wind_south.png)}.tile-20{background-image:url(../../img/tiles/wind_west.png)}.tile-21{background-image:url(../../img/tiles/wind_north.png)}.tile-22{background-image:url(../../img/tiles/dragon_white.png)}.tile-23{background-image:url(../../img/tiles/dragon_green.png)}.tile-24{background-image:url(../../img/tiles/dragon_red.png)}.tile-25{background-image:url(../../img/tiles/character_1.png)}.tile-26{background-image:url(../../img/tiles/character_9.png)}.tile-placeholder{background-image:url(../../img/tiles/flower_plum.png)}.tile-holder.hidden{background-color:#d48623}.hidden .tile{background-image:none}.last-tile{margin-left:.5em}.discard-tiles{width:80%}.other-player .discard-tiles{width:100%;margin:0}.other-player{width:50%;float:left}.this-player{position:absolute;bottom:1em}#notifications{position:absolute;left:10px;top:10px}#player-info{position:absolute;right:10px;top:10px}.rotated-tile{-webkit-transform:rotate(90deg);-webkit-transform-origin:35% 50%;margin-left:28px}.side{float:left;margin-left:.5em}.side a,.other-player a{cursor:default}.buttons{float:left;font-size:32px}.mobile .name{display:none}#audio{display:none}#msg-other{margin-left:8px}.qtip-mahjong{background-color:#d48623;border-color:#000;color:#fff9e5}.qtip-mahjong .qtip-content{text-align:center}.qtip-mahjong .qtip-close{border-color:#000;background:#fff9e5}.shadowed{text-shadow:2px 2px #000}.no-decoration{text-decoration:none}.clickable{cursor:pointer}
/* Self-hosted, latin subset only. Nothing on the page reaches a third-party
   font CDN — conference Wi-Fi is not something to depend on, and a font that
   arrives late re-flows the table mid-game. Licences: public/fonts/README.md */
@font-face { font-family: 'Plex Mono'; font-weight: 400; font-display: swap; src: url(../../fonts/IBMPlexMono-400.woff2) format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-weight: 600; font-display: swap; src: url(../../fonts/IBMPlexMono-600.woff2) format('woff2'); }
@font-face { font-family: 'Plex Condensed'; font-weight: 400; font-display: swap; src: url(../../fonts/IBMPlexSansCondensed-400.woff2) format('woff2'); }
@font-face { font-family: 'Plex Condensed'; font-weight: 500; font-display: swap; src: url(../../fonts/IBMPlexSansCondensed-500.woff2) format('woff2'); }
@font-face { font-family: 'Plex Condensed'; font-weight: 600; font-display: swap; src: url(../../fonts/IBMPlexSansCondensed-600.woff2) format('woff2'); }

/*
 * WORKBENCH — the /workbench look, after SHENZHEN I/O and its Shenzhen
 * Solitaire (hem-y02o3, for a Defcon talk given over Zoom).
 *
 * The table is an engineer's bench: a dark blue-green desk under a coarse
 * grid, each seat a component module with its counters in amber register
 * tags, the middle of the table a chamfered circuit board with a footprint
 * for each river. The tiles stay physical objects — paper-white chips with a
 * visible edge, printed in three flat inks — because the clack of a real tile
 * is the best thing about mahjong and a bench is where real objects sit.
 *
 * Sized for a screen share: video compression eats hairlines, fine repeating
 * patterns and small text first, so nothing that carries information is
 * smaller than 12px at a 1280-wide window, the grids are coarse, and the one
 * signal colour (amber) always means "newest" — the tile you drew, the last
 * discard in each river, the latest line in the log.
 *
 * Every rule is scoped under body.look-bench; the classic site at / never
 * carries that class. Layouts: desktop (readout in a right column), narrow
 * (readout below), phone portrait (hand in two rows, rivers twelve wide),
 * phone landscape (one compact screen).
 */

/* ======================================================================
   tokens
   ====================================================================== */

.look-bench {
    --desk: #0B1519;
    --grid-minor: rgba(120, 175, 185, 0.04);
    --grid-major: rgba(120, 175, 185, 0.085);
    --module: #1A2327;
    --module-hi: #212C31;
    --module-edge: #34434A;
    --text: #D3DEE0;
    --dim: #8DA1A6;
    --faint: #56686E;
    --amber: #F2B544;
    --amber-ink: #2A1D05;
    --teal: #34D6A8;
    --teal-ink: #05271D;
    --red: #C9452E;
    --paper: #F0EEE5;
    --paper-lo: #E1DED0;
    --paper-edge: #A39D88;
    --paper-side: #6E6A5B;
    --back: #1B5A4E;
    --back-lo: #164B41;
    --back-line: rgba(62, 141, 121, 0.6);

    /* Tile sizes follow the window, so one stylesheet fills a shared laptop
       window and a 1080p screen alike; the hand is also capped by width so
       fifteen tiles always fit beside the readout. */
    --hud-w: 300px;
    --pad: 20px;
    --gap: 4px;
    --hand-h: min(9.8vh, calc((100vw - var(--hud-w) - 2 * var(--pad) - 150px) / 15 * 1.35));
    --hand-w: calc(var(--hand-h) / 1.35);
    --opp-h: clamp(28px, 4.1vh, 44px);
    --opp-w: calc(var(--opp-h) * 0.74);
    --river-h: clamp(40px, 6.4vh, 66px);
    --river-w: calc(var(--river-h) * 0.745);
    --river-cols: 6;
    --meld-h: calc(var(--hand-h) * 0.72);
    --meld-w: calc(var(--meld-h) * 0.74);

    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text);
    background-color: var(--desk);
    background-image:
        linear-gradient(var(--grid-major) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
        linear-gradient(var(--grid-minor) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
    background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
    font: 400 15px/1.35 'Plex Condensed', 'Arial Narrow', sans-serif;
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
.look-bench .shadowed { text-shadow: none; }
.look-bench :is(h1, h2, h3, h4, h5, input, button) { font-family: inherit; }
.look-bench a { color: var(--teal); }
.look-bench .hide { display: none !important; }

/* ======================================================================
   the board grid (desktop)
   ====================================================================== */

.look-bench #board {
    position: relative;
    box-sizing: border-box;
    min-height: 100vh;
    margin-right: var(--hud-w);
    padding: var(--pad);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
        "status info"
        "opp-a  opp-b"
        "table  table"
        "me     me";
    column-gap: var(--pad);
    row-gap: 14px;
}
.look-bench #notifications { grid-area: status; position: static; align-self: center; }
.look-bench #player-info { grid-area: info; position: static; justify-self: end; align-self: center; }
.look-bench .table { grid-area: table; }
.look-bench .this-player { grid-area: me; position: static; bottom: auto; }

/* ---------- status line ---------- */

.look-bench #notifications { font: 600 22px/1.2 'Plex Condensed', sans-serif; letter-spacing: 0.01em; }
.look-bench #board:has(.this-player.active) .msg { color: var(--teal); }
.look-bench #msg-other {
    margin-left: 14px; font: 400 14px 'Plex Mono', monospace; color: var(--dim);
}
.look-bench #player-info { font: 400 14px 'Plex Mono', monospace; color: var(--dim); }
.look-bench #player-info a,
.look-bench #play-again,
.look-bench .bench-button {
    display: inline-block;
    margin-left: 10px;
    padding: 7px 14px 6px;
    font: 600 13px/1 'Plex Condensed', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: #A63A27;
    background: #DDD6C1;
    border: 0;
    border-radius: 3px;
    box-shadow: inset 0 2px 0 #B5402C, 0 2px 0 #8E8670;
    cursor: pointer;
}
.look-bench #player-info a:active,
.look-bench #play-again:active,
.look-bench .bench-button:active { transform: translateY(2px); box-shadow: inset 0 2px 0 #B5402C; }
.look-bench #play-again { margin-left: 16px; vertical-align: 3px; }

/* ======================================================================
   seats: component modules
   ====================================================================== */

.look-bench .seat {
    float: none; width: auto; min-width: 0; margin: 0 !important;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "name regs"
        "hand hand";
    align-items: center;
    column-gap: 16px;
    row-gap: 10px;
    padding: 12px 14px 14px;
    background: linear-gradient(var(--module-hi), var(--module));
    border: 1px solid var(--module-edge);
    border-radius: 7px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 22px rgba(0, 0, 0, 0.35);
    transition: border-color 160ms, box-shadow 160ms;
}
.look-bench .seat.active {
    border-color: var(--teal);
    box-shadow: 0 0 0 1px rgba(52, 214, 168, 0.35), 0 0 22px rgba(52, 214, 168, 0.12), 0 8px 22px rgba(0, 0, 0, 0.35);
}
.look-bench .seat .name {
    grid-area: name;
    margin: 0;
    font: 500 17px/1.1 'Plex Condensed', sans-serif;
    text-transform: lowercase;
    color: var(--text);
}
.look-bench .seat .name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.look-bench .this-player .name .who::before { content: 'you \00b7\00a0'; color: var(--dim); }

/* seat wind: the wind tile and its name, like the markers on a real table.
   Ink on a pale plate, not amber: amber means "newest". */
.look-bench .wind {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    padding: 3px 9px 3px 3px;
    font: 600 14px/1 'Plex Mono', monospace;
    color: var(--text);
    background: #2A363B;
    border: 1px solid #3C4C53;
    border-radius: 4px;
}
.look-bench .wind-tile {
    display: inline-block; flex: none;
    width: 21px; height: 28px;
    border-radius: 3px;
    background-color: var(--paper);
    background-size: 84%;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 1px 0 var(--paper-edge), 0 2px 0 var(--paper-side);
}
.look-bench .wind[data-wind="east"] { border-color: var(--dim); }
.look-bench .seat .regs { grid-area: regs; justify-self: end; }
.look-bench .seat .hand-tiles { grid-area: hand; }
.look-bench .this-player .buttons { display: none; }

/* register tags: a lowercase label over an amber value, as on the MC4000 */
.look-bench .regs { display: flex; gap: 8px; }
.look-bench .reg { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
.look-bench .reg i { font: 400 12px/1 'Plex Condensed', sans-serif; font-style: normal; color: var(--dim); }
.look-bench .reg b {
    min-width: 34px;
    padding: 3px 7px 2px;
    text-align: center;
    font: 600 15px/1.15 'Plex Mono', monospace;
    color: var(--amber-ink);
    background: var(--amber);
    border-radius: 3px;
}
/* the turn is the module's teal edge; a register appears only for a win */
.look-bench .reg-mode { display: none; }
.look-bench .reg-mode[data-mode="win"] { display: inline-flex; }
.look-bench .reg-mode[data-mode="win"] b { background: var(--teal); color: var(--teal-ink); }

/* ======================================================================
   tiles
   ====================================================================== */

.look-bench a.tile-holder {
    box-sizing: border-box;
    display: block;
    float: none;
    position: relative;
    width: var(--hand-w);
    height: var(--hand-h);
    margin: 0 var(--gap) 0 0;
    padding: 6px 5px;
    border-radius: 6px;
    text-decoration: none;
    background: linear-gradient(var(--paper), var(--paper-lo));
    box-shadow: 0 2px 0 var(--paper-edge), 0 3px 0 var(--paper-side), 0 6px 10px rgba(0, 0, 0, 0.45);
    transition: transform 90ms ease-out, box-shadow 90ms ease-out;
}
.look-bench a.tile-holder .tile,
.look-bench .other-player a.tile-holder .tile,
.look-bench.mobile a.tile-holder .tile,
.look-bench.mobile .other-player a.tile-holder .tile {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}
.look-bench .tile-placeholder,
.look-bench .hidden .tile { background-image: none !important; }
/* a tile back: PCB green with an inset frame */
.look-bench a.tile-holder.hidden {
    background: linear-gradient(var(--back), var(--back-lo));
    box-shadow:
        inset 0 0 0 2px var(--back-lo), inset 0 0 0 3px var(--back-line),
        0 2px 0 #0F3530, 0 4px 8px rgba(0, 0, 0, 0.45);
}
.look-bench .tile-row { font-size: 0; }
.look-bench .padded { padding: 0; }
.look-bench .hand-tiles { display: flex; align-items: flex-end; flex-wrap: nowrap; }
.look-bench .last-tile { float: none; margin-left: calc(var(--gap) * 3); display: flex; }
.look-bench .side { float: none; margin-left: calc(var(--gap) * 5); display: flex; }
.look-bench .side:empty { display: none; }

/* opponents: small backs */
.look-bench .other-player a.tile-holder {
    width: var(--opp-w); height: var(--opp-h); margin-right: 2px; padding: 3px 2px; border-radius: 3px;
}
.look-bench .other-player .side a.tile-holder { width: calc(var(--opp-w) * 1.15); height: calc(var(--opp-h) * 1.15); }
.look-bench .other-player .last-tile a.tile-holder.hidden:has(.tile-placeholder) { visibility: hidden; }

/* your hand */
.look-bench #player-tiles { padding: 10px 0 22px; }
.look-bench #player-tiles a.tile-holder { margin-top: 0 !important; }
.look-bench #player-tiles a.tile-holder.hidden { opacity: 0.3; }
.look-bench #player-tiles .side a.tile-holder { width: var(--meld-w); height: var(--meld-h); padding: 4px; }
/* silkscreen labels under each part */
.look-bench #player-tiles a.tile-holder::after {
    content: var(--ix, '');
    position: absolute;
    left: -4px; right: -4px; top: calc(100% + 8px);
    text-align: center;
    font: 600 13px/1 'Plex Mono', monospace;
    color: var(--dim);
}
.look-bench #player-tiles a.tile-holder.hidden::after { content: ''; }
/* the drawn tile: an amber datum line under it */
.look-bench #player-tiles .last-tile a.tile-holder:not(.hidden) {
    box-shadow: 0 2px 0 var(--paper-edge), 0 3px 0 var(--paper-side), 0 6px 10px rgba(0, 0, 0, 0.45), 0 10px 0 -2px var(--amber);
}
.look-bench #player-tiles .last-tile a.tile-holder:not(.hidden)::after { color: var(--amber); }
/* pick up (hover with a mouse; the first tap on a touch screen) */
.look-bench .this-player.active #player-tiles a.tile-holder:not(.hidden):hover,
.look-bench .this-player.active #player-tiles a.tile-holder.armed {
    transform: translateY(-8px);
    box-shadow: 0 2px 0 var(--paper-edge), 0 3px 0 var(--paper-side), 0 16px 20px rgba(0, 0, 0, 0.5);
}
.look-bench .this-player.active #player-tiles a.tile-holder.armed { outline: 2px solid var(--teal); outline-offset: 2px; }
.look-bench .this-player.active #player-tiles a.tile-holder:not(.hidden):hover::after,
.look-bench .this-player.active #player-tiles a.tile-holder.armed::after { color: var(--teal); }
.look-bench .this-player.active #player-tiles a.tile-holder:not(.hidden) { cursor: pointer; }

/* a tile you just drew slides in from the wall side */
.look-bench #player-tiles a.tile-holder.drawn-now { animation: bench-draw 240ms cubic-bezier(0.2, 0.8, 0.3, 1) 1; }
@keyframes bench-draw {
    0% { transform: translateX(28px); opacity: 0; }
    100% { transform: none; opacity: 1; }
}

/* ======================================================================
   the table: a chamfered board, a footprint for each river
   ====================================================================== */

.look-bench .table {
    display: flex;
    align-self: center;
    justify-content: center;
    align-items: flex-start;
    gap: calc(var(--pad) * 1.4);
    padding: 22px 28px 26px;
    background-color: rgba(20, 44, 50, 0.5);
    background-image:
        linear-gradient(rgba(140, 200, 205, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140, 200, 205, 0.05) 1px, transparent 1px);
    background-size: 12px 12px;
    border: 1px solid #2F4E57;
    clip-path: polygon(26px 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%, 0 26px);
    position: relative;
}
.look-bench .table::before,
.look-bench .table::after {  /* the chamfer edges, which clip-path would otherwise eat */
    content: ''; position: absolute; width: 37px; height: 1px; background: #2F4E57;
}
.look-bench .table::before { left: -5px; top: 12px; transform: rotate(-45deg); }
.look-bench .table::after { right: -5px; bottom: 12px; transform: rotate(-45deg); }

.look-bench .river {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px 12px 12px;
    border: 1px dashed rgba(120, 175, 185, 0.32);
    border-radius: 6px;
    background: rgba(8, 17, 20, 0.6);
}
.look-bench .river.active { border-style: solid; border-color: rgba(52, 214, 168, 0.7); }
.look-bench .river-name {
    margin: 0;
    font: 500 13px/1 'Plex Mono', monospace;
    text-transform: lowercase;
    color: var(--dim);
}
.look-bench .river-name::after { content: ' \00b7 river'; color: var(--faint); }
.look-bench .river.active .river-name { color: var(--teal); }

/* rivers: rows of six, the riichi convention */
.look-bench .discard-tiles {
    width: auto;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(var(--river-cols), var(--river-w));
    grid-auto-rows: var(--river-h);
    gap: 4px 3px;
    /* room for four rows from the first discard, so nothing below moves */
    min-height: calc(var(--river-h) * 4 + 12px);
    align-content: start;
}
.look-bench .discard-tiles a.tile-holder,
.look-bench .other-player .discard-tiles a.tile-holder {
    width: var(--river-w); height: var(--river-h); margin: 0; padding: 4px 3px; border-radius: 4px;
    box-shadow: 0 1px 0 var(--paper-edge), 0 2px 0 var(--paper-side), 0 3px 5px rgba(0, 0, 0, 0.4);
}
/* the newest discard in each river: the same amber datum as your drawn tile */
.look-bench .river .discard-tiles a.tile-holder:last-child {
    box-shadow: 0 1px 0 var(--paper-edge), 0 2px 0 var(--paper-side), 0 3px 5px rgba(0, 0, 0, 0.4), 0 7px 0 -2px var(--amber);
}
/* a discard lands: dropped onto the board, a small settle, done */
.look-bench .river a.tile-holder.landed { animation: bench-drop 220ms cubic-bezier(0.3, 0.7, 0.4, 1.3) 1; }
@keyframes bench-drop {
    0% { transform: translateY(-14px); }
    100% { transform: none; }
}

/* a won hand turns face up one tile after another (hud.js sets --i) */
.look-bench .seat:has(.reg-mode[data-mode="win"]) .hand-tiles a.tile-holder:not(.hidden) {
    animation: bench-reveal 320ms ease-out both;
    animation-delay: calc(var(--i, 0) * 40ms);
}
@keyframes bench-reveal {
    0% { transform: rotateX(90deg); }
    100% { transform: none; }
}

/* ======================================================================
   readout: the parts bin
   ====================================================================== */

.look-bench #hud {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: var(--hud-w);
    box-sizing: border-box;
    padding: var(--pad);
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    background: rgba(13, 22, 26, 0.95);
    border-left: 1px solid var(--module-edge);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
}
.look-bench #hud i { font-style: normal; }
.look-bench #hud s { text-decoration: none; }
.look-bench .hud-id { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--module-edge); }
.look-bench .hud-name { font: 600 21px/1 'Plex Condensed', sans-serif; color: var(--text); }
.look-bench .hud-variant { font: 400 13px/1 'Plex Mono', monospace; color: var(--dim); }

.look-bench .hud-meters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.look-bench .hud-meter {
    display: flex; flex-direction: column; gap: 6px;
    padding: 8px 10px 9px;
    background: #141E22;
    border: 1px solid #2B393E;
    border-radius: 4px;
}
.look-bench .hud-meter i { font: 400 13px/1 'Plex Condensed', sans-serif; color: var(--dim); }
.look-bench .hud-meter b { font: 600 19px/1 'Plex Mono', monospace; color: var(--text); }
.look-bench .hud-round b { display: flex; align-items: center; gap: 7px; }
.look-bench .hud-round .wind-tile { width: 18px; height: 24px; }
.look-bench .hud-wall {
    grid-column: 1 / -1;
    display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
}
.look-bench .hud-gauge { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.look-bench .hud-gauge s { height: 10px; background: #26343A; border-radius: 1px; }
.look-bench .hud-gauge s.on { background: var(--amber); }
.look-bench .hud-waits { display: none; grid-column: 1 / -1; border-color: var(--teal); }
.look-bench .hud-waits.on { display: flex; }
.look-bench .hud-waits i { color: var(--teal); }
.look-bench .hud-waits b { font-size: 17px; letter-spacing: 0.04em; }

.look-bench .hud-log {
    list-style: none;
    margin: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    padding: 12px 0 0;
    border-top: 1px solid var(--module-edge);
    font: 400 14px/1.3 'Plex Mono', monospace;
    color: var(--dim);
}
.look-bench .hud-log .who { color: var(--text); }
.look-bench .hud-log li:last-child .who { color: var(--teal); }
.look-bench .hud-log .tile-ix {
    padding: 0 5px; border-radius: 2px;
    background: #2A363B; color: var(--text); font-weight: 600;
}
.look-bench .hud-log li:last-child .tile-ix { background: var(--amber); color: var(--amber-ink); }
.look-bench .hud-spec {
    list-style: none;
    margin: 0;
    padding: 10px 12px;
    font: 400 14px/1.45 'Plex Condensed', sans-serif;
    color: var(--dim);
    background: #10191C;
    border: 1px dashed #2E3D42;
    border-radius: 4px;
}
.look-bench .hud-spec li::before { content: '\203A\00a0'; color: var(--amber); }
.look-bench .hud-foot { display: flex; justify-content: space-between; align-items: center; }
.look-bench .hud-sound {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 12px 6px;
    font: 500 13px/1 'Plex Mono', monospace; color: var(--dim);
    background: #141E22; border: 1px solid #2B393E; border-radius: 4px; cursor: pointer;
}
.look-bench .hud-sound .led {
    width: 9px; height: 9px; border-radius: 50%;
    background: #2A363B; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.look-bench .hud-sound[aria-pressed="true"] { color: var(--text); }
.look-bench .hud-sound[aria-pressed="true"] .led { background: var(--teal); box-shadow: 0 0 8px rgba(52, 214, 168, 0.7); }
.look-bench .hud-datasheet { font: 500 13px/1 'Plex Mono', monospace; color: var(--amber); text-decoration: none; }

/* ======================================================================
   the pon / ron prompt
   ====================================================================== */

.look-bench .qtip-mahjong {
    max-width: none;
    background: var(--module); border: 1px solid var(--teal); color: var(--text); border-radius: 6px;
    box-shadow: 0 0 24px rgba(52, 214, 168, 0.22), 0 10px 30px rgba(0, 0, 0, 0.5);
}
.look-bench .qtip-mahjong .qtip-content { padding: 12px 14px; text-align: center; }
.look-bench .qtip-mahjong a.tile-holder { margin: 0 auto 10px; width: 46px; height: 62px; }
.look-bench .qtip-mahjong h1 {
    margin: 0;
    min-width: 96px;
    font: 600 16px/1 'Plex Condensed', sans-serif; letter-spacing: 0.12em; text-transform: uppercase;
    padding: 12px 18px 11px; color: var(--teal-ink); background: var(--teal); border-radius: 4px;
}
.look-bench .qtip-ron { border-color: var(--amber); }
.look-bench .qtip-ron h1 { background: var(--amber); color: var(--amber-ink); }
.look-bench .qtip-mahjong .qtip-close { background: var(--module-hi); border-color: var(--module-edge); }

/* ======================================================================
   the other pages: home, lobby, full table, datasheet
   ====================================================================== */

.look-bench .bench-page {
    box-sizing: border-box;
    max-width: 980px;
    margin: 0 auto;
    padding: 56px var(--pad) 40px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}
.look-bench .bench-head { display: flex; flex-direction: column; gap: 8px; }
.look-bench .part-no {
    align-self: flex-start;
    padding: 3px 8px 2px;
    font: 600 14px/1.2 'Plex Mono', monospace; letter-spacing: 0.06em;
    color: var(--amber-ink); background: var(--amber); border-radius: 3px;
}
.look-bench .bench-head h1 { margin: 0; font: 600 44px/1.05 'Plex Condensed', sans-serif; color: var(--text); }
.look-bench .bench-head .sub { margin: 0; font: 400 16px/1.3 'Plex Mono', monospace; color: var(--dim); }

/* a winning hand on a strip of board, grouped into its sets */
.look-bench .bench-specimen {
    display: flex; flex-wrap: wrap; gap: 18px 22px; align-items: flex-end;
    padding: 26px 28px 22px;
    background-color: rgba(20, 44, 50, 0.5);
    background-image:
        linear-gradient(rgba(140, 200, 205, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(140, 200, 205, 0.05) 1px, transparent 1px);
    background-size: 12px 12px;
    border: 1px solid #2F4E57;
    clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
}
.look-bench .bench-specimen .group { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.look-bench .bench-specimen .tiles { display: flex; font-size: 0; }
.look-bench .bench-specimen .group > span {
    align-self: stretch; text-align: center;
    padding-top: 6px; border-top: 1px solid var(--faint);
    font: 500 13px/1 'Plex Mono', monospace; color: var(--dim);
}
.look-bench .bench-specimen a.tile-holder { width: 50px; height: 68px; margin-right: 4px; cursor: default; }
.look-bench .bench-caption { margin: -8px 0 0; font: 400 17px/1.4 'Plex Condensed', sans-serif; color: var(--dim); }

.look-bench .bench-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.look-bench .bench-actions .bench-button { margin-left: 0; }
.look-bench .bench-button.big { padding: 14px 22px 13px; font-size: 16px; }
.look-bench .bench-link { font: 500 15px/1 'Plex Mono', monospace; color: var(--amber); text-decoration: none; padding: 10px 4px; }

.look-bench .bench-module {
    padding: 16px 18px 18px;
    background: linear-gradient(var(--module-hi), var(--module));
    border: 1px solid var(--module-edge);
    border-radius: 7px;
}
.look-bench .bench-module h2 { margin: 0 0 12px; font: 500 15px/1 'Plex Mono', monospace; color: var(--dim); text-transform: lowercase; }
.look-bench .bench-module p { margin: 0 0 12px; color: var(--dim); font-size: 16px; }
.look-bench .bench-module ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.look-bench .bench-module li { font: 500 17px/1.2 'Plex Mono', monospace; }
.look-bench .bench-module li::before { content: '\25A0\00a0\00a0'; color: var(--teal); font-size: 12px; vertical-align: 2px; }
.look-bench .bench-invite { display: flex; gap: 10px; }
.look-bench .bench-invite input {
    flex: 1; min-width: 0;
    padding: 10px 12px;
    font: 400 15px/1.2 'Plex Mono', monospace; color: var(--text);
    background: #0E171A; border: 1px solid var(--module-edge); border-radius: 4px;
}
.look-bench .bench-invite .bench-button { margin-left: 0; }
.look-bench .bench-foot {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
    padding-top: 16px; border-top: 1px solid var(--module-edge);
    font: 400 14px/1.3 'Plex Mono', monospace; color: var(--faint);
}
.look-bench .bench-foot a { color: var(--dim); text-decoration: none; }

/* the datasheet: a printed sheet on the bench */
.look-bench .bench-datasheet { max-width: 1000px; }
.look-bench .sheet table, .look-bench .sheet td, .look-bench .sheet th { color: #1E2124; font-size: inherit; }
.look-bench .sheet {
    padding: 44px 52px 36px;
    color: #1E2124;
    --text: #1E2124;
    background: #F2F0E8;
    border-radius: 4px;
    box-shadow: 0 2px 0 #C9C4B2, 0 18px 50px rgba(0, 0, 0, 0.5);
    font: 400 17px/1.55 'Plex Condensed', sans-serif;
}
.look-bench .sheet a { color: #1C6E55; }
.look-bench .sheet-head {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
    padding-bottom: 16px; border-bottom: 3px solid #1E2124;
}
.look-bench .sheet-head h1 { margin: 0; font: 600 48px/1 'Plex Condensed', sans-serif; letter-spacing: 0.01em; }
.look-bench .sheet-what { margin: 6px 0 0; font: 500 19px/1.2 'Plex Condensed', sans-serif; color: #4A5257; }
.look-bench .sheet-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font: 400 14px/1.3 'Plex Mono', monospace; color: #4A5257; }
.look-bench .sheet section { padding: 22px 0 6px; border-bottom: 1px solid #CFCAB8; }
.look-bench .sheet h2 { margin: 0 0 10px; font: 600 22px/1.2 'Plex Condensed', sans-serif; }
.look-bench .sheet h2 b {
    display: inline-block; min-width: 1.4em; margin-right: 8px; text-align: center;
    color: #F2F0E8; background: #1E2124; border-radius: 2px; font-weight: 600;
}
.look-bench .sheet p { margin: 0 0 14px; max-width: 72ch; }
.look-bench .sheet code { font: 500 0.92em 'Plex Mono', monospace; padding: 0 4px; background: #E3DFD1; border-radius: 2px; }
.look-bench .sheet a.tile-holder {
    width: 40px; height: 54px; padding: 4px 3px; margin: 0 4px 0 0; cursor: default;
    box-shadow: 0 1px 0 var(--paper-edge), 0 2px 0 var(--paper-side), 0 3px 6px rgba(0, 0, 0, 0.18);
}
.look-bench .pinout { border-collapse: collapse; width: 100%; margin: 6px 0 14px; }
.look-bench .pinout th {
    color: #1E2124;
    width: 7.5em; padding: 10px 12px 10px 0; text-align: left; vertical-align: middle;
    font: 600 16px/1.2 'Plex Condensed', sans-serif;
}
.look-bench .pinout th i { display: block; font: 400 13px/1.2 'Plex Mono', monospace; color: #6A7176; font-style: normal; }
.look-bench .pinout td { padding: 8px 0; border-top: 1px solid #DDD8C6; }
.look-bench .pinout tr:first-child td { border-top: 0; }
.look-bench .pinout figure { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 4px 0 0; }
.look-bench .pinout figcaption { font: 600 13px/1 'Plex Mono', monospace; color: #4A5257; }
.look-bench .timing { margin: 6px 0 16px; display: flex; flex-direction: column; gap: 6px; font: 500 13px/1 'Plex Mono', monospace; }
.look-bench .timing .lane { display: grid; grid-template-columns: 8.5em 3fr 2fr 3fr 2fr 3fr 2fr 3fr; align-items: end; height: 34px; }
.look-bench .timing .who { align-self: center; color: #4A5257; }
.look-bench .timing .lo { height: 2px; background: #1E2124; }
.look-bench .timing .hi {
    height: 28px; display: flex; align-items: center; justify-content: center;
    border: 2px solid #1E2124; border-bottom: 0; color: #1E2124; background: #E7E3D5;
}
.look-bench .timing .claim { height: 2px; background: repeating-linear-gradient(90deg, #C2402A 0 6px, transparent 6px 10px); }
.look-bench .timing .legend { margin: 10px 0 0 8.5em; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: #4A5257; font-size: 13px; }
.look-bench .timing .legend span { display: inline-block; width: 22px; height: 10px; }
.look-bench .timing .k-hi { border: 2px solid #1E2124; border-bottom: 0; background: #E7E3D5; }
.look-bench .timing .k-claim { height: 2px !important; margin-left: 12px; background: repeating-linear-gradient(90deg, #C2402A 0 6px, transparent 6px 10px); }
.look-bench .defs { display: grid; grid-template-columns: 6em 1fr; gap: 10px 16px; margin: 4px 0 16px; }
.look-bench .defs dt { font: 600 16px/1.55 'Plex Mono', monospace; }
.look-bench .defs dd { margin: 0; }
.look-bench .example { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 4px 0 16px; padding: 16px; background: #E7E3D5; border-radius: 3px; font-size: 0; }
.look-bench .example p { flex-basis: 100%; margin: 12px 0 0; font-size: 16px; }
.look-bench .regs-table { border-collapse: collapse; margin: 4px 0 14px; }
.look-bench .regs-table th {
    color: #1E2124;
    padding: 7px 18px 7px 0; text-align: left; vertical-align: top; white-space: nowrap;
    font: 600 15px/1.5 'Plex Mono', monospace;
}
.look-bench .regs-table td { padding: 7px 0; }
.look-bench .regs-table tr + tr th, .look-bench .regs-table tr + tr td { border-top: 1px solid #DDD8C6; }
.look-bench .sheet-foot {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
    padding-top: 18px; font: 400 14px/1.3 'Plex Mono', monospace; color: #6A7176;
}

@media (max-width: 700px) {
    .look-bench .bench-page { padding-top: 28px; gap: 20px; }
    .look-bench .bench-head h1 { font-size: 34px; }
    .look-bench .bench-specimen { padding: 18px 14px 16px; gap: 14px 12px; justify-content: center; }
    .look-bench .bench-specimen a.tile-holder { width: 36px; height: 49px; margin-right: 3px; padding: 4px 3px; }
    .look-bench .bench-actions .bench-button.big { flex: 1 1 100%; text-align: center; }
    .look-bench .sheet { padding: 24px 18px; font-size: 16px; }
    .look-bench .sheet-head { flex-direction: column; align-items: flex-start; }
    .look-bench .sheet-meta { align-items: flex-start; }
    .look-bench .sheet-head h1 { font-size: 38px; }
    .look-bench .pinout th { display: block; width: auto; padding-bottom: 0; }
    .look-bench .pinout td { display: block; border: 0; }
    .look-bench .sheet a.tile-holder { width: 30px; height: 41px; padding: 3px 2px; }
    .look-bench .timing .lane { grid-template-columns: 6.5em 3fr 2fr 3fr 2fr 3fr 2fr 3fr; font-size: 11px; }
    .look-bench .timing .legend { margin-left: 0; font-size: 12px; }
    .look-bench .defs { grid-template-columns: 1fr; gap: 2px; }
    .look-bench .defs dd { margin-bottom: 10px; }
}

/* ======================================================================
   narrow windows: readout below the table
   ====================================================================== */

@media (max-width: 999px) {
    body.look-bench {
        --hud-w: 0px;
        --hand-h: calc((100vw - 2 * var(--pad) - 150px) / 15 * 1.35);
    }
    body.look-bench #board { min-height: 0; }
    body.look-bench .table { flex-wrap: wrap; }
    body.look-bench #hud {
        position: static; width: auto; border: 0; box-shadow: none;
        display: grid; grid-template-columns: 1fr 1fr; align-items: start;
    }
    body.look-bench .hud-id, body.look-bench .hud-foot { grid-column: 1 / -1; }
}

/* ======================================================================
   phones, portrait: hand in two rows, rivers twelve wide, and the whole
   table on one screen — status line to the bottom of your hand — in what
   Chrome leaves of a 360x780 phone (652px under its bars). The readout
   follows below it, a scroll away.
   ====================================================================== */

@media (max-width: 700px) {
    body.look-bench {
        --pad: 10px;
        --gap: 4px;
        /* seven to a row: the drawn tile ends the second row */
        --hand-w: calc((100vw - 2 * var(--pad) - 20px - 7 * var(--gap) - 12px - 4px) / 7);
        --hand-h: calc(var(--hand-w) * 1.35);
        --meld-w: calc(var(--hand-w) * 0.75);
        --meld-h: calc(var(--meld-w) * 1.35);
        --opp-h: 24px;
        --opp-w: calc(var(--opp-h) * 0.74);
        --river-cols: 12;
        --river-w: calc((100vw - 2 * var(--pad) - 16px - 18px - 11 * 3px) / 12);
        --river-h: calc(var(--river-w) * 1.34);
        font-size: 14px;
    }
    body.look-bench #board {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "status status"
            "opp-a  opp-b"
            "table  table"
            "me     me";
        row-gap: 6px;
        column-gap: 8px;
        padding-top: 6px;
    }

    /* one slim row: the status and the tap hint on the left, Restart small
       on the right. Picking a tile up swaps the status for the hint ("Your
       turn" is plain then), so the hint shows in full and nothing moves. */
    body.look-bench #notifications {
        display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0;
        min-height: 24px; padding-right: 84px;
        font-size: 17px; white-space: nowrap;
    }
    body.look-bench #notifications .msg { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    body.look-bench #msg-other {
        flex: 0 1 auto; min-width: 0; margin: 0;
        overflow: hidden; text-overflow: ellipsis;
        font: 400 13px/1.2 'Plex Condensed', sans-serif;
    }
    body.look-bench #board:has(#player-tiles a.armed) .msg { display: none; }
    body.look-bench #board:has(#player-tiles a.armed) #msg-other { color: var(--teal); }
    body.look-bench #play-again { flex: none; margin-left: 0; vertical-align: 0; padding: 6px 10px 5px; font-size: 12px; }
    /* your name is on your module; here only the restart button stays */
    body.look-bench #player-info { grid-area: status; justify-self: end; align-self: center; font-size: 0; }
    body.look-bench #player-info a { font-size: 11px; margin: 0; padding: 7px 10px 6px; }   /* 24px tall: hard to hit by accident */

    /* opponents: the hand count and called sets; their backs carry no
       information, and their river count and last discard are the river
       just below, so only "hand" stays (and "win", when it comes) */
    body.look-bench .other-player {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "name regs" "hand hand";
        align-items: start;
        padding: 7px 9px 8px;
        row-gap: 6px;
        column-gap: 8px;
    }
    body.look-bench .other-player .regs { gap: 5px; }
    body.look-bench .other-player .reg:nth-child(2),
    body.look-bench .other-player .reg:nth-child(3),
    body.look-bench .other-player:has(.reg-mode[data-mode="win"]) .reg:first-child { display: none; }
    body.look-bench .seat .reg { gap: 2px; }
    body.look-bench .seat .reg i { font-size: 11px; }
    body.look-bench .seat .reg b { min-width: 28px; font-size: 13px; padding: 2px 5px 1px; }
    body.look-bench .other-player .name { font-size: 15px; }
    /* the wind plate sits over the name, so neither has to break */
    body.look-bench .other-player .name { flex-direction: column; align-items: flex-start; gap: 4px; }
    body.look-bench .seat .wind { gap: 5px; padding: 2px 7px 2px 2px; font-size: 13px; }
    body.look-bench .seat .wind-tile { width: 16px; height: 21px; }
    body.look-bench .seat .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    body.look-bench .other-player .hand-tiles > a.tile-holder,
    body.look-bench .other-player .hand-tiles > .last-tile { display: none; }
    body.look-bench .other-player .side { margin-left: 0; }
    body.look-bench .other-player .hand-tiles:not(:has(.side a)) { display: none; }

    body.look-bench .table {
        flex-direction: column; align-items: stretch; flex-wrap: nowrap;
        gap: 7px; padding: 9px 7px 8px;
        clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
    }
    body.look-bench .table::before, body.look-bench .table::after { width: 23px; }
    body.look-bench .table::before { left: -3px; top: 7px; }
    body.look-bench .table::after { right: -3px; bottom: 7px; }
    /* each river's name is printed on its outline, as a part's designator
       sits on its footprint, rather than on a line of its own; its plate is
       the board's colour, so the outline breaks behind it */
    body.look-bench .river { position: relative; padding: 8px 8px 6px; gap: 0; }
    body.look-bench .river-name {
        position: absolute; left: 10px; top: -7px;
        padding: 0 5px;
        font-size: 12px; line-height: 12px;
        background: #102026;
    }
    body.look-bench .river-mine { order: 3; }   /* yours sits next to your hand */
    body.look-bench .discard-tiles { gap: 3px; min-height: calc(var(--river-h) * 2 + 3px); }
    body.look-bench .discard-tiles a.tile-holder { padding: 2px; border-radius: 3px; }

    body.look-bench .this-player { padding: 8px 10px 2px; row-gap: 6px; }
    body.look-bench .this-player .regs { gap: 5px; }
    /* your module is the one holding your hand: the wind and your name fit
       beside the registers without the "you" */
    body.look-bench .this-player .name { gap: 8px; }
    body.look-bench .this-player .name .who::before { content: none; }
    body.look-bench #player-tiles { flex-wrap: wrap; row-gap: 20px; padding: 8px 0 18px; }
    body.look-bench #player-tiles a.tile-holder { padding: 5px 4px; }
    body.look-bench #player-tiles a.tile-holder::after { font-size: 11px; top: calc(100% + 5px); }
    /* called sets follow the drawn tile on the second row while they fit */
    body.look-bench #player-tiles .side { margin-left: calc(var(--gap) * 2); flex-wrap: wrap; row-gap: 20px; }

    body.look-bench #hud { grid-template-columns: 1fr; padding: 14px var(--pad) 28px; gap: 12px; }
    body.look-bench .hud-spec { display: none; }
    body.look-bench .hud-log { max-height: 7.5em; padding-top: 10px; }
    body.look-bench .hud-sound, body.look-bench .hud-datasheet { padding: 11px 14px 10px; }

    body.look-bench .qtip-mahjong h1 { padding: 15px 22px 14px; }
}

/* ======================================================================
   phones, landscape: one compact screen
   ====================================================================== */

@media (max-height: 500px) and (min-width: 560px) {
    body.look-bench {
        --pad: 10px;
        --hud-w: 0px;
        --hand-w: min(calc((100vw - 2 * var(--pad) - 28px - 15 * var(--gap)) / 15.6), 54px);
        --hand-h: calc(var(--hand-w) * 1.35);
        --river-cols: 9;
        --river-h: 32px;
        --river-w: 24px;
        font-size: 13px;
    }
    body.look-bench #board { min-height: 0; row-gap: 8px; padding-top: 8px; }
    body.look-bench #notifications { font-size: 17px; }
    body.look-bench #msg-other { font-size: 12px; }
    body.look-bench .seat { padding: 7px 10px 8px; row-gap: 6px; }
    body.look-bench .seat .name { font-size: 15px; }
    body.look-bench .reg { flex-direction: row; gap: 4px; align-items: baseline; }
    body.look-bench .reg b { font-size: 13px; min-width: 24px; padding: 2px 5px 1px; }
    body.look-bench .other-player .hand-tiles > a.tile-holder,
    body.look-bench .other-player .hand-tiles > .last-tile { display: none; }
    body.look-bench .other-player .side { margin-left: 0; }
    body.look-bench .other-player .hand-tiles:not(:has(.side a)) { display: none; }
    body.look-bench .table { flex-wrap: nowrap; gap: 10px; padding: 8px 12px 10px; }
    body.look-bench .river { padding: 5px 7px 7px; gap: 4px; }
    body.look-bench .river-name { font-size: 12px; }
    body.look-bench .discard-tiles { gap: 2px; min-height: calc(var(--river-h) * 3 + 4px); }
    body.look-bench .discard-tiles a.tile-holder { padding: 2px; border-radius: 3px; }
    body.look-bench #player-tiles { padding: 6px 0 20px; }
    body.look-bench #player-tiles a.tile-holder { padding: 4px 3px; }
    body.look-bench #player-tiles a.tile-holder::after { font-size: 11px; top: calc(100% + 5px); }
    body.look-bench #hud {
        position: static; width: auto; border: 0; box-shadow: none;
        display: grid; grid-template-columns: 1fr 1fr; align-items: start;
    }
    body.look-bench .hud-spec { display: none; }
    body.look-bench .hud-log { max-height: 6em; }
}

/* ======================================================================
   phone user agents: the 2013 stylesheet's `.mobile` rules (set from the
   User-Agent by client.js) shrink tiles to 25px and hide names and the
   opponents' rows. Workbench sizes itself by viewport instead.
   ====================================================================== */

body.look-bench.mobile { padding: 0; }
body.look-bench.mobile .seat .name { display: flex; }
body.look-bench.mobile .tile-row { font-size: 0; }
body.look-bench.mobile a.tile-holder { margin: 0 var(--gap) 0 0; width: var(--hand-w); height: var(--hand-h); }
body.look-bench.mobile .other-player a.tile-holder { width: var(--opp-w); height: var(--opp-h); margin: 0 2px 0 0; }
body.look-bench.mobile .discard-tiles a.tile-holder { width: var(--river-w); height: var(--river-h); margin: 0; }
body.look-bench.mobile #player-tiles .side a.tile-holder { width: var(--meld-w); height: var(--meld-h); }
body.look-bench.mobile .other-player .hand-tiles { display: flex; }
body.look-bench.mobile .other-player .hand-tiles:not(:has(.side a)) { display: none; }

/* ======================================================================
   reduced motion: everything lands at once
   ====================================================================== */

@media (prefers-reduced-motion: reduce) {
    .look-bench *, .look-bench *::after { animation: none !important; transition: none !important; }
}

.look-bench .tile-0{background-image:url(../../img/tiles/bench/0.svg)}
.look-bench a[data-tile="0"]{--ix:"1p"}
.look-bench .tile-1{background-image:url(../../img/tiles/bench/1.svg)}
.look-bench a[data-tile="1"]{--ix:"2p"}
.look-bench .tile-2{background-image:url(../../img/tiles/bench/2.svg)}
.look-bench a[data-tile="2"]{--ix:"3p"}
.look-bench .tile-3{background-image:url(../../img/tiles/bench/3.svg)}
.look-bench a[data-tile="3"]{--ix:"4p"}
.look-bench .tile-4{background-image:url(../../img/tiles/bench/4.svg)}
.look-bench a[data-tile="4"]{--ix:"5p"}
.look-bench .tile-5{background-image:url(../../img/tiles/bench/5.svg)}
.look-bench a[data-tile="5"]{--ix:"6p"}
.look-bench .tile-6{background-image:url(../../img/tiles/bench/6.svg)}
.look-bench a[data-tile="6"]{--ix:"7p"}
.look-bench .tile-7{background-image:url(../../img/tiles/bench/7.svg)}
.look-bench a[data-tile="7"]{--ix:"8p"}
.look-bench .tile-8{background-image:url(../../img/tiles/bench/8.svg)}
.look-bench a[data-tile="8"]{--ix:"9p"}
.look-bench .tile-9{background-image:url(../../img/tiles/bench/9.svg)}
.look-bench a[data-tile="9"]{--ix:"1s"}
.look-bench .tile-10{background-image:url(../../img/tiles/bench/10.svg)}
.look-bench a[data-tile="10"]{--ix:"2s"}
.look-bench .tile-11{background-image:url(../../img/tiles/bench/11.svg)}
.look-bench a[data-tile="11"]{--ix:"3s"}
.look-bench .tile-12{background-image:url(../../img/tiles/bench/12.svg)}
.look-bench a[data-tile="12"]{--ix:"4s"}
.look-bench .tile-13{background-image:url(../../img/tiles/bench/13.svg)}
.look-bench a[data-tile="13"]{--ix:"5s"}
.look-bench .tile-14{background-image:url(../../img/tiles/bench/14.svg)}
.look-bench a[data-tile="14"]{--ix:"6s"}
.look-bench .tile-15{background-image:url(../../img/tiles/bench/15.svg)}
.look-bench a[data-tile="15"]{--ix:"7s"}
.look-bench .tile-16{background-image:url(../../img/tiles/bench/16.svg)}
.look-bench a[data-tile="16"]{--ix:"8s"}
.look-bench .tile-17{background-image:url(../../img/tiles/bench/17.svg)}
.look-bench a[data-tile="17"]{--ix:"9s"}
.look-bench .tile-18{background-image:url(../../img/tiles/bench/18.svg)}
.look-bench a[data-tile="18"]{--ix:"E"}
.look-bench .tile-19{background-image:url(../../img/tiles/bench/19.svg)}
.look-bench a[data-tile="19"]{--ix:"S"}
.look-bench .tile-20{background-image:url(../../img/tiles/bench/20.svg)}
.look-bench a[data-tile="20"]{--ix:"W"}
.look-bench .tile-21{background-image:url(../../img/tiles/bench/21.svg)}
.look-bench a[data-tile="21"]{--ix:"N"}
.look-bench .tile-22{background-image:url(../../img/tiles/bench/22.svg)}
.look-bench a[data-tile="22"]{--ix:"Wh"}
.look-bench .tile-23{background-image:url(../../img/tiles/bench/23.svg)}
.look-bench a[data-tile="23"]{--ix:"G"}
.look-bench .tile-24{background-image:url(../../img/tiles/bench/24.svg)}
.look-bench a[data-tile="24"]{--ix:"R"}
.look-bench .tile-25{background-image:url(../../img/tiles/bench/25.svg)}
.look-bench a[data-tile="25"]{--ix:"1m"}
.look-bench .tile-26{background-image:url(../../img/tiles/bench/26.svg)}
.look-bench a[data-tile="26"]{--ix:"9m"}

