:root{--bg:#101113;--panel:#191b1f;--line:#303236;--fg:#f0f0f2;--muted:#a7a8ad;--green:#ed3042}html{scroll-behavior:smooth}body{background:var(--bg)}button{background:#212327;border-radius:7px}button:hover{background:#303237}input{background:#141518;border-color:#36383e;border-radius:7px}input::placeholder{color:#96989f}.primary{background:#ed3042;border-color:#ed3042;color:white}.primary:hover{background:#ff4354}.brand{font-size:19px;letter-spacing:.3px}.brand-mark{width:40px;height:50px}.brand .accent{color:inherit}.panel{border:0;border-radius:12px}.side-nav{display:none}.online{color:#71d583}.notice{background:#242026;border-color:#ed3042}.ranking-me{background:transparent}.ranking-me td:nth-child(2){color:white}.features{color:var(--muted)}.history li:nth-child(odd){background:#24262b}.history-move.current{background:#ed3042;color:white}.result-badge{background:none!important;padding:0;font-weight:500}.result-badge.win{color:#70d587}.result-badge.loss{color:#f47983}.result-badge.ongoing{color:#ff4a5b}.result-badge.draw{color:#aab8db}.signed-in .header{position:fixed;inset:0 auto 0 0;width:244px;padding:28px 18px 20px;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;max-width:none;border:0;border-right:1px solid #1d1f23;background:#111215;z-index:4}.signed-in .brand{gap:9px;font-size:17px}.signed-in .side-nav{display:flex;flex-direction:column;gap:10px;margin-top:38px}.side-nav a{display:flex;gap:17px;align-items:center;padding:14px 16px;border-radius:8px;font-size:21px;color:#bfc0c5}.side-nav a span{font-size:15px}.side-nav a:hover{background:#202126}.side-nav a.active{background:#391c23;color:#ff5060}.side-nav a.active span{color:white}.signed-in #account{margin-top:auto;border-top:1px solid var(--line);padding-top:18px;gap:5px}.signed-in #my-nick{width:100%;border:0;font-size:15px;font-weight:600;padding:10px 8px;margin-bottom:6px;white-space:normal}.signed-in #account .quiet{font-size:12px;color:var(--muted);padding:7px 8px}.signed-in main{margin-left:244px;max-width:1500px;padding:40px 42px;min-height:calc(100svh - 65px)}.signed-in footer{margin-left:286px;margin-right:42px;max-width:none}.signed-in .notice{margin-left:max(260px,30%)}#lobby{grid-template-columns:minmax(0,1.5fr) minmax(290px,1fr);gap:28px 32px}#lobby>.page-heading{grid-column:1/-1;margin-bottom:16px}.page-heading h1{font-size:42px;letter-spacing:-1px;margin-bottom:8px}.page-heading .muted{font-size:17px}#invite{background:none;border-color:#62646b;font-size:14px;padding:11px 17px}#lobby > .lobby-players > .players-panel{grid-column:1;grid-row:2;min-width:0}#lobby > .lobby-details > .ranking-panel{grid-column:2;grid-row:2;min-width:0;padding:24px;align-self:start}#lobby>#invite-card{grid-column:1/-1;grid-row:auto}#lobby > .lobby-players > .challenges-panel{grid-column:1;grid-row:3;min-width:0}#lobby > .lobby-details > .games-panel{grid-column:1/-1;grid-row:4;min-width:0;padding-top:6px}h2{font-size:23px;font-weight:650;letter-spacing:-.5px}.players-title{display:flex;gap:15px;align-items:center}.players-title h2{margin:0}.players-title small{white-space:nowrap}.players-panel .section-title{align-items:center;margin-bottom:18px;flex-wrap:wrap}#search{width:230px;padding:10px 13px;font-size:14px}.player-filters{display:flex;gap:9px;align-items:center}.player-filters button{border-radius:20px;padding:5px 16px;font-size:13px;background:none}.player-filters button.active{background:#ed3042;border-color:#ed3042;color:white}.connection{font-size:10px;color:var(--muted);margin-left:auto}.row{padding:18px 0;gap:14px}.row strong{font-size:16px;font-weight:600}.row small{font-size:12px}.avatar{display:grid;place-items:center;flex:0 0 44px;height:44px;border-radius:50%;background:#2c2e33;color:#e6e6ea;font-size:15px;font-weight:600}#players .row>div:first-of-type{flex:1}#players .row .actions{flex-shrink:0}#players .row button,#games .row button{background:none;border:0;color:#ff4154;font-size:14px;padding-right:0}#players .rows{margin-top:8px}.ranking-panel .muted{font-size:12px;margin-bottom:16px}.ranking-table thead{display:none}.ranking-table th:nth-child(n+4),.ranking-table td:nth-child(n+4){display:none}.ranking-table td:nth-child(2){white-space:normal}.ranking-table td:nth-child(3){color:var(--fg);font-weight:600;min-width:35px!important}#lobby .ranking-table td{padding:17px 5px;font-size:14px}.ranking-table td:first-child{color:var(--muted);width:25px;text-align:left!important}.ranking-table tr:last-child td{border:0}.ranking-me td:nth-child(2)::before{content:'●';color:#ed3042;margin-right:8px;font-size:10px}.challenges-panel .rows{margin:0}.challenges-panel .row{background:#321b22;padding:18px 20px;border:0;border-radius:10px}.challenges-panel .row+.row{margin-top:10px}.challenges-panel .row button:not(.primary){border:0;background:none}.challenges-panel .empty{padding:0;font-size:12px}.games-panel h2{margin-bottom:20px}.games-panel .rows{border-top:1px solid var(--line);margin:0}#games .row{padding:17px 0}#games .row small{display:none}#games .row>div:first-child{min-width:0}#games .row .actions{flex-shrink:0}.table-scroll{max-height:420px}.game-layout{grid-template-columns:minmax(0,650px) minmax(260px,1fr)}
@media(min-width:1800px){.signed-in main{margin-right:auto}}
@media(max-width:1200px){.signed-in .header{width:210px;padding-inline:14px}.signed-in .brand{font-size:14px}.signed-in main{margin-left:210px;padding:30px 25px}.signed-in footer{margin-left:235px;margin-right:25px}#lobby{gap:24px;grid-template-columns:minmax(0,1.2fr) minmax(260px,1fr)}#search{width:100%}.players-panel .section-title{gap:14px}.game-layout{grid-template-columns:minmax(0,1fr)}.game-info{margin-top:0}}
@media(max-width:850px){.signed-in .header{position:static;width:auto;padding:16px;display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;border-bottom:1px solid var(--line)}.signed-in .brand{font-size:16px}.brand-mark{height:36px;width:30px}.signed-in .side-nav{order:3;width:100%;flex-direction:row;margin:5px 0 0;gap:4px}.side-nav a{flex:1;padding:10px 8px;gap:8px;font-size:17px;justify-content:center}.side-nav a span{font-size:12px}.signed-in #account{margin:0 0 0 auto;padding:0;border:0;max-width:260px;justify-content:flex-end}.signed-in #my-nick{width:auto;margin:0;font-size:13px}.signed-in main{margin:0;padding:26px 18px}.signed-in footer{margin:0 18px}.signed-in .notice{margin:12px}#lobby{grid-template-columns:minmax(0,1fr);gap:24px}#lobby > .lobby-players > .players-panel,#lobby > .lobby-details > .ranking-panel,#lobby > .lobby-players > .challenges-panel,#lobby > .lobby-details > .games-panel,#lobby>#invite-card{grid-column:1;grid-row:auto}#lobby > .lobby-players > .players-panel{order:1}#lobby > .lobby-players > .challenges-panel{order:2}#lobby > .lobby-details > .ranking-panel{order:3}#lobby > .lobby-details > .games-panel{order:4}.page-heading{flex-direction:row;align-items:center}.page-heading h1{font-size:32px}.page-heading .muted{font-size:14px}.page-heading #invite{font-size:12px;white-space:nowrap;padding:9px}#search{width:200px}.challenges-panel .row{flex-wrap:wrap}.row strong{font-size:14px}#players .row button,#games .row button{font-size:12px}.avatar{flex-basis:36px;height:36px;font-size:12px}.game-layout{grid-template-columns:minmax(0,1fr)}}
@media(max-width:440px){.signed-in #account{max-width:210px}.signed-in #account .quiet{font-size:10px;padding:5px}.signed-in .brand{font-size:13px}.signed-in .brand-mark{width:24px}.page-heading{gap:12px}.page-heading .muted{max-width:190px}#search{width:100%}.row{gap:9px}.signed-in .side-nav a span{font-size:11px}}
.watch-button{width:34px;height:32px;display:grid;place-items:center;padding:0;color:#ff4154;border-color:#45464c;background:#202126;font-size:17px}.watch-button:hover{background:#392026}.row .quiet:disabled{opacity:.72;color:#b9b9bf;cursor:default}.player-filters{margin-bottom:5px}.players-panel .row{min-height:72px}.players-panel .row>div:first-of-type{min-width:0}.players-panel .row .actions{gap:5px}.players-panel .row .actions button{white-space:nowrap}.players-panel .row small{font-variant-numeric:tabular-nums}.players-panel .row small.playing{color:#ff5261}.spectator-count{display:inline-flex;align-items:center;gap:6px;border:1px solid #383a40;border-radius:20px;background:#1b1d21;padding:8px 12px;color:#f0eff1;font-size:13px;font-variant-numeric:tabular-nums}.spectator-count>span:first-child{font-size:18px;color:#ef3042}.game-tools{display:flex;align-items:center;gap:12px}.signed-in .game-tools #share-game{background:#202126;border-color:#36383e}.signed-in .game-info .eyebrow{color:#ed3042}.signed-in .sq.last,.signed-in .sq.dark.last,.signed-in .sq.light.last{background:#d55b63}.signed-in .sq.selected,.signed-in .sq.selected:hover{background:#ed7881}.signed-in .sq.legal::after{background:#cb243766}.signed-in .sq.capture::after{border-color:#cb243766;background:none}.signed-in .sq.in-check,.signed-in .sq.in-check:hover{background:#df4545;box-shadow:inset 0 0 18px #9b1010}.signed-in .sq.premove,.signed-in .sq.premove:hover{background:#8a789e}
@media(max-width:850px){.signed-in .game-tools{align-self:flex-end}.players-panel .row{min-height:64px}}
.brand-mark{width:36px;height:50px;object-fit:contain;flex:none}.signed-in .brand-mark{width:36px;height:50px}
@media(max-width:850px){.signed-in .brand-mark{width:30px;height:36px}}
@media(max-width:440px){.signed-in .brand-mark{width:24px;height:36px}}
.brand-mark{width:38px;height:54px;object-fit:contain;flex:none;filter:drop-shadow(0 2px 8px #e6121c33)}
.signed-in .brand-mark{width:38px;height:54px}
.signed-in #account.account-actions{position:fixed;top:16px;right:24px;z-index:20;display:flex;align-items:center;gap:10px;margin:0;padding:0;border:0}
.signed-in main{padding-top:90px}
.account-menu-wrap{position:relative}
.account-avatar,.logout-icon{width:42px;height:42px;display:grid;place-items:center;border:1px solid #3b3d43;border-radius:50%;background:#1a1b20;color:#f5f5f6;padding:0}
.account-avatar{background:linear-gradient(145deg,#3b1b22,#1c1d21);border-color:#63313a;color:#ff5966;font-weight:700;font-size:16px}
.account-avatar:hover,.logout-icon:hover{border-color:#ed3042;background:#2b1a20}
.logout-icon svg{width:20px;height:20px;fill:none;stroke:#ff4b5d;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.account-menu{position:absolute;top:calc(100% + 10px);right:0;width:218px;padding:8px;border:1px solid #36383e;border-radius:10px;background:#191a1e;box-shadow:0 14px 34px #0008}
.account-menu strong{display:block;padding:9px 10px 12px;border-bottom:1px solid #303237;color:#f0f0f2;font-size:14px}
.account-menu button{display:block;width:100%;padding:10px;border:0;border-radius:7px;background:transparent;color:#c5c6cb;text-align:left;font-size:13px}
.account-menu button:hover{background:#27282e;color:#fff}
.challenge-button{width:94px;flex:0 0 94px;justify-content:flex-end;text-align:right;white-space:nowrap}
.players-panel .row .actions{display:flex;width:136px;flex:0 0 136px;align-items:center;justify-content:flex-end;gap:8px}
.watch-button,.watch-spacer{width:34px;height:34px;flex:0 0 34px}
.watch-button{border:1px solid #3e4046!important;border-radius:8px!important;background:#1b1c20!important;color:#ff4b5d!important;display:grid!important;place-items:center!important;padding:0!important}
.watch-button:hover{border-color:#a33a45!important;background:#2c1c20!important}
.watch-button svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.watch-button svg circle{fill:currentColor;stroke:none}
.watch-spacer{display:block}
.players-panel .row .actions button{padding:0!important}
.rank-position{display:inline-flex;min-width:59px;align-items:center;gap:8px;color:#c3c5ca;font-variant-numeric:tabular-nums}
.rank-mark{display:inline-flex;width:19px;height:19px;align-items:center;justify-content:center;flex:none}
.rank-mark svg{width:100%;height:100%;fill:currentColor}
.rank-mark.gold{color:#e4b84f;filter:drop-shadow(0 1px 3px #e4b84f33)}
.rank-mark.silver{color:#bbc3cf}
.rank-mark.bronze{color:#bd805d}
.rank-mark.pawn{color:#747780}
.ranking-table td:first-child{width:66px!important;white-space:nowrap}
.ranking-me td:nth-child(2)::before{content:none!important}
.games-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 6px 13px;border-bottom:1px solid var(--line)}
.games-panel .games-heading h2{margin:0}
.text-link{padding:5px 0;border:0;background:none;color:#ff4053;font-size:13px;font-weight:600}
.text-link:hover{background:none;color:#ff7580;text-decoration:underline}
.games-panel .rows{display:grid;gap:0;border:0;margin:0}
#games .game-row{display:flex;align-items:center;gap:16px;padding:13px 6px;border:0;border-bottom:1px solid #292b30;border-radius:0;background:transparent}
#games .game-copy{display:grid;flex:1;min-width:0;gap:3px}
#games .game-matchup{font-size:15px;font-weight:550;line-height:1.45;color:#f0f0f2;overflow-wrap:anywhere}
#games .game-meta{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#games .game-round{display:inline!important;color:#9b9da4;font-size:11px}
#games .result-badge{display:inline-flex!important;align-items:center;font-size:12px;line-height:1.4}
#games .game-open{flex:none;padding:8px 0!important;color:#ff4053!important;font-size:13px!important;font-weight:600;text-align:right;white-space:nowrap}
#games .game-open:hover{color:#ff7a85!important;text-decoration:underline}
#games .empty{padding:16px 6px;color:#96989f}
.challenge-row{display:flex;align-items:center;gap:14px;padding:14px 16px!important;border:1px solid #48242b!important;border-radius:9px!important;background:linear-gradient(100deg,#351b21,#25191d)!important}
.challenge-row>div:first-of-type{flex:1;min-width:0;display:grid;gap:3px}
.challenge-row strong{font-size:14px!important;color:#f4f2f3}
.challenge-row small{font-size:11px!important;color:#b8aeb1}
.challenge-avatar{width:38px;height:38px;flex:0 0 38px;background:#39353a;font-size:12px}
.challenge-row .actions{display:flex;align-items:center;gap:10px}
.challenge-row .actions button{padding:8px 13px!important;font-size:12px!important}
.challenge-row .actions .primary{border:1px solid #ed3042!important;border-radius:6px!important;background:#ed3042!important;color:white!important}
.challenge-row .actions .challenge-decline{color:#c1b8bb!important}
.challenge-row .actions .challenge-decline:hover{background:#43272d!important;color:white!important}
@media(max-width:850px){.signed-in #account.account-actions{top:12px;right:12px}.signed-in main{padding-top:82px}.signed-in .brand-mark{width:32px;height:44px}.signed-in .brand{gap:6px}.players-panel .row .actions{width:126px;flex-basis:126px}.challenge-button{width:84px;flex-basis:84px}.challenge-row{gap:9px;padding:11px!important}.challenge-row .actions{gap:5px}.challenge-row .actions button{padding:8px 9px!important}}
@media(max-width:440px){.signed-in #account.account-actions{top:9px;right:9px;gap:6px}.account-avatar,.logout-icon{width:36px;height:36px}.signed-in main{padding-top:74px}.signed-in .brand-mark{width:28px;height:40px}.signed-in .brand{font-size:11px}.challenge-row{flex-wrap:wrap}.challenge-row .actions{width:100%;justify-content:flex-end;padding-left:47px}.players-panel .row .actions{width:116px;flex-basis:116px;gap:4px}.challenge-button{width:78px;flex-basis:78px}.watch-button,.watch-spacer{width:32px;height:32px;flex-basis:32px}#games .game-matchup{font-size:14px}}
#lobby[data-view="matches"],#lobby[data-view="ranking"]{grid-template-columns:minmax(0,1fr);gap:22px}
#lobby:is([data-view="matches"],[data-view="ranking"]) > :not(.page-heading):not(.lobby-details),
#lobby[data-view="matches"] .ranking-panel,#lobby[data-view="ranking"] .games-panel{display:none!important}
#lobby[data-view="matches"] > .lobby-details > .games-panel{grid-column:1;grid-row:2;width:100%;padding-top:10px}
#lobby[data-view="ranking"] > .lobby-details > .ranking-panel{grid-column:1;grid-row:2;width:100%;padding:26px;align-self:start}
#lobby[data-view="matches"] #all-games{display:none!important}
#lobby[data-view="ranking"] .ranking-table thead{display:table-header-group}
#lobby[data-view="ranking"] .ranking-table th:nth-child(n+4),#lobby[data-view="ranking"] .ranking-table td:nth-child(n+4){display:table-cell}
#lobby[data-view="ranking"] .ranking-table td:first-child{width:95px!important}
#lobby[data-view="ranking"] .ranking-table td:nth-child(2){white-space:nowrap}
#game .spectator-count{position:relative;cursor:help}
#game .spectator-count>svg{width:18px;height:18px;fill:none;stroke:#ef3042;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#game .spectator-count>svg circle{fill:currentColor;stroke:none}
#game .spectator-count::after{content:attr(data-tooltip);position:absolute;z-index:50;top:calc(100% + 8px);right:0;width:max-content;max-width:min(300px,80vw);padding:9px 12px;border:1px solid #393b42;border-radius:8px;background:#1a1b20;color:#f2f2f4;box-shadow:0 10px 28px #0008;font-size:12px;line-height:1.45;white-space:normal;text-align:left;opacity:0;visibility:hidden;transform:translateY(-3px);transition:opacity .15s,transform .15s,visibility .15s}
#game .spectator-count:hover::after,#game .spectator-count:focus-visible::after{opacity:1;visibility:visible;transform:translateY(0)}
.avatar{position:relative;overflow:hidden}.avatar.photo-avatar{border-radius:8px;flex:0 0 44px;height:44px}.avatar>span{display:grid;place-items:center;width:100%;height:100%}.avatar>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.account-avatar{position:relative;border-radius:9px;overflow:hidden}.account-avatar #account-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.ranking-player{display:inline-flex;align-items:center;gap:10px;min-width:0}.table-avatar{width:30px;height:30px;flex-basis:30px!important;border-radius:6px!important;font-size:10px}.ranking-me td:nth-child(2)::before{content:none}.game-player-avatar{width:38px;height:38px;flex:0 0 38px!important;border-radius:7px!important;font-size:11px}.player-bar .game-player-avatar>span{font-size:11px;color:#eee;font-weight:650}.game-matchup{display:flex;align-items:center;gap:8px;white-space:nowrap}.game-avatar{width:30px;height:30px;flex:0 0 30px!important;border-radius:6px!important;font-size:10px}.matchup-separator{color:#9b9ca2}.avatar-preview{width:132px;height:132px;position:relative;display:grid;place-items:center;margin:18px auto 22px;overflow:hidden;border-radius:12px;background:#292a30;color:#e9e9eb;font-size:38px;font-weight:700}.avatar-preview img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.avatar-preview~form .actions{justify-content:flex-end;margin-top:8px}
.player-bar{padding:0 10px;border-left:3px solid transparent;border-radius:7px;transition:background .18s,border-color .18s}.player-bar.turn-active{border-left-color:#ed3042;background:#21191c}.player-bar.turn-active::after{content:'VEZ';margin-left:auto;color:#ff6874;font-size:10px;font-weight:800;letter-spacing:1px}.turn-toast{position:fixed;z-index:20;right:22px;bottom:22px;display:flex;align-items:center;gap:10px;padding:10px 15px;border:1px solid #ed3042;border-radius:9px;background:#2b191e;color:#fff;box-shadow:0 10px 28px #0009;font-size:13px;font-weight:650;pointer-events:none;animation:turn-toast-in .18s ease-out}.turn-toast>span:first-child{color:#ff4b5a;font-size:17px}@keyframes turn-toast-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media(max-width:600px){.turn-toast{right:12px;bottom:14px;padding:9px 12px;font-size:12px}}

/* Keep all player rows below the sticky ranking header. */
.ranking-panel .table-scroll {
  border-radius: 8px;
  isolation: isolate;
}
#lobby[data-view="ranking"] .table-scroll { max-height: min(65svh, 620px); }
.ranking-panel .ranking-table {
  border-collapse: separate;
  border-spacing: 0;
}
.ranking-panel .ranking-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
}
.ranking-panel .ranking-table tbody {
  position: relative;
  z-index: 0;
}
.ranking-panel .ranking-table th {
  position: static;
  background: var(--panel);
}

@media (min-width: 851px) {
  .signed-in #account.account-actions {
    position: fixed;
    inset: 0 0 auto 244px;
    padding: 12px 24px;
    justify-content: flex-end;
    background: #111215;
    border-bottom: 1px solid var(--line);
  }
  .signed-in .brand {
    position: relative;
    z-index: 21;
  }
}
@media (851px <= width <= 1200px) {
  .signed-in #account.account-actions {
    left: 210px;
  }
}
@media (max-width: 850px) {
  .signed-in .header {
    position: sticky;
    inset: 0 auto auto;
    z-index: 10;
    gap: 6px 12px;
    padding: 8px 12px;
    background: #111215;
  }
  .signed-in #account.account-actions {
    position: static;
    margin-left: auto;
  }
  .signed-in .account-avatar,
  .signed-in .logout-icon {
    min-width: 44px;
    min-height: 44px;
  }
  .signed-in main {
    padding: 20px 12px 40px;
  }
  .signed-in .notice {
    position: relative;
    top: auto;
    z-index: 1;
  }
  #lobby[data-view="ranking"] > .lobby-details > .ranking-panel {
    padding: 14px 10px;
  }
  #lobby[data-view="ranking"] .ranking-table {
    min-width: 405px;
  }
  #lobby[data-view="ranking"] .ranking-table td:first-child {
    width: auto !important;
  }
  #games .game-matchup,
  .game-tools,
  .player-filters {
    flex-wrap: wrap;
    white-space: normal;
  }
  #game .page-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  #search,
  form input {
    font-size: 16px;
  }
}

#board[data-move-highlight] {
  --move-square: #a5aaa8;
  --move-dot: #4d5353aa;
}
#board[data-move-highlight="active"] {
  --move-square: #a7c69a;
  --move-dot: #35724dbb;
}
#board[data-move-highlight] .sq.selected,
#board[data-move-highlight] .sq.selected:hover {
  background: var(--move-square);
}
#board[data-move-highlight] .sq.legal::after {
  background: var(--move-dot);
}
#board[data-move-highlight] .sq.capture::after {
  border-color: var(--move-dot);
  background: none;
}

.side-nav a {
  color: var(--muted);
  box-shadow: inset 0 0 0 1px transparent;
  transition: color .15s, background .15s, box-shadow .15s;
}
.side-nav a:hover { color: var(--fg); }
.side-nav a.active { box-shadow: inset 0 0 0 1px #79323e; }
.side-nav a svg {
  flex: 0 0 1em;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-nav a span { font-weight: 600; }

button.profile-name:is(button) {
  display: inline;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  border-radius: 2px;
  overflow-wrap: anywhere;
}
#players .row button.profile-name,
#games .row button.profile-name { color: inherit; font: inherit; }
button.profile-name:hover { text-decoration: underline; text-underline-offset: 3px; }

#player-profile {
  width: min(560px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: clamp(15px, 4vw, 24px);
  border: 1px solid var(--line);
  background: #191b1f;
  color: var(--fg);
  overscroll-behavior: contain;
}
#player-profile::backdrop { background: #050507bb; }
.player-profile-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.player-profile-header .avatar { width: 44px; }
.player-profile-header h2 { margin: 0; overflow-wrap: anywhere; }
.player-profile-header p { margin: 4px 0 0; font-size: 13px; }
#player-profile-close { padding: 3px 11px; font-size: 23px; line-height: 1.2; }
#player-profile-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  background: #141518;
}
#player-profile-stats:empty { display: none; }
#player-profile-stats div { padding: 8px 1px; }
#player-profile-stats dt { font-size: clamp(10px, 2.8vw, 13px); color: var(--muted); }
#player-profile-stats dd { margin: 3px 0 0; font-weight: 700; }
#player-profile h3 { margin: 18px 0 3px; }
.profile-game { padding: 11px 0; justify-content: space-between; }
.profile-game strong { font-size: 14px; }
.profile-game small { display: block; margin-top: 3px; }
.profile-watch { flex: 0 0 auto; color: #ff7581; font-size: 13px; }
.profile-watch:hover { text-decoration: underline; }
#player-profile-message { color: var(--muted); font-size: 13px; }
#player-profile-message:empty { display: none; }
#player-profile-more { margin-top: 12px; }

/* The page, ranking, move list and dialogs all use the club's scrollbar colors. */
:root {
  --scroll-track: #141519;
  --scroll-thumb: #5d5662;
  --scroll-thumb-hover: #ad5262;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
@supports selector(::-webkit-scrollbar) {
  :root { scrollbar-color: auto; }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: var(--scroll-track); }
  ::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border: 2px solid var(--scroll-track);
    border-radius: 8px;
  }
  ::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active {
    background: var(--scroll-thumb-hover);
  }
  ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
}

.lobby-players, .lobby-details { display: contents; }

@media (min-width: 1380px) {
  .signed-in main:has(#lobby[data-view="salon"]:not(.hidden)) {
    max-width: none;
    padding-inline: clamp(32px, 3vw, 72px);
  }
  #lobby[data-view="salon"] {
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
    column-gap: clamp(24px, 2.5vw, 48px);
  }
  #lobby[data-view="salon"] .lobby-players,
  #lobby[data-view="salon"] .lobby-details {
    display: grid;
    align-content: start;
    gap: 24px;
    grid-row: 2;
    min-width: 0;
  }
  #lobby[data-view="salon"] .lobby-players { grid-column: 1; }
  #lobby[data-view="salon"] .lobby-details { grid-column: 2; }
  #lobby[data-view="salon"] :is(.lobby-players, .lobby-details) > section {
    grid-column: auto;
    grid-row: auto;
  }
  #lobby[data-view="salon"] .ranking-panel { margin: 0; }
  #lobby[data-view="salon"] .table-scroll { max-height: clamp(300px, 47svh, 580px); }
  #lobby[data-view="salon"] .games-panel {
    padding: 18px clamp(12px, 1.5vw, 24px);
    background: var(--panel);
    border-radius: 12px;
  }
  #lobby[data-view="salon"] .games-heading { flex-wrap: wrap; }
  #lobby[data-view="salon"] .game-matchup { flex-wrap: wrap; }
}
@media (min-width: 1600px) {
  #lobby[data-view="salon"] .ranking-table thead { display: table-header-group; }
  #lobby[data-view="salon"] .ranking-table :is(th,td):nth-child(n+4) { display: table-cell; }
}
@media (max-width: 850px) {
  #lobby .section-title, #lobby .games-heading { gap: 8px; }
  #lobby .game-copy, #lobby .player-filters { min-width: 0; }
  #game .game-layout { gap: 18px; }
  #game #board { max-width: 640px; margin-inline: auto; }
  #game .game-info { min-width: 0; }
}
@media (max-width: 480px) {
  #lobby[data-view="salon"] .ranking-panel { padding: 14px 10px; }
  #lobby .games-panel .game-row { gap: 8px; }
  #game .game-tools button { padding: 8px 9px; }
}

#floating-game {
  display: grid;
  gap: 6px;
  width: min(100%, max(280px, calc(100dvh - 132px)));
  padding: 8px;
  margin: auto;
}
#floating-game #board { margin: 0; }
#floating-game[data-player="false"] .sq,
#floating-game[data-reviewing="true"] .sq { cursor: default; }
.floating-player {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 13px;
}
.floating-player.floating-turn { background: #243a32; }
#floating-turn-status, #floating-notice { margin: 0; font-size: 13px; padding-inline: 6px; }
#floating-notice { color: #ff7581; }
#floating-notice:empty { display: none; }
.floating-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.floating-controls button { padding: 5px 8px; font-size: 12px; }

body.signed-in.standalone-game > :is(.header, footer),
body.signed-in.standalone-game #game #back { display: none; }
body.signed-in.standalone-game main { margin: 0 auto; padding: 12px; }
body.signed-in.standalone-game .notice { margin-inline: 12px; position: static; }
body.signed-in.standalone-game .game-layout { grid-template-columns: minmax(0, 1fr); }
body.signed-in.standalone-game #game .page-heading { gap: 8px; margin-bottom: 12px; }
body.signed-in.standalone-game #game h1 { font-size: 24px; }
