/* cyrillic-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url(/assets/nunito-0.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url(/assets/nunito-1.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url(/assets/nunito-2.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url(/assets/nunito-3.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url(/assets/nunito-4.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root{font-family:'Nunito',ui-rounded,'Segoe UI',sans-serif;--bg:#eee8f7;--surface:#fcf9ff;--ink:#35234f;--muted:#8d739f;--line:#deceee;--violet:#7540c8;--violet-dark:#6532aa;--lilac:#ede0fa;--board:#f5f1fc}body{font-family:inherit}button,input,select{font-family:inherit}button{font-weight:800}h1,h2,h3,.brand{font-weight:900!important}.game-screen{gap:10px;background:none;padding-bottom:12px}.player-strip{padding:0;gap:12px;min-height:70px}.player-card{min-width:0;max-width:none;background:#e8def4;border:1px solid #d9c8eb;border-radius:19px;padding:9px 14px 9px 9px;box-shadow:0 3px 0 #ded1ed;gap:11px}.player-card.active,.player-card.is-you{background:#fffaff;border:2px solid #a57ad5;box-shadow:0 3px 0 #cdb5e6}.player-name{font-size:15px;font-weight:800}.player-name:after,.active-player-dot,.tile-number,.rack-label,.turn-pill:before{display:none!important}.player-sub{font-size:10px;color:#9377aa;font-weight:700}.player-score,.player-card.active .player-score{font-size:36px;font-weight:900;color:#6c37b5}.illustrated-avatar{width:46px!important;height:46px!important;border-radius:16px!important;padding:0!important;background:transparent!important;overflow:hidden;flex-shrink:0}.illustrated-avatar svg,.illustrated-avatar img{display:block;width:100%;height:100%;object-fit:cover}.illustrated-avatar[role=button]{cursor:pointer}.board-area{background:var(--board);border:2px solid #c5a9e2;border-radius:24px;box-shadow:0 4px 0 #dbcbe9;margin:0;min-height:100px}.canvas-wrap{min-height:60px}.board-area.is-your-turn{box-shadow:0 0 0 3px #ba94e523,0 4px 0 #dbcbe9}.board-status{padding:8px 10px 0;min-height:36px}.turn-pill,.bag-pill{background:#fffaff;color:#7546a4;font-weight:900;font-size:12px;border:0;border-radius:11px}.turn-pill.waiting{background:#fff5d5;color:#9a741b}.board-tools{left:12px;right:auto;bottom:12px;background:#fffaff;border:1px solid #d9c8eb;padding:4px;gap:4px;box-shadow:0 3px 0 #d9c8eb80}.board-tools .icon-button{background:#eee4f9;border-radius:10px;color:#7650a0}.board-tools i{display:none}.hand-panel{display:grid!important;grid-template-columns:minmax(0,1fr) 94px;grid-template-rows:auto 41px;gap:10px 16px;min-height:0!important;padding:13px!important;background:#fbf8ff;border:1px solid #dccbec;border-radius:23px;box-shadow:0 4px 0 #d9c6e9;width:100%;max-width:none;align-items:center}.hand-main{grid-column:1;grid-row:1;padding:0;min-width:0;width:100%;max-width:none}.hand-actions{display:contents!important}.rack{display:flex!important;flex-wrap:nowrap;justify-content:flex-start;gap:9px;max-width:530px;width:100%;padding:0;min-height:0}.rack .tile{width:calc((100% - 45px)/6);height:auto;flex:1;aspect-ratio:1;max-width:80px;border:1px solid #e0d3ed;border-bottom:4px solid #d6c5e7;border-radius:14px;box-shadow:0 2px 4px #67428a0b;touch-action:none}.rack .tile-face{inset:13%}.rack .tile:before,.tile.selected:after{display:none}.rack .tile.selected{transform:none;outline:3px solid #9b63e4;outline-offset:1px}.rack .tile.dragging{opacity:.55;outline:3px solid #9b63e4}.minor-actions{grid-column:1;grid-row:2;justify-self:start;justify-content:flex-start;gap:7px;margin:0;max-width:100%;overflow-x:auto}.minor-actions .text-button{width:auto;height:39px;min-height:39px;padding:7px 11px;border:1px solid #ddc9f0;border-bottom:3px solid #d1b6e7;border-radius:12px;background:#eee3fa;color:#7442a4;font-size:12px;font-weight:800;flex-shrink:0;gap:6px}.minor-actions .text-button .icon{width:20px;height:20px;stroke-width:2.4}.minor-actions .text-button>span{display:inline}.minor-actions #hint,.minor-actions #exchange,.minor-actions #pass{font-size:0;padding:7px;width:38px}.minor-actions #exchange>span{display:none}#commit,body[data-theme=night] #commit{grid-column:2;grid-row:1/3;align-self:stretch;width:100%!important;min-width:0!important;height:auto;min-height:100px;padding:0;margin:0;background:#43bc79;color:white;border:2px solid #24965c;border-bottom:6px solid #187944;border-radius:29px;box-shadow:0 4px 0 #d5e9d9}#commit>span{display:none!important}#commit .icon{width:42px;height:42px;stroke-width:3.3}#commit.waiting,#commit.waiting:disabled,body[data-theme=night] #commit.waiting{opacity:1;background:#f5cb55;border-color:#d8ae36;border-bottom-color:#c69a25;color:#8b6515;box-shadow:0 4px 0 #e7d9b7}#commit:disabled:not(.waiting){opacity:.45}.move-error,.preview-score,.preview-score.has-score{display:none!important}.icon-button,.soft-button{color:#7650a0;border:1px solid #e2d6ef;background:#faf7ff;border-radius:12px;box-shadow:0 2px 0 #dfd1ed}.icon-button .icon{stroke-width:2.2}.text-button{font-weight:800}.button{font-weight:900;font-size:15px}.play-card,.lobby-card{border:1px solid #dccbec;box-shadow:0 4px 0 #d9c6e9;background:#fbf8ff}.button-sun:not(#commit){background:#7540c8;border-bottom:4px solid #52238d}.quick-message{font-weight:800;font-size:12px;background:#eee3fa;color:#71409f;border:1px solid #dbc4f0;border-bottom-width:3px;border-radius:12px}.toast{top:max(8px,env(safe-area-inset-top));bottom:auto!important;left:50%;right:auto;transform:translate(-50%,-100px);min-width:0;width:min(530px,calc(100vw - 24px));font-size:13px;font-weight:800;border-radius:12px;padding:10px 14px;cursor:pointer;pointer-events:auto}.toast.show{transform:translate(-50%,0)}.toast[data-kind=error]{background:#fff0f3;color:#b43d54;border:1px solid #edb1bf}.score-burst{font-size:16px!important;color:#218454!important;background:#e7f5ed;border-radius:10px;padding:7px 11px;top:8px!important;left:50%;text-shadow:none!important}.avatar-dialog{width:min(380px,calc(100vw - 28px));border:2px solid #d7bfe9;border-radius:24px;background:var(--surface);padding:20px}.avatar-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:20px 0}.avatar-option{padding:0;aspect-ratio:1;border:3px solid white;outline:1px solid #e0d0ef;border-radius:24px;overflow:hidden;cursor:pointer}.avatar-option svg{display:block;width:100%;height:100%}.avatar-option:hover{outline:3px solid #9763d6}.upload-photo{display:flex;align-items:center;justify-content:center;padding:13px;background:#7540c8;color:white;border-bottom:4px solid #51228c;border-radius:14px;font-weight:900;cursor:pointer}.google-photo{width:100%;margin-top:8px;font-size:13px}
body[data-theme=night]{--bg:#21182e;--surface:#30233e;--ink:#f2eafa;--muted:#b6a0ca;--line:#533c6b;--board:#332944;--lilac:#47315e;--violet-dark:#cfadf5;background:var(--bg)}body[data-theme=night] .player-card{background:#362743;border-color:#694b86}body[data-theme=night] .player-card.active,body[data-theme=night] .player-card.is-you{background:#40304f;border-color:#a87cd5}body[data-theme=night] .player-score,body[data-theme=night] .player-card.active .player-score{color:#dec2ff}body[data-theme=night] .hand-panel,body[data-theme=night] .play-card,body[data-theme=night] .lobby-card{background:#30233e;border-color:#674985;box-shadow:0 3px 0 #171020}body[data-theme=night] .minor-actions .text-button,body[data-theme=night] .icon-button,body[data-theme=night] .board-tools,body[data-theme=night] .turn-pill,body[data-theme=night] .bag-pill{background:#49335e;color:#ddbcff;border-color:#6a4a87;box-shadow:none}body[data-theme=night] .board-area{border-color:#73508f;box-shadow:0 3px 0 #171020}body[data-theme=night] .board-area.is-your-turn{box-shadow:0 0 0 3px #c58bff30,0 3px 0 #171020}
@media(max-width:800px) and (orientation:portrait){.game-screen{gap:8px;padding:0 9px 10px}.player-strip{gap:8px;min-height:60px}.player-card{padding:7px;gap:7px;border-radius:16px}.player-name{font-size:12px}.player-sub{font-size:9px}.player-score,.player-card.active .player-score{font-size:30px}.player-card .illustrated-avatar{width:36px!important;height:36px!important;border-radius:12px!important}.board-area{border-radius:19px}.hand-panel{grid-template-columns:minmax(0,1fr) 65px;grid-template-rows:auto 37px;padding:9px!important;gap:8px 10px;border-radius:20px}.rack{gap:4px}.rack .tile{width:calc((100% - 20px)/6);min-width:0;height:auto;max-width:none;border-radius:9px;border-bottom-width:3px}.rack .tile-face{inset:11%}#commit,body[data-theme=night] #commit{min-height:86px;border-radius:24px;border-bottom-width:5px}#commit .icon,.hand-actions #commit .icon{width:31px;height:31px}.minor-actions{gap:5px}.minor-actions .text-button{font-size:11px;height:35px;min-height:35px;padding:5px 8px;gap:5px}.minor-actions .text-button .icon{width:18px;height:18px}.minor-actions #hint,.minor-actions #exchange,.minor-actions #pass{width:29px;padding:5px;font-size:0}.turn-pill,.bag-pill{font-size:10px}.board-tools{left:10px;bottom:10px}.board-tools .icon-button{width:29px;height:29px}.game-screen.chat-open .hand-panel{min-height:0}.player-strip:has(.player-card:nth-child(3)){min-height:0}.player-strip:has(.player-card:nth-child(3)) .player-card{max-width:none;min-width:0}.player-strip:has(.player-card:nth-child(3)) .illustrated-avatar{width:28px!important;height:28px!important}}
.player-card .illustrated-avatar{display:block!important}.player-card.is-you:before,.player-name:before{display:none!important}body[data-view=game]{background:var(--bg)!important}.minor-actions #undo,.minor-actions #shuffle{font-size:12px!important;width:auto!important}.minor-actions #undo{min-width:74px}.minor-actions #shuffle{min-width:84px}.player-sub{display:none!important}.board-area::after{animation:none!important;opacity:.15}.board-area:not(.is-your-turn)::after{opacity:0}.minor-actions #exchange{margin-left:0}.minor-actions{overflow-x:auto;max-width:100%;scrollbar-width:none}.minor-actions::-webkit-scrollbar{display:none}
@media(max-width:800px) and (orientation:portrait){.minor-actions #undo,.minor-actions #shuffle{font-size:11px!important;min-width:0!important}.minor-actions{gap:4px}.minor-actions .text-button{padding-left:6px;padding-right:6px}.minor-actions #hint,.minor-actions #exchange,.minor-actions #pass{width:27px;min-width:27px}.player-card .illustrated-avatar{display:block!important}}
/* Controls repair: keep the score visible inside the large confirmation button. */
#board{--grid-color:#9475b326;touch-action:none;user-select:none;display:block;max-width:100%;max-height:100%}body[data-theme=night] #board{--grid-color:#bba0d52b}.canvas-wrap{overflow:hidden;position:relative}.rack .tile.selected,.rack .tile.dragging{outline-width:1.5px;outline-color:#9b72cd;outline-offset:1px}.rack .tile.selected{box-shadow:0 0 0 3px #a781ce15}.rack .tile.exchange-selected{outline:1.5px solid #ca9b35;outline-offset:1px}.rack .tile.exchange-selected:after{display:none!important}.tile-face{pointer-events:none}
.hand-panel .preview-score{display:none!important}.hand-panel .preview-score.has-score{display:flex!important;grid-column:2;grid-row:1 / 3;align-self:start;justify-self:center;align-items:center;justify-content:center;position:relative!important;top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;order:initial!important;margin:13px 0 0!important;padding:0 2px;width:100%;height:20px;min-height:0;background:transparent!important;color:white!important;font-size:13px;font-weight:900;line-height:1;white-space:nowrap;opacity:1!important;z-index:3;pointer-events:none}.hand-panel:has(.preview-score.has-score) #commit>.icon{transform:translateY(10px)}.hand-panel:has(#commit.waiting) .preview-score.has-score{color:#795814!important}
.minor-actions #shuffle>.icon{stroke-width:1.9}.minor-actions #exchange>.icon{stroke-width:1.9}.minor-actions .text-button{border-bottom-width:2px;box-shadow:none}.minor-actions #exchange{background:#e3edf9;border-color:#c4d6ed;color:#48749e}.minor-actions #undo{background:#efe5f8}.minor-actions #shuffle{background:#ede6fa}.board-tools .icon-button{touch-action:manipulation}.board-tools .icon-button:disabled{opacity:.35;pointer-events:none}.board-area{border-width:1px}.board-area::after{border-width:1px!important;box-shadow:none!important}
.history-panel{z-index:20;background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:14px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 10px 35px #39214d20}.history-panel .drawer-heading{flex-shrink:0;margin:0 0 8px;min-height:38px;display:flex;align-items:center;justify-content:space-between}.history-panel .drawer-heading h2{font-size:18px;margin:0;font-weight:800!important}#history{overflow-y:auto;overscroll-behavior:contain;min-height:0;flex:1}.history-row{display:flex;align-items:center;gap:12px;padding:12px 2px;border-bottom:1px solid var(--line);min-height:62px}.history-row:last-child{border-bottom:0}.history-content{flex:1;min-width:0}.history-line{display:flex;align-items:center;gap:8px;min-width:0}.history-number{font-size:10px;font-weight:700;color:var(--muted);width:18px;flex-shrink:0}.history-name{font-size:13px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-row .history-description{display:block;font-size:11px;color:var(--muted);line-height:1.5;margin:3px 0 0 26px}.history-row .history-points{font-size:16px;min-width:42px;text-align:center;padding:7px;border-radius:10px;align-self:center;flex-shrink:0;color:var(--violet-dark);background:var(--lilac)}.history-tiles{display:flex;gap:4px;margin:8px 0 0 26px}.history-tiles .tile{width:25px!important;height:25px!important;aspect-ratio:1;border:1px solid var(--line);border-radius:6px;background:white;box-shadow:none;transform:none!important;opacity:1;cursor:default;pointer-events:none}.history-tiles .tile-face{inset:4px}.history-tiles .tile:before,.history-tiles .tile:after{display:none}.history-panel.hidden{display:none!important}.last-move-name{max-width:38%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.last-move-text{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.last-move-score{flex-shrink:0}.last-move{gap:7px!important}.last-move-slot{min-height:0}
@media(max-width:800px) and (orientation:portrait){.hand-panel .preview-score.has-score{font-size:11px;margin-top:9px!important;height:16px}.hand-panel:has(.preview-score.has-score) #commit>.icon{transform:translateY(9px)}.history-panel,.game-screen:has(.last-move:not(.hidden)) .history-panel,body[data-layout=compact] .game-screen:has(.last-move:not(.hidden)) .history-panel{position:absolute;top:46px;right:9px;left:9px;bottom:120px;width:auto;max-width:none;border-radius:18px}.history-tiles .tile{width:24px!important;height:24px!important}}
body[data-theme=night] .minor-actions #exchange{background:#2d405b;border-color:#49617b;color:#b0d0f0}
/* Keep settings in the same control row as chat and history on every game layout. */
body[data-view=game] .game-topline{padding-right:0!important}.game-topline>#settingsButton{position:static!important;inset:auto!important;transform:none;flex:0 0 40px;width:40px;height:40px;min-height:40px;padding:10px;margin:0 0 0 4px;align-self:center;border-radius:12px;background:var(--surface);border:1px solid var(--line);box-shadow:none;color:var(--violet-dark)}.game-topline>#settingsButton .icon{width:19px;height:19px}body[data-view=game] .app-header .header-actions:empty{display:none}
@media(max-width:800px) and (orientation:portrait){.game-topline{gap:4px}.game-topline>#settingsButton{flex-basis:40px;width:40px;height:44px;min-height:44px;margin-left:2px}.game-topline #historyButton{flex-shrink:0}}

.brand-app-icon{display:block;width:32px;height:32px;flex-shrink:0;border-radius:9px;object-fit:cover}body[data-view=game] .app-header .brand-app-icon{display:none}

/* Saved matches: compact, touch-friendly cards in the home flow. */
.open-games{grid-column:1/-1;width:min(100%,480px);justify-self:center;padding:8px 0 24px}.open-games-heading{display:flex;align-items:center;justify-content:space-between;margin:0 4px 12px}.open-games-heading h2{font-size:18px;margin:0}.open-games-heading .icon-button{width:34px;height:34px}#openGamesList{display:grid;gap:10px}.open-game-card{width:100%;display:flex;align-items:center;gap:12px;text-align:left;padding:14px;border:1px solid var(--line);border-radius:18px;background:var(--surface);color:var(--ink);cursor:pointer;box-shadow:0 3px 0 #70429e12}.open-game-card:hover{border-color:#a57ad5}.open-game-art{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:var(--lilac);color:var(--violet-dark);flex-shrink:0}.open-game-content{flex:1;min-width:0;display:grid;gap:3px}.open-game-content b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px}.open-game-content small{font-size:12px;color:var(--muted)}.open-game-card>.icon{width:20px}.timeout-count{display:inline-block;margin-left:5px;font-size:10px;color:#bd6d26}.player-card.eliminated{opacity:.5}.danger-text{color:#bf4761!important}
body:is([data-view=home],[data-view=hub]) .home-screen{height:auto;min-height:0;align-content:start}@media(max-width:800px){.open-games{padding:8px 4px 24px}}
/* Reserve all six hand slots, even when the bag is empty. */
.hand-panel .rack{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr));align-items:start}
.hand-panel .rack .tile{width:100%!important;min-width:0;max-width:none;flex:none;aspect-ratio:1;height:auto!important}
.avatar-preview{width:104px;height:104px;margin:18px auto}.avatar-preview svg{width:100%;height:100%}.avatar-choices{grid-template-columns:repeat(6,1fr);gap:7px;margin:18px 0}.avatar-option{border-radius:14px;border-width:2px}.avatar-option[aria-pressed=true]{outline:2px solid var(--violet);outline-offset:2px}.avatar-colors{display:grid;grid-template-columns:repeat(8,1fr);gap:8px;margin:18px 0 24px}.avatar-color{aspect-ratio:1;border:3px solid var(--surface);border-radius:50%;outline:1px solid var(--line);cursor:pointer}.avatar-color[aria-pressed=true]{outline:2px solid var(--ink);outline-offset:2px}.avatar-status{font-size:12px;color:#bd405a}.profile-preview-button{display:flex;align-items:center;gap:12px;background:var(--lilac);border:1px solid var(--line);color:var(--ink);border-radius:16px;padding:10px;width:100%;margin:12px 0;cursor:pointer}.profile-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:18px 0}.profile-stat{text-align:center;padding:12px 4px;background:var(--lilac);border-radius:14px}.profile-stat b{display:block;font-size:28px;color:var(--violet-dark)}.profile-stat small{font-size:11px;color:var(--muted)}.match-archive{grid-column:1/-1;width:min(100%,480px);justify-self:center;padding:0 4px 24px}.match-archive h2{font-size:18px;margin:0 0 12px}.saved-match{display:flex;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:16px;background:var(--surface);margin:8px 0;width:100%;text-align:left;color:var(--ink);cursor:pointer}.saved-match span{flex:1;min-width:0}.saved-match small{display:block;color:var(--muted);font-size:11px}.saved-match strong{color:var(--violet-dark);white-space:nowrap}.profile-dialog{width:min(420px,calc(100vw - 24px));max-height:85dvh;overflow:auto}.profile-dialog .history-row{font-size:13px}.player-card .illustrated-avatar[role=button]:focus-visible{outline:2px solid var(--violet);outline-offset:3px}
/* Drag transforms never affect the six-slot rack or the board's layout. */
.rack .tile{will-change:auto}.rack .tile.drag-source{opacity:.16!important;transition:opacity 100ms;outline:none!important}.rack .tile{transition:transform 150ms cubic-bezier(.2,.8,.2,1),opacity 140ms,box-shadow 140ms}.drag-ghost{position:fixed!important;left:0;top:0;z-index:10000;pointer-events:none!important;transform-origin:top left;margin:0!important;min-width:0!important;max-width:none!important;opacity:1!important;border:1px solid #c3a5e0!important;border-bottom:4px solid #b79bd0!important;border-radius:12px!important;background:#fffefd!important;box-shadow:0 12px 26px #37204a38!important;will-change:transform}.drag-ghost .tile-face{inset:12%}.drag-ghost .tile-number,.drag-ghost:before,.drag-ghost:after{display:none!important}.tile-drag-active,.tile-drag-active *{cursor:grabbing!important;user-select:none!important}.friend-entry{display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--line);padding:12px 0}.friend-entry .friend-name{flex:1;min-width:0}.friend-entry .friend-name b{display:block;font-size:14px;overflow:hidden;text-overflow:ellipsis}.friend-entry small{font-size:11px;color:var(--muted)}.friend-entry .icon-button{width:38px;height:38px;flex-shrink:0}.friends-form{display:flex;gap:8px;margin:16px 0}.friends-form input{min-width:0;flex:1}.friends-form button{flex:0 0 46px}.friend-heading{font-size:13px;color:var(--muted);margin:18px 0 4px}.friends-status{font-size:12px;color:var(--muted)}#friendsButton{position:relative}#friendsButton.has-unread:after{content:'';position:absolute;right:6px;top:4px;width:7px;height:7px;border-radius:50%;background:#e99b49}.friend-invite{background:var(--lilac);border-radius:14px;padding:12px;margin:8px 0}.timeout-wait{position:absolute;top:44px;left:12px;right:12px;z-index:5;padding:9px 12px;border-radius:12px;background:var(--surface);color:var(--muted);text-align:center;font-size:12px;border:1px solid var(--line);pointer-events:none}.timeout-choice{width:min(390px,calc(100vw - 28px));border-radius:22px}.timeout-choice .dialog-actions{display:grid;grid-template-columns:1fr;gap:10px}.timeout-choice p{font-size:14px}.timeout-choice .button{min-height:48px}@media(prefers-reduced-motion:reduce){.rack .tile,.drag-ghost{transition:none!important}}body[data-motion=reduced] .rack .tile{transition:none!important}
/* Conversation is a page of the game, sharing its bottom action button. */
.hand-main #chatForm{display:none}
.game-screen.chat-open{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr) auto!important;gap:10px!important}
.game-screen.chat-open>.last-move-slot,.game-screen.chat-open>.player-strip,.game-screen.chat-open>.board-area{display:none!important}
.game-screen.chat-open>.game-topline{grid-row:1;margin:0!important}
.game-screen.chat-open #gameMode{font-size:0}.game-screen.chat-open #gameMode:after{content:'SOHBET';font-size:11px;letter-spacing:1.2px}
.game-screen.chat-open #historyButton,.game-screen.chat-open #chatButton,.game-screen.chat-open #gameCode{display:none!important}
.game-screen.chat-open>.chat-panel{position:relative!important;inset:auto!important;grid-row:2;order:0!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;display:grid!important;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;margin:0!important;padding:0!important;border:1px solid var(--line);border-radius:22px;background:var(--surface);box-shadow:none!important}
.conversation-heading{display:flex;align-items:center;gap:10px;padding:13px 16px;border-bottom:1px solid var(--line);min-width:0}.conversation-heading>div{min-width:0;flex:1}.conversation-heading h2{font-size:19px;line-height:1.2;margin:0 0 3px;font-weight:850}.conversation-heading small{display:block;font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conversation-mark{color:#a994cc}.conversation-mark .icon{width:25px;height:25px}
.game-screen.chat-open .chat-messages{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-height:0;height:auto;overflow-y:auto;overscroll-behavior:contain;padding:16px clamp(12px,4vw,40px);background:radial-gradient(ellipse at top,#a887df0b,transparent 65%);scrollbar-width:thin}
.game-screen.chat-open .chat-message{flex:none;max-width:min(82%,460px);min-width:85px;margin:0;padding:10px 13px 7px;border:1px solid var(--line);border-radius:5px 17px 17px 17px;background:var(--surface);color:var(--ink);box-shadow:0 2px 3px #24163204;text-align:left;overflow-wrap:anywhere}
.game-screen.chat-open .chat-message.own{align-self:flex-end;background:#eee5ff;border-color:#dfd0f5;border-radius:17px 5px 17px 17px;color:#36234e}.game-screen.chat-open .chat-message strong{display:block;font-size:10px;letter-spacing:.1px;color:#8764ac;margin-bottom:4px}.game-screen.chat-open .chat-message.own strong{display:none}.game-screen.chat-open .chat-message p{font-size:14px;line-height:1.45;margin:0;white-space:pre-wrap}.chat-message time{display:block;text-align:right;font-size:9px;color:var(--muted);margin-top:4px;line-height:1.2}.conversation-date{align-self:center;font-size:10px;font-weight:750;color:var(--muted);padding:4px 11px;margin:2px 0 7px;border-radius:12px;background:#9685af10}.conversation-empty{margin:auto;text-align:center;color:var(--muted);font-size:13px}.conversation-empty>.icon{width:44px;height:44px;color:#ad96ce;margin:auto}.conversation-empty p{margin:10px 0}
.game-screen.chat-open .quick-messages{display:flex;flex-wrap:nowrap!important;overflow-x:auto;gap:7px;padding:10px 12px;border-top:1px solid var(--line);scrollbar-width:none;min-width:0}.game-screen.chat-open .quick-message{flex:none;width:auto!important;height:34px!important;border-radius:12px;display:flex;gap:6px;align-items:center;padding:0 10px!important;border:1px solid var(--line);background:var(--surface);font-size:11px;color:var(--muted)}.game-screen.chat-open .quick-label{display:inline!important;font-size:11px}.game-screen.chat-open .quick-message .icon{width:15px;height:15px}
.game-screen.chat-open>.hand-panel{grid-row:3;order:0!important;display:grid!important;grid-template-columns:minmax(0,1fr) 68px!important;grid-template-rows:minmax(62px,auto)!important;padding:9px!important;min-height:0!important;gap:8px!important;margin:0!important;align-items:center;border-radius:21px}
.game-screen.chat-open .hand-main{grid-column:1!important;grid-row:1!important;width:100%;min-width:0}.game-screen.chat-open .hand-actions{display:contents!important}.game-screen.chat-open #commit{grid-column:2!important;grid-row:1!important;width:68px!important;height:62px!important;min-height:62px!important;border-radius:19px!important;align-self:end!important}.game-screen.chat-open #commit .icon{width:28px;height:28px}.game-screen.chat-open .rack-label,.game-screen.chat-open #rack,.game-screen.chat-open .minor-actions,.game-screen.chat-open #previewScore,.game-screen.chat-open #coach,.game-screen.chat-open #moveError{display:none!important}
.game-screen.chat-open .hand-main #chatForm{display:flex!important;margin:0;padding:0;border:0;min-width:0;width:100%}.game-screen.chat-open #chatInput{box-sizing:border-box;width:100%;min-width:0;min-height:54px;max-height:100px;resize:none;font:inherit;font-size:16px;line-height:22px;border-radius:14px;padding:15px 13px;border:1px solid var(--line);color:var(--ink);background:var(--surface);outline:none}.game-screen.chat-open #chatInput:focus{border-color:#af8bdd;box-shadow:0 0 0 2px #af8bdd18}
body[data-theme=night] .game-screen.chat-open .chat-message.own{background:#453258;border-color:#624777;color:#f6edff}body[data-theme=night] .game-screen.chat-open .chat-message strong{color:#c3a6e4}
.message-arrive{animation:message-in .18s ease-out}@keyframes message-in{from{opacity:.3;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}
@media(max-height:500px){.conversation-heading{padding:7px 12px}.game-screen.chat-open .quick-messages{padding:5px 10px}.game-screen.chat-open{gap:5px!important}}
@media(prefers-reduced-motion:reduce){.message-arrive{animation:none}}body[data-motion=reduced] .message-arrive{animation:none}
.game-screen.chat-open{grid-template-rows:minmax(0,1fr) auto!important}.game-screen.chat-open>.game-topline{display:none!important}.game-screen.chat-open>.chat-panel{grid-row:1}.game-screen.chat-open>.hand-panel{grid-row:2}.conversation-heading #settingsButton{margin-left:2px}.conversation-mark{display:none}
#bagButton{cursor:pointer;display:inline-flex;align-items:center;gap:5px;font-family:inherit}#bagButton:focus-visible{outline:2px solid var(--violet);outline-offset:3px}
dialog.tile-inventory{box-sizing:border-box;position:fixed;inset:auto 0 0;margin:0 auto;width:min(100%,620px);max-width:100%;height:min(52dvh,470px);max-height:calc(100dvh - 12px);padding:16px 16px max(12px,env(safe-area-inset-bottom));border:1px solid var(--line);border-radius:24px 24px 0 0;background:var(--surface);color:var(--ink);box-shadow:0 -8px 40px #2e1b4b18;overflow:hidden}dialog.tile-inventory[open]{display:flex;flex-direction:column;gap:10px}.tile-inventory .drawer-heading{flex:none;gap:10px;margin:0}.tile-inventory h2{font-size:18px;margin:0}.tile-inventory small{font-size:11px;color:var(--muted)}#inventoryTotal{margin-left:auto;white-space:nowrap;font-size:12px;color:var(--muted)}.tile-inventory .icon-button{flex:none;width:36px;height:36px}.tile-inventory table{width:100%;height:100%;min-height:0;table-layout:fixed;border-collapse:separate;border-spacing:4px;overflow:hidden}.tile-inventory td{padding:2px;text-align:center;border-radius:10px;background:color-mix(in srgb,var(--ink) 4%,var(--surface));border:1px solid var(--line);vertical-align:middle}.inventory-symbol{display:inline-flex;width:clamp(17px,3.1dvh,27px);height:clamp(17px,3.1dvh,27px);vertical-align:middle}.inventory-symbol svg{width:100%;height:100%}.tile-inventory td b{display:inline-block;vertical-align:middle;font-size:13px;margin-left:4px;min-width:9px}.tile-inventory .depleted{opacity:.3}body[data-theme=night] .inventory-symbol{background:#fff9f2;border-radius:5px;padding:2px}@media(max-height:500px){dialog.tile-inventory{height:90dvh}.tile-inventory table{border-spacing:3px}.tile-inventory .drawer-heading{gap:6px}.inventory-symbol{width:16px;height:16px}}
#bagButton{pointer-events:auto;position:relative;z-index:2;min-height:30px;padding:5px 9px}
.tile-inventory .dialog-close{position:static!important;inset:auto!important;margin:0!important}.tile-inventory .drawer-heading>div{flex:1;min-width:0}.tile-inventory .drawer-heading{display:flex;align-items:center}
/* Clear dialog flow and touch-friendly actions. */
dialog{box-sizing:border-box;max-width:calc(100vw - 24px);max-height:calc(var(--app-height,100dvh) - 24px);overflow-y:auto;overscroll-behavior:contain}dialog .drawer-heading{display:flex;align-items:center;gap:12px;margin-bottom:16px}dialog .drawer-heading h2{flex:1;min-width:0;margin:0;line-height:1.2}dialog .drawer-heading>.icon-button{position:static!important;inset:auto!important;flex:0 0 40px;width:40px;height:40px;margin:0 0 0 auto!important}dialog .dialog-actions{display:flex;flex-wrap:wrap;gap:10px}dialog .dialog-actions>.button{flex:1 1 120px;min-height:46px;min-width:0;white-space:normal}
#messageActions[open]{display:flex;flex-direction:column;gap:10px;width:min(380px,calc(100vw - 24px));padding:22px}#messageActions .drawer-heading{margin:0}#messageActions p{margin:0}#messageActions #reportPreview{max-height:110px;overflow:auto;flex-shrink:0}#messageActions #reportReason{margin:0;flex:none}#messageActions #reportMessage,#messageActions #blockPlayer{flex:none;width:100%;min-height:46px;position:static;margin:0;display:flex;align-items:center;justify-content:center;border-radius:13px}#messageActions #blockPlayer{border:1px solid var(--line);background:var(--surface);color:var(--ink)}
.profile-heading{display:grid;grid-template-columns:minmax(0,1fr) auto auto;column-gap:10px;row-gap:8px;align-items:center;margin-bottom:6px}.profile-heading label{min-width:0}.profile-heading .text-button{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;min-height:40px;padding:4px 0}.profile-heading .icon{flex:none}.account-footer{flex-wrap:wrap}.account-footer>*{min-height:40px;max-width:100%}.friend-entry .friend-name{overflow:hidden}.friend-entry .friend-name b{white-space:nowrap}.friend-entry .icon-button{position:static;flex-shrink:0}
#resignButton{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;min-height:49px;margin:15px 0 10px;padding:12px 16px;border:1px solid #dba0ac;border-bottom:3px solid #c57383;border-radius:14px;background:#fce9ed;color:#9b2946;font-size:15px;font-weight:850;cursor:pointer;opacity:1}#resignButton .icon{width:21px;height:21px}#confirmResign{background:#be3b57;color:#fff;border:1px solid #a82b46;border-bottom:3px solid #8c2037}body[data-theme=night] #resignButton{background:#522b3b;border-color:#94546a;color:#ffd6df}.resign-button:active{transform:translateY(1px)}
.saved-match[data-outcome=win]{background:#eaf6ec;border-color:#c6dfcd}.saved-match[data-outcome=loss]{background:#faecee;border-color:#eacdd3}.saved-match[data-outcome=draw]{background:#fff6d9;border-color:#e9dcae}.saved-match[data-outcome=win] strong{color:#34784f}.saved-match[data-outcome=loss] strong{color:#a45366}.saved-match[data-outcome=draw] strong{color:#8c742d}body[data-theme=night] .saved-match[data-outcome=win]{background:#243c33;border-color:#3a594a}body[data-theme=night] .saved-match[data-outcome=loss]{background:#452e38;border-color:#69414e}body[data-theme=night] .saved-match[data-outcome=draw]{background:#443e29;border-color:#685f3f}body[data-theme=night] .saved-match[data-outcome=win] strong{color:#a6d5b5}body[data-theme=night] .saved-match[data-outcome=loss] strong{color:#e3a4b4}body[data-theme=night] .saved-match[data-outcome=draw] strong{color:#e6d596}
.score-spark{position:fixed;z-index:1200;width:6px;height:6px;border-radius:2px;pointer-events:none;will-change:transform,opacity}.rack .tile:active:not(.used){filter:brightness(1.03)}@media(prefers-reduced-motion:no-preference){body[data-motion=full] .brand-tiles .tile{animation:hello-tiles .45s ease-out both}body[data-motion=full] .brand-tiles .tile:nth-child(2){animation-delay:40ms}body[data-motion=full] .brand-tiles .tile:nth-child(3){animation-delay:80ms}body[data-motion=full] .brand-tiles .tile:nth-child(4){animation-delay:120ms}body[data-motion=full] .brand-tiles .tile:nth-child(5){animation-delay:160ms}body[data-motion=full] .brand-tiles .tile:nth-child(6){animation-delay:200ms}}@keyframes hello-tiles{from{opacity:0;transform:translateY(9px) rotate(-7deg)}to{opacity:1;transform:none}}
@media(max-width:360px){.profile-heading{column-gap:8px}.profile-heading label{font-size:11px}.profile-heading .text-button{font-size:11px}.friend-entry{gap:7px}}
/* Small screens use normal document flow; tile art never overlaps the menu. */
body:is([data-view=home],[data-view=hub]) .home-screen{display:flex!important;flex-direction:column;align-items:stretch;gap:16px;min-height:0;height:auto;overflow:visible;padding-top:14px}body:is([data-view=home],[data-view=hub]) .home-story{position:static!important;inset:auto!important;transform:none!important;height:auto!important;min-height:0;flex:0 0 auto;margin:0!important;padding:0!important;isolation:isolate}body:is([data-view=home],[data-view=hub]) .brand-tiles{position:static!important;display:flex!important;justify-content:center;align-items:center;gap:7px;height:40px;min-height:40px;margin:0!important;transform:none!important;padding:0;overflow:hidden;flex-wrap:nowrap}body:is([data-view=home],[data-view=hub]) .brand-tiles .tile{position:relative!important;inset:auto!important;width:34px!important;height:34px!important;flex:0 0 34px;min-width:0;margin:0!important;transform:none!important;animation:none!important}body:is([data-view=home],[data-view=hub]) .play-card{position:relative;flex:0 0 auto;min-height:0;margin:0!important;z-index:auto}body:is([data-view=home],[data-view=hub]) .open-games,body:is([data-view=home],[data-view=hub]) .match-archive{flex:0 0 auto}.rack .tile-face{inset:7%!important}.tile-face{inset:7%}.player-card.active .player-name{color:#23834e!important}.player-card.active .player-sub{color:#3c8a5e}
.minor-actions #shuffle{font-size:0!important;width:38px!important;padding:7px!important}.minor-actions #shuffle .icon{width:22px;height:22px}.minor-actions #exchange{font-size:11px!important;width:auto!important;padding:7px 10px!important;white-space:nowrap}.minor-actions #exchange>span{display:inline!important}.minor-actions{scrollbar-width:none}
.match-detail-dialog{width:min(880px,calc(100vw - 24px));}.match-board-view{height:clamp(220px,45dvh,480px);width:100%;overflow:auto;background:#f5f1fc;border:1px solid var(--line);border-radius:17px;overscroll-behavior:contain;touch-action:pan-x pan-y}.match-board-content{width:100%;height:100%;min-width:100%;min-height:100%}.match-board-content>svg{display:block;width:100%;height:100%}.snapshot-controls{display:flex;justify-content:center;gap:8px;margin:12px 0 0}.snapshot-controls .icon-button{width:42px;height:42px}
.rule-card{padding:12px 0;border-bottom:1px solid var(--line)}.rule-card h3{font-size:14px;margin:0 0 10px}.rule-card p{font-size:12px;line-height:1.5;color:var(--muted);margin:10px 0}.rule-card .rule-example{display:flex;gap:4px;margin:0;flex-wrap:nowrap;justify-content:flex-start}.rule-card .tile{width:calc((100% - 20px)/6);max-width:43px;aspect-ratio:1;height:auto;flex:0 1 43px}.rule-card .tile-face{inset:6%}.rule-bad .tile:last-child{outline:2px solid #d8778b;outline-offset:1px;opacity:.65}.rule-cross{display:grid;grid-template-columns:repeat(3,38px);grid-template-rows:repeat(3,38px);gap:4px;justify-content:center}.rule-cross .tile{width:38px;height:38px}.rule-cross .example-new{outline:2px dashed #8d62c1;outline-offset:1px}.rules-dialog>.rules-done{margin-top:16px}.avatar-option{aspect-ratio:1;padding:0;overflow:hidden}.avatar-choices{grid-template-columns:repeat(3,1fr)!important;gap:10px}.avatar-option svg{display:block;width:100%;height:100%}.avatar-dialog{width:min(380px,calc(100vw - 24px))}
@media(min-width:801px){body:is([data-view=home],[data-view=hub]) .home-screen{max-width:520px;margin:0 auto;padding-bottom:28px}}@media(max-width:360px){body:is([data-view=home],[data-view=hub]) .home-screen{gap:10px;padding-left:12px;padding-right:12px}.minor-actions .text-button{padding-left:7px;padding-right:7px}.minor-actions #exchange{font-size:10px!important;padding:7px!important}}
.match-detail-dialog .saved-match{padding:8px;margin:6px 0;gap:8px}.match-detail-dialog .saved-match .illustrated-avatar{width:36px!important;height:36px!important}.match-detail-dialog .saved-match span{font-size:13px}.match-detail-dialog .saved-match small{font-size:10px}.match-board-view{height:clamp(180px,36dvh,400px)}
.minor-actions #exchange>span{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:nowrap}.minor-actions #shuffle{min-width:0!important}.minor-actions #exchange{flex-shrink:0;gap:4px}.minor-actions #shuffle>span{display:none!important}@media(max-width:360px){.minor-actions{gap:3px}.minor-actions #undo{width:32px!important;min-width:32px!important;padding:5px!important}.minor-actions #undo>span{display:none}.minor-actions #shuffle{width:32px!important;padding:5px!important}.minor-actions #hint{width:28px;min-width:28px;padding:4px}.minor-actions #exchange{padding:5px!important}}
@media(max-width:360px){.minor-actions #undo{font-size:0!important}}
