/* Keep the established touch layout; the desktop room becomes the instrument. */
.duo-game-switcher{display:none}

@media (min-width:761px) and (min-height:501px),(min-width:1001px){
  .desktop-play-page .duo-game-switcher{display:flex}
  .duo-game-switcher .mobile-game-picker-label{display:none}
  .desktop-play-page:is(.relay-page,.together-page) .shell{max-width:none}
  .desktop-play-page:is(.relay-page,.together-page) #account-link{margin-left:auto;margin-right:12px;width:auto;min-width:64px;font-size:11px}
  .desktop-play-page:is(.relay-page,.together-page) .header-actions{margin-left:0;gap:8px}

  /* A compact entry keeps room discovery and invitations within the viewport. */
  .relay-page .relay-intro{padding:clamp(22px,6vh,60px) 0 24px;max-width:660px}
  .relay-intro .relay-emblem{height:50px;margin-bottom:22px;gap:21px}
  .relay-intro .relay-emblem i{width:34px;height:34px}
  .relay-intro h1{font-size:54px;letter-spacing:-2.5px;margin:12px 0}
  .relay-intro h1 span{font-size:11px;letter-spacing:5px;margin-top:17px}
  .relay-intro>.eyebrow{justify-content:center;font-size:9px}
  .relay-intro .relay-tagline{font-size:12px}
  .relay-modes{margin:30px auto 12px;gap:12px}
  .mode-card{padding:23px 25px;border-radius:16px}
  .mode-card strong{font-size:21px;margin-top:2px}
  .relay-duel-link{font-size:11px}
  .relay-page .relay-lobby{padding:20px 0 32px;max-width:900px}
  .relay-lobby h1{font-size:34px;margin:8px 0 18px}
  .relay-room-tools{margin:14px 0 20px}
  .together-page .together-gate{margin:clamp(24px,10vh,100px) auto 0}
  .together-gate .orbit-mark{margin-bottom:24px}
  .together-gate h1{font-size:44px}
  .together-page #lobby{padding:18px 0 30px;max-width:1060px}
  .together-page .lobby-heading{margin-bottom:22px}
  .together-page .lobby-heading h1{font-size:34px;margin:10px 0}
  .together-page .lobby-heading .eyebrow{font-size:9px}
  .together-page .room-toolbar{margin:16px 0 18px}

  /* Relay: one uninterrupted board, with both players in a quiet side rail. */
  .relay-playing main{display:flex;flex-direction:column;overflow:auto}
  .relay-playing .relay-game{
    --duo-rail:224px;
    display:grid;grid-template-columns:minmax(0,1fr) var(--duo-rail);
    grid-template-rows:minmax(12px,1fr) auto auto auto minmax(12px,1fr);
    column-gap:28px;row-gap:22px;align-items:center;
    width:100%;max-width:1500px;height:100%;min-height:400px;margin:0 auto;
  }
  .relay-game .relay-board-space{grid-column:1;grid-row:1/-1;height:100%;min-width:0;min-height:0}
  .relay-game .relay-board-frame{
    width:min(100%,calc((var(--board-height,calc(100dvh - 94px)) - 20px)*var(--board-ratio,1.285714) + 20px));
    max-width:none;max-height:100%;padding:10px;border-radius:19px;
  }
  .relay-game .relay-game-heading{grid-column:2;grid-row:2;display:block;padding:0}
  .relay-game-heading .eyebrow{font-size:9px;letter-spacing:1.5px;margin-bottom:11px}
  .relay-game h1{font-size:30px;line-height:1.15;letter-spacing:-1px}
  .relay-game-actions{justify-content:flex-start;margin:16px 0 0;gap:7px}
  .relay-game-actions .text-action{padding-left:0;margin-right:auto}
  .relay-game-actions .icon-action{background:var(--graphite-key);box-shadow:var(--graphite-lift);border-radius:10px;font-size:20px;width:40px;min-height:40px}
  .relay-game .relay-seat-bar{grid-column:2;grid-row:3;display:grid;grid-template-columns:1fr;gap:9px;margin:0;align-items:center}
  .relay-seat-bar .relay-connection{grid-row:1;letter-spacing:1.4px;margin:0 0 3px}
  .relay-seat-bar .relay-seat{display:grid;grid-template-columns:16px minmax(0,1fr) auto;justify-content:start;gap:9px;font-size:12px;padding:14px 13px;background:#1c1c1c;border-radius:11px;box-shadow:var(--graphite-press)}
  .relay-seat-bar .relay-seat span{max-width:none}
  .relay-seat-bar .relay-seat small{font-size:9px;white-space:nowrap}
  .relay-game .relay-game-foot{grid-column:2;grid-row:4;display:flex;flex-direction:column-reverse;align-items:flex-start;gap:11px;margin:0;font-size:11px}
  .relay-game-foot p{max-width:210px;line-height:1.7;color:#797979}
  .relay-game-foot>span{font-size:13px;letter-spacing:1px;color:#b6b6b6}
  .relay-page .relay-controls{display:none!important}
  .relay-playing .relay-notice{position:fixed;left:50%;bottom:9px;transform:translateX(-50%);z-index:20;max-width:min(600px,70vw);margin:0;padding:8px 14px;border-radius:9px;background:#202020ed;pointer-events:none;font-size:11px}

  /* Lift the existing room details into one rail without moving mobile nodes. */
  .together-page.duel-open main{display:flex;flex-direction:column;overflow:auto}
  .together-page #match{
    display:grid;grid-template-columns:minmax(0,1fr) 224px;
    grid-template-rows:minmax(8px,1fr) repeat(9,auto) minmax(8px,1fr);
    gap:0 28px;align-items:center;width:100%;
    max-width:calc(var(--desktop-game-height,calc(100dvh - 94px)) + 252px);
    height:100%;min-height:440px;margin:0 auto;
  }
  #match .match-sidebar,#match .duel-console{display:contents}
  #match .match-sidebar>*{grid-column:2;min-width:0}
  #match .match-sidebar>.eyebrow{grid-row:2;margin:0 0 8px;font-size:9px;letter-spacing:1.6px}
  #match .match-sidebar h1{grid-row:3;font-family:inherit;font-size:29px;line-height:1.15;margin:0 0 24px;letter-spacing:-1px}
  #match .match-note{display:none}
  #match .duel-metrics{grid-column:2;grid-row:4;width:100%;gap:8px;padding:0 0 16px}
  #match .duel-metrics span{font-size:9px}
  #match .duel-metrics b{font-family:inherit;font-size:30px;line-height:1;letter-spacing:-1.5px;margin-top:7px;font-variant-numeric:tabular-nums}
  #match .duel-track{grid-column:2;grid-row:5;width:100%;margin:0 0 14px;height:2px;background:#ffffff08}
  #match .room-meta{grid-row:6;gap:8px}
  #match .room-meta .text-button{font-size:11px;min-height:38px}
  #match .room-code-detail{grid-row:7;margin:0 0 12px}
  #match .room-code-detail summary{font-size:9px;min-height:28px}
  #match .room-number{font-size:10px;letter-spacing:1px;margin:3px 0 9px}
  #match .seats{grid-row:8;gap:8px}
  #match .seat{padding:13px 11px;border-radius:11px;box-shadow:var(--graphite-press)}
  #match .seat-name{font-size:11px}
  #match .seat-state{font-size:9px;line-height:1.5;margin-top:8px}
  #match .match-actions{grid-row:9;display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 12px;margin:16px 0 0}
  #match .match-actions .duo-primary{min-height:46px;font-size:12px;padding:0 15px}
  #match .match-actions>.text-button{font-size:11px;min-height:38px;display:flex;align-items:center;margin:0}
  #match .match-actions .leave-room{margin-left:auto}
  #match .duel-caption{grid-column:2;grid-row:10;gap:10px;font-size:9px;color:#737373;margin:14px 0 0}
  #match .duel-board-wrap{
    grid-column:1;grid-row:1/-1;align-self:center;justify-self:center;
    width:100%;max-width:var(--desktop-game-height,calc(100dvh - 94px));
    aspect-ratio:1;margin:0;padding:12px;border-radius:19px;background:#171717;
    box-shadow:inset 0 2px 7px #00000066,inset 0 -1px #ffffff06,0 24px 40px #00000022;
  }
  .together-page #board{gap:9px;border-radius:9px}
  .together-page #board .tile{border-radius:7px}
  .together-page #duel-overlay{inset:12px;border-radius:9px}
  .together-page #duel-overlay strong{font-size:clamp(34px,4vw,52px)}
  .duel-open .together-notice:empty{display:none}
  .duel-open .together-notice{position:fixed;left:50%;bottom:9px;transform:translateX(-50%);max-width:min(600px,70vw);z-index:20;padding:8px 14px;margin:0;border-radius:9px;background:#202020ed;font-size:11px;pointer-events:none}
  .duel-open #retry{position:fixed;bottom:42px;right:28px;z-index:21}
}

@media (min-width:761px) and (min-height:501px) and (max-height:650px),(min-width:1001px) and (max-height:650px){
  .relay-page .relay-intro{padding:14px 0 12px}
  .relay-intro .relay-emblem{height:34px;margin-bottom:12px}
  .relay-intro h1{font-size:40px;margin:9px 0}
  .relay-intro h1 span{margin-top:10px}
  .relay-modes{margin:20px auto 10px}
  .relay-modes .mode-card{padding:17px 22px}
  .relay-page .relay-notice:empty{display:none}
  .relay-playing .relay-game{min-height:320px;row-gap:14px}
  .relay-game h1{font-size:26px}
  .relay-game .relay-seat{padding:11px 12px}
  .relay-game .relay-game-foot{gap:6px}
  .together-page #match{min-height:330px}
  #match .match-sidebar>.eyebrow{margin-bottom:6px}
  #match .match-sidebar h1{font-size:24px;margin-bottom:12px}
  #match .duel-metrics{padding-bottom:8px}
  #match .duel-metrics b{font-size:25px;margin-top:4px}
  #match .duel-track{margin-bottom:8px}
  #match .room-meta .text-button{min-height:32px}
  #match .room-code-detail{margin-bottom:8px}
  #match .room-code-detail summary{min-height:24px}
  #match .seat{padding:9px 10px}
  #match .seat-state{margin-top:6px}
  #match .match-actions{margin-top:10px;gap:2px 12px}
  #match .match-actions .duo-primary{min-height:40px}
  #match .match-actions>.text-button{min-height:30px}
  #match .duel-caption{margin-top:8px}
}
