.duopuzzle-room{--pair-ink:#3d4f52;--pair-blue:#46757d;--pair-copper:#a06c47;--pair-paper:#f5f0e4;width:100%;max-width:1280px;margin:auto;color:var(--pair-ink)}
.game-shell.wide:has(.duopuzzle-room) .play{width:100%;margin:0 auto;align-self:start}
.game-shell .play .duopuzzle-room .session-banner{max-width:none;margin:0 0 1rem;text-align:left}
.game-shell.wide .play .duopuzzle-room h2{font-size:clamp(1.6rem,2.3vw,2.55rem);line-height:1.25;text-align:left}
.game-shell.wide .play .duopuzzle-room .session-banner .meta{margin-inline:0;text-align:left}
.game-shell .play .duopuzzle-room p{text-align:left;line-height:1.6}
.game-shell .play .duopuzzle-room button{min-height:44px;white-space:normal}
.duopuzzle-room .actions{justify-content:flex-start}
.duopuzzle-desk{display:grid;grid-template-columns:minmax(0,1fr) minmax(235px,.35fr);gap:2rem;align-items:start}
.duopuzzle-board{display:grid;grid-template-columns:repeat(var(--pair-columns),minmax(0,1fr));grid-auto-rows:130px;gap:9px;max-width:900px;scroll-margin-top:65px}
.game-shell .play .duopuzzle-room .duopuzzle-card{position:relative;width:100%;height:100%;padding:19px 7px 8px;display:grid;place-items:center;border:1px solid #aca998;border-bottom:4px solid #b8b29e;border-radius:5px;background:#e8e3d5;color:#3d4f52;box-shadow:2px 3px 0 #d7d8cb;overflow:hidden;cursor:pointer}
.duopuzzle-coordinate{position:absolute;top:5px;left:7px;font:550 .75rem ui-monospace,monospace;color:#646f63;z-index:1}
.duopuzzle-back{position:absolute;inset:20px 10px 12px;display:flex;align-items:center;justify-content:center;border:1px solid #bcb49e;border-radius:3px;background:repeating-linear-gradient(45deg,transparent 0 7px,#d5d2bf55 8px 9px)}
.duopuzzle-back>i{display:block;width:24px;height:35px;border:1px solid #acaa91;border-radius:50%;transform:rotate(-25deg);background:#e9e6d8}
.duopuzzle-back>i:last-child{margin-left:-10px;transform:rotate(25deg)}
.duopuzzle-front{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.4rem;width:100%;height:100%;transform-origin:center}
.duopuzzle-front.is-fresh{animation:pair-front-in .17s ease-out}
.duopuzzle-motif{display:block;flex:none;width:54px;height:54px;color:#3d4f52}
.duopuzzle-front strong{display:block;max-width:100%;font-size:1rem;line-height:1.2;font-weight:600;overflow-wrap:anywhere;hyphens:auto}
.game-shell .play .duopuzzle-room .duopuzzle-card[data-duopuzzle-state=open]{background:#faf6e9;border-bottom-color:#9c8b6e}
.game-shell .play .duopuzzle-room .duopuzzle-card[data-duopuzzle-state=claimed]{background:#edf1e5;border-color:#88a4a1;border-bottom-color:#46757d}
.game-shell .play .duopuzzle-room .duopuzzle-card[data-duopuzzle-owner="1"]{background:#f4ecdd;border-color:#b39b7d;border-bottom-color:#a06c47}
.game-shell .play .duopuzzle-room .duopuzzle-card:disabled{cursor:default;opacity:1}
.duopuzzle-owner{position:absolute;top:3px;right:5px;padding:1px 4px;font:750 .75rem ui-monospace,monospace;color:#fff;background:#46757d;border-radius:2px}
[data-duopuzzle-owner="1"] .duopuzzle-owner{background:#9b6844}
.duopuzzle-rail{text-align:left;padding:.2rem 0}
.duopuzzle-scores{display:flex;gap:1rem;margin:0 0 1.2rem;text-align:left}
.duopuzzle-scores>div{display:flex;align-items:baseline;gap:.7rem;padding:.7rem .9rem;border:1px solid #c1c9bb;background:#f2f4eb;min-width:105px}
.duopuzzle-scores>div[data-active=true]{border-bottom:4px solid #46757d}
.duopuzzle-scores>div[data-duopuzzle-score-side="1"][data-active=true]{border-bottom-color:#a06c47}
.duopuzzle-scores span{font-size:.9rem}.duopuzzle-scores strong{font:650 1.8rem ui-monospace,monospace}
.duopuzzle-turn{min-height:150px;border-top:1px solid #c2c8b8;padding-top:.7rem}
.duopuzzle-turn h3{font-size:1.15rem;line-height:1.4;margin:.3rem 0 .6rem;text-align:left}
.game-shell .play .duopuzzle-room .duopuzzle-turn p{font-size:.95rem;margin:.5rem 0;overflow-wrap:anywhere}
.game-shell .play .duopuzzle-room .duopuzzle-remaining{font-size:.85rem;color:#5e6d5f;margin:.8rem 0}
.duopuzzle-phase-action{min-height:68px;margin:.5rem 0 .6rem}
.duopuzzle-phase-action>button{width:100%}
.duopuzzle-action-space{min-height:44px}
.game-shell .play .duopuzzle-room .duopuzzle-keyboard{font-size:.8rem;color:#5e6d5f;margin:1.2rem 0 .4rem}
.duopuzzle-archive{list-style:none;padding:0;margin:1.5rem 0;display:grid;grid-template-columns:1fr 1fr;gap:1.6rem;text-align:left}
.duopuzzle-archive>li{padding:.8rem 0;border-top:2px solid #b5b79f;min-width:0}
.duopuzzle-archive header{display:flex;justify-content:space-between;gap:.8rem;align-items:baseline;flex-wrap:wrap}
.duopuzzle-archive h3{font-size:1rem;margin:.3rem 0}.duopuzzle-archive header>strong{font-size:.9rem}
.duopuzzle-record-pair{display:grid;grid-template-columns:1fr 24px 1fr;gap:.5rem;align-items:center}
.duopuzzle-record-pair figure{margin:.7rem 0;min-height:140px;padding:.75rem;background:#f4f1e5;border:1px solid #c9c4b0;display:flex;flex-direction:column;align-items:center;gap:.45rem;min-width:0}
.duopuzzle-record-pair figure>span{font-size:.75rem;color:#6c7768}
.duopuzzle-record-pair .duopuzzle-motif{width:54px;height:54px}
.duopuzzle-record-pair figcaption{font-size:.9rem;line-height:1.35;overflow-wrap:anywhere;text-align:center}
.duopuzzle-record-pair figcaption b{font:650 .85rem ui-monospace,monospace}
.duopuzzle-record-arrow{text-align:center;color:#7b8978}
.game-shell .play .duopuzzle-room .duopuzzle-rematch-note{font-size:.9rem;color:#5e6d5f;margin:.8rem 0}
@keyframes pair-front-in{from{transform:perspective(400px) rotateY(-9deg);opacity:.65}to{transform:perspective(400px) rotateY(0);opacity:1}}
@media(min-width:1000px) and (min-height:680px){.game-shell.wide .play .duopuzzle-room .duopuzzle-board{grid-auto-rows:clamp(100px,calc((100dvh - 250px)/var(--pair-rows)),145px)}}
@media(max-width:760px){.duopuzzle-desk{grid-template-columns:1fr;gap:1.4rem}.duopuzzle-board{gap:6px;grid-auto-rows:110px}.game-shell .play .duopuzzle-room .duopuzzle-card{padding:19px 4px 6px;border-bottom-width:3px}.duopuzzle-front{gap:.3rem}.duopuzzle-front .duopuzzle-motif{width:37px;height:37px}.duopuzzle-front strong{font-size:.875rem}.duopuzzle-coordinate{left:5px;font-size:.7rem}.duopuzzle-owner{right:3px}.duopuzzle-back{inset:19px 5px 9px}.duopuzzle-back>i{width:17px;height:28px}.duopuzzle-back>i:last-child{margin-left:-8px}.duopuzzle-rail{padding:0}.duopuzzle-turn{min-height:0}.duopuzzle-phase-action{min-height:44px}.duopuzzle-scores{margin-bottom:.8rem}.duopuzzle-archive{grid-template-columns:1fr}.duopuzzle-record-pair figure{padding:.65rem .4rem}.duopuzzle-record-pair figcaption{font-size:.875rem}.duopuzzle-keyboard{display:none}}
@media(max-width:380px){.duopuzzle-board{gap:4px}.game-shell .play .duopuzzle-room .duopuzzle-card{padding-inline:2px}.duopuzzle-front .duopuzzle-motif{width:32px;height:32px}.duopuzzle-front strong{font-size:.875rem}}
@media(prefers-reduced-motion:reduce){.duopuzzle-room *{animation:none!important;scroll-behavior:auto}}

.page-game .game-shell.theme-duopuzzle:has(.duopuzzle-room) {
  --pair-stage:#ebf0f6;--pair-navy:#223653;--pair-accent:#2d5090;
  background:var(--pair-stage);color:var(--pair-navy);
}
.page-game .game-shell.theme-duopuzzle:has(.duopuzzle-room) .game-toolbar {
  background:var(--pair-stage);color:var(--pair-navy);border-color:#a3b1c6;
}
.page-game .game-shell.theme-duopuzzle:has(.duopuzzle-room) .game-toolbar .button,
.page-game .game-shell.theme-duopuzzle .play .duopuzzle-room .button.secondary {
  background:#f8fbff;color:var(--pair-navy);border-color:#8192af;
}
.page-game .game-shell.theme-duopuzzle .play .duopuzzle-room .button:not(.secondary) {
  background:var(--pair-accent);color:white;border-color:var(--pair-accent);
}
.page-game .game-shell.theme-duopuzzle .play .duopuzzle-room .button:not(.secondary):hover {background:#23447b}
.game-shell.theme-duopuzzle .play .duopuzzle-room {
  --pair-ink:var(--pair-navy);--pair-blue:#186963;--pair-copper:#9b4736;
}
.game-shell.theme-duopuzzle .play .duopuzzle-room .session-banner h2 {
  font-size:clamp(1.65rem,4.1vw,3.4rem);line-height:1.08;color:var(--pair-navy);letter-spacing:-.035em;
}
.game-shell.theme-duopuzzle .play .duopuzzle-room .session-banner .meta {color:#4a617d}
.game-shell.theme-duopuzzle .play .duopuzzle-room .duopuzzle-card {
  border-radius:.55rem;box-shadow:0 2px 0 #1d34574d;
}
.game-shell.theme-duopuzzle .play .duopuzzle-room .duopuzzle-card[data-duopuzzle-state=closed] {
  background:linear-gradient(135deg,#4e6da3,#263f73);color:#fff6df;border-color:#263e72;border-bottom-color:#203258;
}
.game-shell.theme-duopuzzle .play .duopuzzle-room .duopuzzle-card[data-duopuzzle-state=closed]:enabled:hover {
  background:linear-gradient(135deg,#5879b0,#365989);
}
.duopuzzle-card[data-duopuzzle-state=closed] .duopuzzle-coordinate {color:#fff4da}
.duopuzzle-back {
  border-color:#cfdef294;
  background:repeating-linear-gradient(42deg,#fffae422 0 1px,transparent 1px 8px);
  box-shadow:inset 0 0 0 2px #baccf329;
}
.duopuzzle-back>i {background:#d6e3fa29;border-color:#f3dfabba}
.game-shell.theme-duopuzzle .play .duopuzzle-room .duopuzzle-card[data-duopuzzle-state=open] {
  background:#fff8e8;border-color:#bea77f;border-bottom-color:#9b7954;
}
.game-shell.theme-duopuzzle .play .duopuzzle-room .duopuzzle-card[data-duopuzzle-owner="0"] {background:#dcefe5;border-color:#518679}
.game-shell.theme-duopuzzle .play .duopuzzle-room .duopuzzle-card[data-duopuzzle-owner="1"] {background:#fae6db;border-color:#b57862}
.duopuzzle-motif {color:#243e5d}
.duopuzzle-owner {background:var(--pair-blue)}
[data-duopuzzle-owner="1"] .duopuzzle-owner {background:var(--pair-copper)}
.duopuzzle-scores>div {border-color:#aebdcd;background:#f7faff;min-width:0}
.duopuzzle-scores>div[data-active=true] {border-bottom-color:var(--pair-blue);background:#e2efe8}
.duopuzzle-scores>div[data-duopuzzle-score-side="1"][data-active=true] {border-bottom-color:var(--pair-copper);background:#faebe2}
.duopuzzle-turn,.duopuzzle-archive>li {border-color:#a3b1c6}
.duopuzzle-card:focus-visible {outline:3px solid #a96528;outline-offset:2px;z-index:2}
.duopuzzle-card[data-duopuzzle-state=closed]:focus-visible {outline-color:#f0bc68;outline-offset:-3px}
.game-shell .play .duopuzzle-room .actions {flex-wrap:wrap}
@media(max-width:760px) {
  .page-game .game-shell.theme-duopuzzle.wide .play:has(.duopuzzle-room) {
    justify-content:flex-start;min-height:0;margin-block:0;padding-block:1.15rem 2rem;
  }
  .duopuzzle-desk {gap:.85rem}
  .duopuzzle-board {grid-auto-rows:clamp(5.65rem,24vw,6.9rem)}
  .duopuzzle-rail {min-width:0}
}
