/* =====================================================
   FilipinoMahjong.org - Safe Mobile Compatibility Patch
   Purpose: improve visitor readability on phones without compressing desktop.
   Desktop is intentionally unchanged. Applies only at 800px and below.
===================================================== */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

img,
iframe,
video,
canvas,
svg {
  max-width: 100%;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

.page,
.card,
.surface-card,
.hero,
.hero-text,
.hero-media,
.grid,
.row,
.entry,
.meta,
main,
section,
aside,
article,
nav,
footer {
  min-width: 0;
}

/* Clear disclosure block for game/community pages. Optional class. */
.safe-note {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.58);
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.55;
}

.safe-note strong {
  color: #fef3c7;
}

/* Desktop stays spacious. Mobile only starts here. */
@media (max-width: 800px) {
  body {
    display: block;
    padding: 10px;
  }

  .page,
  .page.active,
  .container,
  .wrap,
  .mm-wrap,
  .m-wrap,
  .contact-wrap {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  h1,
  header.page-header h1,
  .hero-title,
  .live-title {
    font-size: 23px;
    line-height: 1.12;
  }

  h2 {
    font-size: 17px;
    line-height: 1.2;
  }

  h3 {
    font-size: 15px;
    line-height: 1.25;
  }

  p,
  li,
  label,
  .subtitle,
  .hero-subtitle,
  header.page-header p,
  .player-card p,
  .section-copy {
    font-size: 13px;
    line-height: 1.55;
  }

  header.page-header {
    gap: 10px;
    margin-bottom: 12px;
  }

  .logo-circle {
    width: 58px;
    height: 58px;
    border-width: 2px;
    font-size: 19px;
  }

  .card,
  .surface-card,
  .hero,
  .home-card,
  .home-panel,
  .content-card,
  .mini-card,
  .seo-hero,
  .profile-section,
  .intro,
  .community-section,
  .live-info,
  .video-embed-card,
  .winner-line,
  .schedule-box,
  .upcoming-card {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 14px;
    box-shadow: 0 9px 20px rgba(0, 0, 0, 0.48);
  }

  main,
  .home-grid,
  .hero-inner,
  .content-grid,
  .profile-grid,
  .join-layout,
  .miron-layout,
  .schedule-layout,
  .players-grid,
  .community-grid,
  .feature-grid,
  .player-grid,
  .info-grid,
  .miron-lists,
  .video-embed-grid,
  .qa-grid,
  .week-grid,
  .stats,
  .cards,
  .eye-grid-2,
  .grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .hero-inner {
    display: grid;
  }

  .hero-media {
    order: -1;
    width: 100%;
  }

  .hero-actions,
  .cta-row,
  .cta-block,
  .action-row,
  .btn-row,
  .row,
  .modal-actions,
  .lb-controls,
  .quick-links,
  .hero-actions {
    gap: 6px;
  }

  .btn,
  button,
  .hero-actions .btn,
  .cta-block .btn,
  .action-row .btn,
  .quick-links a {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 12px;
  }

  input,
  textarea,
  select {
    width: 100% !important;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 13px;
  }

  textarea {
    min-height: 70px;
  }

  .nav {
    justify-content: flex-start;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px;
    border: 1px solid rgba(55, 65, 81, 0.85);
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.86);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.38);
  }

  .nav-logo {
    flex: 1 1 100%;
    width: 100%;
    margin-right: 0;
    padding: 7px 10px;
    text-align: center;
    border-color: rgba(250, 204, 21, 0.35) !important;
    background: rgba(250, 204, 21, 0.08);
    overflow-wrap: anywhere;
  }

  .nav-dropdown {
    position: static;
    flex: 1 1 calc(50% - 6px);
    min-width: 128px;
  }

  .nav a,
  .nav-trigger {
    width: 100%;
    min-height: 38px;
    padding: 8px 9px;
    border-color: rgba(55, 65, 81, 0.85);
    background: rgba(15, 23, 42, 0.72);
    font-size: 12px;
    text-align: center;
    white-space: normal;
  }

  .nav-trigger::after {
    content: " \25BE";
    color: var(--accent, #facc15);
    font-size: 10px;
    line-height: 1;
  }

  .nav-menu {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: 360px;
    margin-top: 5px;
    padding: 5px;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.96);
    box-shadow: none;
  }

  .nav-dropdown:last-child .nav-menu {
    left: auto;
    right: auto;
  }

  .nav-menu a,
  .nav-menu span {
    justify-content: center;
    min-height: 36px;
    padding: 9px 8px;
    font-size: 12px;
    text-align: center;
  }

  .player-card,
  .video-item,
  .entry,
  .member-top,
  .time-card {
    gap: 9px;
    padding: 10px;
  }

  .thumb {
    width: 84px;
    min-width: 84px;
    font-size: 10px;
  }

  .lb-scroll,
  .log {
    max-height: 250px;
    padding: 8px;
  }

  .lb-row {
    padding: 8px 5px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 7px;
  }

  .card,
  .surface-card,
  .hero,
  .home-card,
  .home-panel,
  .content-card,
  .mini-card,
  .seo-hero,
  .profile-section,
  .intro,
  .community-section,
  .live-info,
  .video-embed-card {
    padding: 10px;
  }

  h1,
  header.page-header h1,
  .hero-title,
  .live-title {
    font-size: 20px;
  }

  .logo-circle {
    width: 50px;
    height: 50px;
    font-size: 17px;
  }

  .nav {
    gap: 5px;
    padding: 6px;
    border-radius: 14px;
  }

  .nav-dropdown {
    flex-basis: 100%;
    min-width: 0;
  }

  .nav a,
  .nav-trigger {
    min-height: 36px;
    padding: 8px;
  }

  .btn,
  button,
  .hero-actions .btn,
  .cta-block .btn,
  .action-row .btn,
  .quick-links a,
  .row .btn,
  .modal-actions .btn {
    width: 100%;
    flex-basis: 100%;
  }

  .player-card,
  .video-item,
  .member-top,
  .time-card {
    flex-direction: column;
  }

  .thumb {
    width: 100%;
    min-width: 0;
    min-height: 42px;
  }

  .player-avatar {
    width: 48px;
    height: 48px;
    font-size: 17px;
  }
}
