/* ===== Turnir neat frontend patch ===== */

/* 1) Hide misplaced top personal block only; keep personalized sections below */
#my-driver-hub,
.turnir-my-driver-hub{
  display:none !important;
}

/* 2) Contain hero and remove excessive height */
.hero,
.turnir-hero,
.front-hero{
  min-height: 0 !important;
  padding-top: 28px !important;
  padding-bottom: 28px !important;
  overflow: hidden;
}

.hero .container,
.turnir-hero .container,
.front-hero .container{
  max-width: 1180px !important;
}

/* 3) General spacing cleanup */
section,
.card,
.panel,
.block,
.tm-card{
  box-sizing: border-box;
}

.tm-card{
  border-radius: 18px !important;
  padding: 16px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.16) !important;
}

.tm-card h3{
  margin: 0 0 10px !important;
  font-size: 28px !important;
  line-height: 1.05 !important;
}

.tm-card-header{
  margin-bottom: 8px !important;
}

.tm-kicker{
  font-size: 10px !important;
  letter-spacing: .14em !important;
  opacity: .78 !important;
}

.tm-muted{
  font-size: 11px !important;
  opacity: .7 !important;
}

/* 4) Compact personalized grids */
.tm-grid{
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  gap: 10px !important;
}

.tm-grid-4{
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0,1fr)) !important;
  gap: 10px !important;
}

.tm-box{
  padding: 12px 14px !important;
  border-radius: 14px !important;
  min-width: 0 !important;
}

.tm-box span{
  margin-bottom: 6px !important;
  font-size: 11px !important;
}

.tm-box strong{
  font-size: 22px !important;
  line-height: 1.08 !important;
}

.tm-box small{
  margin-top: 6px !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}

/* 5) Make live race feed lighter and cleaner */
.live-feed,
.feed,
.live-feed-list{
  border-radius: 18px !important;
}

.live-feed .live-feed-item,
.feed .feed-item,
.live-feed-item,
.feed-item{
  padding: 10px 12px !important;
  border-radius: 12px !important;
  margin-bottom: 8px !important;
}

.live-feed .item-title,
.feed .item-title{
  font-size: 11px !important;
  letter-spacing: .08em !important;
}

.live-feed .item-text,
.feed .item-text{
  font-size: 14px !important;
  line-height: 1.35 !important;
}

/* 6) Compact leaderboard header area */
.leaderboard,
.leaderboard-wrap,
.leaderboard-table-wrap{
  border-radius: 18px !important;
}

.leaderboard h2,
.leaderboard .section-title{
  margin-bottom: 10px !important;
}

.sort-controls,
.sortby,
.sort-wrapper{
  margin-top: 8px !important;
  margin-bottom: 8px !important;
}

/* 7) Safer widths and no horizontal overflow */
html, body{
  overflow-x: hidden !important;
  max-width: 100% !important;
}

img, video{
  max-width: 100%;
  height: auto;
}

/* 8) iPhone / mobile */
@media (max-width: 900px){
  .hero,
  .turnir-hero,
  .front-hero{
    padding-top: 18px !important;
    padding-bottom: 18px !important;
  }

  .hero .container,
  .turnir-hero .container,
  .front-hero .container,
  .container,
  .wrap{
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .tm-grid,
  .tm-grid-4{
    grid-template-columns: 1fr !important;
  }

  .tm-card{
    padding: 14px !important;
    border-radius: 16px !important;
  }

  .tm-card h3{
    font-size: 22px !important;
  }

  .tm-box{
    padding: 12px !important;
  }

  .tm-box strong{
    font-size: 20px !important;
  }

  .stats,
  .hero-stats{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 10px !important;
  }

  .driver-card,
  .live-card,
  .card{
    width: 100% !important;
    min-width: 0 !important;
  }

  .leaderboard-wrap,
  .table-wrap,
  .leaderboard-table-wrap{
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  table{
    min-width: 760px;
  }
}

@media (max-width: 430px){
  .hero .container,
  .turnir-hero .container,
  .front-hero .container,
  .container,
  .wrap{
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  h1{ font-size: 34px !important; line-height: .97 !important; }
  h2{ font-size: 28px !important; line-height: 1.03 !important; }
  h3{ font-size: 21px !important; line-height: 1.08 !important; }

  .tm-card{
    padding: 12px !important;
  }

  .tm-box{
    padding: 10px !important;
  }

  .tm-box strong{
    font-size: 19px !important;
  }

  .live-feed .live-feed-item,
  .feed .feed-item,
  .live-feed-item,
  .feed-item{
    padding: 10px !important;
  }
}

/* 9) Nice subtle trend polish */
.tm-card,
.live-feed,
.leaderboard-wrap{
  backdrop-filter: blur(10px);
}
