/* Daily Challenges phone regression fix.
   - Original record card @max-width:480px needs GRID, not FLEX.
   - The signed-in account flag should not protrude into the content.
   - The mobile DC section rail is not an overlay.
   Deliberately loaded AFTER the earlier DC responsive stylesheet. */
@media (max-width:860px){
  /* No floating overlay when a page is scrolled. Pages/controls remain visible
     without the translucent bar visually showing text behind it. */
  body[data-theme="glass"] #content .dc-mobile-sections {
    position:relative!important;
    top:auto!important;
    z-index:1!important;
    background:#112c4e!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
  body[data-theme="glass"] #content .dc-mobile-sections-track{
    background:transparent!important;
  }

  /* Mobile header geometry belongs to the shared Workbench shell.
     Records-specific rules below only affect the records page content. */
  /* The previous mobile patch set .v196-record-body to FLEX, while the
     original <=480px rules set .v196-record-main to display:contents.
     All three items then became squeezed horizontal flex siblings.
     Restore the semantic icon/title top row + stats bottom grid. */
  body[data-theme="glass"] #content .v196-record-grid{
    grid-template-columns:minmax(0,1fr)!important;
    min-width:0!important;
    width:100%!important;
    box-sizing:border-box!important;
    padding:0 9px 12px!important;
  }
  body[data-theme="glass"] #content .v196-record-card{
    min-width:0!important;
    max-width:100%!important;
    padding:11px!important;
    box-sizing:border-box!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-body{
    display:grid!important;
    grid-template-columns:54px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    gap:10px 11px!important;
    align-items:center!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    padding:0!important;
    overflow:visible!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-main{
    display:contents!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-icon{
    grid-column:1!important;
    grid-row:1!important;
    box-sizing:border-box!important;
    width:54px!important;
    min-width:54px!important;
    height:54px!important;
    padding:4px!important;
    margin:0!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-icon img{
    width:44px!important;
    height:44px!important;
    max-width:44px!important;
    max-height:44px!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-title{
    grid-column:2!important;
    grid-row:1!important;
    align-self:center!important;
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    font-size:16px!important;
    line-height:1.25!important;
    text-align:left!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
    hyphens:none!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-stats{
    grid-column:1/-1!important;
    grid-row:2!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 78px!important;
    grid-template-rows:auto auto!important;
    align-items:start!important;
    gap:9px 11px!important;
    width:100%!important;
    min-width:0!important;
    margin:2px 0 0!important;
    padding:0!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-stat{
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:100%!important;
    padding:0!important;
    margin:0!important;
    border-right:0!important;
    gap:4px!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-player{
    grid-column:1!important;
    grid-row:1!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-score{
    grid-column:2!important;
    grid-row:1!important;
    border-left:1px solid rgba(167,207,248,.19)!important;
    padding-left:11px!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-date{
    grid-column:1/-1!important;
    grid-row:2!important;
    padding-top:7px!important;
    border-top:1px solid rgba(167,207,248,.15)!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-stat small{
    white-space:normal!important;
    overflow-wrap:normal!important;
    line-height:1.2!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-holders,
  body[data-theme="glass"] #content .v196-record-card .v196-record-holders button{
    display:inline!important;
    max-width:100%!important;
    font-size:14px!important;
    line-height:1.35!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:break-word!important;
    hyphens:none!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-footer{
    flex-wrap:wrap!important;
    gap:5px!important;
    margin-top:12px!important;
  }
}

/* Extra-small phones retain normal words and 44px tap targets instead of
   reducing content down to single-letter columns. */
@media (max-width:360px){
  body[data-theme="glass"] #content .v196-record-card .v196-record-body{
    grid-template-columns:47px minmax(0,1fr)!important;
    column-gap:9px!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-icon{
    width:47px!important;min-width:47px!important;height:47px!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-icon img{
    width:39px!important;height:39px!important;
  }
  body[data-theme="glass"] #content .v196-record-card .v196-record-title{
    font-size:15px!important;
  }
}
