.srStateChase {
  margin-bottom: 18px;
  padding: 18px;
}

.srStateChaseHeader {
  text-align: center;
  margin-bottom: 12px;
}

.srStateChaseHeader h2 {
  margin: 0;
  font-size: 22px;
}

.srStateChaseHeader p {
  margin: 5px 0 0;
  opacity: .62;
  font-size: 13px;
}

.srStateChaseHud {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  max-width: 420px;
  margin: 0 auto 10px;
}

.srStateChaseHud > div {
  text-align: center;
  padding: 7px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}

.srStateChaseHud span {
  display: block;
  font-size: 9px;
  opacity: .5;
}

.srStateChaseHud strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

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

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

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

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

.srStateChaseOverlay h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.srStateChaseOverlay p {
  margin: 0 0 14px;
  opacity: .7;
  line-height: 1.45;
}

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

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

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

.srStateChaseControl {
  width: 50px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 19px;
}

.srStateChaseHint {
  text-align: center;
  margin-top: 8px;
  opacity: .45;
  font-size: 10px;
}

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

@media (max-width:600px) {
  .srStateChase {
    padding: 12px;
  }

  .srStateChaseArena {
    width: min(320px,100%);
  }

  .srStateChaseHud {
    max-width: 320px;
  }
}

/* STATE CHASE — MOBILE CONTROLS FIX */

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

.srStateChaseControl {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}

@media (max-width: 759px) {

  .srStateChaseControls {
    display: grid !important;
  }

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

}

/* ==========================================================
   MOBILE FULLSCREEN
   ========================================================== */

.srStateChaseFullscreenClose {
  display: none;
}

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

@media (max-width:759px) {

  .srStateChase.srStateChaseFullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !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;
    justify-content: flex-start !important;

    overflow: hidden !important;
  }


  .srStateChaseFullscreen
  .srStateChaseHeader {
    margin:
      2px
      42px
      7px
      42px;
  }


  .srStateChaseFullscreen
  .srStateChaseHeader h2 {
    font-size: 16px;
  }


  .srStateChaseFullscreen
  .srStateChaseHeader p {
    display: none;
  }


  .srStateChaseFullscreen
  .srStateChaseHud {
    width: min(100%, 390px);
    margin: 0 auto 7px;
    flex: 0 0 auto;
  }


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

    max-width: none !important;

    margin: 0 auto !important;

    flex: 0 0 auto;
  }


  .srStateChaseFullscreen
  .srStateChaseControls {
    display: grid !important;
    margin-top: 7px;
    flex: 0 0 auto;
  }


  .srStateChaseFullscreen
  .srStateChaseControl {
    width: 62px;
    height: 48px;
    font-size: 23px;
  }


  .srStateChaseFullscreen
  .srStateChaseHint {
    display: none;
  }


  .srStateChaseFullscreenClose {
    display: none;
  }


  .srStateChaseFullscreen
  .srStateChaseFullscreenClose {
    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: 10;
  }

}

/* ==========================================================
   STATE CHASE MOBILE FULLSCREEN V2
   ========================================================== */

@media (max-width:900px), (pointer:coarse) {

  .srStateChase.srStateChaseFullscreen {
    position: fixed !important;

    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;

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

    min-width: 100% !important;
    max-width: none !important;

    margin: 0 !important;

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

    box-sizing: border-box !important;

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

    background: #07070b !important;

    z-index: 2147483000 !important;

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

    overflow: hidden !important;
  }


  .srStateChaseFullscreen
  .srStateChaseHeader {

    flex: 0 0 auto;

    margin:
      2px 45px
      6px 45px !important;
  }


  .srStateChaseFullscreen
  .srStateChaseHeader h2 {
    font-size: 16px !important;
  }


  .srStateChaseFullscreen
  .srStateChaseHeader p {
    display: none !important;
  }


  .srStateChaseFullscreen
  .srStateChaseHud {

    width: min(100%, 430px) !important;

    margin:
      0 auto
      6px auto !important;

    flex: 0 0 auto;
  }


  /*
   * Occupa quasi tutta la larghezza disponibile.
   */
  .srStateChaseFullscreen
  .srStateChaseArena {

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

    height: auto !important;

    max-width: none !important;

    margin: 0 auto !important;

    flex: 0 0 auto;
  }


  .srStateChaseFullscreen
  #srStateChaseCanvas {

    width: 100% !important;
    height: 100% !important;

    display: block !important;
  }


  .srStateChaseFullscreen
  .srStateChaseControls {

    display: grid !important;

    flex: 0 0 auto;

    margin-top: 6px !important;
  }


  .srStateChaseFullscreen
  .srStateChaseControl {

    width: 64px !important;
    height: 48px !important;

    font-size: 22px !important;
  }


  .srStateChaseFullscreen
  .srStateChaseHint {
    display: none !important;
  }


  .srStateChaseFullscreen
  .srStateChaseFullscreenClose {

    display: block !important;

    position: absolute !important;

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

    right: 10px !important;

    z-index: 2147483647 !important;
  }

}

/* ==========================================================
   STATE CHASE MOBILE OVERLAY V1
   ========================================================== */

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

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

.srStateChaseMobileOverlay {
  position: fixed !important;
  inset: 0 !important;

  z-index: 2147483646 !important;

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

  box-sizing: border-box !important;

  background: #07070b !important;

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

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

  overflow: hidden !important;
}


.srStateChaseMobileTop {
  flex: 0 0 auto;

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

  min-height: 42px;
  padding: 0 4px;
}


.srStateChaseMobileTitle {
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: .05em;
}


.srStateChaseMobileClose {
  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;
  font-weight: 850;
}


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

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

  gap: 6px;

  margin: 3px auto 7px;

  flex: 0 0 auto;
}


.srStateChaseMobileHud > div {
  padding: 6px;

  text-align: center;

  border-radius: 10px;

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

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


.srStateChaseMobileHud span {
  display: block;

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

  font-size: 9px;
}


.srStateChaseMobileHud strong {
  display: block;

  margin-top: 2px;

  color: #fff;

  font-size: 16px;
}


.srStateChaseMobileArena {
  flex: 1 1 auto;

  min-height: 0;

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

  overflow: hidden;
}


.srStateChaseMobileArena
#srStateChaseCanvas {

  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;
}


.srStateChaseMobileControls {
  flex: 0 0 auto;

  display: grid;

  gap: 5px;

  justify-content: center;

  margin-top: 5px;
}


.srStateChaseMobileControls > div {
  display: flex;

  gap: 6px;

  justify-content: center;
}


.srStateChaseMobileControls 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;
}


/*
 * Overlay solo mobile/touch.
 */
@media (min-width:901px) and (pointer:fine) {

  .srStateChaseMobileOverlay {
    display: none !important;
  }

}
