/* Upgrade public UI v22 — layout hardening for profiles + giveaways.
   Loaded last on purpose: these rules neutralize legacy min-content/positioning
   that could push profile metadata and the roulette outside their grid tracks. */

/* ======================================================================
   Player directory
   ====================================================================== */
.public-surface .profiles-lab-v4 .profile-directory-card{
  position:relative!important;
  isolation:isolate!important;
  min-width:0!important;
  overflow:hidden!important;
}
.public-surface .profiles-lab-v4 .profile-directory-cover{
  position:relative!important;
  overflow:hidden!important;
}
/* The old floating accent square looked like a broken badge on top of cards. */
.public-surface .profiles-lab-v4 .profile-directory-cover>i:nth-child(2){display:none!important}
.public-surface .profiles-lab-v4 .profile-directory-copy{
  min-width:0!important;
  width:100%!important;
  box-sizing:border-box!important;
  overflow:visible!important;
}
.public-surface .profiles-lab-v4 .profile-online-row{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  width:100%!important;
  min-width:0!important;
  margin:0 0 8px!important;
}
.public-surface .profiles-lab-v4 .profile-online-row>span{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  width:auto!important;
  max-width:100%!important;
  min-width:0!important;
}
.public-surface .profiles-lab-v4 .profile-directory-title-row{
  width:100%!important;
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:7px!important;
}
.public-surface .profiles-lab-v4 .profile-directory-title-row .unique-name-line{
  width:100%!important;
  min-width:0!important;
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
}
.public-surface .profiles-lab-v4 .profile-directory-title-row .unique-name-line h2{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  line-height:1.08!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
}
.public-surface .profiles-lab-v4 .profile-role-pill{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  display:inline-flex!important;
  align-items:center!important;
  width:max-content!important;
  max-width:100%!important;
  min-height:25px!important;
  padding:5px 8px!important;
  overflow:hidden!important;
  border:1px solid rgba(255,255,255,.08)!important;
  border-radius:8px!important;
  background:rgba(255,255,255,.035)!important;
  color:#8f96a1!important;
  font-size:9px!important;
  font-weight:800!important;
  line-height:1!important;
  letter-spacing:.045em!important;
  text-overflow:ellipsis!important;
  text-transform:uppercase!important;
  white-space:nowrap!important;
}
.public-surface .profiles-lab-v4 .profile-role-pill.is-staff{
  border-color:rgba(160,126,255,.22)!important;
  background:linear-gradient(135deg,rgba(103,170,255,.11),rgba(159,94,255,.11))!important;
  color:#bfcaff!important;
}
.public-surface .profiles-lab-v4 .profile-directory-copy>.unique-badge{
  align-self:flex-start!important;
  max-width:100%!important;
  margin-top:8px!important;
}
.public-surface .profiles-lab-v4 .profile-directory-copy>p{
  width:100%!important;
  min-width:0!important;
  overflow-wrap:anywhere!important;
}
.public-surface .profiles-lab-v4 .profile-directory-stats,
.public-surface .profiles-lab-v4 .profile-directory-actions{
  width:100%!important;
  min-width:0!important;
}
.public-surface .profiles-lab-v4 .profile-directory-actions>*{min-width:0!important}

/* ======================================================================
   Giveaways
   ====================================================================== */
.public-surface .giveaways-page{
  padding-top:32px!important;
  overflow:visible!important;
}
.public-surface .giveaway-page-head{
  position:relative!important;
  z-index:1!important;
  min-width:0!important;
  padding-top:2px!important;
}
.public-surface .giveaway-page-head>div:first-child{min-width:0!important}
.public-surface .giveaway-page-head h1{max-width:100%!important;overflow-wrap:anywhere!important}

/* Critical fix: the inner roulette has max-content width. Previously its card
   was allowed to keep that min-content width and physically ran underneath the
   sticky right column. Force every grid item to stay inside its own track. */
.public-surface .giveaway-public-grid-v5{
  width:100%!important;
  min-width:0!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(280px,320px)!important;
  align-items:start!important;
  gap:18px!important;
  position:relative!important;
  isolation:isolate!important;
}
.public-surface .giveaway-main-column,
.public-surface .giveaway-side-column{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
.public-surface .giveaway-main-column{
  display:grid!important;
  gap:16px!important;
  overflow:hidden!important;
}
.public-surface .giveaway-main-column>*{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
.public-surface .ticket-live-card{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
  contain:layout!important;
}
.public-surface .ticket-live-card>*{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
.public-surface .giveaway-live-top{
  min-width:0!important;
  flex-wrap:wrap!important;
}
.public-surface .giveaway-live-top>span{min-width:0!important;overflow-wrap:anywhere!important}
.public-surface .giveaway-live-top time{margin-left:auto!important;white-space:nowrap!important}
.public-surface .ticket-explain-strip{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  grid-template-columns:145px minmax(0,1fr)!important;
  align-items:start!important;
  overflow:hidden!important;
}
.public-surface .ticket-explain-strip>b,
.public-surface .ticket-explain-strip>span,
.public-surface .ticket-explain-strip>strong{
  min-width:0!important;
  max-width:100%!important;
  overflow-wrap:anywhere!important;
}
.public-surface .ticket-explain-strip>strong{
  grid-column:1/-1!important;
  justify-self:start!important;
  margin-top:2px!important;
}
.public-surface .giveaway-roulette{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  contain:paint!important;
}
.public-surface .giveaway-roulette-track{
  justify-content:flex-start!important;
  width:max-content!important;
  min-width:100%!important;
  max-width:none!important;
  box-sizing:border-box!important;
}
.public-surface .giveaway-roulette-track>span{flex:0 0 112px!important;min-width:112px!important;box-sizing:border-box!important}

/* Bank is intentionally a full-width hero stat. This also removes the fragile
   third min-content column that used to leak under the rules card. */
.public-surface .giveaway-live-stats.ticket-live-stats{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
}
.public-surface .giveaway-live-stats.ticket-live-stats>div{
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
.public-surface .giveaway-live-stats .prize-pool-card{
  grid-column:1/-1!important;
  min-height:112px!important;
  padding:19px 21px!important;
  border:1px solid rgba(255,116,43,.42)!important;
  border-radius:18px!important;
  background:
    radial-gradient(circle at 88% 20%,rgba(255,132,55,.28),transparent 34%),
    linear-gradient(120deg,rgba(255,91,20,.18),rgba(255,255,255,.025) 58%,rgba(128,74,255,.06))!important;
  box-shadow:0 18px 45px rgba(255,78,16,.11),inset 0 1px 0 rgba(255,255,255,.05)!important;
}
.public-surface .giveaway-live-stats .prize-pool-card:before{
  content:"БАНК"!important;
  position:absolute!important;
  right:21px!important;
  top:16px!important;
  color:rgba(255,167,108,.19)!important;
  font:900 30px/1 'Unbounded',sans-serif!important;
  letter-spacing:.06em!important;
}
.public-surface .giveaway-live-stats .prize-pool-card:after{
  right:18px!important;
  bottom:-30px!important;
  font-size:112px!important;
}
.public-surface .giveaway-live-stats .prize-pool-card small{font-size:9px!important;letter-spacing:.09em!important}
.public-surface .giveaway-live-stats .prize-pool-card b{
  margin-top:6px!important;
  font-size:42px!important;
  line-height:1!important;
  letter-spacing:-.04em!important;
}
.public-surface .giveaway-live-stats .prize-pool-card span{margin-top:7px!important;font-size:10px!important}

.public-surface .ticket-trigger-grid{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr))!important;
}
.public-surface .ticket-trigger-grid>div{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
.public-surface .giveaway-side-column{
  position:sticky!important;
  top:88px!important;
  z-index:1!important;
  display:grid!important;
  gap:14px!important;
  align-self:start!important;
}
.public-surface .giveaway-side-column>*{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
.public-surface .giveaway-rules-card li,
.public-surface .giveaway-recent-card *{min-width:0!important}
.public-surface .giveaway-rules-card li span,
.public-surface .giveaway-recent-card small{overflow-wrap:anywhere!important}

@media(max-width:1120px){
  .public-surface .giveaway-public-grid-v5{grid-template-columns:1fr!important}
  .public-surface .giveaway-side-column{position:static!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:760px){
  .public-surface .giveaways-page{padding-top:18px!important}
  .public-surface .ticket-explain-strip{grid-template-columns:1fr!important}
  .public-surface .giveaway-live-stats.ticket-live-stats{grid-template-columns:1fr 1fr!important}
  .public-surface .giveaway-live-stats .prize-pool-card{grid-column:1/-1!important;min-height:102px!important;padding:17px!important}
  .public-surface .giveaway-live-stats .prize-pool-card b{font-size:36px!important}
  .public-surface .giveaway-live-stats .prize-pool-card:before{right:16px!important;top:15px!important;font-size:24px!important}
  .public-surface .giveaway-side-column{grid-template-columns:1fr!important}
  .public-surface .profiles-lab-v4 .profile-directory-title-row{gap:6px!important}
}
@media(max-width:420px){
  .public-surface .giveaway-live-stats.ticket-live-stats{grid-template-columns:1fr 1fr!important}
  .public-surface .profile-role-pill{font-size:8px!important}
}
