/* ANIMAL RACE WEB PLAY UX V4 */

.meow-play-enhanced {
  overflow-x: hidden;
}

#meowPlayTools {
  width: min(1180px, calc(100% - 24px));
  margin: 12px auto;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid #33394a;
  border-radius: 14px;
  background: #111622;
  color: white;
  font: 700 14px/1.4 system-ui, sans-serif;
}

#meowPlayTools .meowToolActions {
  display: flex;
  gap: 8px;
}

#meowPlayTools .meowToolsLabel {
  color: #deff72;
  font-size: 16px;
  font-weight: 950;
}

#meowPlayTools .meowToolsLabel small {
  display: block;
  color: #9fa9bc;
  font-size: 10px;
  letter-spacing: .12em;
}

#meowPlayTools .meowTool {
  min-height: 44px;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #454e62;
  border-radius: 10px;
  background: #1b2433;
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .15s, background .15s;
}

#meowPlayTools .meowTool:hover {
  background: #2b3549;
  transform: translateY(-2px);
}

#meowPlayTools .meowTool:active {
  transform: scale(.96);
}

#meowPlayTools .meowTool[hidden] {
  display: none;
}

#meowRotateHint {
  display: none;
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto 10px;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #667b46;
  border-radius: 10px;
  background: #283224;
  color: #ecf9ce;
  font: 600 13px/1.5 system-ui, sans-serif;
}

#meowRotateHint button {
  min-width: 30px;
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: #ffffff22;
  color: white;
  font-size: 20px;
}

#meowHelpDialog {
  width: min(610px, calc(100% - 22px));
  max-height: 88dvh;
  overflow: auto;
  padding: 25px;
  border: 1px solid #546277;
  border-radius: 20px;
  background: #141b29;
  color: #f7f8fd;
  box-shadow: 0 35px 100px #000b;
  font: 16px/1.6 system-ui, sans-serif;
}

#meowHelpDialog::backdrop {
  background: #05070dd9;
  backdrop-filter: blur(8px);
}

#meowHelpDialog .meowHelpHead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

#meowHelpDialog .meowHelpHead small {
  color: #deff72;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .1em;
}

#meowHelpDialog h2 {
  margin: 5px 0 17px;
  font-size: clamp(23px, 4vw, 32px);
  line-height: 1.2;
}

#meowHelpDialog .meowHelpHead button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid #4a5261;
  border-radius: 10px;
  background: #252d3c;
  color: white;
  font-size: 24px;
}

#meowHelpDialog .meowHelpGrid {
  display: grid;
  gap: 10px;
}

#meowHelpDialog .meowHelpGrid > div {
  padding: 14px;
  border: 1px solid #313c50;
  border-radius: 12px;
  background: #1e2738;
}

#meowHelpDialog .meowHelpGrid strong {
  color: #dcff70;
  font-size: 16px;
}

#meowHelpDialog .meowHelpGrid p {
  margin: 5px 0 0;
  color: #c6d1df;
  font-size: 14px;
}

#meowHelpDialog .meowHelpGo {
  width: 100%;
  min-height: 48px;
  margin-top: 15px;
  border: 0;
  border-radius: 11px;
  background: #deff72;
  color: #1b220c;
  font-size: 15px;
  font-weight: 950;
}

#meowTouchDeck {
  display: none;
}

@media (max-width: 900px) {
  .meow-play-enhanced .gameShell,
  .meow-play-enhanced #gameShell {
    max-width: 100%;
    min-width: 0;
  }

  .meow-play-enhanced .gameShell canvas,
  .meow-play-enhanced #gameShell canvas {
    max-width: 100%;
    height: auto;
    touch-action: none;
  }

  .meow-play-enhanced .mobileControls button,
  .meow-play-enhanced #mobileControls button {
    min-width: 60px !important;
    min-height: 60px !important;
    font-size: 22px !important;
    border-radius: 14px !important;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }

  .meow-play-enhanced .overlayCard {
    max-height: 90dvh;
    overflow-y: auto;
  }

  .meow-play-enhanced #ecoWallet {
    gap: 8px;
    flex-wrap: wrap;
  }

  .meow-play-enhanced #meowStarHud {
    font-size: 15px !important;
  }
}

@media (pointer: coarse) {
  #meowTouchDeck {
    position: fixed;
    z-index: 70;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
    pointer-events: none;
  }

  #meowTouchDeck .meowTouchArrows {
    display: flex;
    gap: 10px;
  }

  #meowTouchDeck button {
    width: 70px;
    height: 70px;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    border: 2px solid #cfe9608c;
    border-radius: 18px;
    background: #182234e8;
    color: #f2ffbe;
    box-shadow: 0 8px 22px #0008;
    font-size: 27px;
    font-weight: 900;
    transition: transform .1s, background .1s;
  }

  #meowTouchDeck button.is-pressed {
    background: #d9fa73;
    color: #1a210b;
    transform: scale(.92);
  }

  #meowTouchDeck .meowTouchJump {
    width: 88px;
    background: #deff72;
    color: #1b220c;
  }

  #meowTouchDeck .meowTouchJump span {
    display: block;
    font-size: 11px;
    line-height: 1;
  }

  .meow-play-enhanced:has(#meowTouchDeck) {
    padding-bottom: 95px;
  }
}

@media (max-width: 720px) and
       (orientation: portrait) and
       (pointer: coarse) {
  #meowRotateHint {
    display: flex;
  }
}

@media (max-width: 650px) {
  #meowPlayTools {
    gap: 7px;
    padding: 8px;
  }

  #meowPlayTools .meowToolsLabel {
    order: -1;
    flex: 1 1 100%;
    text-align: center;
  }

  #meowPlayTools .meowTool {
    min-height: 42px;
    padding: 8px 10px;
    font-size: 13px;
  }

  #meowHelpDialog {
    padding: 16px;
  }
}

@media (max-height: 460px) and (pointer: coarse) {
  #meowTouchDeck button {
    width: 62px;
    height: 56px;
    border-radius: 12px;
  }

  #meowTouchDeck .meowTouchJump {
    width: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #meowPlayTools .meowTool,
  #meowTouchDeck button {
    transition: none !important;
  }
}
