/* Mobile fixes for /world: allow button wrapping and reduce spacing */
@media (max-width: 640px) {
  .btn-gold, .btn-line {
    white-space: normal;
    letter-spacing: .06em;
    padding: 12px 14px;
    max-width: 100%;
    text-align: center;
  }
}

/* Mobile fixes for /craft: prevent grid overflow */
@media (max-width: 640px) {
  .ws-trade, .ws-trade div {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  main.page [class*="ws-"] {
    min-width: 0;
  }
}

/* Mobile fixes for /leaderboard: adjust podium layout and text */
@media (max-width: 640px) {
  .lb-stage {
    padding: 30px 10px 0;
  }
  .lb-pod {
    gap: 6px;
  }
  .lb-col, .lb-p {
    min-width: 0;
  }
  .lb-p img {
    max-width: 100%;
    height: auto;
  }
  .lb-p {
    font-size: .8em;
    overflow-wrap: anywhere;
  }
}

/* Mobile tap targets: ensure minimum height and readable font size */
@media (max-width: 640px) {
  button, .btn-gold, .btn-line, select,
  input:not([type=hidden]):not([type=checkbox]):not([type=radio]),
  .lb-tabs a, .at-x {
    min-height: 40px;
  }
  input, select {
    font-size: 16px;
  }
  .btn-gold.small {
    min-height: 36px;
  }
}

/* General mobile safety: scale media, handle tables, and wrap code */
@media (max-width: 640px) {
  img, video, canvas, svg {
    max-width: 100%;
  }
  .wm-layer img, .wm-layer canvas, .wm-layer svg {
    max-width: none;
  }
  table {
    display: block;
    overflow-x: auto;
  }
  pre, code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}
