/* ============================================================
   E-計算！ Math あみだくじ（math/css/amida.css）
   共通の部品は assets/css/tool-kit.css（sp-…）と ek-simple.css（ks-…）。色は共通の変数だけを使う。
   ============================================================ */

/* ---- 読み上げだけの答え（見えない） ---- */
.am-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- あみだくじの絵 ---- */
.am-scroll { overflow-x: auto; margin: 14px 0 0; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.am-board { margin: 0 auto; }
.am-tops, .am-goals { display: grid; }
.am-name { appearance: none; margin: 0 2px; padding: 6px 2px; min-height: 40px; border: 1px solid var(--accent); border-radius: var(--r); background: var(--surface, transparent); color: var(--accent); font: inherit; font-size: 13px; font-weight: 700; line-height: 1.25; cursor: pointer; overflow: hidden; }
.am-name:hover { background: var(--accent-soft); }
.am-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.am-name[disabled] { cursor: default; opacity: .6; }
.am-name.am-done { background: var(--accent-soft); }
.am-name.am-cur { background: var(--accent); color: var(--accent-ink, #fff); }
.am-vert .am-name, .am-vert .am-goal { writing-mode: vertical-rl; text-orientation: mixed; min-height: 64px; display: flex; align-items: center; justify-content: center; letter-spacing: .02em; }
.am-vert.am-num .am-name { writing-mode: horizontal-tb; min-height: 40px; font-size: 12px; padding: 6px 0; }
.am-svg { display: block; overflow: visible; }
.am-v { stroke: var(--ink-2); stroke-width: 2; }
.am-r { stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; }
.am-u { stroke: var(--accent); stroke-width: 3; }
.am-zone { fill: var(--accent-soft); }
.am-slot { fill: transparent; cursor: pointer; }
.am-slot:hover, .am-slot:focus-visible { fill: color-mix(in srgb, var(--accent) 18%, transparent); outline: none; }
.am-path { fill: none; stroke: var(--accent); stroke-width: 4.5; stroke-linejoin: round; stroke-linecap: round; }
.am-path.am-old { stroke-width: 2.5; opacity: .35; }
.am-goal { margin: 0 2px; padding: 8px 2px; min-height: 40px; border: 1px dashed var(--grid); border-radius: var(--r); text-align: center; font-size: 13px; line-height: 1.25; color: var(--muted); overflow: hidden; overflow-wrap: anywhere; }
.am-goal.am-open { border-style: solid; color: var(--ink); background: var(--surface, transparent); }
.am-goal.am-hit { border-color: var(--accent); background: var(--accent); color: var(--accent-ink, #fff); font-weight: 700; }
.am-goal.am-cur { box-shadow: 0 0 0 2px var(--accent); }
.am-res .am-gno { margin-left: 4px; color: var(--muted); font-weight: 400; }

/* ---- 確率の表（色の濃さ） ---- */
#fairPanel .sp-tabs { margin-top: 12px; }
.am-heat-wrap { overflow-x: auto; margin: 6px 0 0; }
.am-heat { border-collapse: collapse; font-size: 11px; }
.am-heat th { padding: 0 3px; font-weight: 400; color: var(--muted); text-align: center; line-height: 1.2; }
.am-heat thead th { height: 16px; vertical-align: bottom; }
.am-heat td { width: var(--c); height: var(--c); min-width: var(--c); padding: 0; text-align: center; border: 1px solid color-mix(in srgb, var(--grid) 60%, transparent); color: var(--ink); font-variant-numeric: tabular-nums; }
.am-heat:not(.am-heat-num) td { border-width: 0; }
.am-heat.am-heat-num td { font-size: 12px; }
.am-sw { display: inline-block; width: 14px; height: 14px; margin: 0 4px -2px 8px; border: 1px solid var(--grid); border-radius: 3px; }
.am-legend .am-sw:first-child { margin-left: 0; }
.am-fairtab th, .am-fairtab td { font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { table.data.am-fairtab th, table.data.am-fairtab td { padding-left: 4px; padding-right: 4px; font-size: 12.5px; white-space: normal; } }

/* ---- A4 の紙（SPTOOL.printSheet。印刷のときだけ出る） ---- */
@media print {
  .am-sheet .am-pnote { margin: 0 0 3mm; font-size: 9pt; }
  .am-pnames, .am-pgoals { display: grid; }
  .am-pnames > div, .am-pgoals > div { border: 1px solid #000; margin: 0 0.6mm; min-height: 14mm; padding: 1mm 0.5mm; text-align: center; font-size: 10pt; overflow: hidden; overflow-wrap: anywhere; line-height: 1.2; }
  .am-pnames > div { min-height: 24mm; }
  .am-pnames small { display: block; font-size: 7pt; color: #444; }
  .am-pv > div { writing-mode: vertical-rl; text-orientation: mixed; display: flex; align-items: center; justify-content: flex-start; }
  .am-pv small { writing-mode: horizontal-tb; }
  .am-psvg { display: block; width: 100%; }
  .am-psvg line { stroke: #000; stroke-width: 1.6; }
  .am-psvg line.am-pband { stroke: #888; stroke-width: 0.8; stroke-dasharray: 3 3; }
  .am-pfold { margin: 2mm 0 2mm; border-top: 1.2px dashed #000; padding-top: 1mm; text-align: center; font-size: 8.5pt; color: #333; }
}
