.srChase21{
  margin:18px 0;
  padding:18px;
  border:1px solid rgba(255,255,255,.11);
  border-radius:18px;
  background:#09090e;
}

.srChase21Header{
  text-align:center;
  margin-bottom:14px;
}

.srChase21Header strong{
  display:block;
  color:#fff;
  font-size:21px;
}

.srChase21Header span{
  display:block;
  margin-top:5px;
  color:rgba(255,255,255,.6);
  font-size:13px;
}

.srChase21Hud{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-bottom:10px;
}

.srChase21Hud div{
  padding:8px;
  text-align:center;
  border-radius:11px;
  background:rgba(255,255,255,.055);
  border:1px solid rgba(255,255,255,.07);
}

.srChase21Hud span{
  display:block;
  color:rgba(255,255,255,.48);
  font-size:10px;
}

.srChase21Hud strong{
  display:block;
  margin-top:2px;
  color:#fff;
  font-size:17px;
}

.srChase21Arena{
  position:relative;
  width:min(100%,500px);
  margin:auto;
  aspect-ratio:1/1;
  overflow:hidden;
  border-radius:15px;
  background:#07070b;
  border:1px solid rgba(255,255,255,.1);
}

#srChase21Canvas{
  display:block;
  width:100%;
  height:100%;
  touch-action:none;
  outline:none;
}

.srChase21Overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(7,7,11,.80);
  backdrop-filter:blur(5px);
  text-align:center;
}

.srChase21Overlay[hidden]{
  display:none!important;
}

.srChase21Overlay h3{
  margin:0 0 8px;
  color:#fff;
  font-size:26px;
}

.srChase21Overlay p{
  margin:0 0 16px;
  color:rgba(255,255,255,.7);
  line-height:1.45;
}

.srChase21Start{
  min-height:46px;
  padding:0 22px;
  border:0;
  border-radius:999px;
  background:#fff;
  color:#08080c;
  font:inherit;
  font-weight:850;
  cursor:pointer;
}

.srChase21Controls{
  display:grid;
  justify-content:center;
  gap:6px;
  margin-top:11px;
}

.srChase21Row{
  display:flex;
  justify-content:center;
  gap:6px;
}

.srChase21Control{
  width:52px;
  height:46px;
  border-radius:11px;
  border:1px solid rgba(255,255,255,.11);
  background:rgba(255,255,255,.06);
  color:#fff;
  font-size:20px;
  cursor:pointer;
}

.srChase21Hint{
  text-align:center;
  margin-top:9px;
  color:rgba(255,255,255,.43);
  font-size:11px;
}

@media(min-width:760px){
  .srChase21Controls{
    display:none;
  }
}

/* ==========================================================
   STATE CHASE HOME V2.2 — COMPACT MODAL FIX
   ========================================================== */

/* Il modal deve sempre restare utilizzabile */
#videoModal .modalCard {
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

/* Gioco più compatto */
.srChase21 {
  margin: 14px 0;
  padding: 12px;
}

.srChase21Header {
  margin-bottom: 9px;
}

.srChase21Header strong {
  font-size: 17px;
}

.srChase21Header span {
  margin-top: 3px;
  font-size: 11px;
}

.srChase21Hud {
  max-width: 330px;
  margin: 0 auto 8px;
  gap: 6px;
}

.srChase21Hud div {
  padding: 5px 7px;
}

.srChase21Hud span {
  font-size: 9px;
}

.srChase21Hud strong {
  font-size: 15px;
}

/* Desktop: arena circa 330x330 */
.srChase21Arena {
  width: min(330px, 100%);
  margin: 0 auto;
}

/* Testi overlay più piccoli */
.srChase21Overlay {
  padding: 14px;
}

.srChase21Overlay h3 {
  font-size: 21px;
  margin-bottom: 6px;
}

.srChase21Overlay p {
  font-size: 12px;
  margin-bottom: 12px;
}

.srChase21Start {
  min-height: 40px;
  padding: 0 17px;
  font-size: 13px;
}

.srChase21Hint {
  margin-top: 6px;
  font-size: 10px;
}

/* Close rimane facilmente raggiungibile durante lo scroll */
#closeVideo {
  position: sticky;
  top: 0;
  z-index: 30;
}

/* Mobile */
@media (max-width: 600px) {

  #videoModal .modalCard {
    max-height: calc(100vh - 12px);
  }

  .srChase21 {
    padding: 10px;
    margin: 10px 0;
  }

  .srChase21Arena {
    width: min(300px, 100%);
  }

  .srChase21Hud {
    max-width: 300px;
  }

  .srChase21Controls {
    margin-top: 7px;
  }

  .srChase21Control {
    width: 46px;
    height: 42px;
  }
}


/* ==========================================================
   STATE CHASE RANKING V1
   ========================================================== */

.srChaseRanking {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.srChaseRankingTitle {
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: .12em;
  margin-bottom: 4px;
}

.srChaseRankingSub {
  color: rgba(255,255,255,.48);
  font-size: 11px;
  margin-bottom: 14px;
}

.srChaseRankingRows {
  display: grid;
  gap: 7px;
}

.srChaseRankingRow {
  display: grid;
  grid-template-columns:
    30px
    minmax(0,1fr)
    auto;
  gap: 8px;
  align-items: center;

  padding: 9px 10px;

  border-radius: 11px;

  background:
    rgba(255,255,255,.035);

  border:
    1px solid rgba(255,255,255,.055);
}

.srChaseRankingPos {
  font-weight: 850;
  color: rgba(255,255,255,.55);
}

.srChaseRankingState {
  min-width: 0;
  color: #fff;
  font-weight: 700;
  font-size: 12px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.srChaseRankingScore {
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.srChaseRankingEmpty {
  color: rgba(255,255,255,.5);
  font-size: 12px;
  line-height: 1.5;
}

.srChaseRankingPlays {
  display: block;
  margin-top: 2px;

  color:
    rgba(255,255,255,.38);

  font-size: 9px;
  font-weight: 400;
}

/* STATE CHASE HOME — MOBILE CONTROLS FIX */

#srChase21Canvas {
  touch-action: none !important;
  -webkit-user-select: none;
  user-select: none;
}

.srChase21Control {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

@media (max-width: 759px) {

  .srChase21Controls {
    display: grid !important;
  }

  .srChase21Control {
    width: 58px;
    height: 50px;
    font-size: 22px;
  }

}

/* ==========================================================
   HOME STATE CHASE — MOBILE FULLSCREEN
   ========================================================== */

.srChase21FullscreenClose {
  display: none;
}

html.srChase21NoScroll,
body.srChase21NoScroll {
  overflow: hidden !important;
  overscroll-behavior: none;
}

@media (max-width:759px) {

  .srChase21.srChase21Fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999999 !important;

    width: 100vw !important;
    height: 100dvh !important;

    margin: 0 !important;

    padding:
      max(10px, env(safe-area-inset-top))
      10px
      max(10px, env(safe-area-inset-bottom))
      10px !important;

    border-radius: 0 !important;
    border: 0 !important;

    background: #07070b !important;

    display: flex !important;
    flex-direction: column !important;

    overflow: hidden !important;
  }


  .srChase21Fullscreen
  .srChase21Header {
    margin:
      2px
      42px
      7px
      42px;
  }


  .srChase21Fullscreen
  .srChase21Header strong {
    font-size: 16px;
  }


  .srChase21Fullscreen
  .srChase21Header span {
    display: none;
  }


  .srChase21Fullscreen
  .srChase21Hud {
    width: min(100%,390px);
    margin: 0 auto 7px;
  }


  .srChase21Fullscreen
  .srChase21Arena {
    width: min(
      calc(100vw - 20px),
      calc(100dvh - 205px)
    ) !important;

    max-width: none !important;

    margin: 0 auto !important;
  }


  .srChase21Fullscreen
  .srChase21Controls {
    display: grid !important;
    margin-top: 7px;
  }


  .srChase21Fullscreen
  .srChase21Control {
    width: 62px;
    height: 48px;
    font-size: 23px;
  }


  .srChase21Fullscreen
  .srChase21Hint {
    display: none;
  }


  .srChase21Fullscreen
  .srChase21FullscreenClose {
    display: block;

    position: absolute;

    top:
      max(
        10px,
        env(safe-area-inset-top)
      );

    right: 12px;

    width: 36px;
    height: 36px;

    padding: 0;

    border-radius: 50%;

    border:
      1px solid rgba(255,255,255,.15);

    background:
      rgba(255,255,255,.08);

    color: #fff;

    font-size: 18px;
    font-weight: 800;

    z-index: 20;
  }

}

/* ==========================================================
   SEPARATE MOBILE OVERLAY RECOVERY
   ========================================================== */

.srChaseHomeMobileOverlay[hidden] {
  display: none !important;
}

html.srChaseHomeOverlayOpen,
body.srChaseHomeOverlayOpen {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.srChaseHomeMobileOverlay {
  position: fixed !important;

  inset: 0 !important;

  z-index: 2147483647 !important;

  width: 100vw !important;
  height: 100dvh !important;

  box-sizing: border-box !important;

  padding:
    max(8px, env(safe-area-inset-top))
    8px
    max(8px, env(safe-area-inset-bottom))
    8px !important;

  background: #07070b !important;

  display: flex !important;
  flex-direction: column !important;

  overflow: hidden !important;
}


.srChaseHomeMobileTop {
  display: flex;

  align-items: center;
  justify-content: space-between;

  flex: 0 0 auto;

  min-height: 42px;

  padding: 0 4px;

  color: #fff;
}


.srChaseHomeMobileTop strong {
  font-size: 16px;
}


#srChaseHomeMobileClose {
  width: 38px;
  height: 38px;

  padding: 0;

  border-radius: 50%;

  border:
    1px solid rgba(255,255,255,.15);

  background:
    rgba(255,255,255,.08);

  color: #fff;

  font-size: 18px;
}


.srChaseHomeMobileHud {
  width: min(100%,430px);

  display: grid;

  grid-template-columns:
    repeat(3,1fr);

  gap: 6px;

  margin:
    3px auto
    7px auto;
}


.srChaseHomeMobileHud > div {
  padding: 6px;

  text-align: center;

  border-radius: 10px;

  background:
    rgba(255,255,255,.055);

  border:
    1px solid rgba(255,255,255,.07);
}


.srChaseHomeMobileHud span {
  display: block;

  font-size: 9px;

  color:
    rgba(255,255,255,.48);
}


.srChaseHomeMobileHud strong {
  display: block;

  margin-top: 2px;

  color: #fff;

  font-size: 16px;
}


.srChaseHomeMobileArena {
  flex: 1 1 auto;

  min-height: 0;

  display: flex;

  align-items: center;
  justify-content: center;

  overflow: hidden;
}


.srChaseHomeMobileArena
#srChase21Canvas {

  display: block !important;

  width:
    min(
      calc(100vw - 16px),
      calc(100dvh - 195px)
    ) !important;

  height:
    min(
      calc(100vw - 16px),
      calc(100dvh - 195px)
    ) !important;

  max-width: none !important;

  aspect-ratio:
    1/1 !important;

  touch-action:
    none !important;

  border-radius: 12px;
}


.srChaseHomeMobileControls {
  display: grid;

  gap: 5px;

  justify-content: center;

  flex: 0 0 auto;

  margin-top: 5px;
}


.srChaseHomeMobileControls > div {
  display: flex;

  justify-content: center;

  gap: 6px;
}


.srChaseHomeMobileControls button {
  width: 66px;
  height: 48px;

  border-radius: 11px;

  border:
    1px solid rgba(255,255,255,.12);

  background:
    rgba(255,255,255,.075);

  color: #fff;

  font-size: 22px;

  touch-action:
    manipulation;

  -webkit-user-select:
    none;

  user-select:
    none;
}


@media (min-width:901px) and (pointer:fine) {

  .srChaseHomeMobileOverlay {
    display: none !important;
  }

}
