*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{
  background-color:#0b0f0d;
  background-image:conic-gradient(#0f1512 25%,transparent 0 50%,#0f1512 0 75%,transparent 0);
  background-size:4px 4px;
  font-family:'Jersey 10',monospace;
  color:#f3efe6;
  font-size:24px;
  overflow:hidden;
  -webkit-tap-highlight-color:transparent;
  
}
[hidden]{display:none!important}
.px{font-family:'Jersey 10',monospace}
:root{--ease:cubic-bezier(.22,.9,.24,1)}

/* ---------- screens ---------- */
.screen{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:16px;overflow:auto;animation:screenIn .32s var(--ease)}
@keyframes screenIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.screen.game{animation:fadeIn .4s ease}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}

.nt{clip-path:polygon(1px 0,calc(100% - 1px) 0,calc(100% - 1px) 1px,100% 1px,100% calc(100% - 1px),calc(100% - 1px) calc(100% - 1px),calc(100% - 1px) 100%,1px 100%,1px calc(100% - 1px),0 calc(100% - 1px),0 1px,1px 1px)}

.panel{background:#151a17;box-shadow:0 0 0 1px #000,3px 3px 0 1px rgba(0,0,0,.45);padding:28px;width:100%;margin:auto}
.narrow{max-width:460px}
.wide-panel{max-width:760px}
.title{font-family:'Jersey 10',monospace;font-size:45px;line-height:44px;text-align:center;color:#e0b04a;margin:0 0 8px;text-shadow:1px 1px 0 #000}
.title.small{font-size:33px;line-height:32px}
.title.big{font-size:110px;line-height:92px;letter-spacing:4px;text-shadow:3px 3px 0 #000;margin-bottom:4px}
.kicker{text-align:center;color:#7d8f85;margin:0 0 26px}
.hello{text-align:center;margin:6px 0 22px;color:#b9c7bf}
.hello b{color:#f3efe6;font-weight:normal}
.link{font:inherit;color:#7d8f85;background:none;border:0;text-decoration:underline;cursor:pointer;padding:4px}
.link:hover{color:#e0b04a}

.field{display:flex;flex-direction:column;gap:8px;margin-bottom:18px}
.field span,.label{font-family:'Jersey 10',monospace;font-size:18px;color:#b9c7bf;margin:0}
input{font:inherit;font-size:30px;color:#f3efe6;background:#0b0f0d;border:0;box-shadow:inset 0 0 0 1px #3a4a40;padding:8px 12px;height:52px;width:100%;outline:none;transition:box-shadow .15s}
input:focus{box-shadow:inset 0 0 0 1px #e0b04a}

.btn{
  font-family:'Jersey 10',monospace;font-size:21px;height:52px;padding:0 18px;border:0;cursor:pointer;
  background:#2c3a32;color:#f3efe6;box-shadow:0 0 0 1px #000,2px 2px 0 1px rgba(0,0,0,.45);
  transition:transform .08s,box-shadow .08s,filter .15s,opacity .2s;
}
.btn:hover{filter:brightness(1.12)}
.btn:active{transform:translate(2px,2px);box-shadow:0 0 0 1px #000,1px 1px 0 1px rgba(0,0,0,.45)}
.btn.gold{background:#e0b04a;color:#1a1206}
.btn.ghost{background:transparent;box-shadow:inset 0 0 0 1px #3a4a40}
.btn.ghost:active{box-shadow:inset 0 0 0 1px #3a4a40}
.btn:disabled{opacity:.45;cursor:default;transform:none;filter:none}
.btn.wide{width:100%}
.btn:focus-visible,input:focus-visible,.clause:focus-visible,.count:focus-visible,.seat:focus-visible,.link:focus-visible{outline:2px solid #fff;outline-offset:4px}
.msg{min-height:28px;margin:14px 0 0;color:#f08a7a;text-align:center}

/* home clauses */
.clauses{display:flex;flex-direction:column;gap:14px}
.clause{
  display:grid;grid-template-columns:52px 1fr;grid-template-rows:auto auto;column-gap:14px;align-items:center;text-align:left;
  font:inherit;color:inherit;background:#0f1411;border:0;cursor:pointer;padding:14px 16px;
  box-shadow:inset 0 0 0 1px #26302a;transition:box-shadow .15s,transform .15s var(--ease),background .15s;
}
.clause:hover{box-shadow:inset 0 0 0 1px #e0b04a;transform:translateX(4px);background:#131915}
.clause .no{grid-row:1/3;width:52px;height:52px;display:flex;align-items:center;justify-content:center;background:#e0b04a;color:#1a1206;font-family:'Jersey 10',monospace;font-size:30px}
.clause .cl{font-family:'Jersey 10',monospace;font-size:23px}
.clause .cs{color:#7d8f85;font-size:23px}

.page-head{display:flex;align-items:center;gap:18px;margin-bottom:22px}
.page-head h2{margin:0;font-family:'Jersey 10',monospace;font-size:28px;color:#e0b04a}
.back{height:40px;font-size:16px;padding:0 12px}

/* host */
.count-pick{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:12px 0 16px}
.count{font:inherit;color:#b9c7bf;background:#0f1411;border:0;cursor:pointer;padding:14px;box-shadow:inset 0 0 0 1px #26302a;display:flex;align-items:center;gap:14px;text-align:left;transition:box-shadow .15s,color .15s}
.count b{font-family:'Jersey 10',monospace;font-size:45px;color:#7d8f85;transition:color .15s}
.count span{font-size:20px;line-height:20px}
.count.on{box-shadow:inset 0 0 0 1px #e0b04a;color:#f3efe6}
.count.on b{color:#e0b04a}
.mini-preview{position:relative;height:170px;margin:0 0 18px}
.mini-preview .mf{position:absolute;left:50%;top:50%;width:220px;height:110px;transform:translate(-50%,-50%);background:#14583a;box-shadow:0 0 0 3px #5c3a22,0 0 0 4px #000;border-radius:50%}
.mini-preview .ms{position:absolute;width:30px;height:30px;transform:translate(-50%,-50%);box-shadow:0 0 0 1px #000;display:flex;align-items:center;justify-content:center;font-family:'Jersey 10',monospace;font-size:15px;transition:left .35s var(--ease),top .35s var(--ease),opacity .25s}
.ta{background:#7bd389;color:#0a2210}.tb{background:#b58ae0;color:#150a22}

/* join list */
.table-list{display:flex;flex-direction:column;gap:10px;min-height:220px;max-height:46vh;overflow:auto;padding:2px}
.trow{display:grid;grid-template-columns:1fr auto auto auto;align-items:center;gap:18px;background:#0f1411;box-shadow:inset 0 0 0 1px #26302a;padding:12px 14px;animation:rowIn .3s var(--ease)}
@keyframes rowIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.trow .tn{font-size:28px;line-height:26px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.trow .tc{font-family:'Jersey 10',monospace;font-size:15px;color:#7d8f85}
.dots{display:flex;gap:5px}
.dots i{width:14px;height:14px;background:#26302a;box-shadow:inset 0 0 0 1px #3a4a40}
.dots i.on{background:#e0b04a;box-shadow:none}
.status{font-family:'Jersey 10',monospace;font-size:15px;color:#7bd389}
.status.playing{color:#f0c050}
.trow .btn{height:44px;font-size:18px}
.empty{color:#7d8f85;text-align:center;padding:60px 0}
.code-row{display:flex;align-items:center;gap:12px;margin-top:20px;padding-top:18px;border-top:1px solid #26302a}
.code-row label{font-family:'Jersey 10',monospace;font-size:18px;color:#b9c7bf;white-space:nowrap}
.code-row input{flex:1;min-width:0;text-transform:uppercase;letter-spacing:8px;font-family:'Jersey 10',monospace;font-size:28px}

/* how to play */
.how .how-body{max-height:64vh;overflow:auto;padding-right:10px;line-height:26px}
.how h3{font-family:'Jersey 10',monospace;font-size:20px;color:#e0b04a;margin:22px 0 8px}
.how p,.how li{color:#d6ded9;margin:6px 0}
.how .lead{color:#7d8f85}
.how b{color:#f3efe6;font-weight:normal;text-decoration:underline;text-decoration-color:#e0b04a}

/* lobby */
.lobby-panel{max-width:640px}
.lobby-top{display:flex;gap:16px;align-items:center;justify-content:center}
.plate{background:#0f1411;box-shadow:0 0 0 1px #000;height:52px;display:flex;align-items:center;gap:14px;padding:0 16px;font-family:'Jersey 10',monospace;font-size:24px}
.hint{text-align:center;color:#b9c7bf;margin:16px 0 8px}
.seat-ring{position:relative;height:360px}
.seat-ring .felt{position:absolute;left:50%;top:50%;width:300px;height:150px;transform:translate(-50%,-50%);background:#14583a;box-shadow:0 0 0 4px #5c3a22,0 0 0 5px #000;border-radius:50%;display:flex;align-items:center;justify-content:center;text-align:center;color:#0b2f20;font-family:'Jersey 10',monospace;font-size:14px;line-height:15px}
.seat{
  position:absolute;width:150px;min-height:72px;transform:translate(-50%,-50%);
  font:inherit;color:inherit;border:0;background:#0f1411;box-shadow:0 0 0 1px #000;padding:6px 8px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-align:center;
  transition:left .35s var(--ease),top .35s var(--ease),box-shadow .15s;animation:fadeIn .25s ease;
}
.seat.open{background:transparent;box-shadow:inset 0 0 0 1px #3a4a40;color:#7d8f85}
.seat.me{box-shadow:0 0 0 1px #7bd389}
.seat .nm{font-size:25px;line-height:24px;word-break:break-word}
.seat .tm{font-family:'Jersey 10',monospace;font-size:13px}
.seat .tm.a{color:#7bd389}.seat .tm.b{color:#b58ae0}
.seat .off{color:#f08a7a;font-size:19px}
.seat .acts{display:flex;gap:6px}
.mini{font-family:'Jersey 10',monospace;font-size:14px;background:#2c3a32;color:#f3efe6;border:0;padding:6px 7px;cursor:pointer;box-shadow:0 0 0 1px #000;transition:filter .15s}
.mini:hover{filter:brightness(1.2)}
.mini.gold{background:#e0b04a;color:#1a1206}
.mini.red{background:#7a2a2a}
.watchers{text-align:center;color:#7d8f85;min-height:26px;margin:6px 0 0}
.lobby-bottom{display:flex;justify-content:space-between;gap:12px;margin-top:14px}
#start{flex:1}

/* ---------- the table ---------- */
.game{padding:0;overflow:hidden}
.stage{position:absolute;left:50%;top:50%;width:1280px;height:800px;transform:translate(-50%,-50%) scale(var(--k,1));transform-origin:center}
.stage svg.felt{position:absolute;left:90px;top:60px}
#cardLayer,#uiLayer{position:absolute;inset:0}
#cardLayer{z-index:1}
#uiLayer{z-index:2}
#uiLayer{pointer-events:none}
#uiLayer .ui{pointer-events:auto}
#uiLayer .center-msg,#uiLayer .log,#uiLayer .bubble,#uiLayer .chip{pointer-events:none}

/* cards: every card on the table is one element that glides between places */
.card{position:absolute;left:0;top:0;width:100px;height:144px;will-change:transform,opacity;
  transition:transform .55s var(--ease),opacity .4s ease;filter:drop-shadow(1px 1px 0 rgba(0,0,0,.45))}
.card .lift{width:100%;height:100%;transition:transform .16s var(--ease),filter .2s}
.card.play{cursor:pointer}
.card.play .lift{transform:translateY(-10px)}
.card.play:hover .lift{transform:translateY(-26px)}
.card.pick{cursor:pointer}
.card.pick:hover .lift{transform:translateY(-14px)}
.card.picked .lift{transform:translateY(-30px);filter:brightness(.62)}
.card.dead .lift{filter:brightness(.5)}
.card.win .face-out{background:#e0b04a}
.card.five .face-out{background:#e0503a}
.card .face-out{width:100%;height:100%;background:#1b1b1b;padding:1px}
.card .face-in{position:relative;width:100%;height:100%;background:#f6f0df}
.card .idx{position:absolute;display:flex;flex-direction:column;align-items:center;gap:3px;font-family:'Jersey 10',monospace;font-size:40px;line-height:30px;letter-spacing:-1px}
.card .idx.tl{left:6px;top:5px}
.card .idx.br{right:6px;bottom:5px;transform:rotate(180deg)}
.card .pip{position:absolute;left:26px;top:48px}
.card .back-out{width:100%;height:100%;background:#f1e7cf;padding:2px}
.card .pat{width:100%;height:100%;background-color:#8c2432;background-image:conic-gradient(#b13a49 25%,transparent 0 50%,#b13a49 0 75%,transparent 0);background-size:3px 3px}
.card .lift{position:relative}
.card .cover{position:absolute;inset:0;opacity:0;transition:opacity .18s ease;pointer-events:none}
.card.down .cover{opacity:1;transition:none}
.card .toss{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:#b3202a;color:#fff;font-family:'Jersey 10',monospace;font-size:15px;padding:5px 6px;box-shadow:0 0 0 1px #000}

/* UI pieces fade/pop in and out */
.ui{position:absolute;animation:uiIn .3s var(--ease) both}
.ui.out{animation:uiOut .22s ease forwards;pointer-events:none}
@keyframes uiIn{from{opacity:0;transform:translateY(6px) scale(.96)}to{opacity:1;transform:none}}
@keyframes uiOut{to{opacity:0;transform:scale(.96)}}
.ui.pop{animation:pop .34s cubic-bezier(.3,1.6,.5,1) both}
@keyframes pop{from{opacity:0;transform:scale(.5)}to{opacity:1;transform:none}}

.topbar{left:24px;top:24px;display:flex;align-items:center;gap:20px}
.topbar .plate{height:44px}
.topbar .btn{height:44px}
.hostbar{right:24px;top:24px;display:flex;gap:14px}
.hostbar .btn{height:44px;font-size:16px}

.pplate{height:56px;background:#151a17;box-shadow:0 0 0 1px #000,2px 2px 0 1px rgba(0,0,0,.45);display:flex;align-items:center;gap:10px;padding:0 10px;transition:box-shadow .3s,opacity .3s}
.pplate.turn{box-shadow:0 0 0 1px #e0b04a,2px 2px 0 1px rgba(0,0,0,.45),0 0 18px 2px rgba(224,176,74,.35)}
.pplate.offline{opacity:.55}
.pplate .av{width:36px;height:36px;flex:none;font-family:'Jersey 10',monospace;font-size:24px;display:flex;align-items:center;justify-content:center}
.pplate .nm{font-size:26px;line-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pplate .sub{font-size:20px;line-height:18px;color:#b9c7bf;white-space:nowrap;transition:color .2s}
.pplate .sub.gold{color:#f0c050}
.chip{width:28px;height:28px;background:#f6f0df;color:#1b1b1b;font-family:'Jersey 10',monospace;font-size:24px;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 1px #000;transition:left .5s var(--ease),top .5s var(--ease)}
.bubble{background:#f6f0df;color:#1b1b1b;font-family:'Jersey 10',monospace;font-size:18px;padding:8px 10px;box-shadow:0 0 0 1px #000,2px 2px 0 0 rgba(0,0,0,.45);white-space:nowrap}
.bubble.dim{background:#9aa39d}
.bubble.gold{background:#e0b04a}
.bubble.red{background:#e0503a;color:#fff}

.box{width:300px;background:#151a17;box-shadow:0 0 0 1px #000,2px 2px 0 1px rgba(0,0,0,.45);padding:10px 12px}
.srow{display:flex;justify-content:space-between;align-items:center;gap:8px}
.snm{font-size:23px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#b9c7bf}
.snm b{font-family:'Jersey 10',monospace;font-size:16px;color:#f3efe6;margin-right:4px;font-weight:normal}
.sval{font-family:'Jersey 10',monospace;font-size:24px;transition:color .3s}
.neg{color:#f08a7a}.pos{color:#7bd389}
.pegs{display:flex;gap:2px;margin:6px 0 10px}
.pegs:last-child{margin-bottom:0}
.pegs i{width:7px;height:7px;background:#2a170c;box-shadow:inset 0 0 0 1px #5c3a22;transition:background .4s ease,box-shadow .4s}
.pegs i:nth-child(5n){margin-right:2px}
.pegs i.on{background:#b58ae0;box-shadow:none}
.pegs i.on.us{background:#7bd389}
.irow{display:flex;justify-content:space-between;gap:10px;font-size:23px;line-height:28px}
.irow span{font-family:'Jersey 10',monospace;font-size:15px;color:#7d8f85;align-self:center}
.irow b{font-weight:normal;display:flex;align-items:center;gap:6px;white-space:nowrap}
.ico{display:inline-block;vertical-align:-3px}

.center-msg{left:0;width:1280px;text-align:center;font-family:'Jersey 10',monospace;font-size:21px;letter-spacing:2px;color:#f3efe6;text-shadow:1px 1px 0 #000;pointer-events:none}
.deck-count{width:120px;text-align:center;font-size:23px;color:#0b2f20}
.watchbar{left:0;width:1280px;bottom:20px;top:auto;text-align:center;font-family:'Jersey 10',monospace;font-size:18px;color:#e0b04a}

.action{left:390px;top:232px;width:500px;background:#151a17;box-shadow:0 0 0 1px #000,2px 2px 0 1px rgba(0,0,0,.45);padding:16px;text-align:center;z-index:300}
.action.low{top:286px}
.atitle{font-family:'Jersey 10',monospace;font-size:21px;margin-bottom:14px;display:flex;align-items:center;justify-content:center;gap:8px}
.abtns{display:flex;flex-wrap:wrap;gap:12px;justify-content:center}
.abtns .btn{height:48px;font-size:20px}
.btn.suit{width:72px;height:64px;background:#f6f0df;display:flex;align-items:center;justify-content:center}
.anote{margin-top:12px;color:#f0c050;font-size:21px}

.log{left:24px;bottom:18px;top:auto;width:440px;font-size:20px;line-height:21px;color:#7d8f85;pointer-events:none}
.log div:last-child{color:#d6ded9}

.result{left:340px;top:160px;width:600px;background:#151a17;box-shadow:0 0 0 1px #e0b04a,3px 3px 0 1px rgba(0,0,0,.55);padding:22px 26px;text-align:center;z-index:400}
.rtitle{font-family:'Jersey 10',monospace;font-size:33px;color:#e0b04a;margin-bottom:12px;text-shadow:1px 1px 0 #000}
.rsub{color:#b9c7bf;margin:8px 0;font-size:23px;display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap}
.rrow{display:grid;grid-template-columns:80px 1fr 60px;align-items:center;font-size:24px;padding:6px 0;border-top:1px solid #26302a}
.rrow b{font-family:'Jersey 10',monospace;font-size:20px;font-weight:normal}
.result .btn{margin-top:12px;width:100%}
.conn{right:24px;bottom:20px;top:auto;font-size:23px;color:#f08a7a}

.badge{height:26px;display:flex;align-items:center;gap:6px;padding:0 8px;background:#e0b04a;color:#1a1206;box-shadow:0 0 0 1px #000,2px 2px 0 0 rgba(0,0,0,.45);font-family:'Jersey 10',monospace;font-size:19px;white-space:nowrap;pointer-events:none}
.badge b{}
.badge span{}
.badge .ico{background:#151a17;padding:2px;box-sizing:content-box}
.badge .calling{opacity:.7}
.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,8px);background:#e0b04a;color:#1a1206;font-family:'Jersey 10',monospace;font-size:18px;padding:12px 16px;box-shadow:0 0 0 1px #000;opacity:0;pointer-events:none;transition:opacity .2s,transform .25s var(--ease);z-index:1000}
.toast.show{opacity:1;transform:translate(-50%,0)}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}
}
