.art-page {
  --art-panel: #F3E3C3; --art-tray: #FBF0D8; --art-board: #FBF4E4; --art-dash: #E4D2AE;
  --art-gold: #F2C230; --art-silver: #CFD6DD; --art-bronze: #D9955B;
  width: 100%; min-width: 0; max-width: calc(1074px + 32px); padding-top: 18px;
}
.art-page [hidden] { display: none !important; }
.art-page .hub-tag { margin: 0; }
.art-page > .hub-title-row .hub-first-note { margin: 0 0 0 auto; font-size: 13px; }
.art-page .hub-top { grid-template-columns: minmax(0, 1fr); row-gap: 30px; margin-top: 34px; }
.art-picker { background: var(--art-panel); display: flex; flex-direction: column; padding: 30px 22px 22px; }
.art-page [data-tier="1"], #art-course-title { --tone: var(--mino-s); }
.art-page [data-tier="2"] { --tone: var(--mino-o); }
.art-page [data-tier="3"] { --tone: var(--mino-z); }
.art-banner { padding: 26px 22px 18px; }
.art-banner > .hub-first-note { margin: 0 0 10px; font-size: 13px; line-height: 1.8; }
.art-banner > .hub-first-note b { color: var(--ink); }
.art-course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.art-course {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px;
  border: var(--stroke-w) solid var(--line-soft); border-radius: 14px; background: var(--surface);
}
.art-course-head { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.art-course-head b { padding: 2px 12px; border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-pill); font-size: 13px; font-weight: 900; background: var(--tone); }
.art-course-head small { font-size: 12px; font-weight: 400; color: var(--muted); }
/* あそぶ＝頁でいちばん強い釦。色・枠・影は遊技頁の開始画面の主釦（game.css の plain .primary-button）と同じ値 */
.art-cta {
  display: block; margin: 2px 0 0; padding: 10px; text-align: center; text-decoration: none;
  background: var(--cta); color: var(--surface); border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-pill);
  box-shadow: 0 4px 0 var(--cta-edge); font-size: 14.5px; font-weight: 900; letter-spacing: 1px;
}
.art-cta:hover { background: var(--cta-hover); }
.art-cta:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cta-edge); }
.art-course-pics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.art-course-pics span { display: flex; align-items: center; justify-content: center; height: 70px; border-radius: 8px; background: var(--art-panel); }
.art-course-pics .art-thumb { width: auto; max-width: calc(100% - 8px); max-height: 60px; padding: 2px; }
.art-thumb { display: block; width: 100%; max-width: 62px; height: auto; padding: 3px; border: var(--stroke-w) solid var(--stroke); border-radius: 8px; background: var(--art-board); }
/* 通信を待つ間も 3 行を確保する。空の案内は同じ 3 行を使うため、順位が届いても版面の高さは変わらない。 */
.art-course .hub-grades {
  --medal-size: 22px; --row-pad: 4px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(3, calc(var(--medal-size) + 2 * (var(--row-pad) + var(--stroke-w)))); gap: 4px;
}
.art-course .hub-grade {
  flex-direction: row; justify-content: flex-start; gap: 10px; padding: var(--row-pad) 10px;
  border: var(--stroke-w) dashed var(--art-dash);
}
.art-course .hub-name { flex: 1; text-align: left; }
.art-course .hub-medal { flex: none; width: var(--medal-size); height: var(--medal-size); font-size: 11px; }
.art-course-empty {
  grid-row: 1 / -1; align-content: center; margin: 0; text-align: center;
  font-size: 12.5px; font-weight: 800; color: var(--accent); background: var(--soft); border-radius: 10px;
}
/* 今日よく遊ばれている：練習の格子の上の 1 行。札は 順位の丸・題・今日の人数 */
.art-hotline { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: var(--stroke-w) dashed var(--art-dash); }
.art-hotline h3 { margin: 0; font-size: 12.5px; font-weight: 900; white-space: nowrap; }
.art-hot { display: flex; flex-wrap: wrap; gap: 8px; }
.art-hot-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; color: var(--ink); text-decoration: none; background: var(--art-tray); border: var(--stroke-w) solid var(--stroke); border-radius: var(--radius-pill); }
.art-hot-pill .hub-medal { flex: none; width: 22px; height: 22px; font-size: 11px; }
.art-hot-pill .hub-name { white-space: nowrap; font-size: 12.5px; }
.art-hot-pill small { font-size: 11px; color: var(--muted); }
.art-hotline .hub-board-empty { margin: 0; font-size: 12px; }
.art-picker .hub-title-row { margin-bottom: 14px; gap: 8px; }
.art-picker .hub-first-note { margin: 0; font-size: 13px; }
.art-picker .hub-more { margin-inline-start: 4px; white-space: nowrap; }
.art-picker .hub-periods button { padding: 3px 12px; }
.art-page .hub-periods button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.art-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.art-grid a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; color: var(--ink); background: var(--surface); text-decoration: none; border-radius: 12px; border: var(--stroke-w) solid var(--stroke); }
.art-grid a > span {
  display: flex; align-items: center; justify-content: center; width: 100%; height: clamp(74px, 8vw, 84px);
  padding: 4px; box-sizing: border-box; border-radius: 8px; background: var(--art-tray);
}
.art-grid .art-thumb { width: auto; max-width: 100%; height: auto; max-height: 100%; box-sizing: border-box; object-fit: contain; }
/* 題は 1 行に収める（「ハンバーガー」が 2 行に折れて、その段だけマスが高くなった）。狭いときは字を詰めて、それでも余れば … */
.art-grid b { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center; font-size: clamp(11px, 1vw, 12.5px); letter-spacing: -.02em; }
.art-grid small { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 6px; margin-top: auto; font-size: 10.5px; letter-spacing: 1px; }
.art-grid small span { font-family: 'Share Tech Mono', monospace; color: var(--muted); letter-spacing: normal; }
.art-medal { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border-radius: 50%; border: 1.5px solid var(--stroke); }
.art-medal[data-medal="gold"] { background: var(--art-gold); }
.art-medal[data-medal="silver"] { background: var(--art-silver); }
.art-medal[data-medal="bronze"] { background: var(--art-bronze); }
.art-picker > .hub-play { display: block; margin: 16px auto 0; padding: 8px 22px; }


@media (max-width: 900px) {
  .art-page { padding-top: 8px; }
  .art-page .hub-top { gap: 34px; margin-top: 24px; }
  .art-banner { padding: 24px 12px 14px; }
  .art-banner > .hub-first-note { font-size: 12px; }
  .art-course-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .art-picker { padding: 24px 12px 12px; }
  .art-picker .hub-first-note { font-size: 12px; }
  .art-hotline { flex-wrap: wrap; }
  .art-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .art-grid a { padding: 6px 4px; border-radius: 10px; }
  .art-grid a > span { height: clamp(68px, 19vw, 74px); padding: 3px; }
  .art-grid b { font-size: 11px; }
  .art-grid small { column-gap: 4px; font-size: 9.5px; }
  .art-picker > .hub-play { margin-top: 12px; padding: 7px 18px; }
  .art-picker .hub-periods button { flex: none; padding: 2px 10px; }
}
/* 「盤面チャレンジとは」の 3 コマ（全站の .fig.is-trio）。手機でも横に 3 つ並べる —— 既定の縦積みだと 10×10 の盤が 3 枚縦に続いて長すぎる（十八稿・站長 11-20） */
@media (max-width: 560px) {
  .art-flow .fig-row { flex-wrap: nowrap; gap: 16px; }
  .art-flow .fig.is-trio .fig-cell, .art-flow.is-trio .fig-cell { flex: 1 1 0; min-width: 0; padding: 8px 4px; }
  .art-flow[data-fig="loop"] .fig-cell:not(:last-child)::after { right: -14px; font-size: 12px; }
  .art-flow figcaption { font-size: 10px; letter-spacing: 0; }
}

/* 首屏の版面を視口にぴったり合わせる（PC だけ。倍率は art/fit.js が --art-scale に出す）。
   版面は実寸 1074 幅で組み、transform で一度に縮める／伸ばす（首页の .console と同じ作り）。
   外側は縮めた後の高さを持ち、足りないぶんは min-height で首屏の底まで埋める —— 下の区块が覗かないように */
@media (min-width: 901px) {
  .art-stage.is-fit { height: calc(var(--art-h) * 1px * var(--art-scale)); min-height: calc(100svh - var(--art-top, 171px)); }
  .art-stage.is-fit.is-open { min-height: 0; } /* 展開中は首屏を埋めない（中身の高さ×同じ倍率） */
  .art-stage.is-fit > .hub-top { transform: scale(var(--art-scale)); transform-origin: top center; }
  /* 格子が読み込まれて倍率が決まるまで見せない（art.js の load の終わりで is-ready）。空の版面で決めた大きい倍率から縮む跳びを見せないため */
  @media (scripting: enabled) {
    .art-stage:not(.is-ready) > .hub-top,
    .art-page:has(> .art-stage:not(.is-ready)) > .hub-title-row { visibility: hidden; }
  }
  /* 題の行も縮めた版面と同じ幅・同じ左端に（版面だけ縮むと、題が左へはみ出して見えた・站長 11-20）*/
  /* 大きい画面では版面が頁の枠より広く伸びる（倍率 > 1）ので、枠からはみ出す分も左右へ等しく出す */
  .art-page:has(> .art-stage.is-fit) > .hub-title-row {
    --fit-w: calc(var(--art-w) * 1px * var(--art-scale));
    width: var(--fit-w); margin-inline: calc((100% - var(--fit-w)) / 2); box-sizing: border-box;
  }
}

/* ★の目安表は 5 列。手机では格子を折り返さず、表だけを横に送る（.table-wrap が横スクロールを持つ）。
   折り返すと最後の列が 1 字幅になり、縦に 1 字ずつ並んだ（11-20 整页通读で発見） */
#stars .pps-table th, #stars .pps-table td { white-space: nowrap; }
