.remote-entry{display:flex;align-items:center;justify-content:space-between;gap:24px;background:#e7ebda;border:1px solid #c4cdb1;padding:24px 28px;border-radius:17px;margin:-20px 0 40px}.remote-entry h2{font:700 25px 'Manrope',sans-serif;letter-spacing:-.8px;margin:6px 0}.remote-entry p{font-size:13px;color:var(--muted);margin:0}.remote-entry .primary{white-space:nowrap}.remote-header{align-items:center}.remote-header h2{font-size:22px}.remote-sync{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;padding:10px 18px;border-bottom:1px solid var(--line);font-size:10px;background:#edf0e3}.remote-sync.offline{background:#f5e0e0;color:#8d3652}.remote-sync-dot{width:7px;height:7px;background:#709452;border-radius:50%}.remote-sync.offline .remote-sync-dot{background:#ac536c}.remote-body{min-height:440px}.remote-body input{text-align:left}.remote-forms{display:grid;grid-template-columns:1fr 1fr;gap:18px;text-align:left}.remote-form-card{background:var(--cream);padding:23px;border:1px solid var(--line);border-radius:16px}.remote-form-card h3{font-size:22px;margin-top:0}.remote-form-card p{font-size:12px;margin:10px 0 20px}.remote-form-card label{display:block;font-size:12px;margin:15px 0 7px;font-weight:600}.remote-form-card .primary{width:100%;font-size:13px;margin-top:20px}.remote-error{color:#9d345b;font-size:13px;margin:14px 0;min-height:20px}.remote-small{font-size:11px!important;color:var(--muted);line-height:1.7!important}.remote-code{font:700 31px 'Manrope',sans-serif;letter-spacing:2px;background:var(--cream);border:1px dashed #9fae7a;border-radius:12px;padding:18px;margin:20px auto;max-width:430px;user-select:all}.remote-people{display:flex;justify-content:center;gap:12px;margin:15px 0 25px}.remote-person{background:var(--cream);border:1px solid var(--line);padding:13px 24px;border-radius:12px;min-width:130px;font-size:13px;max-width:47%;overflow-wrap:anywhere}.remote-person small{display:block;color:var(--muted);font-size:10px;margin-top:4px}.remote-person.active{background:#e6edcf;border-color:#a5b77e}.remote-game-list{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:25px}.remote-game-choice{background:var(--cream);border:1px solid var(--line);padding:18px 12px;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;font-size:12px;font-weight:600;line-height:1.4}.remote-game-choice>span{font:32px Georgia,serif}.remote-game-choice small{font-weight:400;color:var(--muted);font-size:10px}.remote-wait{background:#eef0e5;border:1px solid #d7dec6;border-radius:14px;padding:23px;margin:25px auto;max-width:520px}.remote-wait p{margin:8px 0!important}.remote-turn{display:inline-block;font-size:10px;letter-spacing:1px;border:1px solid #aebc92;background:#e5ebd4;padding:7px 12px;border-radius:30px;margin-bottom:12px}.remote-turn.other-turn{background:#efece5;border-color:var(--line)}.remote-table{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:22px 0}.remote-table>div{padding:18px;background:var(--cream);border-radius:11px;border:1px solid var(--line)}.remote-table small{display:block;font-size:11px;color:var(--muted)}.remote-table b{font-size:23px;display:block;margin-top:5px}.remote-footer{display:flex;justify-content:center;gap:12px;padding:15px;border-top:1px solid var(--line)}.remote-footer button{font-size:11px;padding:8px;background:transparent;color:var(--muted)}.remote-body .choice-grid.one-col{grid-template-columns:1fr}.remote-body .choice.selected{pointer-events:none}.remote-body .word-scramble{font-size:30px}.remote-modal-notice{max-width:550px;margin:22px auto 0;font-size:11px;line-height:1.65;color:var(--muted)}.remote-reaction-pad{width:100%;min-height:180px;background:#d8d0f0;border-radius:15px;font:700 28px 'Manrope',sans-serif;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;touch-action:manipulation;margin:22px 0}.remote-reaction-pad.wait{background:var(--pink)}.remote-reaction-pad.go{background:var(--green)}.remote-reaction-pad small{font:12px 'DM Sans',sans-serif}.remote-instructions{padding:16px 21px;border:1px solid var(--line);background:#f0f0e6;border-radius:13px;font-size:12px;text-align:left;margin:16px auto 23px;max-width:540px}.remote-instructions summary{cursor:pointer;font-weight:600}.remote-instructions p{font-size:12px;margin-bottom:0}.remote-body .story-output{font-size:18px}.remote-body .primary,.remote-body .secondary{max-width:100%}.remote-choice-state{font-size:11px;margin:10px;color:#6b794d}.remote-result-label{font-size:11px;color:var(--muted)}@media(max-width:600px){.remote-entry{padding:22px;flex-direction:column;align-items:flex-start;gap:17px;margin-top:5px}.remote-entry h2{font-size:23px}.remote-entry .primary{font-size:12px;padding:12px 18px;min-height:45px}.remote-forms{grid-template-columns:1fr}.remote-form-card{padding:20px}.remote-game-list{grid-template-columns:1fr 1fr}.remote-code{font-size:22px;letter-spacing:1px}.remote-person{padding:12px 16px;min-width:110px}.remote-header h2{font-size:19px}.remote-body .word-scramble{font-size:26px;letter-spacing:3px}.remote-sync{font-size:9px}.remote-footer{gap:6px}.remote-body .game-content h3{font-size:24px}}
.remote-sync[hidden],.remote-footer[hidden]{display:none!important}
/* Live room: visual rhythm without making play feel rushed. */
.remote-game-hud{display:flex;align-items:center;gap:16px;text-align:left;background:linear-gradient(125deg,#eee4ef,#edf0df);border:1px solid #dedbd0;padding:13px 18px;border-radius:18px;margin:0 0 22px}.remote-hud-art{width:84px;height:66px;flex:0 0 84px;overflow:hidden}.remote-hud-art svg{width:100%;height:100%}.remote-game-hud .eyebrow{font-size:8px;letter-spacing:1.2px}.remote-elapsed{display:block;font:700 28px 'Manrope',sans-serif;font-variant-numeric:tabular-nums;letter-spacing:-1px;margin-top:4px}.remote-round-orbit{margin-left:auto;width:53px;height:53px;border:1px solid #b8bca5;border-radius:50%;display:flex;align-items:center;justify-content:center;gap:1px;flex-direction:column;flex-shrink:0}.remote-round-orbit b{font-size:20px}.remote-round-orbit small{font-size:9px;color:var(--muted)}.remote-progress-track{height:5px;background:#e6e2d8;border-radius:9px;overflow:hidden;margin:-4px 0 19px}.remote-progress-track i{display:block;height:100%;border-radius:9px;background:#8d9f6f;transition:width .35s ease}.remote-game-list{gap:13px}.remote-game-choice{overflow:hidden;transition:transform .2s,box-shadow .2s;position:relative;padding-top:8px}.remote-game-choice:hover{transform:translateY(-3px);box-shadow:0 8px 18px #302d2810;border-color:#b4be9c}.remote-game-choice .remote-game-art{width:100%;height:85px;display:block;background:#f0e9df;border-radius:8px}.remote-game-choice .remote-game-art svg{width:100%;height:100%}.remote-game-choice:nth-child(3n+2) .remote-game-art{background:#ebe3f0}.remote-game-choice:nth-child(3n+3) .remote-game-art{background:#e6ecd9}.remote-person.active{box-shadow:inset 0 0 0 3px #fff6}.waiting-hearts{display:inline-flex;gap:8px;font-size:30px}.waiting-hearts i{font-style:normal;animation:heart-breathe 1.8s ease-in-out infinite}.waiting-hearts i:nth-child(2){animation-delay:.45s;color:#b55d79}.remote-countdown{--time-left:1;display:flex;align-items:center;flex-wrap:wrap;gap:14px;max-width:350px;padding:16px 20px;margin:20px auto 28px;border:1px solid #c5d1ad;background:#edf1e2;border-radius:20px;text-align:left;font-variant-numeric:tabular-nums}.clock-orbit{height:50px;width:50px;display:grid;place-items:center;border-radius:50%;background:conic-gradient(#72864c calc(var(--time-left)*360deg),#d6ddc7 0);position:relative}.clock-orbit:before{content:'';position:absolute;inset:4px;background:#edf1e2;border-radius:50%}.clock-orbit span{position:relative;font-size:24px}.clock-readout small{font-size:8px;letter-spacing:1.4px;color:#596843;display:block}.clock-value{display:block;font:700 33px 'Manrope',sans-serif;letter-spacing:-1.3px}.clock-value span{font:500 14px 'DM Sans',sans-serif;letter-spacing:0;margin-left:5px}.clock-track{height:5px;flex-basis:100%;border-radius:5px;background:#d6ddc7;overflow:hidden}.clock-track i{display:block;width:100%;height:100%;background:#72864c;transform:scaleX(var(--time-left));transform-origin:left;will-change:transform}.remote-countdown.low{background:#fae8ec;border-color:#d7a2b3}.remote-countdown.low .clock-orbit{background:conic-gradient(#b44e73 calc(var(--time-left)*360deg),#e8c6d1 0)}.remote-countdown.low .clock-orbit:before{background:#fae8ec}.remote-countdown.low .clock-track i{background:#b44e73}.remote-countdown.low .clock-readout small{color:#96395a}.remote-body .result-board .cell{display:grid;place-items:center}.remote-body .cell:not(:empty),.remote-body .memory-card:not(.hidden-card){animation:tile-arrive .24s ease-out}.remote-body .result-icon{animation:result-arrive .45s ease-out}.remote-reaction-pad{transition:background .05s,box-shadow .05s}.remote-reaction-pad.go{box-shadow:0 0 0 8px #b6ca8033}.remote-sync-dot{box-shadow:0 0 0 3px #70945218}.remote-sync.offline .remote-sync-dot{box-shadow:none}
@keyframes heart-breathe{50%{transform:translateY(-3px) scale(1.1)}}@keyframes tile-arrive{from{transform:scale(.92);opacity:.4}to{transform:scale(1);opacity:1}}@keyframes result-arrive{from{transform:scale(.65) rotate(-15deg);opacity:0}to{transform:scale(1);opacity:1}}
@media(max-width:600px){.remote-game-hud{gap:11px;padding:11px 12px}.remote-hud-art{width:62px;flex-basis:62px;height:54px}.remote-elapsed{font-size:25px}.remote-game-hud .eyebrow{font-size:7px;letter-spacing:.7px}.remote-round-orbit{width:43px;height:43px}.remote-countdown{max-width:290px;padding:14px 17px}.remote-game-choice .remote-game-art{height:78px}.remote-game-choice{font-size:11px}.remote-body .progress-row{font-size:8px;gap:6px}.remote-sync{padding:10px 12px;gap:6px}.remote-footer button{min-height:42px}}
@media(prefers-reduced-motion:reduce){.waiting-hearts i,.remote-body .cell,.remote-body .memory-card,.remote-body .result-icon{animation:none!important}.remote-progress-track i,.remote-game-choice{transition:none}.remote-game-choice:hover{transform:none}}
/* Immediate local acknowledgement; confirmation remains server-owned. */
.remote-body .move-pending{outline:2px dashed #8b9e68;outline-offset:3px;opacity:.65;transition:none!important}.remote-body .cell.move-pending{animation:none!important}.remote-body .choice.move-pending{background:#e5ebd4;border-color:#8b9e68}
/* Duel Night keeps match points distinct from the score inside each game. */
.duel-invite{position:relative;overflow:hidden;background:#2c3440;color:#fff9ed;border-radius:22px;padding:28px 24px;margin:26px 0 32px;text-align:center;border:1px solid #414c58}.duel-invite h3{color:#fff9ed;font-size:39px;margin:12px 0}.duel-invite p{color:#e5e4de;font-size:14px}.duel-invite .game-badge{background:#45515d;border-color:#637078;color:#f5e7ae}.duel-invite .primary{background:#ead791;color:#2c3440;margin-top:5px}.duel-invite>small{display:block;color:#c9cec7;font-size:10px;line-height:1.6;margin-top:16px}.duel-cup{font:58px Georgia,serif;color:#b39648;line-height:1.15;margin:8px 0 15px}.duel-invite .duel-cup{color:#e9cf86;position:absolute;top:11px;right:20px;font-size:45px;transform:rotate(12deg);opacity:.65}.duel-mini-roster{display:flex;justify-content:center;gap:13px;flex-wrap:wrap;font-size:11px;margin:22px 0}.duel-mini-roster span{border:1px solid #667177;border-radius:99px;padding:7px 10px}.duel-scoring{font-size:12px!important;line-height:1.8!important}.duel-library-label{font-size:10px;letter-spacing:1.5px;color:var(--muted);display:flex;align-items:center;gap:15px;margin:30px 0 8px}.duel-library-label:before,.duel-library-label:after{content:'';height:1px;background:var(--line);flex:1}.guest-invite h3{font-size:29px}.duel-scoreboard{background:#2c3440;color:#fff9ed;border-radius:17px;padding:15px 16px 17px;margin:0 0 24px;text-align:left}.duel-score-top{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:8px;letter-spacing:1px;color:#e6d7a6;border-bottom:1px solid #626973;padding-bottom:12px;margin-bottom:13px}.duel-score-players{display:grid;grid-template-columns:1fr 1fr;gap:12px}.duel-player{display:flex;align-items:center;gap:9px;min-width:0;padding:7px 8px;border:1px solid transparent;border-radius:11px}.duel-player.champion{border-color:#cfb96c;background:#41463d}.duel-avatar{height:30px;width:30px;border-radius:50%;background:#d4b2bb;color:#39332b;display:grid;place-items:center;font-size:21px;flex-shrink:0}.duel-player:nth-child(2) .duel-avatar{background:#bac997}.duel-player>div{min-width:0;flex:1}.duel-player b{font-size:12px;overflow-wrap:anywhere;display:block}.duel-player small{display:block;font-size:7px;letter-spacing:.8px;color:#d1d3cb;margin-top:4px}.duel-player strong{font:700 30px 'Manrope',sans-serif;text-align:center;line-height:1;flex-shrink:0}.duel-player strong small{font:8px 'DM Sans',sans-serif;letter-spacing:0}.duel-history{display:grid;gap:9px;margin:22px auto;text-align:left;max-width:540px}.duel-history-row{display:flex;gap:12px;align-items:center;padding:14px 16px;background:#f1eee6;border:1px solid var(--line);border-radius:12px}.duel-history-row.current{border-color:#bca563;background:#f4eedb}.duel-history-number{display:grid;place-items:center;border:1px solid #d3c8a8;border-radius:50%;width:27px;height:27px;flex-shrink:0;font-size:11px}.duel-history-row>div{flex:1;min-width:0}.duel-history-row b{font-size:12px;overflow-wrap:anywhere}.duel-history-row small{font-size:10px;display:block;color:var(--muted);margin-top:6px;line-height:1.5}.duel-history-row>span:last-child{font:700 17px 'Manrope',sans-serif;white-space:nowrap}.duel-ready-players{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:25px 0 18px}.duel-ready-players span{padding:9px 12px;border:1px solid var(--line);border-radius:30px;background:#eeeae1;font-size:10px}.duel-ready-players .is-ready{background:#e3ebd0;border-color:#a3b57f;color:#455b2a}.duel-next{background:#eee5f0;border-radius:16px;padding:18px 22px;margin:25px 0}.duel-next>small{letter-spacing:1.5px;font-size:9px}.duel-next h3{font-size:24px;margin:10px 0}.duel-next p{font-size:12px;margin-bottom:0}.duel-game-score>small{font-size:9px;letter-spacing:1px;color:var(--muted)}.duel-game-score .remote-table{margin:9px 0 22px}.duel-game-score .remote-table>div{padding:10px}.duel-game-score .remote-table b{font-size:21px}.remote-body .result-board .cell{display:grid;place-items:center}.duel-ready-players+button{min-height:47px}
@media(max-width:600px){.duel-invite{padding:25px 17px}.duel-invite h3{font-size:33px}.duel-invite .duel-cup{right:12px;font-size:32px}.duel-mini-roster{gap:6px;font-size:9px}.duel-mini-roster span{padding:6px 8px}.duel-scoreboard{padding:13px 10px}.duel-score-players{gap:5px}.duel-player{padding:5px 2px;gap:6px}.duel-avatar{width:23px;height:23px;font-size:17px}.duel-player b{font-size:10px}.duel-player strong{font-size:25px}.duel-player strong small{font-size:7px}.duel-player small{font-size:6px}.duel-score-top{font-size:7px;letter-spacing:.6px}.duel-history-row{padding:12px 10px;gap:9px}.duel-history-row b{font-size:11px}.duel-history-row>span:last-child{font-size:14px}.duel-next{padding:17px}.duel-next h3{font-size:23px}}
/* Joining stays separate from reconnecting another saved player on this browser. */
.remote-invite-forms{display:flex;flex-direction:column;max-width:520px;margin-inline:auto}.remote-create-option{text-align:left}.remote-create-option>summary{cursor:pointer;padding:15px 4px;font-size:13px;min-height:44px}.remote-create-option[open]>summary{margin-bottom:5px}.remote-saved{border:1px solid var(--line);border-radius:18px;padding:20px;margin:20px auto 26px;max-width:650px;background:#eeeee3}.remote-saved h3{font-size:20px;margin:0 0 8px}.remote-saved p{font-size:12px}.remote-saved-list{display:grid;gap:10px}.remote-saved-list button{display:flex;flex-wrap:wrap;gap:7px;justify-content:space-between;text-align:left;min-height:48px;white-space:normal}.remote-saved-list strong{font-size:12px;overflow-wrap:anywhere}.remote-saved-list span{font-size:11px;letter-spacing:.5px}.remote-form-card>small{display:block;margin:8px 0 18px;color:var(--muted);font-size:11px;line-height:1.6}.remote-form-card label span{font-weight:400;color:var(--muted)}.remote-error:not(:empty){padding:12px 15px;border:1px solid #cfac91;border-radius:10px;background:#fcf0e6;line-height:1.6;margin:18px 0}.remote-footer{flex-wrap:wrap}.remote-body :is(button,summary,input):focus-visible{outline:3px solid #72834a;outline-offset:3px}
.remote-expiry{font-size:10px;color:var(--muted);flex-basis:100%;text-align:center;padding-top:2px}
/* Live DOM updates preserve the player's viewport explicitly. */
#remoteDialog{overflow-anchor:none}

@media(max-width:600px){
  .game-shell:has([data-game=mindcards]) .remote-sync{padding:6px 14px;font-size:11px;line-height:1.4;gap:6px}
  .remote-body[data-game=mindcards]{min-height:0}
  .remote-body[data-game=mindcards] .remote-table{margin:10px 0;gap:8px}
  .remote-body[data-game=mindcards] .remote-table>div{padding:10px;min-width:0;overflow-wrap:anywhere}
}
.remote-room-details { display: grid; gap: 2px; text-align: left; }
.remote-room-details strong { font-size: 18px; }
.remote-room-details .remote-expiry { font-size: 12px; color: var(--muted); text-align: left; }
#remoteDialog .remote-header { position: sticky; top: 0; z-index: 12; flex-shrink: 0; background: var(--bg); }
.remote-header > #remoteRoomMenu { margin-left: auto; }
.remote-header > #remoteRoomMenu:not([hidden]) + .dialog-play-settings { margin-left: 0; }
#remoteRoomMenu > summary { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 8px; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); font-size: 12px; font-weight: 700; cursor: pointer; }
#remoteRoomMenu > summary::-webkit-details-marker { display: none; }
#remoteRoomMenu[open] > summary { background: #e5ebda; border-color: #8b9c72; }
#remoteRoomMenu .remote-room-menu-panel { position: absolute; top: calc(100% + 6px); right: 12px; width: min(340px, calc(100% - 24px)); max-height: calc(100dvh - 106px); overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--cream); box-shadow: 0 12px 32px #27282026; overscroll-behavior: contain; }
#remoteRoomMenu .remote-footer { display: flex; flex-direction: column; align-items: stretch; padding: 0; gap: 14px; border: 0; }
#remoteRoomMenu .remote-room-actions { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
#remoteRoomMenu .remote-room-actions button { min-height: 48px; padding: 12px; text-align: left; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--cream); }
#remoteRoomMenu .remote-room-actions button + button { border-top: 1px solid var(--line); }
#remoteRoomMenu .remote-room-actions .remote-room-end { color: #96395a; background: #fae8ec; }
#remoteRoomMenu .session-scores { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
#remoteRoomMenu .session-scores summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-size: 13px; }
#remoteRoomMenu .session-score-note { font-size: 11px; line-height: 1.5; }
#remoteRoomMenu .session-score-list { max-height: none; overflow: visible; }
#remoteRoomMenu .session-score-record { padding: 10px; }
.memory-ready { max-width: 480px; margin: auto; }
.memory-ready .intro-rules { margin: 14px auto; }
@media (max-width: 600px) {
  .remote-playing .memory-ready .duel-ready-players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 10px 0; }
  .remote-playing .memory-ready .duel-ready-players span { padding: 8px; font-size: 11px; }
  .remote-playing .memory-ready .remote-wait { margin: 12px auto; padding: 12px; }
}

#remoteResultActions[hidden] { display: none; }
.remote-result-actions {
  position: sticky;
  bottom: 0;
  z-index: 6;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
  text-align: center;
}
.remote-result-actions p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.remote-result-actions > div { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.remote-result-actions button { min-height: 44px; padding: 8px 14px; font-size: 13px; }
.remote-result-actions .remote-result-exit { color: #96395a; background: #fae8ec; }
#remoteDialog:has(#remoteResultActions:not([hidden])) #remoteBody { min-height: 0; }
@media (max-width: 600px) {
  #remoteDialog:has(#remoteResultActions:not([hidden])) #remoteBody { padding: 12px 16px; }
  #remoteDialog:has(#remoteResultActions:not([hidden])) .remote-game-hud,
  #remoteDialog:has(#remoteResultActions:not([hidden])) .remote-body > :is(.result-icon, .victory-friends, .celebrate-button) {
    display: none;
  }
  .remote-result-actions { padding-inline: 8px; }
  .remote-result-actions > div { gap: 5px; }
  .remote-result-actions button { padding-inline: 8px; }
}
