/* Currency belongs to the top bar, alongside progress, in every play layout. */
body.play-screen #board>.goal-card{grid-template-columns:minmax(0,1fr) auto auto 44px}
body.play-screen #board>.goal-card #play-coin-balance{
 grid-column:2;grid-row:1;align-self:center;display:inline-flex;align-items:center;
 justify-content:center;gap:2px;min-width:0;min-height:20px;margin:0;padding:0;
 line-height:1;white-space:nowrap;
}
body.play-screen #board>.goal-card #play-coin-balance .coin{width:20px;height:20px;min-width:20px}
body.play-screen #board>.goal-card #play-coins{font-size:14px;line-height:20px}
body.play-screen #board>.goal-card #play-coin-balance>small{font-size:9px;line-height:20px}
body.play-screen #board>.goal-card #goal-progress{grid-column:3;grid-row:1;align-self:center}
body.play-screen #board>.goal-card #goal-details-button{grid-column:4;grid-row:1/3}
body.play-screen #board>.goal-card #goal-list{grid-column:1/4;grid-row:2}
body.play-screen #board>.goal-card:has(#goal-list[hidden]) #goal-title{grid-column:1/4}

@media(min-width:851px),(min-width:600px) and (min-aspect-ratio:11/10){
 body.play-screen #board>.goal-card{grid-template-columns:minmax(0,1fr) auto auto 36px}
 /* The stats stay compact; upcoming pieces get a whole readable row. */
 body.play-screen #play-sidebar-content>.hud{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}
 body.play-screen #play-sidebar-content>.hud>div:not(.inline-next){flex:1 1 0;min-width:0}
 body.play-screen #play-sidebar-content>.hud .inline-next{
  display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:44px auto;
  flex:1 0 100%;width:100%;max-width:none;min-width:0;gap:2px 5px;
  align-items:center;justify-items:stretch;margin:0;
 }
 body.play-screen #play-sidebar-content>.hud .inline-next>small{
  display:block;grid-column:1;grid-row:1;font-size:11px;line-height:1.2;
  letter-spacing:.2px;white-space:normal;text-align:left;
 }
 body.play-screen #play-sidebar-content>.hud .inline-next #inline-preview{
  display:block;grid-column:1/-1;grid-row:2;justify-self:center;
  width:100%;max-width:168px;height:auto;aspect-ratio:220/100;margin:0;
  object-fit:contain;
 }
 body.play-screen #play-sidebar-content>.hud .inline-next #queue-button{
  grid-column:2;grid-row:1;min-height:44px;min-width:58px;max-width:105px;
  margin:0;padding:5px 7px;font-size:11px;line-height:1.2;white-space:normal;
 }
 /* One labelled toggle replaces the separate heading and arrow button. */
 body.play-screen #play-sidebar .merge-chain-heading{
  grid-template-columns:minmax(0,1fr) 36px;grid-template-rows:auto;gap:4px;
 }
 body.play-screen #play-sidebar #merge-chain-label,
 body.play-screen #play-sidebar #merge-chain-strip.is-collapsed #merge-chain-label{
  position:absolute;grid-column:auto;grid-row:auto;width:1px;height:1px;
  margin:0;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;
 }
 body.play-screen #play-sidebar #merge-chain-collapse,
 body.play-screen #play-sidebar #merge-chain-strip.is-collapsed #merge-chain-collapse{
  grid-column:1;grid-row:1;width:100%;min-width:0;min-height:36px;
  margin:0;padding:5px 6px;font-size:12px;line-height:1.2;font-weight:750;
  white-space:normal;overflow-wrap:anywhere;
 }
 body.play-screen #play-sidebar #merge-chain-button,
 body.play-screen #play-sidebar #merge-chain-strip.is-collapsed #merge-chain-button{
  grid-column:2;grid-row:1;width:36px;min-width:36px;min-height:36px;
  margin:0;padding:3px;font-size:15px;line-height:1;
 }
 /* The full bubble width is for copy; its speaker sits beneath the tail. */
 body.play-screen #play-sidebar .coach #play-speaker{
  display:flex;flex-direction:column-reverse;align-items:center;gap:12px;
  width:100%;min-width:0;height:auto;min-height:0;margin:0;padding:0;
 }
 body.play-screen #play-sidebar #play-quip{
  flex:none;width:100%;min-width:0;max-width:none;margin:0;
  padding:9px!important;font-size:13px!important;line-height:1.4;
 }
 body.play-screen #play-sidebar #quip-heckler{
  flex:none;display:block;width:70px;height:84px;margin:0;object-fit:contain;
 }
 body.play-screen #play-sidebar #play-quip::before{
  left:50%;right:auto;top:auto;bottom:-7px;width:14px;height:14px;
  border:0;border-right:1px solid #c8ac63;border-bottom:1px solid #c8ac63;
  transform:translateX(-50%) rotate(45deg);
 }
 body.play-screen #play-sidebar #play-quip[data-kind="fact"]::before{border-color:#a1b181}
 body.play-screen.large-text #play-sidebar-content>.hud .inline-next>small,
 body.play-screen.large-text #play-sidebar-content>.hud .inline-next #queue-button{font-size:12px}
 body.play-screen.large-text #play-sidebar #merge-chain-collapse{font-size:13px}
 body.play-screen.large-text #play-sidebar #play-quip{font-size:15px!important;line-height:1.4}
}

@media(max-width:850px) and (max-aspect-ratio:11/10),(max-width:599px){
 body.play-screen #board>.goal-card{grid-template-rows:22px auto;column-gap:4px}
 body.play-screen #board>.goal-card #goal-context,
 body.play-screen #board>.goal-card #goal-progress{line-height:22px}
 body.play-screen .hud .inline-next{gap:3px;min-width:0}
 body.play-screen .hud .inline-next #inline-preview{width:88px;height:40px;margin:0;object-fit:contain}
 body.play-screen .hud .inline-next #queue-button{
  min-height:40px;min-width:44px;max-width:90px;padding:4px 6px;
  font-size:10px;line-height:1.15;white-space:normal;
 }
 body.play-screen.large-text .hud .inline-next #queue-button{font-size:12px;min-height:44px}
 body.play-screen.large-text #board>.goal-card #play-coins{font-size:16px}
}
