/* 点つなぎ固有の見た目（共通は ../common/base.css） */
[hidden] { display: none !important; }

/* 紙（点を描く面）。ダークでも紙は明るいまま、少しだけ落とす */
:root { --tt-paper: #FFFFFF; --tt-ink: #1F2328; --tt-done: #9A968C; --tt-line: #2F5D8A; --tt-next: #C0761A; --tt-miss: #B23A3A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tt-paper: #EFEDE7; } }
:root[data-theme="dark"] { --tt-paper: #EFEDE7; }
.stage > .setup-modal { background: none; }

.board-wrap { position: relative; }
.board-wrap.zoomed { overflow: auto; max-height: min(64vh, 720px); overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 4px; }
.dd {
  display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; aspect-ratio: 1;
  background: var(--tt-paper); border-radius: 4px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.board-wrap.zoomed .dd { max-width: none; touch-action: pan-x pan-y; }
.dd text { font-family: system-ui, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; font-weight: 700; fill: var(--tt-ink); pointer-events: none; }
.dd .dot { fill: var(--tt-ink); }
.dd .dot.done { fill: var(--tt-line); }
.dd text.done { fill: var(--tt-done); font-weight: 400; }
.dd .lines { fill: none; stroke: var(--tt-line); stroke-linejoin: round; stroke-linecap: round; }
.dd .band { stroke: var(--tt-line); stroke-dasharray: 1.2 1.2; opacity: .6; }
.dd .ring { fill: none; stroke: var(--tt-next); }
.dd .ring.cur { stroke: var(--tt-line); }
.dd .ring.miss { stroke: var(--tt-miss); }
.dd .ring.pulse { animation: ring-pulse 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ring-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .55; } }
.dd .art { transition: opacity .9s ease-out; }
.dd .fade { transition: opacity .6s ease-out; }
.dd .pre path { stroke: #8C8F96; }

/* 道具 */
.tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px auto 0; max-width: 560px; }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; font-size: 16px; justify-content: center; white-space: nowrap; }
.tool svg { width: 20px; height: 20px; flex: none; }
.tool[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.after { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.linkbtn { display: inline-flex; align-items: center; text-decoration: none; }
.timer { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 18px; min-width: 56px; text-align: right; margin-left: auto; }
.nextlab { display: inline-block; min-width: 1.6em; padding: 0 8px; margin-left: 4px; border-radius: 6px; background: var(--accent-soft); color: var(--ink); font-size: 1.25em; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.lv { display: inline-block; white-space: nowrap; font-size: 14px; font-weight: 700; padding: 0 8px; border-radius: 999px; border: 1.5px solid currentColor; margin-left: 6px; vertical-align: middle; }
.lv.l1 { color: var(--ok); } .lv.l2 { color: var(--accent); } .lv.l3 { color: var(--ng); }
.dan .choice span { min-width: 0; padding-left: 10px; padding-right: 10px; }

.think { margin: 10px auto 0; max-width: 640px; border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); }
.think h3 { margin: 0 0 4px; font-size: 16px; }
.think p { margin: 0 0 6px; }
.think p:last-child { margin-bottom: 0; }
.think .pic { float: right; width: 96px; height: 96px; margin: 0 0 6px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--tt-paper); }
.think::after { content: ''; display: block; clear: both; }
.callout { z-index: 3; top: 42%; }

/* アルバム */
.gallery { margin-top: 4px; }
.gal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gal-head h2 { margin: 0; font-size: 1.15rem; }
.gal-tabs { margin: 8px 0 4px; }
.gal-tabs button { min-height: var(--tap); padding: 0 14px; border: 2px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.gal-tabs button[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.gal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; }
.gal-item { appearance: none; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius); padding: 6px 4px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 118px; }
.gal-item:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }
.gal-item.cur { border-color: var(--accent); }
.gal-item svg { width: 68px; height: 68px; background: var(--tt-paper); border-radius: 4px; }
.gal-item .q { width: 68px; height: 68px; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: var(--ink-sub); background: repeating-linear-gradient(45deg, var(--bg) 0 6px, var(--surface) 6px 12px); border: 1px solid var(--line); border-radius: 4px; }
.gal-item small { font-size: 14px; line-height: 1.3; text-align: center; color: var(--ink-sub); }
.gal-item b { font-size: 14px; line-height: 1.3; text-align: center; }

@media (max-width: 480px) {
  .stage { padding: 8px; }
  .tool { padding: 0 10px; font-size: 15px; }
  .controls .btn.icon { padding: 0 9px; }
  .gal-list { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .dd .ring.pulse { animation: none; }
  .dd .art, .dd .fade { transition: none; }
}
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 2; --tb-st-lines: 1.25; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1.25; } }
@media (min-width: 641px) { .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1.25; } }
:root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { :root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1.25; } }
@media (min-width: 641px) { :root:lang(en) .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1.25; } }
/* 上のバーの高さ ここまで */
