/* v0.4.0: four ordered discard rivers, 32-tile ledger, large cumulative scores. */
:root{font-size:16px}body{overflow:auto}#app{min-height:100dvh}.game-shell{grid-template-columns:minmax(0,1fr) 310px;gap:22px;height:calc(100dvh - 112px);min-height:790px;padding:16px 22px;max-width:1960px}.play-column{grid-template-rows:36px minmax(480px,1fr) 272px}.match-bar{flex-wrap:wrap;gap:6px}.score-mode{font-size:13px}.wood-rim{inset:68px 18px 48px}.round-counter{top:16px;left:20px}.round-counter small{font-size:12px}.seat{width:124px}.seat-2{top:0;width:250px;grid-template-columns:52px 1fr;gap:10px}.seat-1{right:0;top:47%}.seat-3{left:0;top:47%}.seat-info h3{font-size:16px;letter-spacing:0;overflow-wrap:anywhere}.seat-info h3>span{font-size:10px}.seat-info p{font-size:12px}.seat-2 .opponent-hand,.seat-2 .hand-count{display:none}.seat .hand-count{display:none}.seat-scores{display:flex;justify-content:center;gap:12px;margin-top:4px;white-space:nowrap}.seat-scores>span{display:flex;flex-direction:column;align-items:center;font-size:12px;color:var(--muted)}.seat-scores b{font-size:23px;font-variant-numeric:tabular-nums;color:#e8d3ac;line-height:1.1}.seat-scores strong{font:700 29px/1.12 var(--sans);font-variant-numeric:tabular-nums;letter-spacing:0}.seat-2 .seat-scores{justify-content:flex-start}.seat-2 .seat-scores>span{flex-direction:row;gap:8px}.you-identity{min-width:170px;gap:12px}.you-identity>div{display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px}.you-identity .seat-scores{width:100%;gap:16px;margin:0}.you-identity .seat-scores>span{display:flex;flex-direction:row;gap:8px}.you-identity .seat-scores strong{font-size:32px}.hand-topline{height:auto;min-height:74px;gap:18px}.hand-instruction{font-size:14px;max-width:660px}.hand-actions{min-width:160px}.hand-foot{font-size:12px;gap:9px;flex-wrap:wrap}.series-note{font-size:12px;color:var(--gold)}.status-pill{font-size:14px}.online-clock{font-size:12px}.table-status{bottom:2px;display:flex;white-space:nowrap;align-items:center}.table-wait{top:52%;max-width:270px}.table-wait p{font-size:16px}.table-wait small{font-size:12px}.round-award{top:52%;max-width:300px;font-size:14px}.round-award b{font-size:30px}.table-lettering{top:50%;opacity:.35}.table-ornament{opacity:.025}
.river-layer{position:absolute;inset:0;pointer-events:none;z-index:4}.river{position:absolute;pointer-events:auto;text-align:center}.river>header{font-size:12px;color:#bcc7aa;margin-bottom:7px;letter-spacing:.1em}.river header small{font-size:10px;color:#95a28d;letter-spacing:0;margin-left:8px}.river-groups{display:flex;gap:5px;align-items:flex-start;justify-content:center;flex-wrap:wrap}.river-group{padding:3px 3px 2px;border:1px solid transparent;border-radius:5px;background:#12241c55;flex:0 0 auto}.river-cards{display:flex;gap:2px}.river .tile{width:32px;height:auto;margin:0;filter:none}.river-group>small{display:flex;justify-content:space-between;gap:3px;font-size:10px;line-height:15px;color:#829985}.river-group>small i{font-size:10px;color:#afba9b}.river-group>small b{color:#f3d384;font-size:14px;line-height:15px}.river-win{border-color:#ebc777;background:#c6a55128;box-shadow:0 0 12px #e3b34425}.river-win .tile{filter:brightness(1.22) drop-shadow(0 0 2px #ffe49b77)}.river-leading{border-color:#8fb3a9}.river-current:not(.river-win){background:#53785d28}.river-empty{font-size:12px;color:#738b74;line-height:54px}.river-0{bottom:64px;left:50%;transform:translateX(-50%);width:440px;max-width:48%}.river-2{top:98px;left:50%;transform:translateX(-50%);width:440px;max-width:48%}.river-1,.river-3{top:49%;transform:translateY(-50%);width:168px;max-height:240px}.river-1{right:140px}.river-3{left:140px}.river-1 .tile,.river-3 .tile{width:28px}.river-1 .river-groups,.river-3 .river-groups{gap:4px}.cover-mode{display:flex;gap:4px;margin-bottom:8px;border:1px solid var(--line);border-radius:7px;padding:4px}.cover-mode button{flex:1;padding:7px 8px;font-size:14px;border-radius:4px}.cover-mode button.active{background:#dac084;color:#203b2b}.cover-mode button:disabled{opacity:.4}
.ledger{min-height:0;overflow:hidden}.ledger-inner{padding:16px 18px;overflow-y:auto}.memory-rows{display:flex;flex-direction:column;gap:3px}.tile-memory-row{display:grid;grid-template-columns:24px minmax(0,1fr) 27px;gap:10px;align-items:center;padding:5px 0;min-height:61px;border-bottom:1px solid #adbb8716}.memory-tiles{display:flex;gap:5px;align-items:center}.memory-tile{position:relative;display:block;flex:0 0 auto;transition:filter .2s,opacity .2s}.memory-tile>.tile{width:27px;height:auto}.memory-tile.used{filter:grayscale(.9) brightness(.40);opacity:.66}.used-mark{position:absolute;right:1px;bottom:3px;font-size:11px;color:#d9d9c7}.rank-number{font-size:17px}.rank-count{font-size:11px;color:var(--muted);text-align:right}.memory-summary strong{font-size:34px}.ledger-tabs>button{font-size:14px}.ledger-title{font-size:14px}.ledger-note{font-size:12px;line-height:1.6}.memory-summary span{font-size:12px}.covered-details>div{font-size:14px}.covered-details i{max-width:105px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.covered-heading{font-size:13px}.ledger-foot{font-size:12px}
.modal-online-auth{width:min(1040px,96vw);max-width:1040px}.room-browser{display:grid;grid-template-columns:minmax(280px,1fr) minmax(300px,1fr);gap:28px}.room-form{width:100%;max-width:none;padding:0}.room-list{border-left:1px solid var(--line);padding-left:24px;min-width:0}.room-list>header{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px}.room-list h3{font:24px var(--serif);color:var(--gold)}.room-list header span{display:block;font-size:12px;color:var(--muted);margin-top:6px}.room-list-scroll{max-height:530px;overflow-y:auto}.room-list-item{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:15px 10px;border:1px solid var(--line);border-radius:8px;margin-bottom:10px;background:#0e251d55}.room-list-item.chosen{border-color:var(--gold);background:#cfad6420}.room-list-item>div{min-width:0}.room-list-item h4{font-size:16px;overflow-wrap:anywhere}.room-list-item p{font-size:13px;color:var(--muted);margin:7px 0}.room-list-item small{font-size:12px;color:#9cae93}.lock-badge{font-size:10px;border:1px solid #c0a86e66;padding:2px 4px;white-space:nowrap;color:var(--gold)}.room-list-error{color:var(--red);font-size:14px}.room-config-bar{display:flex;justify-content:space-between;gap:18px;align-items:center;border:1px solid var(--line);padding:14px 18px;border-radius:8px;margin-bottom:20px;font-size:14px}.clear-password{display:flex;gap:9px;margin-bottom:22px;align-items:center}.room-total{font-size:15px}.room-total b{font:700 32px var(--sans)}.room-seat-tag{font-size:13px}.room-help{font-size:13px}.room-heading p{font-size:14px}.slot-config select{font-size:14px;max-width:190px}.form-field small{font-size:12px;margin-left:8px}.form-field{margin-bottom:19px}.result-table-head,.result-row{grid-template-columns:minmax(105px,1fr) 90px 65px 90px 100px;gap:8px}.modal-result{width:min(800px,96vw);max-width:800px}.result-row>strong{font-size:26px}.result-row>strong.series-result{font-size:33px}.result-table-head{font-size:13px}.result-row>span{font-size:17px}.result-hero>p{font-size:13px}.your-result{font-size:70px}.room-controls .button{font-size:16px}
@media(max-width:1250px){.game-shell{display:block;height:auto;min-height:0}.play-column{grid-template-rows:40px 505px 275px}.ledger{margin:18px 0 0;max-height:none}.ledger-inner{max-height:none}.memory-rows{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));column-gap:24px}.ledger-foot{padding:14px}.ledger{height:auto}.river-1{right:135px}.river-3{left:135px}.river-0,.river-2{max-width:48%}.covered-details{max-width:440px}.hand-foot{padding-top:5px}}
@media(max-width:850px){.app-header{padding:12px 14px;height:auto;min-height:68px;gap:10px}.header-nav{flex-wrap:wrap;justify-content:flex-end}.nav-button{font-size:12px}.game-shell{padding:12px}.play-column{grid-template-rows:52px 545px auto}.hand-area{min-height:260px}.seat{width:96px}.seat-1{right:0}.seat-3{left:0}.seat-info h3{font-size:14px}.seat-scores{gap:8px}.seat-scores strong{font-size:25px}.seat-scores b{font-size:21px}.river-1{right:105px;width:126px}.river-3{left:105px;width:126px}.river-1 .tile,.river-3 .tile{width:24px}.river-0,.river-2{max-width:50%}.river .tile{width:27px}.hand-topline{gap:12px;flex-wrap:wrap}.you-identity{min-width:160px}.hand-instruction{font-size:13px;flex-basis:50%;padding:5px}.your-hand{padding:18px 0;gap:4px}.hand-card{max-width:70px}.hand-actions{min-width:140px}.room-browser{grid-template-columns:1fr}.room-list{border-left:0;border-top:1px solid var(--line);padding:20px 0 0}.room-list-scroll{max-height:360px}.room-config-bar{flex-wrap:wrap}.modal-body{padding:22px}.modal-header h2{font-size:27px}.memory-rows{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 24px}.room-seats{gap:10px}.room-total b{font-size:29px}}
@media(max-width:520px){.edition-label{display:none}.game-shell{padding:8px}.play-column{grid-template-rows:66px 650px auto}.wood-rim{inset:77px 4px 50px}.round-counter{left:8px;top:58px;font-size:14px}.round-counter small{font-size:10px}.seat-2{top:0;width:216px}.seat-2 .avatar{width:44px;height:44px}.seat-1,.seat-3{width:72px;top:47%}.seat-portrait{width:42px}.seat-portrait .avatar{width:42px;height:42px}.seat-info h3{font-size:12px}.seat-info p{font-size:11px}.seat-scores{gap:6px}.seat-scores>span{font-size:10px}.seat-scores strong{font-size:21px}.seat-scores b{font-size:19px}.seat-2 .seat-scores strong{font-size:25px}.opponent-hand{display:none}.river-3{left:78px;width:84px}.river-1{right:78px;width:84px}.river-1,.river-3{top:50%;max-height:360px}.river-1 .tile,.river-3 .tile{width:23px}.river-1 .river-groups,.river-3 .river-groups{gap:4px}.river-0,.river-2{width:90%;max-width:90%}.river-2{top:103px}.river-0{bottom:70px}.river .tile{width:27px}.river-group{padding:2px}.river>header{font-size:11px}.river>header small{display:none}.table-wait{display:none}.round-award{top:77%;padding:5px 10px;font-size:12px}.round-award b{font-size:24px}.table-status{width:100%;justify-content:center;white-space:normal}.status-pill{font-size:12px;padding:7px 10px}.online-clock{font-size:11px;padding:5px}.match-bar{padding:0 4px}.match-location{flex-wrap:wrap;font-size:12px}.score-mode{font-size:12px}.hand-topline{display:flex}.you-identity{min-width:0;flex:1}.you-identity .seat-scores strong{font-size:30px}.you-identity .seat-scores b{font-size:25px}.hand-instruction{order:3;flex-basis:100%;max-width:100%;padding:0;margin:4px 0;font-size:13px}.hand-and-actions{flex-direction:column;gap:8px}.your-hand{width:100%;gap:3px;padding:15px 0;justify-content:center}.hand-card{width:calc((100% - 24px)/8);flex:0 1 calc((100% - 24px)/8);min-width:0}.hand-card>.tile{width:100%}.hand-actions{display:grid;width:100%;grid-template-columns:1fr 1.2fr;gap:8px;min-width:0}.cover-mode{margin:0}.cover-mode button{font-size:13px;padding:7px 4px}.secondary-actions{grid-column:1/3}.hand-foot{font-size:11px;margin:12px 0}.series-note{font-size:11px}.memory-rows{display:flex}.memory-tile>.tile{width:32px}.memory-tiles{gap:8px}.tile-memory-row{min-height:72px}.ledger-inner{padding:18px}.rank-number{font-size:20px}.rank-count{font-size:13px}.room-list-item{padding:12px 8px}.room-list-item .button{font-size:12px;padding:9px 10px}.room-list h3{font-size:23px}.form-field input{font-size:16px}.room-list-scroll{max-height:350px}.result-table-head,.result-row{grid-template-columns:minmax(73px,1fr) 45px 40px 48px 57px;gap:5px;padding:10px 0}.result-row .avatar{display:none}.result-table-head{font-size:10px}.result-row>div>span{font-size:12px}.result-row small{font-size:10px}.result-row>span{font-size:14px}.result-row>strong{font-size:21px}.result-row>strong.series-result{font-size:25px}.result-hero h2{font-size:23px}.result-actions .button{font-size:13px;padding:10px 12px}.room-total b{font-size:28px}.room-help{font-size:12px}}

/* Intrinsic sizes prevent two-tile groups and mobile controls from overlapping. */
.river-cards{width:max-content}.river-group{min-width:max-content}.hand-foot{height:auto;min-height:27px}
@media(max-width:850px){.hand-and-actions{flex:none;min-height:auto}.hand-area{height:auto;min-height:0;padding-bottom:12px}.your-hand{flex:none;min-height:0}.hand-foot{position:relative;flex:none;margin-top:14px}.hand-instruction{max-height:none;overflow:visible}}
@media(max-width:520px){.hand-actions{margin-bottom:4px}.hand-and-actions{padding-top:8px}.hand-foot{margin:8px 0;row-gap:10px}.hand-foot>span:first-child{display:none}.hand-foot .text-button{font-size:12px}.you-identity strong{font-size:14px}.you-identity small{font-size:11px}.brand>span:last-child{min-width:81px}.brand strong{white-space:nowrap;font-size:16px;letter-spacing:.1em}.header-nav{gap:3px}.river-0 .river-groups,.river-2 .river-groups{gap:3px}}
@media(max-width:370px){.river-3{left:70px;width:76px}.river-1{right:70px;width:76px}.river-1 .tile,.river-3 .tile{width:22px}.river-0 .tile,.river-2 .tile{width:24px}.river-group{padding:2px 1px}.seat-1,.seat-3{width:64px}.seat-info h3{font-size:11px}.seat-scores strong{font-size:20px}.seat-scores b{font-size:18px}.seat-scores{gap:5px}}

/* Keep the requested strictly descending vertical recorder at every screen width. */
@media(max-width:1250px){.memory-rows{display:flex;max-width:380px;margin-inline:auto}}
@media(max-width:520px){.river-2{top:85px}.river-1,.river-3{top:51%}}
