.activities-nav {display:flex;align-items:center;gap:10px;flex:none;margin:12px 10px 0;padding:9px 10px;border:1px solid #3a314b;border-radius:9px;background:#272235;color:#dfd1ff;text-align:left;font-weight:720}
.activities-nav:hover {background:#362a48;border-color:#54446c}
.activities-nav .icon {font-size:16px;color:#bca5ff}
.activity-badge {margin-left:auto;width:8px;height:8px;border-radius:50%;background:#b89cff;box-shadow:0 0 8px #b89cff8f}
.activity-dialog {width:min(900px,calc(100vw - 28px));max-height:calc(100dvh - 28px);background:#1c1b25;border-color:#443e53}
.activity-dialog::backdrop {background:#100e19ca}
.activity-dialog .dialog-heading {position:sticky;z-index:1;top:0;align-items:center;background:#211e2e;padding:14px 21px}
.activity-dialog .dialog-heading h2 {display:flex;align-items:center;gap:10px}
.activity-dialog .dialog-heading h2::before {content:'\2726';display:grid;place-items:center;width:31px;height:31px;border-radius:9px;background:#362a4f;color:#d0baff;font:18px/1 system-ui}
.activity-content {padding:20px}
.game-library {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.card-chess {--game-ink:#efc88e;--game-surface:#372a29;--game-line:#554239}
.card-fall {--game-ink:#cfb1fa;--game-surface:#2d2340;--game-line:#4a3965}
.card-merge {--game-ink:#cee59b;--game-surface:#262e28;--game-line:#454e38}
.card-grid {--game-ink:#a4dadf;--game-surface:#25313c;--game-line:#3b505c}
.game-card {min-height:175px;border:1px solid var(--game-line);border-radius:13px;position:relative;display:flex;text-align:left;align-items:center;overflow:hidden;padding:20px;gap:12px;background:linear-gradient(135deg,#23212c 5%,var(--game-surface));isolation:isolate;transition:border-color .15s,background .15s}
.game-card:hover {border-color:var(--game-ink);background:var(--game-surface)}
.game-card-copy {flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.game-card-copy small {font-size:11px;color:var(--game-ink);font-weight:700}
.game-card-copy strong {font:800 clamp(18px,3vw,25px)/1.2 var(--title);letter-spacing:-.025em}
.game-card-copy>span {color:#c6c1d3;font-size:12px;max-width:205px}
.game-card>.icon {position:absolute;right:14px;bottom:12px;color:var(--game-ink);font-size:15px}
.game-card-art {flex:none;display:grid;width:112px;aspect-ratio:1;align-content:center;justify-content:center;border:1px solid var(--game-line);border-radius:17px;transform:rotate(-8deg);background:#15141b85;box-shadow:0 7px 18px #07060e30}
.chess-art {grid-template-columns:repeat(2,35px);place-content:center;gap:3px;color:#efd0a6;font-size:38px;line-height:1.1}
.chess-art>span {display:grid;place-items:center;background:#5c4534;border-radius:5px}
.chess-art>span:nth-child(2) {margin-top:16px;background:#392e2e;color:#d49e75}
.merge-art {grid-template-columns:repeat(2,34px);gap:5px}
.merge-art>b {display:grid;place-items:center;aspect-ratio:1;border-radius:7px;background:#3c5138;color:#e1ecc3;font:800 16px var(--title)}
.merge-art>b:nth-child(2) {background:#527b4d}.merge-art>b:nth-child(3) {background:#92ac57;color:#20281b}.merge-art>b:nth-child(4) {background:#c8db7b;color:#29301c}
.tiles-art {grid-template-columns:repeat(5,13px);gap:3px}
.tiles-art>span {width:13px;height:13px;border-radius:3px;background:var(--tile,#302b3b)}
.card-grid .tiles-art {transform:rotate(8deg)}
.card-grid .tile-2 {--tile:#4fc3c0}.card-grid .tile-3 {--tile:#7ca9ef}.card-grid .tile-5 {--tile:#c4e4a1}
.tile-1 {--tile:#c6a9f0;--ink:#251941}.tile-2 {--tile:#6fc3df;--ink:#122331}.tile-3 {--tile:#a487e0;--ink:#211735}.tile-4 {--tile:#df8fb3;--ink:#3b152a}.tile-5 {--tile:#e5b174;--ink:#38200e}.tile-6 {--tile:#9cce99;--ink:#102810}
.tile-7 {--tile:#f28f70;--ink:#3b1a13}
.game-heading {display:flex;align-items:center;gap:15px;margin-bottom:16px}
.game-heading h3 {font:800 23px/1.2 var(--title);letter-spacing:-.03em}
.game-heading p {font-size:12px;color:var(--muted);margin-top:3px}
.activity-back {white-space:nowrap}
.game-layout {display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,245px);gap:15px;align-items:start}
.game-stage,.activity-leaders {background:#211f2c;border:1px solid #363244;border-radius:11px;min-width:0}
.game-stage {padding:14px;min-height:240px}
.activity-leaders {overflow:hidden}
.activity-leaders-title {display:flex;align-items:center;justify-content:space-between;padding:6px 10px 6px 13px;border-bottom:1px solid #363244}
.activity-leaders-title h3 {font:800 15px/1.18 var(--title)}
.activity-leaders-title .icon-btn {font-size:19px}
.activity-leaders-content>p {padding:14px;color:var(--muted);font-size:12px}
.activity-leaders-content>.button {margin:0 14px 14px}
.activity-leaders ol {padding:0;list-style:none;margin:0;max-height:395px;overflow:auto}
.activity-leaders li {display:flex;align-items:center;gap:7px;min-height:38px;padding:7px 9px;border-bottom:1px solid #302b3c;font-size:12px}
.activity-leaders li.activity-own {background:#322641}
.activity-leaders li>b {font-variant-numeric:tabular-nums;flex:none;color:#ddc8ff}
.rank-index {min-width:22px;flex:none;color:var(--muted);text-align:center}
.rank-person {flex:1;min-width:0}
.rank-person strong {display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rank-person small {display:block;color:var(--muted);font-size:9px}
.personal-record {display:flex;justify-content:space-between;gap:8px;padding:10px;color:var(--muted);font-size:12px}
.personal-record strong {color:#dcccfa}
.puzzle-ready {display:flex;min-height:242px;align-items:center;justify-content:center;flex-direction:column;gap:18px}
.puzzle-summary {display:flex;justify-content:space-between;align-items:center;padding-bottom:9px;max-width:365px;margin:auto}
.puzzle-summary>div>span {display:block;color:var(--muted);font-size:11px}
.puzzle-summary strong {font:800 24px/1.05 var(--title);font-variant-numeric:tabular-nums}
.next-piece {display:flex;gap:8px;align-items:center}
.mini-piece {display:grid;grid-template-columns:repeat(var(--piece-cols),var(--piece-width,8px));grid-template-rows:repeat(var(--piece-rows),var(--piece-height,8px));gap:var(--piece-gap-y,2px) var(--piece-gap-x,2px);flex:none}
.mini-piece>i {background:var(--tile);border-radius:2px}
.puzzle-board {width:min(100%,365px);display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));gap:3px;padding:6px;background:#16141e;border:1px solid #393349;border-radius:8px;margin:auto}
.board-fall {width:min(100%,238px,35dvh)}
.game-tile {min-width:0;aspect-ratio:1;display:grid;place-items:center;border:1px solid #ffffff0d;border-radius:4px;background:var(--tile,#272334);color:var(--ink,#eee8f7);font:800 clamp(13px,3vw,24px)/1 var(--title);padding:0}
.board-grid .game-tile {border-radius:3px}
.board-merge {position:relative;overflow:hidden}
.board-merge.merge-moving > .game-tile {background:#272334;color:transparent}
.merge-motion {position:absolute;inset:0;pointer-events:none}
.merge-motion .game-tile {position:absolute}
.game-tile.tile-preview {background:#8168a7;border-color:#c6abeb}
.game-tile.tile-ghost {border-color:#9d8eb48c;background:#3b314a}
.puzzle-controls,.piece-tray {display:flex;justify-content:center;gap:5px;flex-wrap:wrap;margin-top:10px}
.puzzle-controls>.button {min-height:32px;padding:4px 8px}
.piece-button {width:82px;min-height:62px;justify-content:center;padding:6px;--piece-width:clamp(12px,3vw,16px);--piece-height:var(--piece-width)}
.piece-button[aria-pressed=true] {background:#36284d;border-color:#a386d5}
.puzzle-footer,.chess-footer {display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0 0;font-size:12px}
.puzzle-footer p,.chess-footer p {color:#c4bdd2;flex:1;min-width:100px}
#puzzleActions {display:flex;gap:6px;flex-wrap:wrap}
#puzzleActions .button,.chess-footer .button {min-height:31px;padding:5px 8px;font-size:11px}
.chess-lobby {padding:14px}
.chess-lobby h4 {margin:0 0 7px;font:780 17px var(--title)}
.chess-lobby p {color:var(--muted);font-size:13px}
.chess-lobby-actions {display:flex;gap:8px;margin-top:13px}
.chess-opponents {list-style:none;padding:0;margin:6px 0 0;max-height:300px;overflow:auto}
.chess-opponents li {display:flex;align-items:center;gap:9px;border-bottom:1px solid #3a3447;padding:7px 0}
.chess-opponents strong,.chess-player strong {flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chess-opponents button {min-height:33px;padding:4px 7px;font-size:11px}
.chess-game {width:min(100%,390px,59dvh);margin:auto}
.chess-board {display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));overflow:hidden;border:1px solid #816f88;border-radius:6px;aspect-ratio:1;margin:5px 0}
.chess-square {display:grid;place-items:center;position:relative;border:0;border-radius:0;min-width:0;padding:0;line-height:1;font-family:'Segoe UI Symbol','DejaVu Sans',sans-serif;font-size:clamp(18px,4vw,39px);z-index:0}
.chess-square:focus-visible {outline-offset:-3px;z-index:1}
.light-square {background:#dac5dc;color:#2d2138}.dark-square {background:#7f698b;color:#281e30}
.chess-square.last-square {box-shadow:inset 0 0 0 3px #f4d48795}
.chess-square.selected-square {background:#aa8e44;box-shadow:inset 0 0 0 3px #efd88b}
.chess-square.legal-square::before {content:'';position:absolute;width:22%;aspect-ratio:1;border-radius:50%;background:#4b4124b3}
.chess-square.legal-square:has(span:not(:empty))::before {width:80%;background:transparent;border:3px solid #4b4124a3}
.chess-square span {z-index:1}
.chess-square small {position:absolute;font:740 9px/1 Inter,system-ui,sans-serif}
.chess-square .chess-rank {left:3px;top:3px}
.chess-square .chess-file {right:3px;bottom:3px}
.dark-square small {color:#f3e7f8}
.white-piece span {color:#fff2e3;text-shadow:0 0 1px #312539,1px 1px #402d46,-1px -1px #402d46}
.black-piece span {color:#24192b;text-shadow:0 1px #e0cbea85}
.chess-player {display:flex;align-items:center;gap:7px;padding:4px 6px;border-radius:5px;min-height:30px;font-size:11px;color:var(--muted)}
.chess-player strong {color:var(--text);font-size:12px}
.chess-player time {font:800 14px var(--title);font-variant-numeric:tabular-nums;color:#d1bedf;background:#333040;padding:2px 5px;border-radius:4px}
.chess-player.current-player time {color:#231931;background:#cdb2f2}
.chess-side {width:10px;height:10px;border-radius:3px;background:#e6d8e9;border:1px solid #bfaebe;flex:none}
.chess-side.black-side {background:#312338}
.backup-status {display:grid;gap:10px}
.backup-status code {display:block;overflow-wrap:anywhere;color:#e0d0f9;background:#1a1824;border:1px solid #383248;border-radius:7px;padding:8px}
@media (max-width:630px) {
  .game-layout {grid-template-columns:minmax(0,1fr)}
  .game-card {padding:12px;min-height:153px}
  .game-card-art {width:77px;scale:.82;transform-origin:center}
  .game-card-copy>span {font-size:11px}
  .activity-content {padding:12px}
}
@media (max-width:460px) {
  .game-library {gap:8px}
  .game-card {flex-direction:column-reverse;align-items:flex-start;min-height:208px}
  .game-card>.icon {right:8px;bottom:8px}
  .game-card-art {width:74px;margin-left:5px}
}

.piece-button {touch-action:none;user-select:none;cursor:grab}
.piece-button:active {cursor:grabbing}
.piece-button.piece-held .mini-piece {opacity:.24}
.piece-drag-ghost {position:fixed;z-index:8;pointer-events:none;opacity:.84;filter:drop-shadow(0 3px 8px #0d091b99)}
.piece-drag-ghost .mini-piece>i {border:1px solid #ffffff38;border-radius:3px}
.piece-drag-ghost.piece-blocked {opacity:.54}
.game-tile.tile-invalid {outline:2px solid #f29db0;outline-offset:-2px}

.card-poker {--game-ink:#a8e2c2;--game-surface:#233b32;--game-line:#3b5849}
.poker-art {grid-template-columns:repeat(2,30px);gap:4px}
.poker-art>b {background:#f6f0df;color:#202335;border-radius:4px;padding:7px 4px;font:800 15px/1.1 var(--title)}
.poker-art>b+b {color:#973b4a;transform:translateY(7px) rotate(10deg)}
.poker-stage {border:1px solid #3c394a;border-radius:12px;background:#211f2c;padding:14px}
.poker-tabs,.poker-actions,.poker-raise {display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.poker-tabs .button {flex:1}
.poker-tabs .button span {margin-inline-start:6px;font-size:11px;opacity:.8}
.poker-rules {font-size:12px;color:var(--muted);margin:10px 0}
.poker-felt {display:grid;justify-items:center;gap:12px;padding:14px 10px 10px;border:1px solid #416550;border-radius:24px;background:radial-gradient(ellipse at top,#254b3d,#18312a 78%)}
.poker-felt-title {width:100%;display:flex;justify-content:space-between;align-items:center;gap:8px;padding:0 8px;font-size:13px;color:#b9d7c9}
.poker-felt-title strong {color:#f1e4b8}
.poker-board,.poker-hole {display:flex;gap:5px;align-items:center}
.poker-card {display:inline-flex;flex-direction:column;justify-content:space-between;align-items:flex-start;width:39px;height:54px;padding:4px 5px;border:1px solid #fbf4e2;border-radius:6px;background:#f6f0df;color:#252338;font:800 17px/1 system-ui,sans-serif;box-shadow:0 2px 4px #0e10174a}
.poker-card-red {color:#a0394a}
.poker-card span {align-self:flex-end}
.poker-card-back {background:repeating-linear-gradient(135deg,#373650 0 3px,#4b4867 3px 6px);border-color:#8e81aa}
.poker-card-slot {background:#192e27;border:1px dashed #648677;box-shadow:none}
.poker-status {min-height:20px;color:#d6e7df;font-size:13px;text-align:center}
.poker-clock {display:inline-block;min-width:32px;margin-left:4px;font-variant-numeric:tabular-nums;color:#f1e4b8}
.poker-seats {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;list-style:none;margin:10px 0;padding:0}
.poker-player {min-width:0;padding:8px;border:1px solid #41394f;border-radius:8px;background:#2b2737}
.poker-player.poker-turn {border-color:#b7dbab;background:#2b4036}
.poker-player.poker-fold {opacity:.72}
.poker-player-top,.poker-badges {display:flex;align-items:center;gap:4px}
.poker-player-top strong {flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.poker-player-top small,.poker-stack span,.poker-player-state {color:var(--muted);font-size:11px}
.poker-badges span {padding:2px 3px;border-radius:4px;background:#48415a;font-size:9px;color:#ece1f8}
.poker-stack {font-size:13px;font-weight:700;font-variant-numeric:tabular-nums}
.poker-hole {margin:5px 0;gap:3px}
.poker-hole .poker-card {width:24px;height:33px;padding:2px 3px;font-size:11px;border-radius:4px}
.poker-winners {display:flex;flex-wrap:wrap;gap:6px;list-style:none;padding:0;margin:10px 0;color:#f1e4b8;font-size:13px}
.poker-winners>li {padding:6px 8px;border:1px solid #5b4a41;border-radius:6px;background:#352c2c;overflow-wrap:anywhere}
.poker-actions p {font-size:13px;color:var(--muted)}
.poker-leave {margin-inline-start:auto}
.poker-raise label {display:flex;gap:6px;align-items:center;font-size:12px}
.poker-raise input {width:80px}
@media (max-width:630px) {
  .poker-stage {padding:10px}
  .poker-seats {grid-template-columns:repeat(2,minmax(0,1fr))}
  .poker-tabs .button,.poker-actions .button {min-height:40px}
  .poker-leave {margin-inline-start:0}
}

.game-heading-copy {flex:1;min-width:0}
.game-heading h3:focus {outline:none}
.game-volume {flex:0 0 min(140px,22vw);display:grid;gap:4px;color:var(--muted);font-size:11px}
.game-volume>span {display:flex;justify-content:space-between;gap:6px;align-items:baseline}
.game-volume input {width:100%;min-width:0}
@media (max-width:520px) {
  .game-heading {flex-wrap:wrap}
  .game-heading-copy {flex-basis:50%}
  .game-volume {flex-basis:100%}
}
