/* =================================================================
   MARS — responsive-fix.css
   À coller à la FIN de responsive.css.
   =================================================================
   Corrige : hit targets <44px, fonts <10px, chat cramped, settings
   wrap, chart endpoint marker. Purement additif — n'override que
   ce qui pose problème.
   ================================================================= */

/* ---- A. FLOOR TYPOGRAPHIQUE — plus rien sous 10px ---- */
@media (max-width: 480px) {
  .label,
  .day-label,
  .settings-item-desc,
  .nav-item .label,
  .stat-label,
  .meta-label,
  .caption,
  .hint,
  .chat-meta,
  .chat-ts {
    font-size: 10px !important;
    letter-spacing: 0.3px;
  }
  /* Valeurs / nombres restent lisibles */
  .stat-value,
  .score-value,
  .xp-amount {
    font-size: max(14px, 1em);
  }
}

/* ---- B. HIT TARGETS — minimum 44×44 partout ---- */
@media (max-width: 480px) {
  button,
  .btn,
  .chip,
  .icon-btn,
  input[type="checkbox"] + label,
  input[type="radio"] + label,
  .settings-item button,
  .settings-item .btn,
  .tab,
  .week-nav {
    min-height: 44px;
    min-width: 44px;
  }
  /* Checkbox habitude : zone invisible élargie */
  .habit-checkbox,
  .habit-check {
    position: relative;
  }
  .habit-checkbox::after,
  .habit-check::after {
    content: '';
    position: absolute;
    inset: -10px;
  }
}

/* ---- C. SETTINGS ROWS — ne jamais wrap ---- */
@media (max-width: 480px) {
  .settings-item {
    flex-wrap: nowrap !important;
    gap: 10px;
    min-height: 56px;
    align-items: center;
  }
  .settings-item .info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }
  .settings-item .info .label,
  .settings-item .info .desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .settings-item button,
  .settings-item .btn,
  .settings-item .action {
    flex-shrink: 0;
    max-width: 110px;
  }
}

/* ---- D. CHAT — reply button en long-press, pas hover ---- */
@media (max-width: 480px) {
  .chat-bubble {
    max-width: 90%;
  }
  .chat-reply-btn {
    /* Caché par défaut, apparaît sur .selected (activé par long-press) */
    display: none;
  }
  .chat-bubble.selected .chat-reply-btn {
    display: inline-flex;
    position: absolute;
    top: -28px;
    right: 0;
    background: var(--m-charcoal, #1E1E1E);
    border: 1px solid var(--m-steel, #3A3A3A);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    color: var(--m-accent-green, #19E639);
  }
}

/* ---- E. SCORE BANNER — tighten sur ≤360 ---- */
@media (max-width: 360px) {
  .score-banner {
    padding: 12px 14px;
    gap: 10px;
  }
  .score-banner .icon {
    width: 32px;
    height: 32px;
  }
  .score-banner .label {
    font-size: 10px;
    letter-spacing: 1.5px;
  }
  .score-banner .value {
    font-size: 22px;
    min-width: 48px;
  }
}

/* ---- F. HABIT ROWS — min-height 60px ---- */
@media (max-width: 480px) {
  .habit-item,
  .mission-item {
    min-height: 60px;
    padding: 12px 14px;
    gap: 12px;
  }
  .habit-item .icon,
  .mission-item .icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  .habit-item .name {
    font-size: 13px;
  }
}

/* ---- G. PAGES — gap horizontal 12px (pas 8) pour respirer ---- */
@media (max-width: 480px) {
  .page,
  .page-content {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ---- H. PULL-TO-REFRESH — état visuel ---- */
.ptr-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0;
  overflow: hidden;
  transition: height 0.2s ease;
  color: var(--m-accent-green, #19E639);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
}
.ptr-active .ptr-indicator {
  height: 50px;
}
.ptr-refreshing .ptr-indicator::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ptrSpin 0.7s linear infinite;
  margin-right: 8px;
}
@keyframes ptrSpin {
  to { transform: rotate(360deg); }
}
