@media (max-width: 920px) {
  .stat-label { display: none; }
  .hud-chip { padding: 6px 11px; }
  .chip-level i { display: none; }
}

@media (max-width: 720px) {
  #hud {
    flex-wrap: wrap;
    row-gap: 7px;
    padding-left: 10px;
    padding-right: 10px;
    justify-content: center;
  }
  .hud-left { order: 1; }
  .hud-right { order: 2; }
  .hud-center {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 6px;
  }
  .btn-round { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .btn-hint { display: none; }

  #stage { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  #btn-hint-bottom {
    display: inline-flex;
    position: absolute;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 55;
    box-shadow: 0 5px 0 rgba(0,0,0,.3), 0 14px 30px rgba(0,0,0,.45);
  }
  #btn-hint-bottom:active { transform: translateX(-50%) translateY(2px); }
  #btn-hint-bottom span:last-child { margin-left: 2px; }
  #btn-hint-bottom.spent { animation: shake-chip 0.35s ease; }

  .levels-grid { grid-template-columns: repeat(auto-fill, minmax(min(132px, 44vw), 1fr)); }
  .howto-grid { grid-template-columns: 1fr; }
  .menu-buttons {
    width: min(320px, 88vw);
    gap: 14px;
  }
  .menu-buttons .btn {
    min-height: 52px;
    padding: 0.85em 1.5em;
    font-size: clamp(0.95rem, 2.8vw, 1.1rem);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .menu-inner {
    gap: clamp(16px, 4vh, 30px);
    padding: clamp(14px, 3vh, 28px);
  }
}

@media (max-width: 430px) {
  .chip-level b { font-size: 0.85em; }
  .hud-chip { font-size: 0.76rem; gap: 5px; padding: 6px 9px; }
  .chip-progress { min-width: 128px; }
  .progress-track { width: 52px; }
  .game-logo { letter-spacing: 0.02em; }
  .level-card { min-height: 112px; }
  .result-actions .btn { width: 100%; }
  .menu-buttons {
    width: min(300px, 92vw);
  }
  .menu-buttons .btn {
    min-height: 50px;
    font-size: clamp(0.92rem, 3.2vw, 1.05rem);
  }
  .game-logo {
    font-size: clamp(2rem, 12vw, 3.6rem);
  }
  .panel-pop {
    padding: clamp(14px, 3vmin, 24px);
    max-height: 88vh;
  }
}

@media (max-width: 720px) and (orientation: landscape) {
  #hud { padding-top: 4px; row-gap: 4px; }
  .hud-center { order: 2; width: auto; flex-wrap: nowrap; }
  .hud-right { order: 3; }
  .chip-mistakes, .chip-level i { display: none; }
  #stage { padding-bottom: 8px; }
  #btn-hint-bottom {
    bottom: 8px;
    padding: 0.5em 1.2em;
    font-size: 0.8rem;
  }
  .panel-pop { max-height: 94%; }
  .intro-card h2 { font-size: 1.6rem; }
}

@media (max-height: 520px) {
  .logo-top { margin-bottom: 2px; }
  .tagline { margin-top: 4px; }
  .menu-inner { gap: 10px; }
  .watermark { display: none; }
}

@media (min-width: 1600px) {
  .levels-grid { max-width: 1400px; margin: 0 auto; width: 100%; }
}

@media (hover: none) and (pointer: coarse) {
  .btn:active:not(:disabled) {
    transform: translateY(2px) scale(0.97);
    filter: brightness(0.92);
  }
  .level-card:not(:disabled):active {
    transform: translateY(-1px) scale(0.97);
    border-color: var(--gold-2);
  }
  .btn-round:active:not(:disabled) {
    transform: scale(0.9);
  }
}
