/* 彬彬中文 · 小工具/小游戏 手机与 iPad 竖屏适配
   Shared mobile + tablet-portrait tweaks for the bb-styled tools.
   在各工具页的内联 <style> 之后引入，因此同名规则会覆盖内联样式。 */

@media (max-width: 900px) {
  /* ── 页面外框 ── */
  body { padding: 14px 12px 32px; }
  body::before { font-size: 190px; top: -30px; }
  body::after  { font-size: 150px; bottom: -40px; }

  /* ── 页头 ── */
  .bb-head { gap: 10px; margin-bottom: 12px; }
  .bb-head img { height: 40px; }
  .bb-head h1 { font-size: 22px; }
  .bb-head .bb-sub { font-size: 11px; }
  .bb-back { padding: 8px 14px; font-size: 12px; }
  .hint { font-size: 12.5px; margin-bottom: 12px; }

  /* ── 表单：16px 可避免 iOS Safari 聚焦时自动放大整页 ── */
  fieldset { padding: 14px 12px; border-radius: 16px; }
  legend { font-size: 13px; }
  input[type="text"], input[type="number"], input[type="search"],
  select, textarea {
    font-size: 16px;
    max-width: none;
    width: 100%;
  }
  input[type="checkbox"], input[type="radio"] { width: auto; transform: scale(1.15); }
  label { line-height: 1.5; }

  /* ── 计分板 ── */
  #scoreboard, .scoreboard { gap: 8px; }
  .scoreCard { min-width: 78px; padding: 8px 10px; border-radius: 14px; }
  .scoreCard .pts { font-size: 20px; }
  .scoreCard .name { font-size: 12px; }

  /* ── 提示条 ── */
  #banner, #pBanner, #turnBanner, #roomBar {
    font-size: 15px; padding: 10px 12px; border-radius: 14px; margin-bottom: 12px;
  }

  /* ── 翻字大挑战：卡片格子 ── */
  #board, .board { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
  .card { font-size: 38px; border-radius: 14px; }
  .card.done::after { margin-left: 40px; margin-top: -40px; }

  /* 底部判分条 */
  #judgeBar { bottom: 10px; padding: 10px 12px; gap: 8px; border-radius: 18px; }
  #judgeBar .jChar { font-size: 34px; padding: 3px 9px; }
  #judgeBar button { font-size: 14px; padding: 12px 16px; }

  /* ── 成语抢答：字格与主持人按钮 ── */
  #stage, .stage { padding: 18px 12px; border-radius: 18px; }
  #valueTag { font-size: 22px; padding: 6px 20px; margin-bottom: 14px; }
  #charRow { gap: 8px; margin-bottom: 14px; }
  .charBox { width: 64px; height: 64px; font-size: 38px; border-radius: 10px; }
  .charBox.hidden { font-size: 30px; }
  #countdown { font-size: 32px; }
  #hostBar { gap: 8px; }
  #hostBar button { font-size: 14px; padding: 12px 18px; }
  #buzzBtn { width: min(190px, 62vw); height: min(190px, 62vw); font-size: 28px; }

  /* ── 联机版大厅 ── */
  .lobby-card { padding: 16px 12px; border-radius: 16px; }
  .lobby-card input[type="text"] { width: 100% !important; max-width: none !important; }

  /* ── 词语连连看 ── */
  .arena { gap: 6px; grid-template-columns: 1fr 16px 1fr; }
  .col { gap: 6px; }
  .char-btn { height: 60px; font-size: 30px; border-radius: 14px; }
  .top-bar button { padding: 10px 14px; }

  /* ── 识字小测 ── */
  #charGrid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
  .uk-grid { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
  .table-stats { min-width: 0; }
  .stat-card { min-width: 92px; padding: 12px 14px; }

  /* ── 结算/报告 ── */
  #finalBoard, .finalBox, #final { padding: 20px 14px; border-radius: 18px; }
  .rep-student, .rep-none { padding: 14px 12px; }
  .rep-char { font-size: 28px; padding: 5px 8px; }
}

@media (max-width: 480px) {
  .bb-head h1 { font-size: 19px; }
  #board, .board { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .card { font-size: 32px; }
  .charBox { width: 56px; height: 56px; font-size: 32px; }
  .charBox.hidden { font-size: 26px; }
  .char-btn { height: 54px; font-size: 27px; }
  #judgeBar { left: 8px; right: 8px; transform: none; max-width: none; }
}
