/* Giok panels and owned cosmetics. */

.b-local-button{font-size:10px!important;min-height:27px!important;padding:4px 6px!important;color:#756342!important;background:#ede9d8!important;border:1px dashed #bcb298!important;border-radius:6px}
#bareng-card{border:1px solid #ccd6c2;border-radius:14px;background:#fffef6;overflow:hidden;margin:0 0 12px;color:#254c39;font:14px/1.4 Arial,sans-serif}
.b-card-main{display:flex;align-items:center;gap:12px;padding:17px 18px}.b-coin{width:38px;height:38px;border:1px solid #cbbb86;border-radius:50%;background:#f4ecd2;display:grid;place-items:center;color:#90743c;font-size:26px;flex-shrink:0}.b-card-balance{flex:1}.b-card-main strong{display:block;font-size:22px}.b-card-main strong small{font-size:12px;font-weight:400}.b-card-main p{font-size:12px;color:#4e6247;margin:3px 0 0}.b-card-main button{border:1px solid #cbd5c0;border-radius:8px;background:#f8faef;min-height:36px;padding:6px 13px;color:#28513c;font:600 12px Arial}.b-card-main button:first-of-type{background:#265c44;color:#fff;border-color:#265c44}.b-card-main button span{margin-left:8px}.b-card-track{height:3px;background:#e6ebdd}.b-card-track span{display:block;height:100%;background:#ab9257;transition:width .2s}
.b-dialog{position:fixed;inset:0;width:min(640px,calc(100vw - 24px));max-width:640px;max-height:calc(100dvh - 28px);margin:auto;padding:0;border:1px solid #d7dccd;border-radius:20px;background:#fffef6;color:#294c3b;box-shadow:0 24px 90px #0f342a38;overflow:auto;font:14px/1.5 Arial,sans-serif}
.b-dialog::backdrop{background:#133c2c68;backdrop-filter:blur(3px)}
.b-dialog *{box-sizing:border-box}.b-dialog h2,.b-dialog h3,.b-dialog p{margin:0}.b-dialog button{appearance:none;min-height:38px;cursor:pointer;border:1px solid #cdd5c4;border-radius:9px;background:#f8f9f0;color:#2b513e;padding:8px 14px;font:600 12px/1.35 Arial,sans-serif;box-shadow:none}.b-dialog button:hover:not(:disabled){background:#e9efdf}.b-dialog button:disabled{opacity:.5;cursor:default}.b-dialog button:focus-visible,#bareng-card button:focus-visible{outline:3px solid #ae914e;outline-offset:3px}
.b-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:22px 25px 15px}.b-eyebrow{font:600 9px/1.5 Arial;letter-spacing:1.7px;color:#8d845f}.b-head h2{font:700 29px/1.2 Georgia,serif;margin-top:3px}.b-head .b-close{width:36px;height:36px;min-height:36px;border-radius:50%;padding:0;background:transparent;border-color:#d5dccb;font:400 25px/1 Arial}
.b-wallet{display:flex;align-items:center;gap:15px;margin:0 25px 17px;padding:17px 20px;background:linear-gradient(110deg,#1d4937,#31674e);border-radius:13px;color:#fffdf1;position:relative;overflow:hidden}.b-wallet:after{content:'✧';position:absolute;right:150px;top:-32px;font-size:140px;color:#c7d1a30d;pointer-events:none}.b-wallet-icon{font-size:39px;color:#dccc91}.b-wallet small{font-size:11px;color:#dbe4ce}.b-wallet strong{display:block;font:700 34px/1.12 Georgia}.b-wallet p{font-size:11px;text-align:right;margin-left:auto;color:#d1ddc7}.b-wallet p b{font-weight:500;color:#fff5d6;font-size:15px}
.b-tabs{display:flex;padding:0 25px;border-bottom:1px solid #dce1d3;gap:6px}.b-tabs button{flex:1;border:0;border-radius:0;min-height:43px;background:transparent;color:#7a816d;border-bottom:3px solid transparent;font-size:13px}.b-tabs button[aria-current=page]{color:#214e38;border-bottom-color:#285b40}.b-pane{padding:20px 25px 9px}.b-section-heading{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin:0 0 12px}.b-section-heading h3{font:700 18px Georgia,serif}.b-section-heading>span{font-size:10px;color:#858976;text-align:right}.b-quest-list{display:grid;gap:10px;margin-bottom:24px}.b-quest{display:flex;gap:12px;border:1px solid #dce2d0;border-radius:12px;padding:14px;background:#fbfcf5}.b-quest-icon{flex:none;width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#e9efdc;color:#567248;font-size:23px}.b-quest-copy{flex:1;min-width:0}.b-quest-title{display:flex;justify-content:space-between;align-items:center;gap:10px}.b-quest h3{font:600 13px/1.3 Arial}.b-quest p{font-size:11px;color:#78816c;margin:5px 0 8px}.b-reward{white-space:nowrap;color:#967b3c;background:#f5edd6;border:1px solid #e8dcbb;padding:2px 6px;font-size:10px;border-radius:5px}.b-progress-row{display:flex;gap:10px;align-items:center}.b-progress-row progress{width:100%;height:5px;border:0;border-radius:3px;appearance:none;overflow:hidden;flex:1}.b-progress-row progress::-webkit-progress-bar{background:#e2e8da}.b-progress-row progress::-webkit-progress-value{background:#71945e}.b-progress-row progress::-moz-progress-bar{background:#71945e}.b-progress-row>span{font-size:10px;font-weight:600;color:#617554}.b-quest small{font-size:10px;color:#858b79;display:block;margin-top:4px}.b-done{background:#eff5e8}.b-done .b-reward{background:#e1ecda;border-color:#d5e3cc;color:#4b7441}.b-rules{font-size:11px;color:#7b826f;margin-top:18px;border-top:1px solid #e0e4d6;padding-top:14px}.b-rules summary{cursor:pointer;color:#5e7352}.b-rules p{margin:9px 0}.b-intro{font-size:12px;color:#7b826f;margin:-3px 0 16px!important}
.b-shop-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:20px}.b-product{border:1px solid #dce1d3;border-radius:12px;overflow:hidden}.b-art{height:124px;display:grid;place-items:center;background:#edf0e2;position:relative}.b-product-info{padding:12px}.b-product-info>small{font-size:9px;letter-spacing:.2px;color:#878974}.b-product-info h3{font:600 12px/1.4 Arial;margin:3px 0 12px}.b-product-bottom{display:flex;justify-content:space-between;gap:6px;align-items:center;font-size:10px}.b-product-bottom strong{font-size:11px;color:#8e783f}.b-product-bottom button{min-height:30px;padding:5px 9px;font-size:11px}.b-avatar{display:grid;place-items:center;width:55px;height:55px;border-radius:50%;background:#f8f4e5;border:2px solid #fff;color:#437656;font:700 26px Georgia}.frame-jade .b-avatar{outline:4px solid #638c6b;outline-offset:4px;box-shadow:0 0 0 8px #cbd8b7}.frame-friends .b-avatar{outline:3px dashed #b29b55;outline-offset:4px;box-shadow:0 0 0 8px #e1d7b4}.frame-jade{background:radial-gradient(circle at center,#f6f8ec,#e3e9d5)}.frame-friends{background:#eee9d8}.back-bamboo{background:#e7e9dc}.b-back-tile{height:78px;width:57px;border:4px solid #fffef2;border-radius:7px;background:repeating-linear-gradient(90deg,#386145 0 7px,#426e4c 7px 8px);box-shadow:0 5px 0 #bdc9ad,0 9px 15px #31513226;transform:rotate(-10deg);display:flex;justify-content:center;align-items:center;gap:6px}.b-back-tile i{height:42px;width:3px;background:repeating-linear-gradient(#a2ba78 0 12px,#456444 12px 14px);border-radius:2px}.b-back-tile i:nth-child(2){height:50px}.table-dusk{background:radial-gradient(at top,#766077,#403f50)}.b-mini-table{display:flex;gap:5px;transform:rotate(-6deg)}.b-mini-table>span:not(.tile){background:#fffdf0;border:1px solid #d1d3c7;color:#7c554b;width:31px;height:46px;text-align:center;border-radius:4px;font:16px/19px Georgia;padding-top:3px;box-shadow:0 3px 0 #b2bcad}.b-achievement-mark{font-size:60px;color:#947a39}.b-art-large{height:210px;border-radius:14px;margin:12px 0 20px}.b-art-large .b-avatar{width:82px;height:82px;font-size:40px}.b-art-large .b-back-tile{transform:rotate(-10deg) scale(1.4)}.b-art-large .b-mini-table{transform:rotate(-6deg) scale(1.5)}.b-preview-copy{text-align:center;margin-bottom:20px}.b-preview-copy h3{font:700 27px Georgia;margin:8px 0}.b-preview-copy p{font-size:13px;color:#7d8470}.b-purchase{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:12px;padding:15px;border:1px solid #e0e2d4;border-radius:12px}.b-purchase strong{color:#927a40}.b-purchase small{width:100%;text-align:center;color:#828872;font-size:11px}.b-dialog .b-primary{background:#265e45;border-color:#265e45;color:#fffef5;min-height:42px;padding:10px 22px}.b-dialog .b-primary:hover:not(:disabled){background:#1a4935}.b-dialog .b-back{border:0;background:transparent;padding:0;min-height:26px;color:#76856c}.b-footnote{font-size:11px!important;color:#858975!important;line-height:1.6;margin:16px 0!important}.b-empty{text-align:center;border:1px dashed #d3dbca;border-radius:13px;padding:30px 25px;margin-bottom:24px}.b-empty>span{display:block;font-size:40px;color:#a5b491}.b-empty h3{font:700 21px Georgia;margin:8px}.b-empty p{font-size:12px;color:#828b73;margin-bottom:15px}.b-achievement{width:100%;display:flex;text-align:left;align-items:center;gap:13px;margin-bottom:9px;background:#faf9ef!important}.b-achievement>span{font-size:26px;color:#b4a166}.b-achievement>div{flex:1}.b-achievement small{display:block;font-size:11px;font-weight:400;color:#7c846f;margin-top:4px}.b-achievement b{font-size:11px}.b-history{padding:0;list-style:none;margin:0}.b-history li{display:flex;gap:12px;align-items:center;border-bottom:1px solid #e3e6da;padding:14px 0}.b-history li>div{flex:1}.b-history strong{display:block;font-size:12px;font-weight:500}.b-history small{font-size:10px;color:#8c907e}.b-history b{font-size:13px;color:#54814f}.b-history b.b-spent{color:#9b7854}.b-history-icon{width:28px;height:28px;border-radius:50%;background:#eef1e3;display:grid;place-items:center;color:#8f9d78}
#b-message{margin:0;padding:0 25px 18px;font-size:12px;color:#617a4e;min-height:18px}.b-guest-note{margin:0 25px 15px!important;padding:10px;background:#f6efd9;font-size:11px;border-radius:8px;color:#8c794e}.b-local-note{background:#f3eedf;border:1px dashed #c8bc98;border-radius:10px;margin:2px 25px 18px;padding:15px;font-size:12px;color:#78694c}.b-local-note p{margin-top:7px}.b-profiles,.b-test-grid{margin:0 25px 18px;display:grid;gap:10px}.b-profiles button{display:flex;text-align:left;align-items:center;gap:15px}.b-profiles button>span:nth-child(2){flex:1}.b-profiles small{display:block;font-size:11px;font-weight:400;color:#81876f;margin-top:4px}.b-profiles .b-avatar{width:40px;height:40px;font-size:20px}.b-profiles button[aria-pressed=true]{border-color:#80a276;background:#edf3e5}.b-test-grid{grid-template-columns:1fr 1fr}.b-test-date{margin:0 25px 15px!important;font-size:12px;color:#7e816d}#b-open-test,#b-select-account{margin:0 25px 15px}.b-dialog #b-content>.b-footnote{margin:12px 25px!important}.b-toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 30px);padding:12px 18px;border-radius:11px;background:#244d39;color:#fffce8;box-shadow:0 5px 30px #13372230;z-index:10000;font:12px/1.4 Arial;pointer-events:none}.b-toast[hidden]{display:none}.b-result-reward{padding:9px 12px;margin:10px 0;border-radius:8px;color:#516a3d;background:#eff4df;font:12px Arial}
/* A distinct social achievement, separate from competitive rank medals. */
#bareng-friends{min-height:36px;padding:7px 11px;font-size:12px;background:#fffef7;color:#284e3a;border:1px solid #cbd5c0;border-radius:9px}

#bareng-friends,#bareng-account{flex:0 0 auto;width:auto!important;min-width:0!important;white-space:nowrap}
@media(max-width:380px){#bareng-friends,#bareng-account{padding:7px 8px;font-size:11px}}
.b-social-content{padding:2px 25px 22px}.b-social-note{font-size:11px;color:#7d846f;margin-bottom:16px!important}
.b-friend-list{display:grid;gap:10px}.b-dialog .b-friend-row{width:100%;display:flex;align-items:center;gap:12px;text-align:left;padding:14px;background:#f3f6e9;border-radius:13px}
.b-friend-row>.b-avatar{width:42px;height:42px;flex:none;font-size:23px}.b-friend-copy{flex:1;min-width:0}.b-friend-name{display:flex;align-items:center;gap:7px;min-width:0}.b-friend-name strong{font-size:16px;overflow-wrap:anywhere}.b-friend-copy small{display:block;font-size:11px;color:#7b856f;font-weight:400;margin-top:2px}
.b-player-identity{display:flex;align-items:center;gap:15px;margin:18px 0 24px}.b-player-identity>.b-avatar{flex:none;width:58px;height:58px}.b-player-identity>div{min-width:0}.b-player-identity h3{font:700 26px Georgia;overflow-wrap:anywhere}.b-player-identity p{font-size:12px;color:#77856d;margin-top:3px}
.b-player-achievements>h3{font:600 12px Arial;margin-bottom:11px}.b-player-badge,.b-room-achievement{display:flex;align-items:center;gap:14px;background:linear-gradient(110deg,#eef3e3,#faf7e9);border:1px solid #d8dfc9;border-radius:13px;padding:14px}
.b-player-badge>div,.b-room-achievement>div{min-width:0}.b-player-badge strong,.b-room-achievement strong{display:block;font:600 15px Arial;overflow-wrap:anywhere}.b-player-badge p,.b-room-achievement p{font:12px/1.5 Arial;color:#79816d;margin:5px 0 0}.b-room-achievement small{display:block;font:10px Arial;color:#7d8169;margin-bottom:6px}.b-room-achievement{margin:12px 0}.b-room-achievement[hidden]{display:none}
.b-player-badge>.b-profile-badge,.b-room-achievement>.b-profile-badge{display:block;width:72px;height:72px;flex:none;max-width:none;object-fit:contain}
.b-social-empty{padding:18px;border:1px dashed #d4ddca;border-radius:12px;color:#7b846d;font-size:12px}.b-player-actions{display:flex;flex-wrap:wrap;gap:9px;border-top:1px solid #e1e5d5;padding-top:17px;margin-top:22px}
@media(max-width:380px){.b-social-content{padding:0 18px 18px}.b-player-badge,.b-room-achievement{padding:11px;gap:10px}.b-player-badge>.b-profile-badge,.b-room-achievement>.b-profile-badge{width:62px;height:62px}}
.b-badge-art{display:block;width:132px;height:auto;aspect-ratio:1;max-width:calc(100% - 24px);object-fit:contain;image-rendering:auto;pointer-events:none;user-select:none}
.b-new-item{display:inline-block;vertical-align:middle;white-space:nowrap;border:1px solid #dbc77c;background:#f8edbd;color:#6a531b;border-radius:5px;padding:2px 6px;font:700 10px/1.3 Arial,sans-serif;letter-spacing:.1px}
.b-product-info h3 .b-new-item,.b-achievement strong .b-new-item{margin:3px 0 3px 3px}
.b-tabs button{padding-inline:4px}.b-tabs .b-new-item{font-size:8px;padding:1px 4px}
@media(max-width:380px){.b-tabs .b-new-item{display:block;width:max-content;margin:2px auto 0}}
.b-art.badge-ten{background:radial-gradient(ellipse at center,#f8f4e4,#e4ebdc)}
.b-art-large>.b-badge-art{width:180px}
.b-achievement>.b-badge-icon{flex:none;width:44px;height:44px;max-width:none}
.b-achievement>div{min-width:0}
@media(max-width:520px){.home-tools .b-local-button{display:none!important}}
@media(max-width:520px){.b-card-main{padding:11px 12px;gap:8px}.b-card-main strong{font-size:18px}.b-card-main strong small{font-size:10px}.b-card-main p{font-size:10px}.b-card-main button{padding:6px 10px;font-size:11px}.b-card-main button span{display:none}.b-coin{width:30px;height:30px;font-size:23px}.b-card-main .b-dot{display:none}.b-card-main p{max-width:185px}.b-dialog{border-radius:17px}.b-head{padding:18px 18px 13px}.b-head h2{font-size:25px}.b-wallet{margin:0 18px 14px;padding:15px}.b-tabs{padding:0 14px;gap:0}.b-pane{padding:17px 16px 8px}.b-quest{padding:12px 10px;gap:9px}.b-quest h3{font-size:12px}.b-quest p{font-size:10px}.b-quest-icon{width:29px;height:29px;font-size:21px}.b-quest small{font-size:9px}.b-quest-title{gap:5px}.b-reward{font-size:9px}.b-section-heading h3{font-size:17px}.b-section-heading>span{font-size:9px}.b-shop-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.b-product-info{padding:10px}.b-product-info h3{font-size:12px}.b-art{height:119px}.b-art-large{height:190px}.b-local-note{margin:0 18px 16px}.b-test-grid,.b-profiles{margin:0 18px 18px}.b-local-button{display:none}.b-wallet strong{font-size:30px}.b-wallet-icon{font-size:34px}.b-tabs button{font-size:12px}#b-message{padding:0 18px 15px}}
#bareng-dialog>.b-head{display:flex;align-items:center;justify-content:space-between;width:auto;height:auto;min-height:0;margin:0;padding:22px 25px 15px;background:transparent;border:0}
#bareng-dialog>.b-head h2{margin:3px 0 0;font:700 29px/1.2 Georgia,serif}
html:has(#bareng-dialog[open]){overflow:hidden}
/* Cosmetic frames decorate lobby seats only. Nine-slice keeps the carved corners intact. */
body.lobby-mode #room #lobby #seats:has(:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"])) .seat-card{min-height:100px}
body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]){--seat-medal-size:64px;position:relative;outline:none;border:0;border-radius:12px;padding:16px 16px 18px;grid-template-columns:var(--seat-medal-size) minmax(0,1fr);gap:7px;background:#f1f5e8;box-shadow:0 2px 3px #183c2820}
body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]).mine{background:#e8efdc}
body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]).without-medal{grid-template-columns:minmax(0,1fr);padding-left:26px}
/* Scale the 160px vertical and 250px horizontal corner slices equally. */
body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]):after,.b-jade-seat:after{content:'';position:absolute;inset:0;z-index:2;pointer-events:none;border:24px solid transparent;border-image:url('/r/0.9.0-rc.64-giok.19/giok-assets/frame-jade-v2.png?v=5') 160 250 / 24px 37.5px / 0 stretch}
body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"])>.tier-medal{width:var(--seat-medal-size);height:var(--seat-medal-size)}
body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]) .seat-number{left:18px;bottom:18px}
body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]) :is(.host-label,.seat-you){top:20px}
body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]) .host-label{right:20px}
body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]) .seat-you{left:87px}
body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]).without-medal .seat-you{left:26px}
body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]).without-medal .seat-foot{padding-left:13px}
body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]) .voice-activity{top:37px;left:10px}

@media(max-width:380px){
 body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]){--seat-medal-size:54px;gap:5px}
 body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]):not(.without-medal) .seat-you{left:75px}
 body.lobby-mode #room #lobby .seat-card:is([data-cosmetic-frame="frame-jade"],[data-cosmetic-frame="frame-friends"]):not(.without-medal) .host-label{right:16px;min-width:24px;padding:0 2px;font-size:9px}
}
/* Render the large original as an image so browser downsampling stays smooth.
   Compensate the transparent canvas margin without enlarging the tile box. */
:root{--b-jade-back-tone:contrast(.94) saturate(.92) brightness(.98)}
.tile.concealed[data-back="back-bamboo"]{position:relative;overflow:hidden;background:transparent!important;border:0!important;padding:0!important;box-shadow:none!important;filter:none}
.tile.concealed[data-back="back-bamboo"]>.jade-back-art{position:absolute;left:-3.4%;top:-3.9%;width:106.8%;height:107.8%;max-width:none;pointer-events:none;user-select:none;object-fit:fill;image-rendering:auto;filter:var(--b-jade-back-tone)}
.tile.concealed[data-back="back-bamboo"]>svg{visibility:hidden}
/* Enlarge every public tile together; four tiles still fit in one Kong group.
   table-layout reads this height when reserving room above the discards. */
body.playing-mode #game #discards{--public-tile-height:30px}
html[data-table-layout=rows]:not([data-row-density=compact]) body.playing-mode #game #discards .river-public{max-width:187px}
html[data-table-layout=rows]:not([data-row-density=compact]) body.playing-mode #game #discards .river-melds{max-width:91px}
html[data-table-layout=rows] body.playing-mode #game #discards .river-melds .public-meld{gap:1px}
html[data-table-layout=rows]:not([data-row-density=compact]) body.playing-mode #game #discards .river-bonus,
html[data-table-layout=rows]:not([data-row-density=compact]) body.playing-mode #game #discards .river-bonus:has(.tile:nth-child(5)){max-width:91px}
html[data-table-layout=rows]:not([data-row-density=compact]) body.playing-mode #game #discards .river-public .tile{width:22px;min-width:22px;height:var(--public-tile-height);min-height:var(--public-tile-height)}
/* Keep concealed sets and flowers on one line, even with all 8 bonuses. */
html[data-table-layout=rows] body.playing-mode #game #discards .player-open-tiles{align-items:flex-start}
html[data-table-layout=rows][data-row-density=compact] body.playing-mode #game #discards .river-public{max-width:calc(var(--row-mini-height,11px)*.73*8 + 9px)}
html[data-table-layout=rows][data-row-density=compact] body.playing-mode #game #discards .player-open-tiles{flex-direction:row;align-items:flex-start;gap:3px}
html[data-table-layout=rows][data-row-density=compact] body.playing-mode #game #discards .river-melds{max-width:calc(var(--row-mini-height,11px)*.73*4 + 3px)}
html[data-table-layout=rows][data-row-density=compact] body.playing-mode #game #discards .river-bonus,
html[data-table-layout=rows][data-row-density=compact] body.playing-mode #game #discards .river-bonus:has(.tile:nth-child(5)){max-width:calc(var(--row-mini-height,11px)*.73*4 + 3px)}
html[data-table-layout=rows] body.playing-mode #game #discards .river-bonus{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;touch-action:pan-x;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scrollbar-width:none}
html[data-table-layout=rows] body.playing-mode #game #discards .river-bonus .tile{scroll-snap-align:start}
html[data-table-layout=rows] body.playing-mode #game #discards .river-bonus:focus-visible{outline:1px solid #ead391;outline-offset:2px}
/* One surface treatment keeps the shop, lobby and playing table consistent. */
:root{--b-jade-table-surface:linear-gradient(#103e2a85,#103e2a85),url('/r/0.9.0-rc.64-giok.19/giok-assets/table-dusk-v3.png') center/cover no-repeat}
body[data-room-theme="table-dusk"] #game>.table{background:var(--b-jade-table-surface)!important;box-shadow:none;border-color:transparent}
body[data-room-theme="table-dusk"] #room>.room-bar{background:var(--b-jade-table-surface)!important;box-shadow:none}
body[data-room-theme="table-dusk"] #game .river-row{background:#062d2540!important;border-color:#b1c6a44d!important}
body[data-room-theme="table-dusk"] #game .river-row.active{background:#43714a38!important;border-color:#e2c77f!important}
body[data-room-theme="default"] #game>.table{background:radial-gradient(at top,#285f47,#1c4939)!important}
body[data-room-theme="default"] #game .river-row{background:#123e3055!important;border-color:#b8ccae55!important}
body[data-room-theme="default"] #game .river-row.active{background:#3f765155!important}
@media(max-width:520px){#bareng-dialog>.b-head{padding:18px 18px 13px}#bareng-dialog>.b-head h2{font-size:25px}}
@media(prefers-reduced-motion:reduce){.b-card-track span{transition:none}}

/* Large, straight previews share the actual lobby frame asset. */
.b-dialog{width:min(740px,calc(100vw - 24px));max-width:740px}
.b-wallet{padding:12px 18px;margin-bottom:12px}
.b-wallet strong{font-size:30px}
.b-section-heading h3{font-size:20px}
.b-shop-grid{gap:14px}
.b-product{background:#fffdf6;border-color:#d9d9c8;box-shadow:0 3px 10px #263c2410}
.b-product-info{padding:14px}
.b-product-info>small{font-size:10px;letter-spacing:.8px;color:#64755d}
.b-product-info h3{font:600 16px/1.3 Arial;margin:6px 0}
.b-product-info .b-item-use{font:12px/1.4 Arial;color:#677361;margin:0 0 13px}
.b-product-bottom{gap:8px}
.b-product-bottom strong{font-size:13px;color:#74602e}
.b-product-bottom button{min-height:42px;min-width:62px;font-size:13px}
.b-art{height:182px;overflow:hidden}
.b-art.frame-jade,.b-art.back-bamboo,.b-art.table-dusk{background:linear-gradient(145deg,#eef1e6,#dbe2d0)}
.b-jade-seat{position:relative;width:90%;height:104px;display:flex;align-items:center;justify-content:center;gap:8px;padding:22px 18px;background:#eef3e4;border-radius:12px;box-shadow:0 7px 12px #1a342226;color:#234331}
.b-seat-avatar{flex:none;display:grid;place-items:center;width:37px;height:37px;border-radius:50%;background:linear-gradient(145deg,#d6debc,#719b7c);box-shadow:inset 0 0 0 1px #8fa47b;color:#234530;font:700 23px Georgia}
.b-seat-sample-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:600 16px Arial}
.b-seat-sample-name small{display:block;font:10px Arial;color:#667559;margin-top:6px}
.b-real-back{display:block;width:87px;height:116px;border-radius:10px;background:url('/r/0.9.0-rc.64-giok.19/giok-assets/back-bamboo-v3.png') center / 100% 100% no-repeat;box-shadow:none;filter:var(--b-jade-back-tone) drop-shadow(0 3px 4px #24372126)}
.b-dusk-board{position:relative;display:grid;place-items:center;width:88%;aspect-ratio:1.42;background:var(--b-jade-table-surface);border-radius:10px;box-shadow:none}
.b-dusk-board .b-mini-table{gap:4px;transform:none}
.b-dusk-board .b-mini-table>span:not(.tile){width:25px;height:36px;font:13px/14px Georgia;padding-top:3px;box-shadow:0 2px 0 #b2bcad}
.b-art-large{height:274px}
.b-art-large .b-jade-seat{max-width:330px;height:148px;padding:28px;gap:18px}
.b-art-large .b-jade-seat:after{border-width:32px;border-image-width:32px 50px}
.b-art-large .b-seat-avatar{width:63px;height:63px;font-size:32px}
.b-art-large .b-seat-sample-name{font-size:23px}
.b-art-large .b-seat-sample-name small{font-size:13px;margin-top:8px}
.b-art-large .b-real-back{width:141px;height:188px;border-radius:16px}
.b-art-large .b-dusk-board{width:330px;max-width:85%}
.b-art-large .b-dusk-board .b-mini-table{transform:none;gap:7px}
.b-art-large .b-dusk-board .b-mini-table>span:not(.tile){width:34px;height:48px;font:17px/19px Georgia}
@media(max-width:600px){
 .b-shop-grid{grid-template-columns:1fr;gap:12px}
 .b-shop-grid .b-product{display:grid;grid-template-columns:42% 58%;align-items:stretch;min-height:144px}
 .b-shop-grid .b-product .b-art{height:100%;min-height:144px}
 .b-product-info{display:flex;flex-direction:column;justify-content:center;padding:12px}
 .b-product-info h3{font-size:16px;margin:4px 0}
 .b-product-info>small{font-size:9px;letter-spacing:.5px}
 .b-product-info .b-item-use{font-size:11px;margin-bottom:8px}
 .b-product-bottom{margin-top:auto}
 .b-product-bottom button{min-height:40px;font-size:12px;padding:7px 12px}
 .b-jade-seat{height:100px;width:90%;gap:6px;padding:22px 16px;flex-direction:column}
 .b-seat-avatar{width:28px;height:28px;font-size:18px}
 .b-seat-sample-name{font-size:13px;text-align:center}
 .b-seat-sample-name small{display:none}
 .b-real-back{width:74px;height:99px}
 .b-dusk-board{aspect-ratio:1.15;width:88%}
 .b-dusk-board .b-mini-table{gap:3px}
 .b-dusk-board .b-mini-table>span:not(.tile){width:21px;height:31px;font:11px/12px Georgia}
 .b-art-large{height:240px}
 .b-art-large .b-jade-seat{flex-direction:row;gap:14px;height:130px}
 .b-art-large .b-seat-avatar{width:49px;height:49px;font-size:27px}
 .b-art-large .b-seat-sample-name{font-size:20px;text-align:left}
 .b-art-large .b-seat-sample-name small{display:block;font-size:11px}
 .b-art-large .b-real-back{width:132px;height:176px}
 .b-art-large .b-dusk-board{width:275px;aspect-ratio:1.42}
 .b-art-large .b-dusk-board .b-mini-table>span:not(.tile){width:29px;height:42px;font:15px/17px Georgia}
 .b-section-heading h3{font-size:18px}
}
@media(max-width:360px){.b-product-info h3{font-size:14px}.b-product-bottom strong{font-size:12px}.b-product-info{padding:10px}.b-shop-grid .b-product{grid-template-columns:40% 60%}.b-real-back{width:66px;height:88px}.b-seat-sample-name{font-size:12px}.b-dusk-board .b-mini-table>span:not(.tile){width:17px;height:27px;font:10px/11px Georgia}}

/* Friendship Circle: consistent corner scale, with a quiet warm card interior. */
body.lobby-mode #room #lobby .seat-card[data-cosmetic-frame="frame-friends"],.b-friends-seat{background:#fbf5e9}
body.lobby-mode #room #lobby .seat-card[data-cosmetic-frame="frame-friends"].mine{background:#f4eedc}
body.lobby-mode #room #lobby .seat-card[data-cosmetic-frame="frame-friends"]:after,.b-friends-seat:after{border-image:var(--friends-frame-art) 120 / 24px / 0 stretch}
.b-art.frame-friends{background:linear-gradient(145deg,#f8eee2,#e7d6bd)}
.b-friends-seat .b-seat-avatar{background:#fff7e6;color:#88412e;border-color:#e6cca6}
.b-art-large .b-friends-seat:after{border-image-width:32px}
/* FRIENDS_FRAME_ASSET_START */
:root{--friends-frame-art:url('/r/0.9.0-rc.64-giok.19/giok-assets/frame-friends-v1.png')}
/* FRIENDS_FRAME_ASSET_END */

/* Compact collection: the full row opens the existing item detail. */
.b-collection-list{margin-bottom:18px}
.b-collection-list:last-child{margin-bottom:0}
.b-collection-row{gap:10px;min-height:64px;padding:10px 12px}
.b-collection-row>.b-collection-symbol{flex:none;width:44px;text-align:center}
.b-collection-row>.b-collection-state{flex:none;white-space:nowrap;font-size:10px;color:#41634e}
.b-collection-row strong{font:600 12px/1.4 Arial,sans-serif}
.b-collection-row small{line-height:1.45}
@media(max-width:380px){
 .b-collection-row{gap:8px;padding:9px}
 .b-collection-row>.b-badge-icon,.b-collection-row>.b-collection-symbol{width:36px}
 .b-collection-row>.b-badge-icon{height:36px}
}

/* Group owned cosmetics by their catalog type; new items join automatically. */
.b-collection-category{margin:0 0 16px}
.b-collection-category:last-child{margin-bottom:0}
.b-category-heading{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:0 0 7px}
.b-category-heading h4{margin:0;font:600 13px/1.4 Arial,sans-serif;color:#355640}
.b-category-heading>span{font:10px/1.4 Arial,sans-serif;color:#7c846f}

/* Five navigation choices remain readable on narrow phones. */
.b-tabs{gap:0}
.b-tabs button{flex:1 1 0;min-width:0;padding-inline:3px}
.b-tabs button[data-tab="achievements"]{flex-grow:1.7}
.b-tabs .b-new-item{display:block;width:max-content;margin:2px auto 0}
.b-empty>button+button{margin-left:6px}
@media(max-width:480px){
 .b-tabs{padding-inline:12px}
 .b-tabs button{font-size:11px;padding-inline:2px}
}


/* Real game tiles also serve the table-theme preview. */
.b-dusk-board .b-mini-table{width:calc(100% - 18px);gap:3px;justify-content:center}
.b-dusk-board .b-mini-table>.tile{flex:0 1 33px;width:33px;height:auto;aspect-ratio:40/56;border-bottom-width:3px;box-sizing:border-box}
.b-art-large .b-dusk-board .b-mini-table{width:80%;gap:6px}
.b-art-large .b-dusk-board .b-mini-table>.tile{flex-basis:52px;width:52px;border-bottom-width:4px}

/* Shared compact art cards keep Shop and Collection visually consistent. */
.b-compact-catalog .b-shop-grid{grid-template-columns:1fr;gap:10px;margin-bottom:0}
.b-compact-catalog .b-product{display:grid;grid-template-columns:clamp(104px,36vw,150px) minmax(0,1fr);align-items:stretch;min-height:128px}
.b-compact-catalog .b-product .b-art{height:100%;min-height:128px;padding:6px;box-sizing:border-box}
.b-compact-catalog .b-jade-seat{width:100%;height:110px;flex-direction:column;gap:6px;padding:22px 12px;box-sizing:border-box}
.b-compact-catalog .b-real-back{width:87px;height:116px;max-width:100%;border-radius:10px}
.b-compact-catalog .b-dusk-board{width:100%;height:116px;aspect-ratio:auto}
.b-compact-catalog .b-badge-art{width:110px;max-width:100%}
.b-compact-catalog .b-product-info{display:flex;flex-direction:column;justify-content:center;gap:12px;padding:12px;min-width:0}
.b-compact-catalog .b-product-info h3{margin:0;font-size:15px;line-height:1.35}
.b-compact-catalog .b-product-bottom{margin-top:0}
@media(max-width:360px){
 .b-compact-catalog .b-product{grid-template-columns:104px minmax(0,1fr)}
 .b-compact-catalog .b-product-info{padding:10px;gap:10px}
 .b-compact-catalog .b-product-info h3{font-size:14px}
 .b-compact-catalog .b-jade-seat:after{border-image-width:21px 32.8px}
 .b-compact-catalog .b-friends-seat:after{border-image-width:21px}
 .b-compact-catalog .b-product-bottom{gap:5px}
 .b-compact-catalog .b-product-bottom button{min-width:54px;padding-inline:8px}
}
/* Let the preview shrink with a narrow card instead of clipping the last tile. */
.b-compact-catalog .b-product .b-art{min-width:0;grid-template-columns:minmax(0,1fr)}
.b-compact-catalog .b-dusk-board{min-width:0}
.b-dusk-board .b-mini-table{width:calc(100% - 10px);min-width:0}
.b-dusk-board .b-mini-table>.tile{margin:0}
.b-art-large .b-dusk-board .b-mini-table{width:80%}
.b-compact-catalog .b-seat-sample-name small{display:none}

/* Shop retains a short usage note and a readable price beside the action. */
.b-shop-catalog .b-product-info{gap:10px}
.b-shop-catalog .b-product-copy{min-width:0}
.b-shop-catalog .b-product-info .b-item-use{font-size:11px;line-height:1.4;margin:5px 0 0}
.b-shop-catalog .b-product-bottom strong{font-size:12px;white-space:nowrap}
.b-shop-catalog .b-footnote{margin:12px 0 0}
.b-shop-categories{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
.b-shop-category{min-width:0}
@media(min-width:760px){
 .b-shop-categories{grid-template-columns:repeat(2,minmax(0,1fr))}
 .b-shop-catalog .b-product{grid-template-columns:130px minmax(0,1fr)}
}
@media(max-width:360px){
 .b-shop-catalog .b-product-bottom strong{font-size:11px}
}

/* Giok: one vector jewel, crisp at wallet and inline sizes. Source: assets/giok-v1.svg. */
.b-giok-icon{display:inline-block;width:20px;height:20px;flex:0 0 auto;vertical-align:middle;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%0A%20%20%3Cdefs%3E%0A%20%20%20%20%3ClinearGradient%20id%3D%22rim%22%20x1%3D%2212%22%20y1%3D%226%22%20x2%3D%2248%22%20y2%3D%2260%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%20%20%20%20%20%20%3Cstop%20stop-color%3D%22%23fff1b0%22%2F%3E%3Cstop%20offset%3D%22.31%22%20stop-color%3D%22%23d6b967%22%2F%3E%0A%20%20%20%20%20%20%3Cstop%20offset%3D%22.64%22%20stop-color%3D%22%239b712f%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23f0d98b%22%2F%3E%0A%20%20%20%20%3C%2FlinearGradient%3E%0A%20%20%20%20%3ClinearGradient%20id%3D%22stone%22%20x1%3D%2216%22%20y1%3D%2210%22%20x2%3D%2246%22%20y2%3D%2255%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%20%20%20%20%20%20%3Cstop%20stop-color%3D%22%23a2d9ad%22%2F%3E%3Cstop%20offset%3D%22.29%22%20stop-color%3D%22%2354b383%22%2F%3E%0A%20%20%20%20%20%20%3Cstop%20offset%3D%22.63%22%20stop-color%3D%22%2318845f%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%230c513d%22%2F%3E%0A%20%20%20%20%3C%2FlinearGradient%3E%0A%20%20%20%20%3ClinearGradient%20id%3D%22light%22%20x1%3D%2221%22%20y1%3D%2212%22%20x2%3D%2236%22%20y2%3D%2241%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%20%20%20%20%20%20%3Cstop%20stop-color%3D%22%23f2ffe1%22%20stop-opacity%3D%22.57%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23e3f9da%22%20stop-opacity%3D%220%22%2F%3E%0A%20%20%20%20%3C%2FlinearGradient%3E%0A%20%20%3C%2Fdefs%3E%0A%20%20%3Cpath%20d%3D%22M28.5%205.8a5%205%200%200%201%207%200l22.7%2022.7a5%205%200%200%201%200%207L35.5%2058.2a5%205%200%200%201-7%200L5.8%2035.5a5%205%200%200%201%200-7Z%22%20fill%3D%22url%28%23rim%29%22%20stroke%3D%22%23765b2f%22%20stroke-width%3D%22.8%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M29.4%209.2a3.7%203.7%200%200%201%205.2%200l20.2%2020.2a3.7%203.7%200%200%201%200%205.2L34.6%2054.8a3.7%203.7%200%200%201-5.2%200L9.2%2034.6a3.7%203.7%200%200%201%200-5.2Z%22%20fill%3D%22url%28%23stone%29%22%20stroke%3D%22%23164d3b%22%20stroke-width%3D%221.1%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M31%2011.7q1-1%202%200L49%2028c-9.7-4.2-20.3%207.1-35.7%203.6q-1.3-.3-.3-1.6Z%22%20fill%3D%22url%28%23light%29%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M14.4%2029.2%2030%2013.6q2-2%204%200%22%20fill%3D%22none%22%20stroke%3D%22%23efffe1%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%221.6%22%20stroke-linecap%3D%22round%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M17%2035c7.4-5%2011.5%204%2018-1s8-5%2013.8-3.4M23%2043c6-2.4%208%201.6%2014-2.8%22%20fill%3D%22none%22%20stroke%3D%22%23d0e9bc%22%20stroke-width%3D%221.1%22%20stroke-opacity%3D%22.12%22%20stroke-linecap%3D%22round%22%2F%3E%0A%20%20%3Cpath%20d%3D%22m12%2036%2017.6%2017.6q2.4%202.4%204.8%200L51%2037%22%20fill%3D%22none%22%20stroke%3D%22%23092f28%22%20stroke-width%3D%221.8%22%20stroke-opacity%3D%22.25%22%2F%3E%0A%3C%2Fsvg%3E%0A");filter:drop-shadow(0 1px 1px #082d262b)}
.b-wallet-icon{display:grid;place-items:center;width:38px;height:38px;flex:0 0 38px;line-height:1}
.b-wallet-icon .b-giok-icon,.b-coin .b-giok-icon{width:100%;height:100%}
.b-coin{border:0;background:none;border-radius:0}
.b-giok-amount{display:inline-flex;align-items:center;gap:6px}
.b-result-reward{display:flex;align-items:center;gap:7px}
/* Long translated tabs still fit on a 320px phone. */
@media(max-width:360px){.b-tabs button,.b-tabs button[data-tab="achievements"]{flex:1 1 auto;font-size:10px;letter-spacing:-.1px;padding-inline:2px}}

#bareng-card .b-card-main{min-height:91px;box-sizing:border-box}#bareng-card{min-height:94px}#bareng-card .b-card-main>div{min-width:0}#bareng-card .b-card-main button{flex-shrink:0}@media(max-width:520px){#bareng-card{min-height:84px}#bareng-card .b-card-main{min-height:81px}}

/* Keep the mission card compact without shrinking its controls. */
#bareng-card{min-height:62px;margin-bottom:0}
#bareng-card .b-card-main{min-height:60px}
