/*
 * 5G Activity Engine 共通の見た目
 *
 * 依存ファイル: なし（Google Fonts の Zen Maru Gothic・BIZ UDPGothic を各ページの <head> で読む。読めなくても標準の書体で表示される）
 * このファイルを呼び出すコード: play/index.html・play/records.html・play/records-sheet.html・play/articles/*.html・play/games/*.html（keisan・kazu・moji・kioku・hanno・rule-quiz・tokuten・kaiten）・play/exercise/taiso-timer.html
 * このファイルが呼び出すファイル: なし
 *
 * 色はマスコットの絵から取った: 卓球台の青・ラバーの赤・ラケットの木
 * 文字の大きさは <html data-font="std|large|xlarge"> で切り替える（FiveG.settings）
 */
:root {
  --table: #3181BC;
  --table-deep: #1F5E91;
  --table-ink: #17476E;
  --rubber: #BF0000;
  --rubber-deep: #9E0000;
  --wood: #EAC382;
  --wood-tint: #FBF3E4;
  --ink: #22303C;
  --sub: #4E5D6A;
  --line: #D5DFE8;
  --ok: #1E7A3C;
  --ok-tint: #E7F4EB;
  --ng: #9E0000;
  --ng-tint: #FBEAEA;
  --radius: 14px;
}

html { font-size: 18px; }
html[data-font="large"] { font-size: 21px; }
html[data-font="xlarge"] { font-size: 25px; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: 'BIZ UDPGothic', 'Hiragino Sans', 'Yu Gothic', Meiryo, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, .g5-title { font-family: 'Zen Maru Gothic', 'BIZ UDPGothic', sans-serif; font-weight: 700; line-height: 1.35; }

a { color: var(--table-deep); }

:focus-visible { outline: 3px solid var(--rubber); outline-offset: 3px; }

.g5-wrap { max-width: 980px; margin: 0 auto; padding: 0 1.1rem; }

/* ---------- ヘッダー ---------- */
.g5-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.g5-header-inner { max-width: 980px; margin: 0 auto; padding: .5rem 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.g5-brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font-weight: 700; }
.g5-brand span { font-family: 'Zen Maru Gothic', sans-serif; }
.g5-nav { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.g5-nav a, .g5-settings-btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 .9rem;
  font: inherit; font-size: .95rem; font-weight: 700; color: var(--ink); text-decoration: none;
  background: none; border: 0; border-radius: 999px; cursor: pointer;
}
.g5-nav a:hover, .g5-settings-btn:hover { background: #EEF4FA; }
.g5-settings-btn { border: 2px solid var(--line); }
.g5-settings-btn[aria-expanded="true"] { border-color: var(--table-deep); background: #EEF4FA; }

.g5-settings { max-width: 980px; margin: 0 auto; padding: .4rem 1.1rem 1rem; display: flex; flex-wrap: wrap; gap: .4rem 2rem; }
.g5-choice { border: 0; padding: 0; margin: 0; }
.g5-choice legend { font-weight: 700; font-size: .95rem; padding: 0; margin-bottom: .3rem; }
.g5-choice-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.g5-choice button {
  min-height: 48px; min-width: 4.5rem; padding: 0 1rem; font: inherit; font-size: .95rem; font-weight: 700;
  color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 10px; cursor: pointer;
}
.g5-choice button[aria-pressed="true"] { background: var(--table-deep); border-color: var(--table-deep); color: #fff; }
.g5-choice button[aria-pressed="true"]::before { content: "✓ "; }
.g5-settings .g5-small { flex-basis: 100%; margin: .2rem 0 0; }

.g5-notice { margin: 0; padding: .6rem 1.1rem; background: var(--wood-tint); color: #5A4A30; font-size: .95rem; text-align: center; }
.g5-small { font-size: .88rem; color: var(--sub); }

/* ---------- ボタン ---------- */
.g5-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 56px; padding: .5rem 1.6rem; font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.3;
  color: var(--table-deep); background: #fff; border: 2px solid var(--table-deep); border-radius: 999px;
  text-decoration: none; cursor: pointer; text-align: center;
}
.g5-btn:hover { background: #EEF4FA; }
.g5-btn--main { color: #fff; background: var(--rubber); border-color: var(--rubber); }
.g5-btn--main:hover { background: var(--rubber-deep); border-color: var(--rubber-deep); }
.g5-btn--quiet { border-color: var(--line); color: var(--ink); min-height: 48px; padding: .3rem 1.1rem; font-size: .95rem; }
.g5-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin: 1.4rem 0 .6rem; }

/* ---------- マスコット ---------- */
.g5-mascot { display: flex; align-items: center; gap: .8rem; margin: 1rem 0; }
.g5-mascot-svg { flex: none; }
.g5-mascot-bubble {
  position: relative; margin: 0; padding: .7rem 1.1rem; background: var(--wood-tint);
  border: 2px solid var(--wood); border-radius: 16px; font-weight: 700;
}
.g5-mascot-bubble::before {
  content: ""; position: absolute; left: -10px; top: 50%; margin-top: -8px;
  border: 8px solid transparent; border-right-color: var(--wood); border-left: 0;
}
.g5-mascot--happy .g5-mascot-svg { transform: rotate(-8deg); }

/* マスコットの出てくるときの動き（1 回だけ。くり返さない・点滅しない。動きを減らす設定の端末では下の prefers-reduced-motion で止まる） */
.g5-mascot .g5-mascot-svg { animation: g5-pop .45s ease-out both; }
.g5-mascot .g5-mascot-bubble { animation: g5-bubble .45s ease-out .1s both; }
.g5-mascot--happy .g5-mascot-svg { animation: g5-hop .9s ease-out both; }
.g5-mascot--cheer .g5-mascot-svg { animation: g5-wave 1.2s ease-in-out both; }
.g5-hero .g5-mascot-svg { animation: g5-pop .5s ease-out both; }
.g5-hero-say { animation: g5-bubble .45s ease-out .15s both; }
@keyframes g5-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@keyframes g5-bubble { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes g5-hop {
  0% { opacity: 0; transform: translateY(6px) rotate(-8deg); }
  30% { opacity: 1; transform: translateY(-12px) rotate(-8deg); }
  55% { transform: translateY(0) rotate(-8deg); }
  75% { transform: translateY(-6px) rotate(-8deg); }
  100% { transform: translateY(0) rotate(-8deg); }
}
@keyframes g5-wave {
  0% { opacity: 0; transform: scale(.7) rotate(0); }
  25% { opacity: 1; transform: scale(1.08) rotate(-12deg); }
  45% { transform: scale(1.08) rotate(10deg); }
  65% { transform: scale(1.04) rotate(-8deg); }
  85% { transform: scale(1) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ---------- ゲームの画面 ---------- */
.g5-main { padding: 1.4rem 0 3rem; }
.g5-panel { max-width: 760px; margin: 0 auto; }
.g5-title { font-size: 1.9rem; margin: .4rem 0 .6rem; }
.g5-intro { font-size: 1.05rem; }
.g5-meta { margin: .3rem 0; color: var(--sub); }
.g5-meta strong { color: var(--ink); }
.g5-play-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.g5-progress { margin: 0; font-weight: 700; font-size: 1.05rem; }
.g5-status { min-height: 2.6em; margin: 1rem 0 0; padding: .6rem 1rem; border-radius: 10px; font-weight: 700; font-size: 1.1rem; }
.g5-status:empty { padding: 0; }
.g5-status.is-ok { background: var(--ok-tint); color: var(--ok); }
.g5-status.is-ng { background: var(--ng-tint); color: var(--ng); }
.g5-status.is-ok::before { content: "○ "; }
.g5-status.is-ng::before { content: "× "; }
.g5-score { font-family: 'Zen Maru Gothic', sans-serif; font-size: 1.7rem; font-weight: 700; margin: .4rem 0; }
.g5-badge { display: inline-block; padding: .3rem 1rem; background: var(--wood-tint); border: 2px solid var(--wood); border-radius: 999px; font-weight: 700; }

/* 数字や文字のマス（数字探し・文字探しで使う） */
.g5-grid { display: grid; gap: .5rem; margin: 0 auto; max-width: 560px; }
.g5-cell {
  aspect-ratio: 1; min-height: 56px; display: flex; align-items: center; justify-content: center;
  font: inherit; font-family: 'Zen Maru Gothic', 'BIZ UDPGothic', sans-serif; font-weight: 700; font-size: 1.6rem;
  color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; padding: 0;
}
.g5-cell:hover { border-color: var(--table); }
.g5-cell[aria-pressed="true"], .g5-cell.is-done { background: var(--table-deep); border-color: var(--table-deep); color: #fff; }
.g5-cell.is-done::after { content: "✓"; font-size: .6em; margin-left: .15em; }
.g5-cell.is-miss { border-color: var(--ng); border-style: dashed; }
.g5-cell:disabled { cursor: default; }

/* 数字を入れるボタン（計算ゲーム） */
.g5-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; max-width: 360px; margin: 1rem auto 0; }
.g5-key {
  min-height: 64px; font: inherit; font-size: 1.5rem; font-weight: 700; color: var(--ink);
  background: #fff; border: 2px solid var(--line); border-radius: 12px; cursor: pointer;
}
.g5-key:hover { border-color: var(--table); }
.g5-key--wide { font-size: 1.05rem; }
.g5-key--go { background: var(--rubber); border-color: var(--rubber); color: #fff; font-size: 1.1rem; }

/* ---------- 一覧ページ ---------- */
.g5-hero { background: var(--table); color: #fff; border-bottom: 8px solid #fff; box-shadow: 0 8px 0 var(--table); margin-bottom: 8px; }
.g5-hero .g5-wrap { padding-top: 2.2rem; padding-bottom: 2.2rem; display: flex; align-items: center; gap: 1.4rem; }
.g5-hero h1 { font-size: 2rem; margin: 0 0 .4rem; }
.g5-hero p { margin: 0; max-width: 34em; }
.g5-hero .g5-mascot-svg { filter: drop-shadow(0 4px 0 rgba(0,0,0,.15)); }
.g5-hero .g5-hero-say { display: inline-block; margin: .8rem 0 0; padding: .5rem 1rem; max-width: 34em; background: var(--wood-tint); color: var(--ink); border: 2px solid var(--wood); border-radius: 16px; font-weight: 700; }
.g5-section { padding: 2.2rem 0 .6rem; }
.g5-section h2 { font-size: 1.5rem; margin: 0 0 .3rem; }
.g5-section > .g5-wrap > p { margin: 0 0 1.2rem; color: var(--sub); }

.g5-today { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; padding: 1.4rem; background: var(--wood-tint); border: 2px solid var(--wood); border-radius: var(--radius); }
.g5-today h3 { margin: 0 0 .2rem; font-size: 1.45rem; }
.g5-today p { margin: 0 0 .8rem; }
.g5-today .g5-label { display: block; font-weight: 700; color: #7A5A20; font-size: .95rem; }

.g5-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.g5-item a {
  display: block; height: 100%; padding: 1.1rem 1.2rem 1.2rem; color: var(--ink); text-decoration: none;
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
}
.g5-item a:hover { border-color: var(--table); }
.g5-item h3 { margin: 0 0 .3rem; font-size: 1.25rem; color: var(--table-ink); }
.g5-item p { margin: 0; font-size: .95rem; color: var(--sub); }
.g5-item .g5-go { display: inline-block; margin-top: .7rem; font-weight: 700; color: var(--rubber); }
.g5-item.is-soon a { border-style: dashed; color: var(--sub); pointer-events: none; }

/* ---------- 記録ページ ---------- */
.g5-cal { width: 100%; border-collapse: separate; border-spacing: .3rem; table-layout: fixed; }
.g5-cal caption { text-align: left; font-weight: 700; font-size: 1.2rem; padding-bottom: .4rem; }
.g5-cal th { font-size: .9rem; color: var(--sub); font-weight: 700; }
.g5-cal td { height: 4.2rem; vertical-align: top; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 10px; font-size: .9rem; }
.g5-cal td.is-empty { border: 0; }
.g5-cal td.is-today { border: 2px solid var(--table-deep); }
.g5-cal .g5-day { font-weight: 700; display: block; }
.g5-cal .g5-mark { display: block; font-size: .78rem; line-height: 1.3; font-weight: 700; }
.g5-cal .g5-mark--game { color: var(--table-deep); }
.g5-cal .g5-mark--exercise { color: var(--rubber); }
.g5-cal-nav { display: flex; gap: .6rem; align-items: center; margin: .6rem 0 1rem; flex-wrap: wrap; }
.g5-stats { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.g5-stats li { padding: .8rem 1.2rem; border: 2px solid var(--line); border-radius: var(--radius); }
.g5-stats strong { display: block; font-size: 1.5rem; font-family: 'Zen Maru Gothic', sans-serif; }
.g5-history { width: 100%; border-collapse: collapse; font-size: .95rem; }
.g5-history th, .g5-history td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--line); }

.g5-footer { margin-top: 3rem; padding: 1.4rem 0; background: var(--table-deep); color: #fff; text-align: center; font-size: .9rem; }
.g5-footer a { color: #fff; }

@media (max-width: 640px) {
  .g5-header-inner { padding: .3rem .8rem; gap: .2rem; }
  .g5-brand span { font-size: .95rem; }
  .g5-nav a, .g5-settings-btn { padding: 0 .6rem; font-size: .9rem; }
  .g5-hero .g5-wrap { flex-direction: column; align-items: flex-start; }
  .g5-today { grid-template-columns: 1fr; }
  .g5-title { font-size: 1.6rem; }
  .g5-cell { font-size: 1.3rem; }
  .g5-cal td { height: 3.4rem; padding: .2rem; }
}

/* ---------- 上の帯（会員ページ apps/header.php と同じ形。2026-12-01） ----------
 * 文字の大きさの設定（html の font-size）で帯がくずれないよう、帯の文字は px で決める */
.g5u-head { font-size: 16px; }
.g5u-in { max-width: 1080px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 22px; }
.g5u-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); line-height: 1.2; flex-shrink: 0; }
.g5u-brand:hover { color: var(--ink); }
.g5u-mark { width: 34px; height: 34px; flex-shrink: 0; }
.g5u-brand b { display: block; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; font-size: 18px; }
.g5u-brand small { display: block; color: var(--sub); font-size: 13px; }
.g5u-nav-wrap { flex: 1; }
.g5u-nav { display: flex; gap: 3px; margin: 0; padding: 0; list-style: none; }
.g5u-nav a {
  display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 13px; border-radius: 10px;
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: 16px; white-space: nowrap;
}
.g5u-nav a:hover { background: #EAF2F9; color: var(--table-ink); }
.g5u-nav a[aria-current="page"] { background: #EAF2F9; color: var(--table-deep); box-shadow: inset 0 -3px 0 var(--table); }
.g5u-i { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.g5u-nav .g5u-i { color: var(--table); }
.g5u-user { display: flex; align-items: center; gap: 8px; margin-left: auto; white-space: nowrap; }
.g5u-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 14px;
  border: 1px solid #6C757D; border-radius: 8px; color: #495057; background: #fff; text-decoration: none; font-size: 15px; font-weight: 700;
}
.g5u-btn:hover { background: #6C757D; color: #fff; }
.g5u-btn--main { border-color: var(--rubber); background: var(--rubber); color: #fff; }
.g5u-btn--main:hover { border-color: var(--rubber-deep); background: var(--rubber-deep); color: #fff; }
.g5u-sub { border-top: 1px solid var(--line); background: #FBFCFD; }
.g5u-sub__in { max-width: 1080px; margin: 0 auto; padding: 4px 20px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.g5u-sub__in a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px;
  font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: none;
}
.g5u-sub__in a:hover { background: #EEF4FA; }
.g5u-sub__in a[aria-current="page"] { color: var(--table-deep); background: #EEF4FA; }
.g5u-sub .g5-settings-btn { margin-left: auto; min-height: 44px; font-size: 15px; }
.g5u-head .g5-settings { font-size: 16px; }
.g5u-tabs { display: none; }
/* 少し狭い画面: ヘルプ・ログアウトはアイコンだけ（ログインは文字も出す） */
@media (max-width: 1199.98px) {
  .g5u-in { gap: 14px; }
  .g5u-nav a { padding: 0 9px; }
  .g5u-btn:not(.g5u-btn--main) .g5u-label { display: none; }
  .g5u-btn { padding: 0 11px; }
}
/* スマホ: 上の帯のメニューは隠し、会員は下に大きいボタンの帯（ホーム・記録・コース・あそび・設定） */
@media (max-width: 991.98px) {
  .g5u-nav-wrap { display: none; }
  .g5u-in { padding: 6px 12px; justify-content: space-between; }
  .g5u-sub__in { padding: 2px 8px; }
  .g5u-sub__in a { padding: 0 10px; font-size: 14px; }
  .g5u-sub .g5-settings-btn { font-size: 14px; padding: 0 10px; }
  .g5u-tabs {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .g5u-tabs a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 66px;
    text-decoration: none; color: var(--sub); font-size: 13px; font-weight: 700;
  }
  .g5u-tabs .g5u-i { width: 24px; height: 24px; }
  .g5u-tabs a[aria-current="page"] { color: var(--table-deep); box-shadow: inset 0 3px 0 var(--table); }
  body.g5u-has-tabs { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .g5u-brand small { display: none; }
  .g5u-brand b { font-size: 16px; }
}
@media print {
  .g5u-tabs, .g5u-sub { display: none !important; }
  body.g5u-has-tabs { padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- 印刷 ---------- */
@media print {
  .g5-header, .g5-footer, .g5-no-print, .g5-actions { display: none !important; }
  body { font-size: 12pt; }
  .g5-cal td { height: 2.2cm; border: 1px solid #999; }
  .g5-section { padding: 0; }
  a { color: #000; text-decoration: none; }
}

/* ---------- 各ゲームの細かい見た目 ---------- */
.keisan-q { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; font-size: 2.6rem; text-align: center; margin: .2rem 0 .6rem; letter-spacing: .04em; }
.keisan-a { display: flex; justify-content: center; align-items: center; gap: .8rem; margin: 0; }
.keisan-label { font-weight: 700; }
.keisan-out { display: inline-block; min-width: 6ch; min-height: 1.5em; padding: .1rem 1rem; border: 3px solid var(--table-deep); border-radius: 12px; font-size: 2rem; font-weight: 700; text-align: center; line-height: 1.4; }
.keisan-next, .moji-next { justify-content: center; }
.kazu-next, .moji-target { font-size: 1.25rem; font-weight: 700; text-align: center; margin: 0 0 1rem; }
.moji-big { display: inline-block; min-width: 1.6em; font-family: 'Zen Maru Gothic', sans-serif; font-size: 2.3rem; color: var(--rubber); vertical-align: middle; border-bottom: 3px solid var(--rubber); text-align: center; }
.g5-danger { margin-top: 1.6rem; }
.g5-danger summary { cursor: pointer; font-weight: 700; color: var(--sub); min-height: 48px; display: flex; align-items: center; }
.today-mascot { display: block; }

/* 記憶ゲーム */
.kioku-lead { font-size: 1.25rem; font-weight: 700; text-align: center; margin: 0 0 1rem; }
.kioku-seq { list-style: none; padding: 0; margin: 0 auto 1rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.kioku-card { position: relative; display: flex; flex-direction: column; align-items: center; width: 6.2rem; padding: .6rem .3rem .4rem; background: #fff; border: 2px solid var(--line); border-radius: 12px; }
.kioku-card.is-ok { border-color: var(--ok); background: var(--ok-tint); }
.kioku-card.is-ng { border-color: var(--ng); border-width: 3px; background: var(--ng-tint); }
.kioku-no { position: absolute; top: .2rem; left: .45rem; font-weight: 700; font-size: .9rem; color: var(--sub); }
.kioku-name { display: block; font-size: .82rem; font-weight: 700; line-height: 1.3; margin-top: .2rem; }
.kioku-board { max-width: 480px; }
.kioku-cell { flex-direction: column; aspect-ratio: auto; min-height: 104px; padding: .4rem 0; }
.kioku-cell.is-done { background: var(--ok-tint); border-color: var(--ok); color: var(--ink); }
.kioku-cell.is-done::after { content: none; }
.kioku-cell.is-miss { background: var(--ng-tint); }
.kioku-next, .kioku-ready { justify-content: center; }

/* 反応ゲーム（点滅はしない） */
.hanno-pad {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; max-width: 560px; min-height: 16rem; margin: 0 auto; padding: 1rem;
  font: inherit; font-family: 'Zen Maru Gothic', 'BIZ UDPGothic', sans-serif; font-weight: 700; font-size: 1.6rem;
  color: var(--ink); background: #fff; border: 3px solid var(--line); border-radius: 20px; cursor: pointer;
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.hanno-pad.is-idle { border-color: var(--table-deep); color: var(--table-deep); }
.hanno-pad.is-wait { background: #EEF4FA; border-style: dashed; color: var(--sub); }
.hanno-pad.is-go { background: var(--wood-tint); border-color: var(--rubber); color: var(--rubber); }
.hanno-ball { display: block; width: 6rem; height: 6rem; border-radius: 50%; background: var(--rubber); box-shadow: inset -10px -10px 0 rgba(0,0,0,.18); }
.hanno-help { text-align: center; }
.hanno-times { max-width: 560px; margin: .6rem auto 0; padding: 0; list-style: none; columns: 2; font-weight: 700; }

/* ---------- 無料・有料の印 ---------- */
.g5-plan { display: inline-block; margin-bottom: .3rem; padding: 0 .7rem; border-radius: 999px; font-size: .82rem; font-weight: 700; line-height: 1.9; }
.g5-plan--free { background: #E7F4EB; color: var(--ok); border: 1px solid #B9DEC5; }
.g5-plan--paid { background: var(--wood-tint); color: #7A5A20; border: 1px solid var(--wood); }

/* ---------- アカウントの画面 ---------- */
.g5-account { max-width: 640px; }
.g5-form { margin: 1rem 0; }
.g5-field { margin: 0 0 1.1rem; border: 0; padding: 0; }
.g5-field > label, .g5-field > legend { display: block; font-weight: 700; margin-bottom: .3rem; padding: 0; }
.g5-field input, .g5-field select {
  width: 100%; min-height: 56px; padding: .5rem .9rem; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: #fff; border: 2px solid #9FB3C6; border-radius: 10px;
}
.g5-field input:focus, .g5-field select:focus { border-color: var(--table-deep); outline: 3px solid rgba(31,94,145,.25); outline-offset: 0; }
.g5-birth { display: flex; flex-wrap: wrap; gap: .6rem; }
.g5-birth legend { flex-basis: 100%; }
.g5-birth label { flex: 1 1 8rem; }
.g5-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.g5-actions form { margin: 0; }
.g5-profile { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.4rem; margin: 1rem 0; padding: 1.2rem 1.4rem; border: 2px solid var(--line); border-radius: var(--radius); }
.g5-profile dt { font-weight: 700; color: var(--sub); }
.g5-profile dd { margin: 0; word-break: break-all; }
.g5-status div + div { margin-top: .2rem; }

/* ---------- 体操タイマー ---------- */
.timer-presets { margin: 1rem 0; }
.timer-presets button { display: flex; flex-direction: column; align-items: flex-start; padding: .5rem 1rem; line-height: 1.4; text-align: left; }
.timer-preset-sub { display: block; font-size: .8rem; font-weight: 400; }
.timer-steps { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: 1rem 0; }
.timer-step-title { display: block; font-weight: 700; margin-bottom: .3rem; }
.timer-step-row { display: flex; align-items: center; gap: .5rem; }
.timer-step-row .g5-btn { min-width: 56px; min-height: 56px; padding: 0; font-size: 1.4rem; }
.timer-step-val { min-width: 4.5em; text-align: center; font-size: 1.3rem; font-weight: 700; }
.timer-examples { margin: 1.2rem 0; }
.timer-examples summary { cursor: pointer; font-weight: 700; min-height: 48px; display: flex; align-items: center; }
.timer-safety { text-align: left; border-radius: 10px; margin-top: 1rem; }
.timer-face { text-align: center; padding: 1.2rem 1rem 1.4rem; border: 4px solid var(--line); border-radius: 24px; background: #fff; }
.timer-face.is-work { border-color: var(--rubber); background: var(--wood-tint); }
.timer-face.is-rest { border-color: var(--table); background: #EEF4FA; }
.timer-face.is-paused { opacity: .6; }
.timer-phase { margin: 0; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; font-size: 1.6rem; }
.timer-face.is-work .timer-phase { color: var(--rubber); }
.timer-face.is-rest .timer-phase { color: var(--table-deep); }
.timer-num { margin: .2rem 0; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; font-size: 6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.timer-bar { height: 14px; margin: .4rem auto .6rem; max-width: 520px; background: var(--line); border-radius: 999px; overflow: hidden; }
.timer-bar span { display: block; height: 100%; width: 0; background: var(--table-deep); }
.timer-face.is-work .timer-bar span { background: var(--rubber); }
.timer-ctrl { justify-content: center; }
@media (max-width: 640px) { .timer-num { font-size: 4.6rem; } }

/* ---------- 卓球ルールクイズ ---------- */
.quiz-q { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; font-size: 1.45rem; margin: .2rem 0 1rem; }
.quiz-choices { display: grid; gap: .7rem; }
.quiz-choice {
  display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 64px; padding: .6rem 1rem;
  font: inherit; font-size: 1.15rem; font-weight: 700; text-align: left; color: var(--ink);
  background: #fff; border: 2px solid var(--line); border-radius: 14px; cursor: pointer;
}
.quiz-choice:hover { border-color: var(--table); }
.quiz-choice:disabled { cursor: default; }
.quiz-mark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--table-deep); color: #fff; font-size: 1rem; }
.quiz-choice.is-right { border-color: var(--ok); background: var(--ok-tint); }
.quiz-choice.is-right .quiz-mark { background: var(--ok); }
.quiz-choice.is-right::after { content: "○ 正解"; margin-left: auto; color: var(--ok); font-size: .95rem; }
.quiz-choice.is-wrong { border-color: var(--ng); border-style: dashed; background: var(--ng-tint); }
.quiz-choice.is-wrong::after { content: "×"; margin-left: auto; color: var(--ng); }
.quiz-why { margin: 1rem 0 0; padding: .8rem 1.1rem; background: var(--wood-tint); border-left: 6px solid var(--wood); border-radius: 8px; }
.quiz-next { justify-content: center; }

/* ---------- 卓球の得点板（play/games/tokuten.html） ---------- */
.sb-names { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; margin-top: 1rem; }
.sb-choice { margin: 0 0 1rem; }
.sb-choice button { display: inline-block; vertical-align: top; padding: .5rem 1rem; line-height: 1.35; }
.sb-choice-sub { display: block; font-size: .78rem; font-weight: 400; }
.sb-rules { margin: 1.2rem 0; }
.sb-rules summary { cursor: pointer; font-weight: 700; min-height: 48px; display: flex; align-items: center; }
.sb-rules ul { margin: .4rem 0; padding-left: 1.3rem; }
.sb-board { max-width: 900px; margin: 0 auto; }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.sb-head .g5-btn { flex: none; white-space: nowrap; }
.sb-game { margin: 0; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; font-size: 1.3rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; }
.sb-games { font-size: 1rem; color: var(--sub); }
.sb-games strong { color: var(--ink); font-size: 1.25rem; }
.sb-final { font-size: .9rem; padding: 0 .7rem; border-radius: 999px; background: var(--wood-tint); border: 2px solid var(--wood); color: #7A5A20; }
.sb-sides { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.sb-side { display: flex; flex-direction: column; align-items: center; padding: .8rem .6rem 1rem; background: #fff; border: 4px solid var(--line); border-radius: 20px; text-align: center; }
.sb-side.is-serve { border-color: var(--rubber); background: var(--wood-tint); }
.sb-name { margin: 0; font-weight: 700; font-size: 1.2rem; word-break: break-all; }
.sb-point { margin: 0; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; font-size: 7rem; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--table-ink); }
.sb-serve { margin: 0 0 .6rem; min-height: 1.8em; font-weight: 700; color: var(--rubber); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .2rem .4rem; line-height: 1.3; }
.sb-ball { display: inline-block; width: 1.1em; height: 1.1em; border-radius: 50%; background: #fff; border: 3px solid var(--rubber); }
.sb-add { width: 100%; min-height: 96px; font-size: 1.25rem; border-radius: 18px; touch-action: manipulation; }
.sb-add:disabled { opacity: .45; cursor: default; }
.sb-next { margin: 1rem 0 0; padding: 1rem 1.2rem; text-align: center; border: 2px solid var(--wood); border-radius: var(--radius); background: var(--wood-tint); }
.sb-next p { margin: .3rem 0 .8rem; }
.sb-ctrl { justify-content: center; }
.sb-result { max-width: 480px; margin: 1rem 0; }
.sb-result td { font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .sb-names { grid-template-columns: 1fr; }
  .sb-point { font-size: 5rem; }
  .sb-serve { font-size: .88rem; }
  .sb-add { min-height: 84px; font-size: 1.1rem; padding: .5rem; }
}

/* ---------- 回転シミュレーター（play/games/kaiten.html） ---------- */
.kt-q { font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; font-size: 1.35rem; margin: .2rem 0 .2rem; }
.kt-spin { color: var(--rubber); }
.kt-hint { margin: 0 0 .6rem; }
.kt-scene { margin: .4rem 0 .8rem; border: 2px solid var(--line); border-radius: var(--radius); background: #F6FAFD; overflow: hidden; }
.kt-svg { display: block; width: 100%; height: auto; }
.kt-table { fill: var(--table); }
.kt-leg { fill: var(--table-ink); }
.kt-net { fill: #fff; stroke: var(--ink); stroke-width: 1; }
.kt-side { fill: var(--sub); font-size: 17px; font-weight: 700; }
.kt-rubber { fill: var(--rubber); }
.kt-grip { fill: var(--wood); stroke: #B8955A; stroke-width: 1; }
.kt-ball circle { fill: #fff; stroke: #E07A00; stroke-width: 2.5; }
.kt-ball line { stroke: #E07A00; stroke-width: 2; }
.kt-trail { fill: none; stroke: var(--table-deep); stroke-width: 2; stroke-dasharray: 6 5; }
.kt-mark { font-size: 20px; font-weight: 700; }
.kt-mark.is-ok { fill: var(--ok); }
.kt-mark.is-ng { fill: var(--ng); }
.kt-choice { margin: 0 0 .9rem; }
.kt-go { justify-content: center; margin-top: .6rem; }
.kt-free { margin-top: 3rem; padding-top: 1.6rem; border-top: 2px dashed var(--line); }
.kt-free h2 { font-size: 1.5rem; margin: 0 0 .3rem; }
.kt-tips { margin: 1.2rem 0; }
.kt-tips summary { cursor: pointer; font-weight: 700; min-height: 48px; display: flex; align-items: center; }
.kt-tips ul { margin: .4rem 0; padding-left: 1.3rem; }
@media (max-width: 640px) {
  .kt-choice .g5-choice-row button { min-width: 0; padding: 0 .7rem; font-size: .88rem; }
}

/* ---------- 読みもの（play/articles/*.html） ---------- */
.ar-wrap { max-width: 820px; }
.ar-crumbs { font-size: .9rem; color: var(--sub); margin: 0 0 .6rem; }
.ar-cat { padding: 1.4rem 0 .4rem; }
.ar-cat h2 { font-size: 1.4rem; margin: 0 0 .8rem; }
.ar-date { display: block; font-size: .88rem; color: var(--sub); margin: 0 0 .2rem; }
.ar-head { margin-bottom: 1.4rem; padding-bottom: 1rem; border-bottom: 2px solid var(--line); }
.ar-head .g5-title { margin: .2rem 0 .3rem; }
.ar-lead { font-size: 1.08rem; margin: .6rem 0 0; }
.ar-body { font-size: 1.05rem; }
.ar-body h2 { font-size: 1.45rem; margin: 2.2rem 0 .6rem; padding-left: .7rem; border-left: 8px solid var(--rubber); }
.ar-body h3 { font-size: 1.2rem; margin: 1.6rem 0 .4rem; color: var(--table-ink); }
.ar-body p { margin: .6rem 0; }
.ar-list { margin: .6rem 0; padding-left: 1.4rem; }
.ar-list li { margin: .3rem 0; }
.ar-steps { list-style: none; counter-reset: ar-step; margin: .8rem 0; padding: 0; }
.ar-steps li { counter-increment: ar-step; position: relative; margin: 0 0 .8rem; padding: .2rem 0 0 3.2rem; min-height: 2.4rem; }
.ar-steps li::before { content: counter(ar-step); position: absolute; left: 0; top: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--table-deep); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ar-step-title { display: block; }
.ar-point, .ar-note { margin: 1.2rem 0; padding: .9rem 1.2rem; border-radius: var(--radius); }
.ar-point { background: var(--wood-tint); border: 2px solid var(--wood); }
.ar-note { background: #EEF4FA; border-left: 8px solid var(--table-deep); }
.ar-point p, .ar-note p { margin: .2rem 0; }
.ar-box-title { font-weight: 700; }
.ar-fig { margin: 1.2rem 0; }
.ar-fig img { display: block; max-width: 100%; height: auto; border-radius: 10px; }
.ar-fig figcaption { font-size: .88rem; color: var(--sub); margin-top: .3rem; }
.ar-link { margin: 1.2rem 0; }
.ar-related { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 2px dashed var(--line); }
.ar-related h2 { font-size: 1.3rem; margin: 0 0 .8rem; }
@media print {
  .ar-crumbs, .ar-related, .ar-link { display: none !important; }
  .ar-body { font-size: 11pt; }
  .ar-point, .ar-note { break-inside: avoid; }
}

/* ---------- 運動の記録表（印刷用。play/records-sheet.html） ---------- */
.g5-sheet-scroll { overflow-x: auto; margin-top: 1.4rem; -webkit-overflow-scrolling: touch; }
.g5-sheet-page { min-width: 660px; padding: 1rem 1.2rem; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); }
.g5-sheet-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.g5-sheet-title { flex: 1 1 auto; margin: 0; font-size: 1.45rem; }
.g5-sheet-name { margin: 0; font-weight: 700; display: flex; align-items: flex-end; gap: .4rem; }
.g5-sheet-name span { display: inline-block; width: 11em; border-bottom: 2px solid var(--ink); height: 1.4em; }
.g5-sheet-lead { margin: .4rem 0 .6rem; font-size: .88rem; color: var(--sub); }
.g5-sheet { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .9rem; }
.g5-sheet th, .g5-sheet td { border: 1px solid #8A9BAA; padding: .15rem .35rem; height: 2.1rem; vertical-align: middle; line-height: 1.25; }
.g5-sheet thead th { background: #EEF4FA; font-size: .82rem; text-align: center; }
.g5-sheet tfoot th, .g5-sheet tfoot td { background: var(--wood-tint); font-weight: 700; }
.g5-sheet .c-day { width: 2.6em; }
.g5-sheet .c-wd { width: 2.2em; }
.g5-sheet .c-ex { width: 4.6em; }
.g5-sheet .c-timer { width: 8.6em; }
.g5-sheet .c-game { width: 4.8em; }
.g5-sheet .c-cond { width: 10.4em; }
.g5-sheet-day, .g5-sheet-wd, .g5-sheet-ex, .g5-sheet-game { text-align: center; }
.g5-sheet-day { font-weight: 700; }
.g5-sheet-ex { font-size: 1.15rem; font-weight: 700; color: var(--rubber); }
.g5-sheet-timer { font-size: .82rem; }
.g5-sheet-cond { text-align: center; font-size: .78rem; color: var(--sub); letter-spacing: .02em; }
.g5-sheet tr.is-sun .g5-sheet-day, .g5-sheet tr.is-sun .g5-sheet-wd { color: var(--rubber); }
.g5-sheet tr.is-sat .g5-sheet-day, .g5-sheet tr.is-sat .g5-sheet-wd { color: var(--table-deep); }
.g5-sheet-foot { margin: .5rem 0 0; font-size: .78rem; color: var(--sub); text-align: right; }

/* 印刷: A4 縦 1 枚に収める（名前つきの page に対応していないブラウザでは、ふつうの用紙設定で印刷される） */
.g5-sheet-body { page: g5sheet; }
@page g5sheet { size: A4 portrait; margin: 10mm; }
@media print {
  .g5-sheet-body .g5-main { padding: 0; }
  .g5-sheet-body .g5-wrap { max-width: none; padding: 0; }
  .g5-sheet-body .g5-sheet-scroll { overflow: visible; margin: 0; }
  .g5-sheet-page { min-width: 0; padding: 0; border: 0; border-radius: 0; }
  .g5-sheet-title { font-size: 15pt; }
  .g5-sheet-name, .g5-sheet-lead { font-size: 9.5pt; }
  .g5-sheet-lead { color: #333; margin: 1.5mm 0 2mm; }
  .g5-sheet { font-size: 10pt; page-break-inside: avoid; break-inside: avoid; }
  .g5-sheet th, .g5-sheet td { height: 6.9mm; padding: 0 1.5mm; border-color: #555; }
  .g5-sheet thead th { font-size: 9pt; }
  .g5-sheet-timer, .g5-sheet-cond { font-size: 8.5pt; }
  .g5-sheet-cond { color: #333; }
  .g5-sheet thead th, .g5-sheet tfoot th, .g5-sheet tfoot td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .g5-sheet-foot { font-size: 8pt; margin-top: 1.5mm; color: #333; }
}
