/* 見た目は「ネオン」（3．デザイン案.html）。色の正はこのファイル。
   2026-10-25 pineさん「ネオンの彩度をもう少しさげて」で一度下げたが、同日「見た目を戻してネオンの色にして」で、もとのネオンの色と光にもどした */
:root {
  color-scheme: dark;
  --bg: #0B1020; --surface: #141B33; --surface2: #1C2544; --ink: #EAF0FF; --sub: #8E9BBD; --line: #29355E;
  --cell: #161F3B; --cellEdge: #29355E; --p1: #FF4D6D; --p1ink: #2A0710; --p2: #2BC8F0; --p2ink: #03212B; --accent: #FFE27A;
  --btn: #FFE27A; --btnInk: #1A1400; --warn: #FF7A59; --honey: #F7B32B;
  --title-font: 'Dela Gothic One', 'M PLUS Rounded 1c', sans-serif;
  --ui-font: 'M PLUS Rounded 1c', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: radial-gradient(110% 60% at 50% 50%, #141D3D 0%, var(--bg) 72%) fixed, var(--bg); color: var(--ink); font-family: var(--ui-font); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; touch-action: manipulation; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#app { height: 100vh; height: 100dvh; }

/* ボタン */
.btn { flex: 1; min-height: 48px; border-radius: 14px; border: none; background: var(--surface); color: var(--ink); font-weight: 800; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--btn); color: var(--btnInk); box-shadow: 0 0 20px rgba(255, 226, 122, .35); }
.btn.outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.big { flex: none; min-height: 56px; font-size: 17px; }
.btn.swap { background: color-mix(in srgb, var(--p2) 22%, var(--surface)); box-shadow: inset 0 0 0 2px var(--p2); }
.btn:focus-visible, .ico:focus-visible, .seg button:focus-visible, .stepper button:focus-visible, .seats button:focus-visible, .link:focus-visible, .inlink:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: none; font-size: 16px; font-weight: 800; cursor: pointer; flex: none; }
.link { background: none; border: none; color: var(--sub); font-weight: 700; font-size: 12.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 4px 6px; }
.inlink { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; }

/* ─── タイトル ──────────────────────────────────────────
   ROWTATE と同じ作り（2026-10-25 pineさん「タイトルをロウテートみたいに」「デザインを左、カスタムを右に」）。
   パソコン（幅900以上の横長）：左に名前と盤、右に設定。スマホ：名前と盤と「遊ぶ」「カスタマイズ」、設定は下から出る板。
   どの画面でも1画面に収まる（スクロールしない。同日「一画面ずつで完結する様に」） */
.title-screen { height: 100%; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 18px max(14px, env(safe-area-inset-bottom)); overflow: hidden; }
.title-hero { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
/* 盤の後ろの光（ROWTATE の「スポットライト」を、赤と青で） */
.title-hero::before { content: ''; position: absolute; left: 50%; top: 58%; width: min(115%, 760px); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none;
                      background: radial-gradient(closest-side, rgba(255, 77, 109, .17), rgba(43, 200, 240, .11) 55%, transparent 76%); animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .title-hero::before { animation: none; } }
.logo { position: relative; text-align: center; line-height: 1; flex: none; margin-top: clamp(12px, 5vh, 52px); } /* 上すぎないように（2026-10-27 pineさん「タイトルの文字が上すぎてバランスが悪く感じる」） */
.logo h2 { margin: 0; font-family: var(--title-font); font-weight: 400; font-size: clamp(56px, 19vw, 92px); letter-spacing: .06em; }
.logo .h { color: var(--p1); text-shadow: 0 0 24px rgba(255, 77, 109, .65); }
.logo .e { color: var(--ink); text-shadow: 0 0 18px rgba(234, 240, 255, .35); }
.logo .x { color: var(--p2); text-shadow: 0 0 24px rgba(43, 200, 240, .65); }
.hero-board { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.hero-board svg { width: 100%; height: 100%; max-height: 440px; }
.title-quick { flex: none; display: flex; flex-direction: column; gap: 8px; }
.quick-summary { text-align: center; font-size: 12.5px; color: var(--sub); font-weight: 700; margin: 0; }
.consent { text-align: center; font-size: 11.5px; color: var(--sub); margin: 0; line-height: 1.6; }
.title-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 4px; }

/* 設定（パソコンでは右半分。スマホでは「カスタマイズ」で下から出る板）。どの設定も「見出し＋同じ高さのボタン1列」で、選んでも高さが変わらない */
.title-side { display: flex; flex-direction: column; gap: 12px; }
.side-head { display: flex; align-items: center; justify-content: space-between; }
.side-head b { font-size: 17px; }
.setting { min-width: 0; }
.slabel { font-size: 12px; color: var(--sub); font-weight: 800; margin: 0 0 6px 2px; white-space: nowrap; }
/* モードの説明は高さ2行で固定（モードを変えても枠の高さが変わらない。2026-10-27 pineさん「ボタンを押すと枠のサイズが変わっているから変わらないように」） */
.snote { font-size: 12px; color: var(--sub); line-height: 1.6; margin: 6px 2px 0; height: 3.2em; overflow: hidden; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface2); border-radius: 14px; padding: 3px; }
.seg button { border: none; background: none; min-height: 40px; padding: 0 4px; font-size: 14px; font-weight: 800; border-radius: 11px; color: var(--sub); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(255, 226, 122, .35); }
.seg button:disabled, .stepper button:disabled { opacity: .35; cursor: default; }
.setting.off .seg, .setting.off .slabel { opacity: .45; }
.seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seats button { min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; font-size: 13px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.25; box-shadow: inset 0 3px 0 var(--c); }
.seats button small { font-size: 11px; color: var(--sub); }
.seats button[data-kind="human"] small { color: var(--accent); }
.setting-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
/* モード（2026-10-27）：6つを3つずつ2段 */
.rules .seg { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2px; }
.rules .seg button { font-size: 13px; padding: 0 2px; }
/* このモードの設定：2つ並び（設定のないモードは1つの箱）。どのモードでも同じ高さ */
.rule-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
.rule-row .wide { grid-column: 1 / -1; }
.rule-row.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.rule-row .seg button { font-size: 13px; padding: 0 2px; }
.rulebox { min-height: 46px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 10px; border-radius: 14px; background: var(--surface2); color: var(--sub); font-size: 12px; font-weight: 700; line-height: 1.4; }
.setting-row2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px; }
.setting-row2 .seg button { font-size: 13px; padding: 0 2px; }
.stepper.shape { grid-template-columns: 26px minmax(0, 1fr) 26px; }
.stepper.shape output { font-size: 12px; }
.topbar .ttl .rev { color: var(--warn); }
.topbar .ttl .pow { color: var(--accent); }
.topbar .ttl .snow { color: #BFE8FF; }
.stepper { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: center; background: var(--surface2); border-radius: 14px; padding: 3px; min-height: 46px; }
.stepper button { height: 40px; border: none; border-radius: 11px; background: var(--surface); font-weight: 800; font-size: 17px; cursor: pointer; }
.stepper output { text-align: center; font-weight: 800; font-size: 14px; white-space: nowrap; }

/* スマホ：設定は下から出る板 */
.title-side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; max-width: 480px; margin: 0 auto; background: #121A31; border: 1px solid var(--line); border-bottom: none; border-radius: 22px 22px 0 0;
              padding: 14px 18px max(16px, env(safe-area-inset-bottom)); max-height: 94dvh; overflow: auto; transform: translateY(105%); visibility: hidden; transition: transform .25s ease, visibility .25s; }
.title-side.open { transform: none; visibility: visible; }
/* 左右の列のまとまり（スマホの横持ちだけ2列に分ける。ほかは まとまりを作らず、中身がそのまま1列に並ぶ） */
.side-a, .side-b { display: contents; }
@media (prefers-reduced-motion: reduce) { .title-side { transition: none; } }
/* スマホ縦の板：モードの2段を足しても1画面に収める（2026-10-27。375×812・375×667 で測った）。背の低い画面では説明を消し、ボタンを少し低く。
   ⚠️ 1列の高さをそろえるため、seg のボタン（＋上下3px）・stepper・rulebox・席のボタンは いつも同じ高さにする */
@media (max-width: 899px) and (orientation: portrait) {
  .title-side { gap: 7px; padding-top: 12px; }
  .title-side .rules .seg button { min-height: 36px; }
}
@media (max-width: 899px) and (orientation: portrait) and (max-height: 760px) {
  .title-side .snote { display: none; }
  .title-side .btn.big { min-height: 46px; }
  .title-side .seg button { min-height: 36px; }
  .title-side .stepper, .title-side .rulebox, .title-side .seats button { min-height: 42px; }
  .title-side .stepper button { height: 36px; }
}
@media (max-width: 899px) and (orientation: portrait) and (max-height: 700px) {
  .title-side { gap: 6px; padding-top: 10px; }
  .title-side .seg button { min-height: 34px; }
  .title-side .rules .seg button { min-height: 32px; }
  .title-side .stepper, .title-side .rulebox, .title-side .seats button { min-height: 40px; }
  .title-side .stepper button { height: 34px; }
  .title-side .btn.big { min-height: 44px; }
  /* 遊び方・規約のリンクは、タイトルの画面にも並んでいる */
  .title-side .title-links { display: none; }
}

/* パソコン：左に名前と盤、右に設定 */
@media (min-width: 900px) and (orientation: landscape) {
  .title-screen { max-width: 1400px; display: grid; grid-template-columns: minmax(0, 1fr) clamp(420px, 36vw, 540px); align-items: center; gap: clamp(24px, 4vw, 64px); padding: 24px clamp(24px, 4vw, 56px); }
  .title-hero { height: 100%; }
  .logo h2 { font-size: clamp(76px, 9vw, 140px); }
  .hero-board svg { max-height: none; }
  .title-quick, .side-head, .title-screen > .overlay { display: none; }
  .title-side { position: static; transform: none; visibility: visible; transition: none; background: none; border: none; border-radius: 0; padding: 0; max-width: none; max-height: 100%; overflow: visible; }
}
/* パソコンで背の低い窓（1280×720・1024×640 など）：モードの2段を足しても1画面に収める（2026-10-27） */
@media (min-width: 900px) and (orientation: landscape) and (max-height: 760px) {
  .title-side { gap: 6px; }
  .title-side .seg button { min-height: 38px; }
  .title-side .rules .seg button { min-height: 34px; }
  .title-side .stepper, .title-side .rulebox, .title-side .seats button { min-height: 44px; }
  .title-side .stepper button { height: 38px; }
  .title-side .btn.big { min-height: 46px; }
}
@media (min-width: 900px) and (orientation: landscape) and (max-height: 680px) {
  .title-screen { padding-top: 16px; padding-bottom: 16px; }
  .title-side .snote { display: none; }
}
/* スマホの横持ち：左に名前と盤、右に「遊ぶ」「カスタマイズ」 */
@media (max-width: 899px) and (orientation: landscape) {
  .title-screen { max-width: none; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(240px, 1fr); align-items: center; gap: 20px; padding: 10px 24px; }
  .title-hero { height: 100%; }
  .logo h2 { font-size: clamp(40px, 10vh, 64px); }
  /* 設定の板は2列にして、背の低い画面でも1画面に収める（左 side-a：モード・あそびかた・だれと・盤、右 side-b：このモードの設定・強さと音・はじめる）。
     左右は別々に積む（行をそろえない）。844×390・667×375 で測った（2026-10-27） */
  .title-side { max-width: 760px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; row-gap: 6px; align-content: start; align-items: start; padding-top: 6px; }
  .title-side > .side-head { grid-column: 1 / -1; }
  .side-a, .side-b { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .title-side .snote { display: none; }
  .title-side .btn.big { min-height: 42px; }
  .title-side .seg button { min-height: 34px; }
  .title-side .rules .seg button { min-height: 32px; }
  .title-side .stepper, .title-side .rulebox, .title-side .seats button { min-height: 40px; }
  .title-side .stepper button { height: 34px; }
  .title-side .stepper:not(.shape) { grid-template-columns: 30px minmax(0, 1fr) 30px; }
  /* 見出しを少し小さく、ボタンとの間を詰める（モードの2段を足した分。667×375 で左の列が20pxはみ出していた） */
  .title-side .slabel { font-size: 11px; margin-bottom: 3px; }
  .title-side .side-head b { font-size: 15px; }
  .title-side .side-head .ico { width: 30px; height: 30px; }
}
/* 背の低いスマホ縦（高さ680以下）：名前を少し小さく */
@media (max-height: 680px) and (orientation: portrait) { .logo h2 { font-size: clamp(48px, 15vw, 64px); } }

/* 後ろを暗くする幕と、まん中の窓（遊び方・利用規約・プライバシーポリシー・メニュー） */
.overlay { position: fixed; inset: 0; background: rgba(3, 6, 15, .62); z-index: 10; }
.dialog { position: fixed; z-index: 12; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
          display: flex; flex-direction: column; background: #121A31; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.dialog.small { width: min(400px, calc(100vw - 32px)); }
.dialog .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); flex: none; }
.dialog .head b { font-size: 17px; }
.dialog .body { overflow: auto; padding: 6px 20px 22px; overscroll-behavior: contain; }
.menu-list { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.confirm { margin: 14px 2px 0; font-size: 14px; line-height: 1.7; font-weight: 700; }

/* ─── 動き（2026-10-25 pineさん「UI、UX、SEを改良して」）。「動きを減らす」設定では止める ─── */
/* 押したボタンが少し沈む */
.btn:active, .seg button:active, .stepper button:active, .seats button:active, .zb:active, .ico:active { transform: scale(.97); }
/* 置いた石：小さく現れて、少し行きすぎてから落ち着く */
.board .drop { transform-box: fill-box; transform-origin: center; animation: drop .32s cubic-bezier(.2, 1.5, .45, 1) both; }
@keyframes drop { from { transform: scale(.35); opacity: .1; } to { transform: scale(1); opacity: 1; } }
/* 勝ちの道：端から線が描かれ、道の石の輪が順に灯る */
.board .pathline.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawpath .95s ease-out .15s forwards; }
@keyframes drawpath { to { stroke-dashoffset: 0; } }
.board .pathring { opacity: 0; animation: ringon .3s ease-out forwards; }
@keyframes ringon { from { opacity: 0; } to { opacity: 1; } }
/* タイトルの道：ゆっくり明滅 */
.board .pathline.pulse { animation: pathpulse 3.2s ease-in-out infinite; }
@keyframes pathpulse { 50% { opacity: .45; } }
/* スマホの1回目の印：点線がゆっくり回る */
.board .previewmark { animation: march 1.2s linear infinite; }
@keyframes march { to { stroke-dashoffset: -10.4; } }
@media (prefers-reduced-motion: reduce) {
  .board .drop, .board .pathline.draw, .board .pathring, .board .pathline.pulse, .board .previewmark { animation: none; }
  .board .pathline.draw { stroke-dashoffset: 0; }
  .board .pathring { opacity: 1; }
  .btn:active, .seg button:active, .stepper button:active, .seats button:active, .zb:active, .ico:active { transform: none; }
}
.doc h3 { font-size: 15px; margin: 20px 0 6px; padding-bottom: 3px; border-bottom: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.doc h4 { font-size: 13.5px; margin: 14px 0 4px; }
.doc p, .doc li { font-size: 13.5px; line-height: 1.85; color: #C9D3EA; margin: 0; overflow-wrap: anywhere; }
.doc p + p { margin-top: 6px; }
.doc ol, .doc ul { margin: 0; padding-left: 1.3em; }
/* 規約の改定のお知らせ（2026-11-13）：変えたあとの文に「11/21から」、変える前の文に「11/20まで」の印 */
.doc .revise { margin: 4px 0 8px; padding: 2px 12px 10px; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--accent); }
.doc .new, .doc .old { display: inline-block; margin-right: 4px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 800; line-height: 1.7; vertical-align: 1px; }
.doc .new { background: var(--accent); color: var(--btnInk); }
.doc .old { box-shadow: inset 0 0 0 1px var(--sub); color: var(--sub); }
.doc li + li { margin-top: 3px; }
.doc b { color: var(--ink); }
.doc .lead { color: var(--sub); font-size: 12.5px; margin-top: 10px; }
.doc .draft { background: #3A1E1E; border: 1px solid #FF7A59; color: #FFD3C7; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; margin-top: 12px; }
.doc figure { margin: 10px 0 2px; display: flex; justify-content: center; }
.doc figure svg { width: min(100%, 260px); height: auto; }
.doc figcaption { text-align: center; font-size: 12px; color: var(--sub); }

/* 対局（縦長の画面）。盤を少しでも大きくするため、左右のすきまは細く（2026-10-25 pineさん「画面の中で盤を大きく」） */
.game { height: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; padding: 0 6px max(10px, env(safe-area-inset-bottom)); }
.topbar { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; padding: 0 4px; }
.topbar .ttl { font-size: 13px; font-weight: 700; color: var(--sub); text-align: center; flex: 1; }
.players { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 4px 0; flex: none; }
.pcard { position: relative; background: var(--surface); border-radius: 14px; padding: 8px 9px; display: flex; align-items: center; gap: 8px; border: 2px solid transparent; min-width: 0; }
.pcard.on { border-color: var(--c); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent); }
.pcard .who { min-width: 0; }
.pcard b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard small { display: block; font-size: 11px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now { position: absolute; top: -10px; left: 10px; background: var(--c); color: var(--cink); font-size: 11px; font-weight: 800; padding: 1px 9px; border-radius: 999px; line-height: 1.6; }
/* コンピューターが考えているあいだ、札がゆっくり明滅する */
.busy { animation: busy 1.1s ease-in-out infinite; }
@keyframes busy { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .busy { animation: none; } }
.chip { flex: none; display: block; overflow: visible; }
.pcard small, .seat small { color: var(--sub); font-weight: 700; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 4px 0; flex: none; }
.team { background: var(--surface); border-radius: 14px; padding: 6px 7px 7px; border-top: 3px solid var(--c); }
.team .tname { font-size: 11px; color: var(--sub); font-weight: 800; padding: 1px 4px 3px; }
.seat { display: flex; align-items: center; gap: 7px; padding: 4px 5px; border-radius: 9px; font-size: 13px; font-weight: 700; }
.seat.on { background: color-mix(in srgb, var(--c) 20%, transparent); }
.seat.won { background: color-mix(in srgb, var(--c) 30%, transparent); }
.seat em { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--ink); font-weight: 800; }
.order { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 8px 0 0; font-size: 12px; color: var(--sub); flex: none; font-weight: 700; }
.order .on { color: var(--ink); font-weight: 800; text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.boardwrap { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 4px 0; overflow: hidden; }
/* 盤の上では、ブラウザの拡大やスクロールを止めて、こちらで拡大・ずらしをする */
.boardwrap svg { width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.zoombar { position: absolute; right: 4px; bottom: 6px; display: flex; flex-direction: column; gap: 6px; }
.zb { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); font-size: 17px; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.zb:disabled { opacity: .3; cursor: default; }
.zb:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.board .cell { fill: var(--cell); stroke: var(--cellEdge); }
.board.live .cell { cursor: pointer; }
.board .num { font-family: var(--ui-font); font-weight: 800; }
/* 縦長の画面：上に情報（名前カード・案内）、下に操作（2026-10-26 pineさん「縦画面で情報を上 操作を下」） */
.hint { text-align: center; font-size: 13px; color: var(--sub); min-height: 22px; flex: none; font-weight: 700; padding: 8px 4px 0; }
.hint b { color: var(--ink); }
/* おしつけ：①自分の色 ②相手の色 の、いま置く方を明るく */
.hint .steps { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; margin-right: 6px; }
.hint .st { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; opacity: .3; }
.hint .st.on { opacity: 1; color: var(--ink); }
.wide .hint .steps { display: flex; margin: 0 0 6px; }
.actions { display: flex; gap: 8px; flex: none; padding: 4px 4px 0; }

/* 決着 */
.result { background: var(--surface); border-radius: 18px; padding: 14px 14px 12px; text-align: center; flex: none; margin: 0 4px; }
.result .big { font-family: var(--title-font); font-size: 28px; color: var(--c); line-height: 1.25; text-shadow: 0 0 18px color-mix(in srgb, var(--c) 60%, transparent); }
.result p.small { font-size: 11.5px; margin: 8px 0 0; }
.result p { font-size: 12.5px; color: var(--sub); margin: 6px 0 10px; line-height: 1.65; }
.mini { display: flex; justify-content: center; gap: 5px; margin-bottom: 12px; flex-wrap: wrap; }
.mini span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--surface2); font-weight: 700; }
.mini span.win { background: var(--c); color: var(--cink); font-weight: 800; }
.result .row { display: flex; gap: 8px; }

/* ─── ピース（2026-10-26）：名前カードの中の「つぎ」、操作の「いま・回す・裏返す・もどす」、盤の上の影 ─── */
.cnext { margin-left: auto; display: flex; flex-direction: column; align-items: center; gap: 1px; flex: none; padding-left: 4px; }
.cnext span { font-size: 9.5px; color: var(--sub); font-weight: 800; white-space: nowrap; }
.piece { display: block; overflow: visible; }
.pieceops { display: grid; grid-template-columns: 74px repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot { background: var(--surface); border-radius: 14px; position: relative; display: grid; place-items: center; min-height: 68px; border: 2px solid var(--c); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 40%, transparent); }
.slot .tag { position: absolute; top: -9px; left: 8px; font-size: 10px; font-weight: 800; padding: 0 7px; border-radius: 999px; line-height: 1.6; background: var(--c); color: var(--cink); }
.opb { border: none; border-radius: 14px; background: var(--surface); color: var(--ink); font-weight: 800; font-size: 19px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; line-height: 1; min-height: 56px; touch-action: manipulation; }
.opb small { font-size: 10.5px; color: var(--sub); }
.opb:disabled { opacity: .35; cursor: default; }
.opb:active { transform: scale(.97); }
.opb:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* 幅の狭いスマホ：つぎのピースがあるカードは、名前の前の小さな石を外して名前の場所を空ける（色は つぎのピースで分かる） */
@media (max-width: 430px) { .pcard:has(.cnext) > .chip { display: none; } }
.board .ghostcell { animation: march 1.2s linear infinite; }
/* ─── 電気（2026-10-26）：残り1の石は点滅、消える石はしぼむ ─── */
.board .dying { animation: dying .7s ease-in-out infinite; }
@keyframes dying { 50% { opacity: .2; } }
.board .vanish { transform-box: fill-box; transform-origin: center; animation: vanish .7s ease-in forwards; }
@keyframes vanish { to { transform: scale(.15); opacity: 0; } }
.hint .snownote { font-size: 11.5px; color: #BFE8FF; font-weight: 700; }
/* 蜜：名前カードの残りの しずく、切りかえのボタン、案内の文 */
.choney { margin-left: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; padding-left: 4px; }
.choney .drops { display: flex; gap: 3px; }
.choney i { width: 9px; height: 9px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--honey); box-shadow: inset 0 0 0 1.5px var(--c); }
.choney i.used { opacity: .16; }
.choney span:last-child { font-size: 9.5px; color: var(--sub); font-weight: 800; white-space: nowrap; }
.btn.honey { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--honey) 60%, transparent); }
.btn.honey.on { background: color-mix(in srgb, var(--honey) 22%, var(--surface)); box-shadow: inset 0 0 0 2px var(--honey); }
.topbar .ttl .honey { color: var(--honey); }
.hint .honeynote { font-size: 11.5px; color: var(--honey); font-weight: 700; }
/* 電気の絶縁体（2026-10-26）：名前カードの残り（白い棒に持ち主の色のふち。使ったものはうすく）と、切りかえのボタン */
.cins { margin-left: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; padding-left: 4px; }
.cins .bars { display: flex; gap: 3px; }
.cins i { width: 5px; height: 15px; border-radius: 3px; background: var(--ink); box-shadow: inset 0 0 0 1.5px var(--c); }
.cins i.used { opacity: .16; }
.cins span:last-child { font-size: 9.5px; color: var(--sub); font-weight: 800; white-space: nowrap; }
.btn.ins { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 55%, transparent); }
.btn.ins.on { background: color-mix(in srgb, var(--ink) 18%, var(--surface)); box-shadow: inset 0 0 0 2px var(--ink); }
@media (prefers-reduced-motion: reduce) { .board .dying { animation: none; } .board .vanish { animation: none; opacity: 0; } }
.hint .bad { color: var(--warn); }
@media (prefers-reduced-motion: reduce) { .board .ghostcell { animation: none; } .opb:active { transform: none; } }

/* ─── 対局（横長の画面：パソコン・スマホの横持ち）──────────────────
   盤は上下の辺が水平で右肩上がりの平行四辺形（app.js の ORIENTS.wide）。この形は画面の左上と右下が空くので、
   盤を画面いっぱいに置き、左上に情報（名前カード・案内）、右下に操作（拡大・もどす・ピース・決着）を重ねる
   （2026-10-26 pineさん「横画面時、菱形を右肩上がりの横に並行の図形にして／左上に情報、右下に操作ボタンを配置して」。
   その前は3列：左に情報・まん中に縦がつぶれた菱形・右に操作） */
.game.wide { max-width: none; display: flex; flex-direction: column; padding: 0 14px 12px; }
.wide .stage { position: relative; flex: 1; min-height: 0; }
.wide .boardwrap { position: absolute; inset: 0; padding: 0; }
.wide .left, .wide .right { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 10px; max-height: 100%; overflow: auto; }
.wide .left { left: 0; top: 4px; width: clamp(180px, 19vw, 260px); }
.wide .right { right: 0; bottom: 0; width: clamp(170px, 18vw, 250px); justify-content: flex-end; }
.wide .players, .wide .teams, .wide .actions, .wide .result { padding-left: 0; padding-right: 0; margin-left: 0; margin-right: 0; }
.wide .left .players, .wide .left .teams { grid-template-columns: 1fr; gap: 14px; }
.wide .hint { text-align: left; background: var(--surface); border-radius: 14px; padding: 10px 12px; }
.wide .actions { flex-direction: column; }
.wide .right .zoombar { position: static; flex-direction: row; justify-content: flex-end; }
.wide .pieceops { grid-template-columns: 1fr 1fr; }
.wide .pieceops .slot { grid-column: 1 / -1; min-height: 96px; }
.wide .pieceops .opb { min-height: 50px; }
.wide .pieceops .undo { grid-column: 1 / -1; flex-direction: row; gap: 8px; font-size: 14px; min-height: 44px; }
.wide .pieceops .undo small { font-size: 14px; color: var(--ink); }
.box { background: var(--surface); border-radius: 14px; padding: 10px 12px; font-size: 12.5px; }
.box h4 { margin: 0 0 8px; font-size: 12px; color: var(--sub); }
.keys { color: var(--sub); line-height: 1.9; }
.keys kbd { font-family: inherit; font-size: 11px; padding: 0 6px; border-radius: 5px; background: var(--surface2); color: var(--ink); font-weight: 800; }
@media (max-height: 720px) { .wide .keys { display: none; } }
@media (max-height: 480px) { .topbar { height: 46px; } .wide .left .players, .wide .left .teams { gap: 8px; } }
/* 幅の狭い横長（スマホの横持ち）：左上・右下の欄を細く、小さく */
@media (max-width: 899px) {
  .game.wide { padding: 0 10px 8px; }
  .wide .left { width: clamp(150px, 24vw, 210px); gap: 8px; }
  .wide .right { width: clamp(130px, 20vw, 180px); gap: 6px; }
  .wide .hint { font-size: 11.5px; padding: 7px 9px; }
  .wide .pcard { padding: 6px 7px; }
  .wide .result { padding: 10px 8px; }
  .wide .result .big { font-size: 20px; }
  .wide .result p { margin: 4px 0 8px; }
  .wide .result .row { flex-direction: column; }
  .wide .btn { min-height: 42px; }
  .wide .zb { width: 34px; height: 34px; }
  .wide .pieceops .slot { min-height: 72px; }
  .wide .pieceops .opb { min-height: 40px; font-size: 16px; }
  .wide .pieceops .undo { min-height: 36px; }
}
/* 小さいスマホの横持ち（背が420以下）：空く角が小さいので、左上・右下の欄をもっと小さく（盤のマスにかからないように） */
@media (max-width: 899px) and (max-height: 420px) {
  .wide .left { width: clamp(140px, 22vw, 190px); gap: 6px; }
  .wide .right { width: clamp(118px, 18vw, 160px); }
  .wide .pcard { padding: 4px 6px; }
  .wide .pcard small { display: none; }
  .wide .cnext { flex-direction: row-reverse; gap: 2px; }
  .wide .cnext span { writing-mode: vertical-rl; font-size: 8.5px; }
  .wide .left .players { gap: 12px; }
  .wide .hint { font-size: 10.5px; padding: 5px 8px; line-height: 1.45; }
  .wide .pieceops { gap: 5px; }
  .wide .pieceops .slot { min-height: 60px; }
  .wide .pieceops .opb { min-height: 34px; font-size: 14px; }
  .wide .pieceops .opb small { font-size: 9.5px; }
  .wide .pieceops .undo { min-height: 30px; }
  .wide .zb { width: 30px; height: 30px; font-size: 15px; }
}
/* スマホの横持ち（背が低い）：相乗りの赤と青の箱を横に並べて背を低くする（左上の欄が盤にかからないように） */
@media (max-width: 899px) and (max-height: 480px) {
  .wide .left .teams { grid-template-columns: 1fr 1fr; gap: 6px; }
  .wide .seat em, .wide .seat small, .wide .team .tname { display: none; }
  .wide .team { padding: 4px 4px 5px; }
  .wide .seat { padding: 2px 3px; gap: 5px; font-size: 12px; }
  .wide .order { display: none; }
}

/* ─── 見た目「はちみつ（みつばち・こい蜜の巣）」（2026-10-27 pineさん「みつばち（こい蜜の巣）を、はちみつの見た目として試作品に入れて。いまはカスタマイズの「見た目」で選べる形にして」）
   見本は 9．はちみつの色合いさがし.html の「みつばち（こい蜜の巣）」。金色の地に、こい蜜色の巣の部屋。石は 白（先手）と 黒（後手）、呼び名も「白・黒」（app.js の tr）。
   白い石も黒い石も映えるよう、巣の部屋は明るさ L60 ほどの こい蜜色（石と巣の差 白70・黒73）。<html data-look="honey"> のときだけ効く ─── */
:root[data-look="honey"] {
  color-scheme: light;
  --bg: #E09A12; --surface: #FFF3CF; --surface2: #FBE3A6; --ink: #2B1D14; --sub: #6B4A1A; --line: #E7B550;
  --cell: #CF8318; --cellEdge: #5A3A0C; --p1: #F3EEE4; --p1ink: #3A2A1C; --p1e: #9E907A; --p2: #2B1D14; --p2ink: #FFE7B0; --p2e: #0E0804;
  --accent: #3A2508; --btn: #2B1D14; --btnInk: #FFE08A; --warn: #B3261E; --honey: #FFDF8A;
}
:root[data-look="honey"] body { background: radial-gradient(110% 60% at 50% 40%, #FBD86A 0%, #F2B62C 62%, #E09A12 100%) fixed, var(--bg); }
/* うすい蜂の巣の模様 */
:root[data-look="honey"] body::before { content: ''; position: fixed; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='72.7' viewBox='0 0 42 72.7'%3E%3Cpath d='M21 0l21 12.1v24.2L21 48.5 0 36.3V12.1zM21 48.5v24.2' fill='none' stroke='%232B1D14' stroke-opacity='.10' stroke-width='1.2'/%3E%3C/svg%3E"); background-size: 42px 72.7px; }
:root[data-look="honey"] #app { position: relative; }
:root[data-look="honey"] .title-hero::before { background: radial-gradient(closest-side, rgba(255, 246, 210, .55), rgba(255, 223, 138, .25) 55%, transparent 76%); }
:root[data-look="honey"] .logo .h { color: #FFF8EA; text-shadow: 0 3px 0 #B9AD98, 0 6px 14px rgba(43, 29, 20, .25); }
:root[data-look="honey"] .logo .e { color: transparent; background: linear-gradient(180deg, #FFF0B8 0%, #F7B32B 50%, #A8650A 100%); -webkit-background-clip: text; background-clip: text; text-shadow: none; filter: drop-shadow(0 3px 6px rgba(120, 60, 0, .35)); }
:root[data-look="honey"] .logo .x { color: #2B1D14; text-shadow: 0 4px 12px rgba(43, 29, 20, .3); }
:root[data-look="honey"] .btn.primary { box-shadow: 0 4px 14px rgba(43, 29, 20, .3); }
:root[data-look="honey"] .seg button[aria-pressed="true"] { box-shadow: 0 1px 3px rgba(43, 29, 20, .25), inset 0 0 0 1px rgba(58, 37, 8, .35); }
:root[data-look="honey"] .title-side, :root[data-look="honey"] .dialog { background: #FFF6DA; }
:root[data-look="honey"] .overlay { background: rgba(60, 35, 5, .45); }
/* 遊び方・規約の本文（ネオンでは明るい灰色の文字にしている） */
:root[data-look="honey"] .doc p, :root[data-look="honey"] .doc li { color: #4A3622; }
:root[data-look="honey"] .doc .draft { background: #FDE3DC; border-color: #B3261E; color: #6E1A12; }
/* 白と黒は、うすい地の上でも見えるよう こげ茶のふちを足す */
:root[data-look="honey"] .pcard.on { box-shadow: 0 0 0 2px #3A2508, 0 4px 12px rgba(43, 29, 20, .2); }
:root[data-look="honey"] .now, :root[data-look="honey"] .mini span.win, :root[data-look="honey"] .slot .tag { box-shadow: 0 0 0 1.5px #3A2508; }
:root[data-look="honey"] .team { box-shadow: inset 0 0 0 1px var(--line); }
:root[data-look="honey"] .result .big { color: var(--ink); text-shadow: 0 2px 0 rgba(255, 255, 255, .6); }
:root[data-look="honey"] .topbar .ttl .snow, :root[data-look="honey"] .hint .snownote { color: #1F6F9A; }
:root[data-look="honey"] .topbar .ttl .honey, :root[data-look="honey"] .hint .honeynote { color: #8A4B00; }
/* 盤：巣の部屋（こい蜜色に こげ茶の壁）、外まわりは蜜ろうの上に白と黒、石は光らせず影とつや */
.board .gloss, .board .rimwax, .board .snowcap { display: none; }
:root[data-look="honey"] .board .cell { stroke-width: 2.8px; }
:root[data-look="honey"] .board .rimglow { display: none; }
:root[data-look="honey"] .board .rimwax { display: inline; stroke: #8A5A12; }
:root[data-look="honey"] .board .rim { stroke-width: 5px; }
:root[data-look="honey"] .board .glowgrp { filter: drop-shadow(0 1.5px 1.2px rgba(40, 20, 0, .45)); }
:root[data-look="honey"] .board .gloss { display: inline; }
:root[data-look="honey"] .chip { filter: drop-shadow(0 1px 1px rgba(40, 20, 0, .35)); }
:root[data-look="honey"] .chip polygon, :root[data-look="honey"] .piece .pieceglow { filter: none !important; }
:root[data-look="honey"] .piece { filter: drop-shadow(0 1px 1.2px rgba(40, 20, 0, .4)); }
/* 決着したあと・タイトルの飾りで うすくする石：はちみつの地では 黒い石が巣にまぎれるので、うすくしすぎない */
:root[data-look="honey"] .board .fadegrp { opacity: .62; }

/* ─── 見た目「雪」（2026-10-27 pineさん「雪解けや蜂蜜を選んだときにマップが変わるように」。雪どけを入れた対局と、タイトルのくじで出る）───
   見本は 8．雪とはちみつの見た目案.html の「雪」：白い朝の雪原、マスは氷のタイル、石の屋根に雪（app.js の snowCap）、画面の奥に降る雪と下の雪だまり（app.js の snowFx）、字は紺。
   石は 朱 #E8542F と 藍 #1F3A93（8．の「5.」で、色の見え方が少数派の人にも見分けやすかった組）。呼び名は「赤・青」のまま。<html data-look="snow"> のときだけ効く ─── */
:root[data-look="snow"] {
  color-scheme: light;
  --bg: #EAF3FA; --surface: #FFFFFF; --surface2: #E6EFF7; --ink: #1E3247; --sub: #5F7690; --line: #CFE0EE;
  --cell: #F5F9FD; --cellEdge: #BCD3E6; --p1: #E8542F; --p1ink: #FFFFFF; --p1e: #B23A1A; --p2: #1F3A93; --p2ink: #FFFFFF; --p2e: #142668;
  --accent: #3BA3E6; --btn: #1E3247; --btnInk: #FFFFFF; --warn: #D9480F; --honey: #F7B32B;
}
:root[data-look="snow"] body { background: linear-gradient(180deg, #F8FBFE 0%, #E7F0F8 55%, #D6E6F3 100%) fixed, var(--bg); }
:root[data-look="snow"] #app { position: relative; }
.snowfx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.snowfx i { position: absolute; top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 2px rgba(80, 130, 170, .55); animation: snowfall linear infinite; }
.snowfx .drift { position: absolute; left: -2px; bottom: -2px; width: calc(100% + 4px); height: 46px; }
@keyframes snowfall { from { transform: translate(0, -10px); } to { transform: translate(22px, 105vh); } }
@media (prefers-reduced-motion: reduce) { .snowfx i { display: none; } }
:root[data-look="snow"] .title-hero::before { background: radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(214, 232, 246, .5) 55%, transparent 76%); }
/* 名前の字の上に雪がつもる：字ごとに、字の形（いちばん上の線）にそって描いた白い帯（app.js の snowCaps。2026-10-27 pineさん「雪がかぶっている位置がおかしいのでは」） */
:root[data-look="snow"] .logo h2 span { text-shadow: 0 3px 0 rgba(30, 50, 71, .12); }
.logo .ch { position: relative; }
.logo .cap { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.logo .cap path { fill: #fff; filter: drop-shadow(0 1.5px 1.5px rgba(30, 50, 71, .28)); }
:root[data-look="snow"] .btn.primary { box-shadow: 0 4px 14px rgba(30, 50, 71, .25); }
/* 白いボタン・カードは、白い雪（画面の下の雪だまり）にまぎれないよう、うすい影とふちをつける */
:root[data-look="snow"] .btn:not(.primary):not(.outline), :root[data-look="snow"] .pcard:not(.on), :root[data-look="snow"] .ico { box-shadow: 0 2px 10px rgba(30, 50, 71, .12), inset 0 0 0 1px #E2ECF5; }
:root[data-look="snow"] .seg button[aria-pressed="true"] { box-shadow: 0 1px 3px rgba(30, 50, 71, .18), inset 0 0 0 1px rgba(59, 163, 230, .45); }
:root[data-look="snow"] .title-side, :root[data-look="snow"] .dialog { background: #F7FBFF; }
:root[data-look="snow"] .overlay { background: rgba(30, 50, 71, .35); }
:root[data-look="snow"] .doc p, :root[data-look="snow"] .doc li { color: #34495E; }
:root[data-look="snow"] .doc .draft { background: #FDE6DE; border-color: #D9480F; color: #7A2410; }
:root[data-look="snow"] .topbar .ttl .snow, :root[data-look="snow"] .hint .snownote { color: #1F6F9A; }
:root[data-look="snow"] .result .big { text-shadow: 0 2px 0 rgba(255, 255, 255, .8); }
/* 盤：氷のタイルに、外まわりは色の帯（光らせない）。石は影と、屋根の雪 */
:root[data-look="snow"] .board .cell { stroke-width: 1.6px; }
:root[data-look="snow"] .board .rimglow { filter: none; opacity: .2; stroke-width: 10px; }
:root[data-look="snow"] .board .rim { stroke-width: 5px; }
:root[data-look="snow"] .board .glowgrp { filter: drop-shadow(0 1.5px 1.5px rgba(30, 50, 71, .35)); }
:root[data-look="snow"] .board .snowcap { display: inline; }
:root[data-look="snow"] .board .fadegrp { opacity: .45; }
:root[data-look="snow"] .chip { filter: drop-shadow(0 1px 1px rgba(30, 50, 71, .3)); }
:root[data-look="snow"] .chip polygon, :root[data-look="snow"] .piece .pieceglow { filter: none !important; }
:root[data-look="snow"] .piece { filter: drop-shadow(0 1px 1.2px rgba(30, 50, 71, .35)); }

/* パソコンのタイトル：設定の欄は どの見た目でも地の色をつけない（はちみつ・雪で箱になり、浮いて見えた。2026-10-27 pineさん「カスタマイズの枠がタイトル画面で浮いている」）。
   スマホの板（下から出る）と窓には、見た目ごとの地の色を残す */
@media (min-width: 900px) and (orientation: landscape) {
  :root[data-look] .title-side { background: none; }
}

/* ─── オンライン対戦（2026-10-27 pineさん「オンライン対戦も追加」）─── */
/* はじめるボタンが2つ（部屋・世界の人と）のときも、1つのときと同じ高さ */
.startpair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.startpair .btn { font-size: 15px; padding: 0 6px; }
.topbar .ttl .net { color: var(--accent); }
/* 部屋づくり・さがす窓 */
.lobby .body { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.lobby .lead { font-size: 13px; color: var(--sub); line-height: 1.7; margin: 0; }
.lobby .small { font-size: 12px; color: var(--sub); line-height: 1.6; margin: 0; }
.lobby .bad { color: var(--warn); font-size: 13px; font-weight: 700; margin: 0; }
.lobby .row { display: flex; gap: 8px; }
.lobby .lsep { font-size: 12px; font-weight: 800; color: var(--sub); margin-top: 6px; }
.lobby .joinrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.lobby .joinrow .btn { flex: none; padding: 0 20px; }
.lobby .codein { min-height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface2); color: var(--ink); font: inherit; font-size: 20px; font-weight: 800; letter-spacing: .18em; text-align: center; text-transform: uppercase; padding: 0 10px; min-width: 0; }
.lobby .codein:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.lobby .codebig { font-family: var(--title-font); font-size: 40px; letter-spacing: .14em; text-align: center; color: var(--ink); padding: 6px 0; user-select: all; }
.lobby .btn.ghost { background: transparent; color: var(--sub); min-height: 40px; box-shadow: none; }
.lobby .spinner { width: 34px; height: 34px; margin: 4px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: lobbyspin 1s linear infinite; }
@keyframes lobbyspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lobby .spinner { animation: none; } }
/* ─── 2026-11-13：友達と遊ぶ・ランキング戦（ROWTATE と同じ形）─── */
/* はじめるボタンの小さな字（2行でも、1つのときと同じ高さ） */
.startpair .btn { flex-direction: column; gap: 0; line-height: 1.2; }
.startpair .btn small, .lobby .btn small { display: block; font-size: 10.5px; font-weight: 700; opacity: .8; margin-top: 2px; }
.lobby .btn:has(small) { flex-direction: column; gap: 0; line-height: 1.25; }
/* 窓の見出しの右に、待った時間 */
.lobby .head .lobby-clock { margin-left: auto; margin-right: 6px; font-weight: 800; font-size: 14px; color: var(--accent); font-variant-numeric: tabular-nums; }
/* 友達を待つ：QR コードと合言葉を横に並べる（スクロールしないように小さめ） */
.lobby .waitgrid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.lobby .roomqr { width: 132px; height: 132px; background: #fff; border-radius: 10px; padding: 6px; }
.lobby .roomqr svg { display: block; width: 100%; height: 100%; }
.lobby .waitside { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lobby .waitside .codebig { font-size: clamp(22px, 7vw, 30px); padding: 0; letter-spacing: .06em; white-space: nowrap; }
.lobby .waitside .row { flex-direction: column; }
.lobby .waitside .row .btn { min-height: 40px; font-size: 13px; }
@media (max-width: 360px) { .lobby .roomqr { width: 104px; height: 104px; } .lobby .waitside .codebig { font-size: 24px; } }
/* ランキング戦をさがす：こつ（高さを変えない）・ほかのモードで待っている人 */
.lobby .lobby-tip { min-height: 3.4em; margin: 0; padding: 8px 10px; border-radius: 12px; background: var(--surface2); font-size: 12.5px; line-height: 1.7; color: var(--ink); }
.lobby .lobby-others { display: flex; flex-direction: column; gap: 6px; }
.lobby .lobby-others .btn { min-height: 44px; font-size: 13px; }
.lobby .lobby-nobody { text-align: center; }
/* 見つかった窓 */
.lobby .found-title { margin: 0; text-align: center; font-family: var(--title-font); font-size: 20px; color: var(--accent); }
.lobby .found-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.lobby .found-side { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.lobby .found-side b { font-size: 15px; }
.lobby .found-side small { font-size: 11px; color: var(--sub); }
.lobby .found-vs { font-weight: 800; color: var(--sub); }
.lobby .found-count { text-align: center; font-family: var(--title-font); font-size: 46px; line-height: 1.1; color: var(--ink); animation: foundpop .3s ease-out; }
@keyframes foundpop { from { transform: scale(.7); opacity: .3; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lobby .found-count { animation: none; } }
/* 待つあいだ CPU と遊んでいるときの、上の帯の札（合言葉か「さがし中」と待った時間） */
.topbar .lpill { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 12px; border-radius: 17px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent); }
.topbar .lpill-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--accent); animation: lpill 1.6s ease-in-out infinite; }
@keyframes lpill { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .topbar .lpill-dot { animation: none; } }
.topbar .lpill-text { flex: 1; min-width: 0; background: none; border: none; padding: 0; font-size: 12.5px; font-weight: 800; color: var(--ink); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.topbar .lpill-x { flex: none; width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--surface2); color: var(--sub); cursor: pointer; }
/* ランキング戦の持ち時間：のこり10秒で赤く */
.now.hurry { background: var(--warn); color: #1A0A05; }
/* 決着の欄の、全国ランキングの一言 */
.result .rk-line { font-weight: 700; color: var(--ink); }
/* 全国ランキングの窓 */
.ranking .body { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.ranking .lead { font-size: 12.5px; color: var(--sub); line-height: 1.7; margin: 0; }
.ranking .small { font-size: 12px; color: var(--sub); line-height: 1.6; margin: 0; }
.ranking .rk-closed { margin: 0; padding: 12px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--accent); font-size: 13.5px; line-height: 1.8; }
.ranking .rk-you { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--surface2); box-shadow: inset 0 0 0 1.5px var(--accent); }
.ranking .rk-you-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ranking .rk-you-head span { flex: none; font-size: 11px; font-weight: 800; color: var(--accent); }
.ranking .rk-you-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.ranking .rk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ranking .rk-stats div { display: flex; flex-direction: column; align-items: center; padding: 5px 4px; border-radius: 10px; background: var(--surface); font-variant-numeric: tabular-nums; }
.ranking .rk-stats small { font-size: 11px; font-weight: 800; color: var(--sub); }
.ranking .rk-stats b { font-size: 15px; }
.ranking .rk-you-btns { display: flex; justify-content: flex-end; gap: 4px; margin: -4px -6px -6px; }
.ranking .rk-form { display: flex; flex-direction: column; gap: 6px; }
.ranking .joinrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.ranking .joinrow .btn { flex: none; padding: 0 18px; }
.ranking .codein { min-height: 46px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; font-weight: 700; padding: 0 12px; min-width: 0; }
.ranking .codein:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ranking .rk-msg { margin: 0; min-height: 1.2em; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.ranking .rk-msg:empty { display: none; }
.ranking .rk-list { list-style: none; margin: 0; padding: 0; max-height: 40dvh; overflow-y: auto; border-radius: 12px; background: var(--surface2); }
.ranking .rk-list li { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto 30px; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ranking .rk-list li:last-child { border-bottom: none; }
.ranking .rk-list li.mine { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ranking .rk-list li.rk-empty { display: block; text-align: center; color: var(--sub); padding: 16px 12px; }
.ranking .rk-rank { font-weight: 800; color: var(--sub); text-align: center; font-variant-numeric: tabular-nums; }
.ranking .rk-rank.top1, .ranking .rk-rank.top2, .ranking .rk-rank.top3 { color: var(--accent); }
.ranking .rk-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ranking .rk-val { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.ranking .rk-val small { display: block; font-size: 10.5px; color: var(--sub); font-weight: 700; }
.ranking .rk-flag { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: none; border-radius: 8px; background: none; color: var(--sub); opacity: .55; cursor: pointer; }
.ranking .rk-flag:hover, .ranking .rk-flag:focus-visible { opacity: 1; color: var(--warn); }

/* ─── 意見箱（2026-10-27 pineさん「意見箱を作る」。ROWTATE と同じ）─── */
.inbox .body { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.inbox .lead { font-size: 12.5px; color: var(--sub); line-height: 1.7; margin: 0; }
.inbox .lsep { font-size: 12px; font-weight: 800; color: var(--sub); margin-top: 6px; }
.inbox textarea { width: 100%; box-sizing: border-box; min-height: 110px; resize: vertical; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface2); color: var(--ink); font: inherit; font-size: 14px; line-height: 1.6; padding: 10px 12px; }
.inbox textarea:focus, .inbox .codein:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.inbox .joinrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.inbox .joinrow .btn { flex: none; padding: 0 20px; }
.inbox .codein { min-height: 46px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface2); color: var(--ink); font: inherit; font-size: 16px; font-weight: 700; letter-spacing: .06em; text-align: center; padding: 0 10px; min-width: 0; }
.inbox .imsg { font-size: 12.5px; color: var(--sub); line-height: 1.6; margin: 0; white-space: pre-line; overflow-wrap: anywhere; min-height: 0; }
.inbox .imsg:empty { display: none; }
.inbox .imsg.strong { color: var(--ink); font-weight: 800; background: var(--surface2); border-radius: 12px; padding: 8px 10px; }

/* ─── はちみつ：蜜の色の字（ツ・ナ）の下のふちから垂れる蜜と、落ちる しずく（app.js の honeyDrips。2026-10-27 pineさん「蜂蜜の色がついている文字から不規則な蜜がたれているデザインにして」）─── */
.logo .drip { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.logo .drip path { fill: #F2A51F; stroke: #B06A08; stroke-width: 1px; stroke-linejoin: round; }
.logo .drip { filter: drop-shadow(0 1px 1px rgba(110, 55, 0, .35)); }
.logo .ldrop { position: absolute; pointer-events: none; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: radial-gradient(circle at 38% 34%, #FFF4C8 0 14%, #E8A11E 52%, #9E5E08 100%); box-shadow: inset 0 0 0 1px rgba(142, 82, 6, .55); transform-origin: 50% 0; opacity: 0; animation: ldrop 9s linear infinite; }
@keyframes ldrop {
  0% { transform: translate(-50%, -3px) scale(.3, .2); opacity: 0; }
  8% { opacity: 1; }
  58% { transform: translate(-50%, 0) scale(1, 1.1); }
  64% { transform: translate(-50%, 2px) scale(.9, 1.3); animation-timing-function: cubic-bezier(.55, 0, 1, .6); }
  96% { opacity: .95; }
  100% { transform: translate(-50%, 150px) scale(.85, 1.35); opacity: 0; }
}
/* ⛔ 垂れた蜜の分、名前の字の下を空けない（はちみつだけ盤が小さくなる。2026-10-27 pineさん「はちみつだけタイトルの盤面の大きさが違う」）。
   垂れは字の箱の外に絵としてはみ出すだけで、並びには入らない。前の版〈.logo h2 に margin-bottom .34em〉は _bk/style_2026-10-27_説明の字を消す前.css */

/* ─── 電気がチカチカ（2026-10-27 pineさん「電気がチカチカしていたら面白いかも」）─── */
/* ネオンのタイトル：「ナ」だけが、古い看板のネオン管のように いつも ジジッと不安定（ほかの字は光ったまま）。
   2026-10-27 pineさん「N2」（11．タイトルのデザイン案.html）。前は ム・ギ が ときどき またたく形（_bk/style_2026-10-27_演出を選ぶ前.css） */
@keyframes buzz { 0%, 100% { opacity: 1; } 3% { opacity: .45; } 4% { opacity: .95; } 5% { opacity: .5; } 6% { opacity: 1; } 22% { opacity: .85; } 23% { opacity: 1; } 51% { opacity: 1; } 52% { opacity: .25; } 53% { opacity: .9; } 55% { opacity: .4; } 56% { opacity: 1; } 79% { opacity: .9; } 80% { opacity: 1; } }
:root:not([data-look]) .logo .e .ch:last-child { animation: buzz 2.3s infinite; }
/* 電気のモード：電気の来ている石と、電源の辺が チカチカ（光のまとまりの明るさを ゆらす） */
@keyframes zap { 0%, 100% { opacity: 1; } 6% { opacity: .72; } 7% { opacity: 1; } 41% { opacity: 1; } 42% { opacity: .55; } 43% { opacity: .95; } 44% { opacity: .68; } 45% { opacity: 1; } 77% { opacity: .85; } 78% { opacity: 1; } }
@keyframes zaprim { 0%, 100% { opacity: .55; } 12% { opacity: .2; } 13% { opacity: .6; } 58% { opacity: .55; } 59% { opacity: .15; } 60% { opacity: .5; } 61% { opacity: .25; } 62% { opacity: .55; } }
.board.power .glowgrp { animation: zap 3.1s infinite; }
.board.power .rimglow { animation: zaprim 4.3s .6s infinite; }
@media (prefers-reduced-motion: reduce) {
  .logo .ldrop { display: none; }
  .logo .ch, .board.power .glowgrp, .board.power .rimglow { animation: none !important; }
}
