/* phone.css — chỉnh riêng cho điện thoại (nạp sau cùng). 2026-11-22 */

/* Lưới bảng điều khiển trang Học: cột 1fr bị nội dung đẩy rộng hơn màn hình (Kế hoạch hôm nay, Bảng tin) làm cả trang trượt ngang */
@media (max-width: 900px) { .dgrid.a, .dgrid.b { grid-template-columns: minmax(0, 1fr); } }
.dgrid.b { grid-template-columns: minmax(0, 1fr); }
.dgrid > * { min-width: 0; }

@media (max-width: 640px) {
  /* Học thêm: 4 thẻ 2 cột, icon nằm trên chữ để chữ không bị bóp từng từ */
  .opt-cards.three.four { grid-template-columns: 1fr 1fr; gap: 12px; }
  .opt-cards.three.four .opt-card.hasop { grid-template-columns: minmax(0, 1fr); row-gap: 2px; padding: 14px; align-content: start; }
  .opt-cards.three.four .opt-card.hasop > .opic { grid-row: auto; grid-column: 1; width: 48px; height: 48px; border-radius: 16px; margin-bottom: 6px; }
  .opt-cards.three.four .opt-card.hasop > .opic .pic { width: 34px; height: 34px; }
  .opt-cards.three.four .opt-card.hasop > b, .opt-cards.three.four .opt-card.hasop > span, .opt-cards.three.four .opt-card.hasop > small { grid-column: 1; }
  .opt-cards.three.four .opt-card b { font-size: 1.12rem; line-height: 1.25; }
  .opt-cards.three.four .opt-card span { font-size: .9rem; }
  .opt-cards.three.four .opt-card small { font-size: .78rem; line-height: 1.35; }

  /* Menu đầy đủ: lưới 3 cột như ô ứng dụng, vừa một màn hình cùng thẻ hồ sơ */
  .mm-sheet { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); }
  .mm-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mm-list .mmrow { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding: 10px 4px 8px; min-height: 0; border-radius: 18px; text-align: center; }
  .mm-list .mmrow b { font-size: .78rem; line-height: 1.25; font-weight: 800; white-space: normal; }
  .mm-list .mmi { width: 44px; height: 44px; margin: 0; }
  .mm-sep { grid-column: 1 / -1; margin: 4px 10px; }
  .mm-me { margin-top: 8px; padding: 10px 12px; gap: 8px; }
  .mm-stats span { padding: 6px 10px; }

  /* Ô chọn trò trong Phòng chơi: 2 cột gọn thay vì 14 hàng dài */
  .rmgames.sel { grid-template-columns: 1fr 1fr; gap: 6px; }
  .rmgames.sel .rmg { padding: 8px; gap: 8px; align-items: center; }
  .rmgames.sel .rmg .gi { width: 30px; height: 30px; border-radius: 9px; } .rmgames.sel .rmg .gi .ic { width: 18px; height: 18px; }
  .rmgames.sel .rmg b { font-size: .86rem; line-height: 1.25; } .rmgames.sel .rmg small { font-size: .72rem; }

  /* Phòng chờ: ô màu đội nhỏ lại cho gọn; bảng điểm trong trận chừa chỗ cho tên */
  .teamrow { gap: 7px; }
  .teamrow .tsw { width: 36px; height: 36px; border-radius: 10px; }
  .teamrow .tsw .ic, .teamrow .tsw svg { width: 16px; height: 16px; }
  .teamlegend { gap: 6px; padding-right: 44px; } .teamlegend .tl { font-size: .8rem; padding: 3px 10px 3px 7px; }
  .slots:has(.steam) { row-gap: 34px; padding-top: 30px; }
  .srow .sscore { font-size: .7rem; white-space: nowrap; flex: none; }

  /* Từ điển: bớt thụt lề lồng nhau để câu ví dụ có chỗ */
  .dict .dsl > li { gap: 8px; }
  .dict .dsl-b .dex { margin-left: -38px; }
  .dict .dsl-b .dex, .dict .dex { padding: 10px; gap: 8px; border-radius: 16px; }
  .dict .dex .zh { font-size: 1.12rem; line-height: 1.5; }
  .dict .dex .dsay, .dict .dex > button:first-child { width: 34px; height: 34px; min-width: 34px; }
  .dict .dbar input { min-width: 0; }
  .dict .dbar input::placeholder { font-size: .88rem; }

  /* Ô giới thiệu (hero) các trang Luyện: gọn lại cho đỡ chiếm màn hình */
  .ly-pills { gap: 6px; margin-top: 10px; }
  .ly-pills span { font-size: .78rem; padding: 4px 10px; }
  .tp-pills span { font-size: .78rem; }

  /* Nút tốc độ đọc nổi: thu nhỏ, không đè lên nội dung */
  #spd { bottom: 104px; }
  #spd .spd-btn { min-width: 24px; padding: 5px 2px 4px 4px; font-size: .56rem; letter-spacing: -.02em; opacity: .85; }
  #spd .spd-btn .ic { width: 13px; height: 13px; }
  #spd.open .spd-btn { opacity: 1; }
}

@media (max-width: 380px) {
  .mm-list .mmrow b { font-size: .72rem; }
  .opt-cards.three.four { gap: 8px; }
  .opt-cards.three.four .opt-card.hasop { padding: 12px; }
}
