@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;1,500&display=swap');
:root{font-family:'DM Sans',sans-serif;color:#173e35;background:#f5f3ec;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button{cursor:pointer;color:inherit}button:disabled{opacity:.4;cursor:default}button{border:1px solid #d8ded5;background:transparent;border-radius:9px;padding:11px 17px}button:hover:not(:disabled){filter:brightness(.94);background-color:#e4e8dd}header{height:100px;margin:0 6%;border-bottom:1px solid #d9ddd4;display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:10px;font-size:28px;font-weight:700;color:inherit;text-decoration:none}.brand:first-letter{font-size:36px}.light{font-weight:400}.tag,.eyebrow,.section-head,.bottom-note>span{font-size:11px;letter-spacing:2px;font-weight:700}.tag{color:#77887c}header button{border:0}main{max-width:1250px;margin:auto;padding:0 35px}#lobby{display:grid;grid-template-columns:1.1fr 1fr;gap:70px;padding-top:75px}.intro{padding-top:40px}.eyebrow{color:#729482}h1{font-family:'Playfair Display',Georgia,serif;font-size:clamp(44px,4.8vw,67px);line-height:1.17;font-weight:500;letter-spacing:-2px;margin:25px 0}h1 em{color:#b58d4d;font-weight:500}.intro p{line-height:1.9;color:#778078;font-size:16px}.pills{display:flex;gap:23px;margin-top:35px;font-size:12px;color:#607667}.setup{background:#fffefa;border:1px solid #e2e3d9;border-radius:18px;padding:27px;box-shadow:0 15px 40px #183c3507}.section-head{display:flex;justify-content:space-between;margin-bottom:20px}.modes{display:grid;grid-template-columns:1fr 1fr;gap:13px}.mode{text-align:left;padding:19px 17px;background:#f8f8f3;border:1px solid #e5e6de}.mode.active{border:2px solid #285d4b;background:#edf2e9;padding:18px 16px}.mode strong{display:block;font-size:20px}.mode>span{font-size:12px;color:#7b857c;display:block;margin-top:6px}.mini-tiles{display:flex;gap:4px;margin-top:20px;transform:rotate(-5deg)}.mini-tiles i{background:#fffdf3;border:1px solid #dedac9;border-bottom:4px solid #d8d1b9;border-radius:4px;padding:7px 10px;font-size:21px;font-style:normal;color:#bd714c;font-weight:bold}.blue i{color:#487887}.settings{margin:22px 0}label{font-size:12px}input:not([type=checkbox]){width:100%;background:#fafaf6;border:1px solid #e2e4db;border-radius:7px;padding:12px;margin-top:8px;outline-color:#38735a}input[type=checkbox]{accent-color:#285d4b;width:21px;height:21px}.switch-row{display:flex;align-items:center;justify-content:space-between;padding-top:18px}.switch-row small{display:block;color:#889186;font-size:11px;margin-top:5px}.primary{background:#225442;color:#fff;border:0;font-weight:600}.primary:hover:not(:disabled){background:#2c644d}.setup>.primary,.secondary{width:100%;margin-bottom:10px;padding:14px}.primary span{float:right}.secondary{background:#fffefa}.join{display:flex;align-items:center;border-top:1px solid #e6e7dd;padding-top:13px;gap:8px}.join input{margin:0;width:55%}.join button{white-space:nowrap;font-size:12px;border:0;padding:8px}.fine{font-size:10px;text-align:center;color:#93998e;margin-bottom:0}.bottom-note{grid-column:1/-1;border-top:1px solid #d9ddd4;display:flex;align-items:center;justify-content:space-between;padding:25px 0;color:#819082}.bottom-note p{font-family:Georgia,serif;font-style:italic;font-size:18px}.bottom-note>span:last-child{font-size:33px}#game{padding-top:25px}.game-top{display:flex;align-items:center;gap:12px}.game-top>div{margin-right:auto}h2{font-family:Georgia,serif;font-size:30px;margin:8px 0 20px}#players{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:15px 0}.player{padding:14px;background:#e9eee4;border-radius:10px;border:2px solid transparent;font-size:13px}.player.current{border-color:#b49150;background:#f2ead6}.player small{display:block;color:#7b887d;margin-top:5px}.felt{background:radial-gradient(ellipse,#34735b,#1c4a3b);border:10px solid #bc9d6a;border-radius:40px;box-shadow:0 8px 0 #8d714b;min-height:285px;padding:20px;color:#f7f0dc;text-align:center}.draw-area{display:flex;align-items:center;justify-content:center;gap:40px;margin:15px}.stack{background:#eae4d2;color:#245542;min-height:92px;min-width:85px;font-size:26px;border-bottom:5px solid #c4baa0}.stack small{display:block;font-size:11px}.tile{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;min-width:43px;height:65px;border-radius:5px;border:1px solid #d6d0bb;border-bottom:5px solid #c9bea1;background:#fffbed;font-weight:700;font-size:27px;position:relative;padding:4px;box-shadow:0 2px 3px #0002}.tile::after{content:'●';font-size:8px;line-height:12px;opacity:.6}.tile.c0{color:#bd4e3d}.tile.c1{color:#d39b27}.tile.c2{color:#2f73a7}.tile.c3{color:#333f41}.tile.c4{color:#647e64}.tile.selected{transform:translateY(-12px);outline:2px solid #c79a4a}.tile.staged{opacity:.45}.rack-head{display:flex;justify-content:space-between;align-items:center;margin:28px 0 17px;font-size:12px}.rack-head button{padding:7px 12px}#rack{display:flex;flex-wrap:wrap;justify-content:center;gap:5px;background:linear-gradient(#b9935e,#9a7448);padding:24px 12px 13px;border-radius:10px;border-bottom:10px solid #805d38;min-height:110px}.actions{display:flex;gap:10px;align-items:center;margin:18px 0}.actions>span{margin-right:auto;color:#7a8579;font-size:12px}#melds,#groups{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}#melds .tile,#groups .tile{height:38px;min-width:27px;font-size:18px}#message{font-size:13px}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#173e35;color:white;border-radius:12px;padding:14px 24px;display:none;z-index:10}dialog{border:0;border-radius:18px;max-width:520px;padding:32px;color:#173e35}dialog::backdrop{background:#173e3588}dialog p{font-size:14px;line-height:1.7}#waiting button{background:#e8d8ae;margin:10px}#table-info{font-size:12px;color:#c4d9c4}#last .tile{height:38px;min-width:29px;font-size:18px}#indicator{margin-top:8px}#game[hidden],#lobby[hidden]{display:none}@media(max-width:800px){header{height:80px}.tag{display:none}main{padding:0 18px}#lobby{grid-template-columns:1fr;gap:30px;padding-top:20px}.intro{padding-top:15px}h1{font-size:48px}.intro p br{display:none}.pills{margin-top:18px}.bottom-note{gap:20px}.bottom-note p{font-size:14px}.bottom-note>span:first-child{display:none}.game-top{flex-wrap:wrap}#players{grid-template-columns:1fr 1fr}.felt{border-width:6px;padding:12px;border-radius:25px}.draw-area{gap:18px}.tile{min-width:35px;height:53px;font-size:23px}#rack{gap:4px;padding:20px 6px 10px}.rack-head{gap:8px}.rack-head button{font-size:11px;padding:7px}.actions{flex-wrap:wrap}.actions>span{width:100%}}
/* Table seats and the two fixed rack shelves. */
[hidden]{display:none!important}
.match-settings{display:flex;gap:14px;align-items:end;flex-wrap:wrap;border-top:1px solid #e6e7dd;margin-top:16px;padding-top:14px}
select{font:inherit;color:inherit;background:#fafaf6;border:1px solid #d8ded5;border-radius:7px;padding:8px;display:block;margin-top:5px}
.check-label{display:flex;gap:5px;align-items:center;padding-bottom:6px;font-size:11px}
.check-label input[type=checkbox]{width:16px;height:16px}
.game-top h2{margin-bottom:8px}.game-top button{font-size:12px}
.table-shell{display:grid;grid-template-columns:118px minmax(0,1fr) 118px;grid-template-rows:auto minmax(270px,auto) auto;gap:12px;align-items:center;margin:12px 0 0}
#players{display:contents}
.player{text-align:center;padding:13px 8px;overflow-wrap:anywhere}
.player b{font-size:13px}.player small{font-size:10px;line-height:1.5}
.player.seat-top{grid-column:2;grid-row:1;justify-self:center;min-width:210px}
.player.seat-left{grid-column:1;grid-row:2}
.player.seat-right{grid-column:3;grid-row:2}
.player.seat-self{grid-column:2;grid-row:3;justify-self:center;padding:5px 20px;background:transparent;display:flex;align-items:center;gap:10px;max-width:100%}
.player.seat-self small{display:inline;margin:0}
.empty-seat{color:#91a28e;font-size:12px;background:#e9eee470;border-style:dashed}
.tile-backs{display:block;color:#9aaa8e;font-size:17px;letter-spacing:-3px;margin-top:12px}
.felt{grid-column:2;grid-row:2;min-width:0;min-height:270px;padding:16px 12px;border-width:8px;border-radius:32px}
.draw-area{gap:24px;margin:14px 0 8px}
.stack{min-height:74px;min-width:76px;padding:8px;font-size:24px}
#indicator .tile{min-width:36px;height:51px;font-size:23px}
#message{margin:8px 0 3px;line-height:1.5;font-size:12px}
#return{font-size:10px;color:#f6e8c4;border-color:#76917b;padding:5px 10px;margin-top:6px}
.rack-head{margin:12px 0;gap:12px;flex-wrap:wrap}
.sort-controls{display:flex;gap:6px}.sort-controls button{background:#fffdf5}
.meld-controls{display:flex;align-items:end;gap:7px;flex-wrap:wrap;margin-bottom:12px}
.meld-controls label{font-size:10px}.meld-controls select{padding:6px;margin-top:3px}
.meld-controls button{font-size:11px;padding:9px}
#groups{justify-content:flex-start;margin-bottom:8px}
.staged-group{display:flex;gap:3px;padding:5px;background:#eee8d9}
#rack-scroll{max-width:100%;overflow-x:auto;border-radius:12px;background:#a7814d}
#rack{display:grid;grid-template-columns:repeat(15,44px);grid-template-rows:78px 78px;column-gap:2px;row-gap:7px;justify-content:start;position:relative;isolation:isolate;min-width:720px;min-height:0;padding:12px 16px 8px;border-radius:12px;border-bottom:9px solid #79562e;background:linear-gradient(#b99660,#99723f);box-shadow:inset 0 2px 0 #e2c79c}
#rack::before,#rack::after{content:'';position:absolute;left:0;right:0;height:12px;background:linear-gradient(#cbac77,#a07a43);border-top:2px solid #e5c994;box-shadow:0 5px 5px #66482166;z-index:-1}
#rack::before{top:79px}#rack::after{bottom:0}
.rack-slot{height:78px;display:flex;align-items:center;justify-content:center;border-radius:5px}
#rack .tile{width:100%;min-width:0;max-width:54px;height:65px;font-size:27px;user-select:none;touch-action:manipulation}
#rack .tile:hover{background:#fffcdf;box-shadow:0 3px 6px #63462566}
#rack .tile.selected{transform:translateY(-7px);background:#fff4d0;outline:2px solid #e2ba63}
#rack .tile.staged{opacity:.65;border-top:3px solid #387559}
.empty-slot{font-size:24px;opacity:.16;color:#4c321a}
.tile.joker:before{content:'★';font-size:8px;position:absolute;right:3px;top:2px;color:#b08932}
.rack-tip{font-size:11px;color:#7a897c;text-align:center;line-height:1.6;margin:0 0 20px}
.actions{margin:12px 0 8px}
#melds{gap:8px;max-height:230px;overflow:auto;align-items:start;padding:4px}
.meld-group{display:flex;flex-direction:column;gap:3px;align-items:center;background:#143c2e55;border-radius:7px;padding:5px}
.meld-group>small{font-size:9px;color:#bcd4bb}
.meld-target{display:flex;gap:2px;padding:3px;border:1px solid #72927a;background:transparent;border-radius:5px}
.meld-target:hover{background:#74947a66!important;border-color:#d9c592}
#melds .tile{min-width:23px;height:33px;font-size:16px;border-bottom-width:3px;padding:2px}
#melds .tile:after{font-size:5px;line-height:8px}
.swap-joker{color:#f1d597;font-size:9px;padding:3px 9px;border-color:#819175}
#scoreboard{background:#fffdf7;border:1px solid #dadfd2;border-radius:12px;padding:15px;margin:15px 0;overflow:auto}
#scoreboard h3{margin:0 0 12px;font-size:15px}
#scoreboard table{border-collapse:collapse;width:100%;font-size:12px;min-width:420px;text-align:center}
#scoreboard th,#scoreboard td{padding:8px;border-bottom:1px solid #e8e9df}
#scoreboard .total-row{font-weight:bold;background:#edf1e6}#scoreboard p{font-size:12px;margin-bottom:0}
@media(max-width:800px){.table-shell{grid-template-columns:80px minmax(0,1fr) 80px;gap:7px}.player{padding:10px 4px}.player b{font-size:11px}.player small{font-size:9px}.tile-backs{font-size:13px;letter-spacing:-3px}.felt{padding:10px 7px;border-width:5px}.draw-area{gap:10px}.stack{min-width:60px;font-size:20px;min-height:68px}.stack small{font-size:9px}.rack-head{margin:10px 0}.game-top button{padding:8px 10px}.game-top>div{width:100%}}
@media(max-width:540px){header{margin:0 4%;height:65px}.brand{font-size:23px}header button{font-size:11px;padding:6px}main{padding:0 9px}#game{padding-top:13px}.game-top{gap:5px}.game-top h2{font-size:25px}.table-shell{grid-template-columns:60px minmax(0,1fr) 60px;gap:4px;grid-template-rows:auto minmax(240px,auto) auto}.player{border-radius:8px}.player.seat-top{min-width:160px;padding:6px}.player.seat-self{padding:4px 6px;gap:5px;flex-wrap:wrap;justify-content:center}.player b{font-size:10px}.player small{font-size:8px}.tile-backs{font-size:11px}.felt{border-radius:23px;border-width:4px;padding:10px 4px}.draw-area{gap:7px}.stack{min-width:49px;padding:5px;font-size:19px}.stack small{font-size:8px}#indicator .tile{min-width:30px;height:45px;font-size:21px}.draw-area .eyebrow{font-size:8px;letter-spacing:.7px}#table-info{font-size:9px}#message{font-size:10px}.rack-head>span{font-size:10px}.sort-controls{gap:3px}.sort-controls button{padding:7px 9px}.meld-controls{gap:5px}.meld-controls button{padding:8px 6px;font-size:10px}.actions button{font-size:12px;padding:10px}.actions>span{font-size:11px}.rack-tip{font-size:9px}.setup{padding:20px}.match-settings{gap:10px}#melds{max-height:170px}#melds .tile{min-width:19px;height:29px;font-size:14px}.meld-group{padding:3px}}
#rack{--rack-slot-width:44px;grid-auto-columns:var(--rack-slot-width)}
/* Larger, more legible game view; keep the lobby and compact mobile layout. */
main:has(#game:not([hidden])){max-width:1740px}
@media(min-width:801px){
  #game{padding-top:22px}
  .game-top h2{font-size:40px}
  #game .eyebrow{font-size:13px}
  .game-top button,.rack-head,.rack-head button{font-size:17px}
  .table-shell{grid-template-columns:150px minmax(0,1fr) 150px;grid-template-rows:auto minmax(300px,auto) auto;gap:14px}
  .player b{font-size:19px}.player small{font-size:15px;color:#536752}
  .player.seat-top{min-width:250px;padding:14px}
  .player.seat-self{padding:8px 22px}
  .felt{min-height:300px;padding:20px 16px}
  #table-info,#message{font-size:18px}
  .stack{min-width:96px;min-height:92px;font-size:30px;padding:12px}
  .stack small{font-size:14px}
  #indicator .tile{min-width:48px;height:68px;font-size:31px}
  #last .tile{min-width:37px;height:49px;font-size:24px}
  .draw-area{gap:32px;margin:20px 0 12px}
  .meld-controls label{font-size:13px}
  .meld-controls button{font-size:14px;padding:11px}
  #rack{--rack-slot-width:64px;grid-template-columns:repeat(15,var(--rack-slot-width));grid-template-rows:104px 104px;min-width:1020px}
  .rack-slot{height:104px}
  #rack .tile{max-width:none;height:92px;font-size:40px}
  #rack::before{top:105px}
  #melds .tile,#groups .tile{min-width:32px;height:44px;font-size:23px}
  .meld-group>small{font-size:12px}.swap-joker{font-size:12px}
  .actions>span,.rack-tip{font-size:14px;color:#536752}
  .actions button{font-size:17px;padding:13px 22px}
  #scoreboard table,#scoreboard p{font-size:15px}
}
.rack-slot{position:relative}
.rack-slot.drop-before::before,.rack-slot.drop-after::after{content:'';position:absolute;top:3px;bottom:5px;width:4px;background:#fff3ac;border-radius:3px;box-shadow:0 0 6px #4f391b;z-index:3;pointer-events:none}
.rack-slot.drop-before::before{left:-3px}.rack-slot.drop-after::after{right:-3px}
/* Keep the complete desktop game in the viewport; reserve size for the rack. */
@media(min-width:801px){
 body:has(#game:not([hidden])){height:100dvh;overflow:hidden;display:flex;flex-direction:column}
 body:has(#game:not([hidden]))>header{height:44px;min-height:44px;margin:0 22px;flex-shrink:0}
 body:has(#game:not([hidden])) .brand{font-size:22px}
 body:has(#game:not([hidden]))>header .tag{font-size:9px}
 body:has(#game:not([hidden]))>header button{font-size:12px;padding:5px 10px}
 main:has(#game:not([hidden])){width:100%;flex:1;min-height:0;padding:5px 18px 6px;max-width:1740px}
 #game:not([hidden]){height:100%;min-height:0;display:flex;flex-direction:column;gap:4px;padding:0}
 .game-top{min-height:40px;flex-shrink:0;gap:7px}
 .game-top h2{font-size:25px;margin:2px 0}
 #game .eyebrow{font-size:10px;letter-spacing:1px}
 .game-top button{font-size:12px;padding:7px 11px}
 .table-shell{flex:1;min-height:180px;position:relative;grid-template-columns:140px minmax(0,1fr) 140px;grid-template-rows:minmax(0,1fr);gap:8px;margin:0}
 .player{padding:7px 5px}.player b{font-size:15px}.player small{font-size:11px;line-height:1.4;margin-top:2px}
 .player.seat-left,.player.seat-right{grid-row:1;z-index:2}
 .player.seat-top,.player.seat-self{position:absolute;grid-area:auto;left:50%;transform:translateX(-50%);z-index:2;max-width:calc(100% - 310px);min-width:220px;padding:4px 9px;background:#edf1e4}
 .player.seat-top{top:5px}
 .player.seat-top>small{display:inline;margin:0 4px}
 .player.seat-top>b{display:block}
 .player.seat-self{bottom:5px;display:flex;gap:7px;justify-content:center;flex-wrap:wrap}
 .player.seat-self>b{font-size:13px}.player.seat-self>small{font-size:10px}
 .felt{grid-row:1;position:relative;height:100%;min-height:0;border-width:6px;border-radius:25px;padding:76px 10px 56px;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:8px}
 #table-info{position:absolute;top:9px;left:12px;font-size:11px;max-width:26%;text-align:left;line-height:1.5}
 #message{position:absolute;bottom:8px;left:10px;font-size:11px;line-height:1.4;max-width:25%;margin:0;text-align:left}
 #waiting:not(:empty){position:absolute;top:82px;left:8px;right:8px;font-size:12px;z-index:3}
 #waiting button{font-size:12px;padding:7px;margin:4px}
 .draw-area{gap:12px;margin:0;flex-shrink:0}
 .stack{min-width:70px;min-height:62px;font-size:24px;padding:6px}
 .stack small{font-size:11px}
 #indicator{margin-top:4px}#indicator .tile{min-width:37px;height:52px;font-size:26px}
 #last .tile{min-width:25px;height:34px;font-size:19px}
 #return{position:absolute;right:8px;bottom:7px;font-size:10px}
 #melds{flex:1;min-width:0;min-height:0;max-height:100%;gap:4px;padding:2px;align-content:center}
 #melds:empty{display:none}
 #melds .tile{min-width:23px;height:31px;font-size:17px}
 .meld-group{padding:3px}.meld-group>small{font-size:9px}.swap-joker{font-size:9px;padding:2px 5px}
 .rack-head{margin:0;min-height:29px;flex-shrink:0;font-size:13px}
 .rack-head button{font-size:13px;padding:5px 10px}
 .meld-controls{margin:0;gap:6px;flex-shrink:0;align-items:center;min-height:31px}
 .meld-controls label{font-size:11px;display:flex;align-items:center;gap:5px}
 .meld-controls select{margin:0;padding:5px;font-size:12px}
 .meld-controls button{font-size:12px;padding:6px 9px}
 #groups{margin:0;flex-shrink:0;max-height:40px;flex-wrap:nowrap;overflow:hidden;gap:5px}
 #groups:empty{display:none}
 .staged-group{padding:2px;gap:2px;flex-shrink:0}
 #groups .tile{min-width:24px;height:33px;font-size:18px}
 #rack-scroll{flex-shrink:0;overflow:hidden}
 #rack{--rack-tile-height:clamp(66px,11dvh,92px);grid-template-columns:repeat(15,var(--rack-slot-width));grid-template-rows:repeat(2,calc(var(--rack-tile-height) + 8px));row-gap:4px;padding:6px 16px;border-bottom-width:6px;min-height:0}
 .rack-slot{height:calc(var(--rack-tile-height) + 8px)}
 #rack .tile{height:var(--rack-tile-height);font-size:clamp(29px,4.7dvh,40px)}
 #rack::before{top:calc(var(--rack-tile-height) + 7px);height:9px}
 #rack::after{height:9px}
 .actions{margin:0;min-height:36px;gap:8px;flex-shrink:0}
 .actions>span{font-size:12px}.actions button{font-size:15px;padding:7px 18px}
 .rack-tip{font-size:11px;margin:0;line-height:1.3;flex-shrink:0}
 #scoreboard{position:fixed;inset:65px 30px 30px;max-width:850px;max-height:calc(100dvh - 95px);margin:auto;z-index:8;box-shadow:0 15px 90px #123b3566;overflow:auto}
}
.player-discards{display:flex;flex-direction:column;align-items:center;gap:3px;padding:4px;border:0;width:100%;background:transparent}
.discard-caption{font-size:10px;color:#536752}
.discard-strip{display:flex;align-items:center;justify-content:center;gap:2px;min-height:30px;flex-wrap:nowrap}
.discard-strip .tile{min-width:24px;width:24px;height:33px;font-size:19px;padding:1px;border-bottom-width:3px}
.discard-strip .tile::after{font-size:5px;line-height:6px}
.last-discard{outline:2px solid #c39643;outline-offset:1px}
.no-discards{font-size:9px;color:#7c8975;min-height:16px}
.player.seat-top .player-discards,.player.seat-self .player-discards{flex-direction:row;justify-content:center;width:auto;padding:2px}
.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:15px}
.close-scores{position:absolute;right:12px;top:9px;font-size:12px;padding:5px 10px}
.dialog-head h2{margin:0;font-size:25px}.dialog-head button{font-size:12px;padding:7px 12px}
#discard-dialog{width:min(900px,94vw);max-width:900px;max-height:88dvh;overflow:auto}
.discard-note{font-size:12px!important;color:#697c69}
#discard-history-content h3{font-size:14px;margin:16px 0 9px}
.history-tiles{display:flex;flex-wrap:wrap;gap:6px;font-size:12px;color:#697c69}
.history-tiles .tile{min-width:36px;height:52px;font-size:25px}
@media(max-width:800px){.player-discards{padding:2px}.discard-strip{gap:1px;flex-wrap:wrap}.discard-strip .tile{min-width:21px;width:21px;height:29px;font-size:16px}.discard-caption{font-size:9px}.player.seat-self .player-discards{flex-direction:row}}
@media(min-width:801px) and (max-height:680px){
 body:has(#game:not([hidden]))>header{height:34px;min-height:34px}
 .game-top{min-height:32px}.game-top h2{font-size:21px}
 .player.seat-top{min-width:190px}.player.seat-top>small{font-size:9px}
 .player.seat-top .player-discards{padding:0}.player.seat-top .discard-strip .tile{height:27px;font-size:16px}
 .felt{padding-top:64px;padding-bottom:48px}.table-shell{min-height:150px}
 .player.seat-self{bottom:3px;padding:2px 5px}.rack-tip{display:none}
}
/* Larger public discards and a more readable welcome screen. */
.discard-strip .tile{min-width:34px;width:34px;height:47px;font-size:28px}
.discard-strip{gap:3px;min-height:47px}
.discard-caption{font-size:12px;color:#38533f}
.no-discards{font-size:11px;min-height:18px}
.history-tiles .tile{min-width:45px;height:63px;font-size:33px}
@media(min-width:801px){
 .table-shell{grid-template-columns:164px minmax(0,1fr) 164px}
 .player.seat-top{min-width:260px}
 .felt{padding-top:94px;padding-bottom:70px}
 #last .tile{min-width:34px;height:47px;font-size:28px}
 main:has(#lobby:not([hidden])){max-width:1560px}
 body:has(#lobby:not([hidden]))>header{height:80px}
 #lobby{gap:44px;padding-top:clamp(20px,4vh,48px);grid-template-columns:1.05fr 1fr}
 .intro{padding-top:30px}
 .intro .eyebrow{font-size:14px}
 .intro h1{font-size:clamp(52px,5vw,78px);margin:22px 0}
 .intro p{font-size:21px;line-height:1.8;color:#536a59}
 .pills{font-size:16px;color:#49634f;gap:22px;margin-top:28px}
 .setup{padding:28px 30px}
 .section-head{font-size:14px;margin-bottom:18px}
 .mode strong{font-size:26px}.mode>span{font-size:16px;color:#536a59}
 .mini-tiles i{font-size:27px;padding:7px 12px}
 .setup label{font-size:16px}
 .setup input:not([type=checkbox]){font-size:18px;padding:13px}
 .settings{margin:20px 0}
 .switch-row small{font-size:14px;color:#536a59;line-height:1.5}
 .setup input[type=checkbox]{width:24px;height:24px}
 .setup .match-settings{gap:14px;align-items:center}
 .setup .check-label{font-size:14px;gap:7px}
 .setup select{font-size:16px;padding:9px}
 .setup .primary,.setup .secondary{font-size:19px;padding:15px}
 .join button{font-size:15px}.fine{font-size:12px;color:#647560;line-height:1.5}
 .bottom-note{padding:20px 0}.bottom-note>span{font-size:13px}.bottom-note p{font-size:21px}
}
@media(min-width:801px) and (max-width:1100px){
 #lobby{gap:28px}.setup{padding:22px}.intro h1{font-size:52px}.intro p{font-size:18px}.pills{flex-wrap:wrap;gap:12px;font-size:14px}
 .setup .check-label{font-size:13px}.join button{font-size:13px;padding:6px}
}
@media(min-width:801px) and (max-height:680px){
 .player.seat-top .discard-strip .tile{min-width:32px;width:32px;height:42px;font-size:25px}
 .felt{padding-top:80px;padding-bottom:62px}
}
@media(max-width:800px){
 .discard-strip .tile{min-width:27px;width:27px;height:38px;font-size:23px}
 .discard-strip{gap:2px;min-height:38px}.no-discards{min-height:14px}
}
@media(min-width:801px) and (max-height:900px){
 body:has(#lobby:not([hidden]))>header{height:60px}
 #lobby{padding-top:16px;row-gap:18px}
 .intro{padding-top:24px}.intro h1{font-size:clamp(50px,4.6vw,70px)}
 .setup{padding:20px 24px}
 .section-head{margin-bottom:12px}
 .mode{padding:15px 13px}.mode.active{padding:14px 12px}
 .mode strong{font-size:24px}.mode>span{font-size:14px;margin-top:4px}
 .mini-tiles{margin-top:12px}.mini-tiles i{font-size:24px;padding:6px 10px}
 .settings{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;margin:15px 0}
 .settings>label:first-child{min-width:0}
 .settings .switch-row{padding-top:0;align-self:center;gap:8px}
 .switch-row small{font-size:12px}
 .settings input:not([type=checkbox]){font-size:16px;padding:10px;margin-top:5px}
 .settings .match-settings{grid-column:1/-1;margin-top:0;padding-top:10px}
 .setup .primary,.setup .secondary{font-size:17px;padding:12px;margin-bottom:8px}
 .join{padding-top:10px}.join input:not([type=checkbox]){padding:10px;font-size:16px}
 .fine{font-size:11px;margin-top:10px}
 .bottom-note{padding:10px 0}.bottom-note p{font-size:18px;margin:8px 0}
}
/* Rotate the actual okey face, while keeping selection and drag movement upright. */
.tile.reversed .tile-face{display:flex;flex-direction:column;align-items:center;transform:rotate(180deg);line-height:1.05}
.tile.reversed .tile-face::after{content:'●';font-size:8px;line-height:12px;opacity:.6}
.tile.reversed::after{display:none}
#rack .tile.reversed::before{content:'OKEY';font-size:9px;letter-spacing:1px;top:3px;right:0;left:0;text-align:center;font-weight:700;color:#725318}
#rack .tile.reversed{background:#fff7d9;border-color:#b79a58}
@media(min-width:801px){
 body:has(#lobby:not([hidden])){height:100dvh;overflow:hidden;display:flex;flex-direction:column}
 body:has(#lobby:not([hidden]))>header{height:52px;min-height:52px;flex-shrink:0}
 main:has(#lobby:not([hidden])){flex:1;min-height:0;width:100%;padding:6px 26px}
 #lobby:not([hidden]){height:100%;min-height:0;padding-top:0;grid-template-rows:minmax(0,1fr) 32px;row-gap:8px;align-items:center}
 .intro{padding-top:0;align-self:center}
 .setup{max-height:100%;padding:16px 22px;align-self:center}
 .section-head{margin-bottom:10px}
 .settings{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;margin:10px 0}
 .settings>label:first-child{min-width:0}
 .settings .switch-row{padding-top:0;align-self:center;gap:8px}
 .settings .match-settings{grid-column:1/-1;margin-top:0;padding-top:8px}
 .setup .primary,.setup .secondary{font-size:18px;padding:11px;margin-bottom:7px}
 .join{padding-top:8px}.fine{margin-top:8px;font-size:11px;line-height:1.3}
 .bottom-note{height:32px;min-height:0;padding:0;gap:12px}
 .bottom-note p{font-size:16px;margin:0}.bottom-note>span{font-size:11px}.bottom-note>span:last-child{font-size:24px}
}
@media(min-width:801px) and (max-height:680px){
 body:has(#lobby:not([hidden]))>header{height:42px;min-height:42px}
 .setup{padding:12px 18px}.mini-tiles{display:none}
 .mode{padding:12px}.mode.active{padding:11px}
 .intro h1{font-size:clamp(44px,4.4vw,64px)}
 .settings{margin:8px 0}.setup input:not([type=checkbox]){padding:9px}
}
/* A separate wooden discard rack in front of each player. */
.player-discards{width:164px!important;height:67px;padding:8px 8px 10px!important;border:1px solid #c5a16a;border-bottom:5px solid #77532b;border-radius:7px;background:linear-gradient(#b9945b,#98713d);box-shadow:inset 0 2px 0 #dfc28d,0 3px 4px #24402a20;flex-direction:column!important;gap:0!important;overflow:visible}
.player-discards:hover:not(:disabled){background:linear-gradient(#c09e68,#a37c46)}
.player-discards::after{content:'';position:absolute;left:0;right:0;bottom:1px;height:7px;border-top:2px solid #e8ce9c;background:#b28b51;pointer-events:none}
.player-discards .discard-caption{position:absolute;top:-18px;left:0;right:0;text-align:center;font-size:11px;font-weight:600;color:#536343;white-space:nowrap}
.player-discards .discard-strip{width:100%;height:47px;min-height:47px;gap:3px;flex-wrap:nowrap}
.player-discards .discard-strip .tile{flex-shrink:0}
.player-discards .no-discards{color:#f5e6c9;font-size:10px;line-height:1.4;white-space:normal}
@media(min-width:801px){
 .player.seat-left .player-discards{position:absolute;left:0;bottom:12px;right:auto;transform:none}
 .player.seat-right .player-discards{position:absolute;right:0;bottom:12px;left:auto;transform:none}
 .player.seat-top .player-discards{position:absolute;left:50%;top:calc(100% + 18px);transform:translateX(-50%)}
 .player.seat-self .player-discards{position:absolute;left:50%;bottom:calc(100% + 18px);transform:translateX(-50%)}
 .player.seat-self{min-height:26px}
 .felt{padding-top:126px;padding-bottom:108px}
 .felt .draw-area{margin-left:auto}
 #message{max-width:26%}
}
@media(min-width:801px) and (max-height:680px){
 .player-discards{height:58px}.player-discards .discard-strip .tile{height:40px;font-size:25px}
 .player-discards .discard-strip{height:40px;min-height:40px}
 .felt{padding-top:110px;padding-bottom:94px}
}
@media(max-width:800px){
 .player-discards{position:relative;width:100%!important;height:auto;min-height:52px;margin-top:20px;padding:5px 3px 9px!important}
 .player-discards .discard-strip{height:auto;min-height:38px;flex-wrap:wrap;gap:2px}
 .player-discards .discard-strip .tile{min-width:24px;width:24px;height:34px;font-size:21px}
 .player-discards .discard-caption{font-size:9px;top:-16px}
}
@media(min-width:801px){
 .player.seat-top .discard-caption,.player.seat-self .discard-caption{color:#f2dfad;text-shadow:0 1px 2px #173e35}
}
/* Keep the newly drawn tile identifiable after manual moves or sorting. */
#rack .tile.just-drawn{border-bottom-color:#087fa8;box-shadow:inset 0 -4px 0 #1197c4,0 2px 4px #0002}
#rack .drawn-badge{position:absolute;bottom:5px;right:2px;padding:2px 3px;border-radius:3px;background:#087fa8;color:white;font-size:9px;line-height:1;font-weight:700;letter-spacing:.4px;pointer-events:none}
#indicator{position:relative;border-radius:7px}
#indicator.finish-drop{outline:3px solid #f1ca68;outline-offset:5px;background:#f1ca6833;box-shadow:0 0 18px #f1ca6877}
#indicator.finish-drop::after{content:'BİTİR';position:absolute;left:50%;bottom:-21px;transform:translateX(-50%);font-size:11px;font-weight:700;letter-spacing:1px;color:#fff2c4;white-space:nowrap;pointer-events:none}
/* Nameplates sit on miniature wooden racks; public discards are stacked separately. */
.player .name-rack{display:block;padding:7px 10px 8px;border:1px solid #c4a16b;border-bottom:4px solid #79582e;border-radius:6px;color:#fff8e6;background:linear-gradient(#bb965f,#916b36);box-shadow:inset 0 2px 0 #e5c895;text-shadow:0 1px 1px #5f431f;font-weight:700}
.player-discards,.player-discards:hover:not(:disabled){width:100px!important;height:86px;min-height:0;padding:4px!important;border:1px solid #b7b18c70;border-bottom:1px solid #b7b18c70;border-radius:9px;background:transparent;box-shadow:none}
.player-discards::after{display:none}
.player-discards .discard-strip{position:relative;display:block;width:76px;height:72px;min-height:72px;margin:auto;overflow:visible}
.player-discards .discard-strip .tile,.player-discards .discard-covered{position:absolute;top:calc(2px + var(--stack-index)*2px);left:calc(8px + var(--stack-index)*4px);width:42px;min-width:42px;height:58px;box-sizing:border-box;z-index:var(--stack-index)}
.player-discards .discard-strip .tile{font-size:32px;padding:2px}
.discard-covered{border:1px solid #c6bea3;border-bottom:4px solid #b9ad8d;border-radius:5px;background:#ede6cf;box-shadow:0 1px 2px #0002}
.player-discards .no-discards{display:flex;align-items:center;justify-content:center;font-size:11px;line-height:1.4;color:#647557;min-height:72px}
.player.seat-top .player-discards .no-discards,.player.seat-self .player-discards .no-discards{color:#e4d6b5}
.player-discards.discard-drop{outline:3px solid #eac568;outline-offset:3px;background:#eac56833;box-shadow:0 0 14px #eac56855}
@media(min-width:801px){
 .player.seat-right .player-discards{right:32px}
 .player.seat-left .player-discards{left:32px}
 .player.seat-top .player-discards{margin-left:-60px;top:calc(100% + 17px)}
 .player.seat-self .player-discards{margin-left:60px;bottom:calc(100% + 17px)}
 .player.seat-self .name-rack{padding:5px 10px}
 .felt{padding-top:118px;padding-bottom:108px}
}
@media(max-width:800px){
 .player .name-rack{padding:5px 3px;font-size:10px;border-bottom-width:3px}
 .player-discards,.player-discards:hover:not(:disabled){width:100%!important;height:72px;margin-top:19px}
 .player-discards .discard-strip{width:54px;min-height:60px;height:60px}
 .player-discards .discard-strip .tile,.player-discards .discard-covered{width:32px;min-width:32px;height:45px;left:calc(2px + var(--stack-index)*3px)}
 .player-discards .discard-strip .tile{font-size:25px}
}
.draw-source{cursor:grab;user-select:none;-webkit-user-drag:element}
.draw-source-active{opacity:.65;cursor:grabbing}
#rack-scroll.draw-drop{outline:3px solid #eac568;outline-offset:-3px;box-shadow:inset 0 0 24px #ffe48a77}
#rack-scroll.draw-drop #rack{box-shadow:inset 0 0 24px #ffe48a77}
/* Discard stacks occupy the four inner table corners in playing order. */
#corner-discards{display:contents}
.table-shell{--corner-inset:172px;position:relative}
#corner-discards .player-discards{position:absolute!important;width:88px!important;height:78px;min-height:0;margin:0!important;transform:none!important;z-index:4}
#corner-discards .corner-top{top:22px;left:calc(var(--corner-inset) + 10px);right:auto;bottom:auto}
#corner-discards .corner-right{top:22px;right:calc(var(--corner-inset) + 10px);left:auto;bottom:auto}
#corner-discards .corner-left{bottom:16px;left:calc(var(--corner-inset) + 10px);right:auto;top:auto}
#corner-discards .corner-self{bottom:16px;right:calc(var(--corner-inset) + 10px);left:auto;top:auto}
#corner-discards .discard-caption{color:#f2dfad;text-shadow:0 1px 2px #173e35}
#corner-discards .no-discards{color:#e4d6b5}
@media(min-width:801px){
 .felt{padding:68px 110px 60px}
 .felt .draw-area{margin:0;gap:8px}
 #message{left:27%;max-width:46%;text-align:center}
 #table-info{top:76px;left:28%;max-width:44%;font-size:11px;text-align:center}
}
@media(max-width:800px){
 .table-shell{--corner-inset:87px}
 #corner-discards .player-discards{width:62px!important;height:65px}
 #corner-discards .discard-strip{width:48px;min-height:53px;height:53px}
 #corner-discards .discard-strip .tile,#corner-discards .discard-covered{width:29px;min-width:29px;height:41px;font-size:24px}
}
@media(max-width:540px){
 .table-shell{--corner-inset:64px}
 #corner-discards .player-discards{width:48px!important;height:57px}
 #corner-discards .discard-strip{width:38px;min-height:47px;height:47px}
 #corner-discards .discard-strip .tile,#corner-discards .discard-covered{width:24px;min-width:24px;height:35px;font-size:21px;left:calc(1px + var(--stack-index)*2px)}
}
/* A genuine okey is black-backed; pressing reveals its normal face temporarily. */
#rack .tile.reversed,#rack .tile.reversed:hover{background:linear-gradient(#22272a,#060708);border-color:#51575a;border-bottom-color:#000;box-shadow:0 2px 4px #0005;color:#fff}
#rack .tile.reversed::before{display:none}
#rack .tile.reversed .tile-face{visibility:hidden;transform:none}
#rack .joker-back-label{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#fff;font-size:clamp(11px,1.4vw,17px);font-weight:700;letter-spacing:1px;pointer-events:none}
#rack .tile.reversed.revealing,#rack .tile.reversed.revealing:hover{background:#fffbed;border-color:#d6d0bb;border-bottom-color:#c9bea1}
#rack .tile.reversed.revealing .tile-face{visibility:visible}
#rack .tile.reversed.revealing .joker-back-label{visibility:hidden}
#rack .tile.reversed.revealing.c0{color:#bd4e3d}
#rack .tile.reversed.revealing.c1{color:#d39b27}
#rack .tile.reversed.revealing.c2{color:#2f73a7}
#rack .tile.reversed.revealing.c3{color:#333f41}
#rack .tile.reversed.just-drawn{border-bottom-color:#087fa8;box-shadow:inset 0 -4px 0 #1197c4,0 2px 4px #0005}
@media(min-width:801px){#message{bottom:59px;left:28%;max-width:44%}}
/* Enlarge only the corner stacks; the viewport-sized table and rack stay fixed. */
@media(min-width:801px){
 #corner-discards .player-discards{width:104px!important;height:96px}
 #corner-discards .discard-strip{width:88px;height:84px;min-height:84px}
 #corner-discards .discard-strip .tile,#corner-discards .discard-covered{width:54px;min-width:54px;height:74px}
 #corner-discards .discard-strip .tile{font-size:40px;font-weight:700}
 #corner-discards .discard-caption{font-size:12px;top:-18px}
 #corner-discards .no-discards{font-size:12px}
}
@media(min-width:801px) and (max-height:680px){
 #corner-discards .player-discards{width:96px!important;height:88px}
 #corner-discards .discard-strip{width:80px;height:76px;min-height:76px}
 #corner-discards .discard-strip .tile,#corner-discards .discard-covered{width:49px;min-width:49px;height:67px}
 #corner-discards .discard-strip .tile{font-size:36px}
}
/* Larger central draw controls, kept within the existing table footprint. */
@media(min-width:801px){
 .felt .draw-area{gap:14px}
 .draw-area .stack{min-width:88px;min-height:82px;font-size:30px;padding:9px 10px}
 .draw-area .stack small{font-size:14px;font-weight:600;line-height:1.3}
 .draw-area .eyebrow{font-size:12px!important;letter-spacing:1px}
 #indicator .tile{min-width:49px;width:49px;height:69px;font-size:34px}
 #indicator{margin-top:6px}
 #last .tile{min-width:40px;width:40px;height:55px;font-size:31px;margin-top:3px}
}
@media(min-width:801px) and (max-height:680px){
 .felt .draw-area{gap:10px}
 .draw-area .stack{min-width:80px;min-height:74px;font-size:27px;padding:7px}
 .draw-area .stack small{font-size:13px}
 #indicator .tile{min-width:44px;width:44px;height:62px;font-size:31px}
 #last .tile{min-width:36px;width:36px;height:49px;font-size:28px}
}
/* Match the annotated seating: Efe upper-left, Deniz upper-right, Ada lower-left, self lower-right. */
#corner-discards .corner-left{top:22px;right:calc(var(--corner-inset) + 10px);bottom:auto;left:auto}
#corner-discards .corner-right{bottom:16px;left:calc(var(--corner-inset) + 10px);top:auto;right:auto}
/* Discard piles sit in the light side gutters, outside the green table. */
#corner-discards .corner-top{top:22px;left:calc((var(--corner-inset) - 104px)/2);right:auto;bottom:auto}
#corner-discards .corner-left{top:22px;right:calc((var(--corner-inset) - 104px)/2);left:auto;bottom:auto}
#corner-discards .corner-right{bottom:16px;left:calc((var(--corner-inset) - 104px)/2);right:auto;top:auto}
#corner-discards .corner-self{bottom:16px;right:calc((var(--corner-inset) - 104px)/2);left:auto;top:auto}
#corner-discards .discard-caption{color:#435b43;text-shadow:none}
#corner-discards .no-discards{color:#647557}
@media(min-width:801px) and (max-height:680px){
 #corner-discards .corner-top,#corner-discards .corner-right{left:calc((var(--corner-inset) - 96px)/2)}
 #corner-discards .corner-left,#corner-discards .corner-self{right:calc((var(--corner-inset) - 96px)/2)}
}
@media(max-width:800px){
 #corner-discards .corner-top,#corner-discards .corner-right{left:calc((var(--corner-inset) - 62px)/2)}
 #corner-discards .corner-left,#corner-discards .corner-self{right:calc((var(--corner-inset) - 62px)/2)}
}
@media(max-width:540px){
 #corner-discards .corner-top,#corner-discards .corner-right{left:calc((var(--corner-inset) - 48px)/2)}
 #corner-discards .corner-left,#corner-discards .corner-self{right:calc((var(--corner-inset) - 48px)/2)}
}
#indicator{cursor:pointer;user-select:none} #indicator:focus-visible{outline:3px solid #eac568;outline-offset:4px}
/* Improve the marked labels and controls without changing the rack size. */
@media(min-width:801px){
 .game-top{min-height:48px;gap:8px}
 .game-top button{font-size:16px;font-weight:600;padding:9px 14px;min-height:40px}
 .player .name-rack{font-size:19px;padding:8px 9px;line-height:1.2}
 .player small{font-size:13px;color:#496049}
 .player.seat-top .name-rack{font-size:21px}
 .player.seat-top>small{font-size:13px}
 .player.seat-self .name-rack{font-size:17px;padding:6px 10px}
 .player.seat-self>small{font-size:12px}
 .rack-head{min-height:40px;font-size:17px;font-weight:600}
 .rack-head button{font-size:17px;font-weight:600;padding:8px 15px;min-height:38px}
 .actions{min-height:45px}
 .actions>span{font-size:14px}
 .actions button{font-size:19px;font-weight:600;padding:10px 22px;min-height:44px}
 #turn-info{color:#214c39}
 .actions button:disabled{opacity:.65}
}
@media(min-width:801px) and (max-width:1100px){
 .game-top button{font-size:14px;padding:9px 10px}
 .player .name-rack{font-size:17px}
 .rack-head,.rack-head button{font-size:16px}
}
@media(min-width:801px) and (max-height:680px){
 .game-top{min-height:40px}.game-top button{min-height:34px;padding:6px 11px;font-size:15px}
 .rack-head{min-height:34px}.rack-head button{min-height:32px;padding:5px 12px}
 .actions{min-height:38px}.actions button{min-height:37px;padding:6px 18px;font-size:18px}
}
/* Readable table status without adding height to the viewport layout. */
@media(min-width:801px){
 #table-info{font-size:17px;font-weight:600;line-height:1.4;color:#f5f0d9;top:83px;left:22%;max-width:56%;text-shadow:0 1px 2px #173d30}
 #message{font-size:17px;font-weight:500;line-height:1.4;color:#fff8df;bottom:65px;left:20%;max-width:60%;text-shadow:0 1px 2px #173d30}
}
@media(min-width:801px) and (max-height:680px){
 #table-info{font-size:15px;top:76px}
 #message{font-size:15px;bottom:56px}
}
/* Centre and enlarge the three arrangement controls above the rack. */
@media(min-width:801px){
 .rack-head{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);min-height:48px;gap:10px}
 #turn-info{grid-column:1;grid-row:1;justify-self:start}
 .rack-head .sort-controls{grid-column:2;grid-row:1;justify-self:center;gap:8px}
 .rack-head .sort-controls button{font-size:20px;font-weight:600;padding:10px 20px;min-height:46px}
}
@media(min-width:801px) and (max-width:1100px){
 .rack-head .sort-controls button{font-size:18px;padding:10px 16px}
 #turn-info{font-size:15px}
}
@media(min-width:801px) and (max-height:680px){
 .rack-head{min-height:42px}
 .rack-head .sort-controls button{font-size:18px;padding:7px 17px;min-height:40px}
}
@media(max-width:800px){
 .rack-head{justify-content:center}
 #turn-info{width:100%;text-align:center}
 .rack-head .sort-controls{justify-content:center;gap:7px}
 .rack-head .sort-controls button{font-size:16px;padding:9px 15px}
}
/* Centre the primary hand actions below the rack. */
@media(min-width:801px){
 .actions{display:grid;grid-template-columns:minmax(0,1fr) auto auto minmax(0,1fr);gap:10px;min-height:52px}
 .actions>span{grid-column:1;grid-row:1;margin-right:0;font-size:13px}
 .actions #finish{grid-column:2;grid-row:1}
 .actions #discard{grid-column:3;grid-row:1}
 .actions #finish,.actions #discard{font-size:22px;padding:11px 28px;min-height:50px;min-width:148px}
}
@media(min-width:801px) and (max-height:680px){
 .actions{min-height:46px}
 .actions #finish,.actions #discard{font-size:20px;padding:8px 24px;min-height:44px}
}
@media(max-width:800px){
 .actions{justify-content:center;gap:10px}
 .actions>span{width:100%;text-align:center;margin:0}
 .actions #finish,.actions #discard{font-size:18px;padding:11px 23px;min-height:44px}
}
/* Centre the 101 meld controls and make each action easy to read. */
@media(min-width:801px){
 .meld-controls{justify-content:center;gap:8px;min-height:44px;flex-wrap:nowrap}
 .meld-controls label{font-size:14px;gap:6px;flex-shrink:0}
 .meld-controls select{font-size:15px;padding:8px;min-height:40px}
 .meld-controls button{font-size:17px;font-weight:600;padding:10px 15px;min-height:42px;white-space:nowrap}
}
@media(min-width:801px) and (max-width:1100px){
 .meld-controls{gap:6px}.meld-controls button{font-size:16px;padding:9px 12px}
 .meld-controls label{font-size:13px}.meld-controls select{font-size:14px}
}
@media(min-width:801px) and (max-height:680px){
 .meld-controls{min-height:38px}
 .meld-controls button{font-size:16px;padding:7px 12px;min-height:36px}
 .meld-controls select{padding:6px;min-height:35px}
}
@media(max-width:800px){
 .meld-controls{justify-content:center;gap:7px}
 .meld-controls button{font-size:15px;padding:9px 12px;min-height:40px}
 .meld-controls label{font-size:13px}
 .meld-controls select{font-size:14px}
}
@media(min-width:801px){
 #corner-discards .corner-top,#corner-discards .corner-left{top:12px}
 #corner-discards .corner-right,#corner-discards .corner-self{bottom:6px}
 .player.seat-left,.player.seat-right{padding:4px 5px}
 .player.seat-left small,.player.seat-right small{margin-top:1px;line-height:1.2}
}
/* Give the arrangement buttons equal breathing room above and below. */
.rack-head{padding-top:6px;padding-bottom:6px}
@media(min-width:801px){.rack-head{min-height:60px}}
@media(min-width:801px) and (max-height:680px){.rack-head{min-height:54px}}
/* Separate the bottom actions from the wooden rack without adding page scroll. */
.actions{padding-top:7px}
@media(min-width:801px){.actions{min-height:59px}}
@media(min-width:801px) and (max-height:680px){.actions{min-height:53px}}
/* Separate the 101 action row from arrangement controls and the rack. */
.meld-controls{padding-top:6px;padding-bottom:6px}
@media(min-width:801px){.meld-controls{min-height:56px}}
@media(min-width:801px) and (max-height:680px){.meld-controls{min-height:50px}}
/* Mark the player whose turn it is with a green name rack. */
.player.current .name-rack{background:linear-gradient(#398b59,#1d633c);border-color:#74ba83;border-bottom-color:#17482c;color:#fff;box-shadow:inset 0 2px 0 #a5d4a3,0 0 8px #318b5040;text-shadow:0 1px 1px #153f27}
.player.current{border-color:#4b9a62;background:#e0efdf}
/* The player's main rack is green only during their own turn. */
#rack-scroll.my-turn{background:#276a42}
#rack-scroll.my-turn #rack{background:linear-gradient(#43895a,#27643e);border-bottom-color:#17492b;box-shadow:inset 0 2px 0 #9acb9a}
#rack-scroll.my-turn #rack::before,#rack-scroll.my-turn #rack::after{background:linear-gradient(#71a973,#36764a);border-top-color:#b0d3a7;box-shadow:0 5px 5px #17492b66}
/* A server-timed red stroke counts down around the active player's rack. */
.player .name-rack{position:relative}
.turn-clock-frame{display:none;position:absolute;inset:-4px;width:calc(100% + 8px);height:calc(100% + 8px);overflow:visible;pointer-events:none}
.turn-clock-progress{fill:none;stroke:#ed3434;stroke-width:4;stroke-dasharray:100 100;stroke-dashoffset:0;stroke-linecap:round;vector-effect:non-scaling-stroke;transition:stroke-dashoffset .1s linear}
.turn-countdown{display:none;position:absolute;right:4px;top:-12px;background:#c9232d;color:#fff;border:1px solid #fff1dc;border-radius:7px;padding:2px 5px;font-size:11px;line-height:1.1;font-weight:700;white-space:nowrap;text-shadow:none;z-index:5}
.clock-active .player.current .turn-clock-frame,.clock-active .player.current .turn-countdown{display:block}
.clock-active .player.current.clock-urgent .turn-countdown{background:#9f101c;box-shadow:0 0 7px #f42b2b99}
#rack-scroll{position:relative}
.rack-turn-clock{display:none;position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:5}
.clock-active #rack-scroll.my-turn .rack-turn-clock{display:block}
.rack-turn-clock .turn-clock-progress{stroke-width:5}
.turn-clock-progress{vector-effect:none}
/* Keep opened melds and the indicator readable from the first deal onward. */
@media(min-width:801px){
 #melds{gap:18px 24px;align-content:center;justify-content:center}
 .meld-group{padding:5px;gap:5px}
 .meld-group>small{font-size:12px;color:#e0edce}
 .meld-target{gap:3px;padding:4px}
 #melds .tile{min-width:40px;width:40px;height:58px;font-size:31px;padding:3px;border-bottom-width:4px}
 #melds .tile::after{font-size:7px;line-height:10px}
 .swap-joker{font-size:12px;padding:4px 9px}
 #indicator .tile{min-width:64px;width:64px;height:89px;font-size:44px}
 .draw-area .eyebrow{font-size:14px!important}
 .felt{padding-left:60px;padding-right:60px;gap:16px}
 .felt .draw-area{flex-shrink:0}
}
/* Separate whole melds without reducing the size of their tiles. */
#melds .meld-group{border:1px solid #c8ddba66;background:#123d2ed9;box-shadow:0 2px 4px #0002;flex-shrink:0}
#rack .playable-line{position:absolute;left:18%;right:18%;bottom:13px;height:3px;border-radius:2px;background:#d96316;pointer-events:none;z-index:2}
@media(max-width:800px){#melds{gap:12px 16px}}
@media(min-width:801px) and (max-height:680px){
 #melds .tile{min-width:35px;width:35px;height:50px;font-size:28px}
 .meld-group>small{font-size:11px}
 #indicator .tile{min-width:56px;width:56px;height:78px;font-size:39px}
 .meld-group{padding:4px;gap:3px}
}
@media(max-width:800px){
 #melds .tile{min-width:29px;width:29px;height:43px;font-size:24px}
 #indicator .tile{min-width:43px;width:43px;height:62px;font-size:32px}
}
@media(min-width:801px) and (max-height:900px){
 body:has(#meld-controls:not([hidden])) #rack{--rack-tile-height:68px}
 body:has(#meld-controls:not([hidden])) .felt{padding-top:94px;padding-bottom:76px;padding-left:18px;padding-right:18px;gap:12px}
 #melds{align-content:safe center}
 #melds .meld-target{flex-wrap:wrap;max-width:100%;justify-content:center}
 #melds .meld-group{max-width:100%}
}
/* Keep the round continuation visible inside the score overlay. */
#scoreboard{height:fit-content;bottom:auto;max-height:calc(100dvh - 95px)}
.score-actions{text-align:center;padding-top:16px;border-top:1px solid #d8ded5;margin-top:16px}
#scoreboard .score-actions p{font-size:16px;line-height:1.5;margin:0 0 14px}
.next-round{font-size:18px;padding:13px 25px;min-height:48px}
/* A speech bubble anchored to the rack corner, outside the tile slots. */
.rack-frame{position:relative;flex-shrink:0;min-width:0}
.per-total{position:absolute;right:12px;top:-30px;z-index:4;background:#fff4cc;color:#244f38;border:2px solid #a78135;border-radius:18px;padding:5px 14px;font-size:17px;font-weight:700;line-height:1.2;box-shadow:0 2px 5px #173e3522;pointer-events:none;white-space:nowrap}
.per-total::after{content:'';position:absolute;right:20px;bottom:-7px;width:10px;height:10px;background:#fff4cc;border-right:2px solid #a78135;border-bottom:2px solid #a78135;transform:rotate(45deg)}
.per-total[hidden]{display:none}
.per-total.ready{background:#dcf6df;color:#135b2d;border-color:#268244}
.per-total.ready::after{background:#dcf6df;border-color:#268244}
.per-total.below-target{background:#ffe2df;color:#a12420;border-color:#c94036}
.per-total.below-target::after{background:#ffe2df;border-color:#c94036}
@media(max-width:800px){.per-total{font-size:13px;right:7px;top:-25px;padding:4px 9px}}

.meld-target.process-drop{outline:3px solid #f4c656;background:#548351!important;box-shadow:0 0 15px #f4c65688}
#corner-discards .can-take-discard{border:2px solid #30854b;box-shadow:0 0 0 3px #30854b20;background:#e8f4df}#corner-discards .can-take-discard .discard-caption{color:#216436;font-weight:700}
.bot-speed-label{display:flex;flex-direction:column;gap:3px;font-size:12px;font-weight:600;flex-shrink:0}
.bot-speed-label select{font:inherit;font-size:14px;color:#173e35;background:#fffdf5;border:1px solid #c8d2c3;border-radius:7px;padding:6px;max-width:155px}
@media(min-width:801px){.game-top{flex-wrap:wrap;min-height:58px;height:auto;flex-shrink:0}.game-top .bot-speed-label{margin-left:auto}.game-top>div{margin-right:0}}
@media(max-width:800px){.bot-speed-label{font-size:11px}.bot-speed-label select{font-size:12px;padding:4px}}
/* Larger lobby controls, while retaining a single-screen desktop layout. */
@media(min-width:801px){
 main:has(#lobby:not([hidden])){max-width:1720px;padding:12px 36px}
 #lobby:not([hidden]){grid-template-columns:.95fr 1.15fr;column-gap:64px}
 #lobby .intro h1{font-size:clamp(58px,5vw,86px)}
 #lobby .intro p{font-size:23px;line-height:1.65}
 #lobby .setup{padding:26px 30px;border-radius:20px}
 #lobby .section-head{font-size:16px;margin-bottom:16px}
 #lobby .mode{padding:19px 17px}
 #lobby .mode.active{padding:18px 16px}
 #lobby .mode strong{font-size:30px}
 #lobby .mode>span{font-size:18px;margin-top:6px}
 #lobby .mini-tiles{margin-top:17px}
 #lobby .mini-tiles i{font-size:29px;padding:6px 12px}
 #lobby .settings{margin:17px 0;gap:12px 18px}
 #lobby .setup label{font-size:18px}
 #lobby .switch-row small{font-size:15px;line-height:1.35}
 #lobby .setup .check-label{font-size:16px}
 #lobby .setup input:not([type=checkbox]){font-size:20px;padding:13px}
 #lobby .setup select{font-size:18px;padding:9px}
 #lobby .setup .primary,#lobby .setup .secondary{font-size:22px;padding:15px;margin-bottom:9px;min-height:54px}
 #lobby .join button{font-size:18px;padding:9px}
 #lobby .fine{font-size:13px;line-height:1.35;margin-top:12px}
}
@media(min-width:801px) and (max-height:760px){
 main:has(#lobby:not([hidden])){padding:6px 26px}
 #lobby:not([hidden]){column-gap:32px}
 #lobby .setup{padding:16px 22px}
 #lobby .section-head{margin-bottom:10px;font-size:14px}
 #lobby .mode{padding:13px}
 #lobby .mode.active{padding:12px}
 #lobby .mode strong{font-size:27px}
 #lobby .mini-tiles{margin-top:9px}
 #lobby .settings{margin:12px 0;gap:9px 13px}
 #lobby .setup input:not([type=checkbox]){padding:10px;font-size:18px}
 #lobby .setup .primary,#lobby .setup .secondary{padding:11px;font-size:20px;min-height:47px}
 #lobby .intro p{font-size:20px}
 #lobby .intro h1{font-size:clamp(48px,4.5vw,70px)}
}
@media(min-width:801px) and (max-width:1150px){
 #lobby:not([hidden]){column-gap:24px;grid-template-columns:.8fr 1.2fr}
 #lobby .setup .match-settings{gap:8px;flex-wrap:wrap}
 #lobby .setup .check-label{font-size:14px}
 #lobby .intro h1{font-size:52px}
}
/* Named public tables share the lobby with table creation. */
.open-rooms{margin-top:24px;border:1px solid #d7ded1;border-radius:16px;padding:18px;background:#fffdf7;box-shadow:0 8px 25px #173e3508}
.open-rooms-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.open-rooms-head h2{font:700 23px 'DM Sans',sans-serif;margin:0}
.open-rooms-head h2 span{font-size:15px;color:#66816b}
.open-rooms-head button{font-size:14px;padding:7px 10px;white-space:nowrap}
.room-search-label{font-size:13px;color:#5d7562}
#room-search{margin-top:5px;font-size:16px;padding:10px}
.rooms-list{display:flex;flex-direction:column;gap:10px;max-height:270px;overflow:auto;margin-top:13px;overscroll-behavior:contain}
.room-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px;border:1px solid #d9e1d2;border-radius:10px;background:#eff4e9}
.room-card>div{display:flex;flex-direction:column;gap:5px;min-width:0}
.room-card strong{font-size:19px;overflow-wrap:anywhere}
.room-card span{font-size:14px;color:#3e6150}
.room-card small{font-size:13px;color:#647b63;overflow-wrap:anywhere}
.room-card button{flex-shrink:0;font-size:16px;padding:10px 13px}
.rooms-note{font-size:12px!important;line-height:1.5!important;color:#6a7d69!important;margin:12px 0 0!important}
.rooms-empty{font-size:16px!important;line-height:1.6!important;color:#647b63!important;margin:5px 0!important}
.settings .room-name-field{grid-column:1/-1}
.player.empty-seat .add-bot,.player .remove-bot{display:block;margin:7px auto 0;padding:7px 10px;font-size:14px;background:#fff9e4;border-color:#ad986a;color:#28533e;white-space:nowrap}
.game-top h2{max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(min-width:801px){
 #lobby .intro{min-height:0;max-height:100%;display:flex;flex-direction:column}
 #lobby .intro h1{font-size:clamp(38px,3.6vw,60px);margin:12px 0}
 #lobby .intro>p{font-size:18px;margin:5px 0 0}
 #lobby .open-rooms{margin-top:18px;min-height:0}
 .rooms-list{max-height:clamp(130px,28dvh,300px)}
}
@media(min-width:801px) and (max-height:850px){
 #lobby .mini-tiles{display:none}
 #lobby .setup{padding:16px 22px}
 #lobby .settings{gap:8px 14px;margin:12px 0}
 #lobby .setup input:not([type=checkbox]){padding:10px}
 #lobby .mode{padding:13px}#lobby .mode.active{padding:12px}
 #lobby .setup .primary,#lobby .setup .secondary{padding:11px;min-height:46px;font-size:20px}
 #lobby .intro h1{font-size:43px}
 .rooms-list{max-height:190px}
}
@media(max-width:800px){.open-rooms{padding:14px;margin-top:18px}.rooms-list{max-height:240px}.room-card strong{font-size:17px}.settings .room-name-field{display:block}.game-top h2{max-width:230px}}
.return-seats{display:flex;flex-direction:column;gap:6px;margin-bottom:10px;max-height:105px;overflow:auto}
.return-seats:empty{display:none}
.return-seat{background:#e0f1dc;border:1px solid #58966a;color:#205231;font-size:15px;font-weight:700;padding:10px 12px;text-align:left;overflow-wrap:anywhere}
@media(min-width:801px){
 #lobby .open-rooms{display:flex;flex-direction:column;max-height:calc(100dvh - 300px);overflow:hidden}
 .open-rooms-head,.room-search-label,#room-search,.rooms-note,.return-seats{flex-shrink:0}
 #lobby .rooms-list{flex:1;min-height:50px}
 .return-seats{max-height:88px}
}
