/* Cross-page layout contracts verified at mobile, tablet and desktop widths.
   Wide data tables scroll inside their own container; numbers never get cut. */
.fb-box,
.six-calendar-panel { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.pc-nav-item.mega:focus-within .pc-mega { display: grid; }
.pc-mega { max-height: calc(100vh - 128px); max-height: calc(100dvh - 128px); overflow-y: auto; overscroll-behavior: contain; }
:where(button, a, [role="button"]):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (min-width: 768px) {
  .pc-live-wrap { min-width: 0; max-width: 100%; }
  .pc-live.kind-race .pc-live-table { min-width: 1150px; }
  .pc-live.kind-bingo .pc-live-table { min-width: 1215px; }
  .pc-live.kind-fantan:not(.is-bingo-ft) .pc-live-table { min-width: 1000px; }
  .pc-live.kind-fantan:not(.is-bingo-ft) .col-time { width: 168px; }
  .pc-live.kind-fantan:not(.is-bingo-ft) .col-per { width: 96px; }
  .pc-live.kind-fantan:not(.is-bingo-ft) .col-ft { width: 96px; }
  .pc-live.kind-fantan:not(.is-bingo-ft) .col-nums { width: auto; }
  .pc-live.kind-fantan:not(.is-bingo-ft) .history-table th,
  .pc-live.kind-fantan:not(.is-bingo-ft) .history-table td { padding: 8px 4px !important; }
  .pc-live .six-history { min-width: 1100px; }
  .six-history .six-period-col { width: 200px; }
  .six-history .six-main-col { width: 120px; }
  .six-history .six-special-col { width: 60px; }
  .six-history .six-stat-col { width: 80px; }
  .six-history .six-period { white-space: nowrap; }

  .public-nav a { border: 1px solid var(--line); color: #2c3a4d; }
  .public-nav a.on { color: #fff; border-color: var(--primary-deep); background: var(--primary-deep); }
  .more-pc > h1 { margin: 0 0 16px; font-size: 22px; line-height: 1.4; }
  .more-pc .public-nav {
    padding: 18px 20px; margin-bottom: 16px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; gap: 10px;
  }
  .more-pc .public-nav a {
    padding: 8px 16px; font-size: 15px; border-radius: 8px;
    border-color: #e8eef6; background: #f8fbff;
  }
  .more-pc .page-body { padding: 16px 20px; }
  .more-pc .page-body h1 { font-size: 16px; }

  .rules-body { grid-template-columns: minmax(0, 1fr); }
  .rules-body > .pc-side { display: none; }
  .rules-page { padding: 0; border: 0; background: transparent; }
  .rule-page-heading .rule-return { float: none; display: inline-block; margin-bottom: 8px; }
  .rule-page-heading h1 { margin: 0 0 16px; font-size: 22px; line-height: 1.4; }
  .rules-page .rule-tabs,
  .rules-page .rule-article { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
  .rules-page .rule-tabs { padding: 16px 20px; margin-bottom: 16px; }
  .rules-page .rule-group { display: block; padding: 0; margin-bottom: 8px; }
  .rules-page .rule-group:last-child { margin-bottom: 0; }
  .rules-page .rule-group strong { display: block; width: auto; margin-bottom: 6px; color: #2b4a6f; }
  .rules-page .rule-tabs a {
    display: inline-flex; padding: 4px 12px; margin: 0 4px 4px 0;
    border: 1px solid var(--line); border-radius: 999px; background: #f7fafc;
  }
  .rules-page .rule-tabs a.on { color: #fff; background: var(--primary); border-color: var(--primary); }
  .rules-page .rule-article { padding: 24px 28px; color: #222; }
  .rules-page .rule-article h2 { color: #2b4a6f; }
}

@media (max-width: 767px) {
  /* Desktop margins must not be added a second time to the mobile result row. */
  .detail-panel[data-analysis-kind="fantan"] .pc-hero-balls { gap: 0; }
  .pc-hero-balls .pc-ft-jg-row { gap: .16rem; margin-top: 0; padding: .053333rem .08rem 0; }
  .pc-hero-balls .pc-ft-hero-jg { flex: 1 1 0; min-width: 0; gap: .08rem; font-size: .32rem; }
  .pc-hero-balls .pc-ft-hero-jg .yuan { width: .213333rem; height: .213333rem; flex-shrink: 0; }
  .bingo-ft-hero { gap: .12rem; }
  .bingo-ft-main { flex: 1 1 0; min-width: 0; }
  .pc-hero-balls.is-bingo-ft .ball-row { gap: .06rem; }
  .sheet-root .sheet { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; }
  .drawer { overflow-y: auto; }
  .rec-page .wait-card { border-radius: .426667rem; }
  .more-page { padding-bottom: 0 !important; }
  .rules-page { display: flex; flex-direction: column; }
  .rules-page .rule-tabs { order: 0; }
  .rule-page-heading { order: 1; padding: .426667rem .426667rem 0; }
  .rule-page-heading h1 { margin: 0 0 .266667rem; font-size: .4rem; line-height: 1.4; }
  .rule-page-heading .rule-return { float: right; font-size: .3rem; }
  .rules-page .rule-article { order: 2; padding-top: 0; color: #222; }
  .rules-page .rule-article h2 { color: #2b4a6f; }
}
