/* =========================================================
   使い方ガイド(js/guide.js)
   ・はじめの案内(.gw):起動画面と同じレーダーの雰囲気のカード
   ・ボタンの説明(.gt):実際のボタンを光る枠で囲み、まわりを暗くして、吹き出しで説明
   ・色だけに頼らない:何枚目かは数字(03/08)でも出す。有料プランは PLUS の印+文字
   ・白(html.light)・夜の色(html.night)・動きを減らす設定でも崩れないように
   ========================================================= */
.gd-root { position: fixed; inset: 0; z-index: 150; font-family: var(--font-ja); color: var(--ink); }

/* ---------- 共通のボタン ---------- */
.gd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1 1 auto; min-width: 0;
  min-height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line2);
  background: rgba(var(--d2), .55); color: var(--ink); font-size: 14px; font-weight: 700; letter-spacing: .02em;
}
.gd-btn:disabled { opacity: .35; cursor: default; }
.gd-btn.primary {
  border: 0; color: var(--on-acc);
  background: linear-gradient(135deg, #8ff7ff, var(--accent) 45%, #4aa8ff);
  box-shadow: 0 8px 26px rgba(var(--acc-rgb), .32), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.gd-btn.big { min-height: 52px; font-size: 15.5px; width: 100%; }
.gd-btn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.gd-skip {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line2);
  background: rgba(var(--d0), .55); color: var(--ink2); font-size: 12.5px; font-weight: 700;
}
/* 有料プランの一言(PLUS の印+文字) */
.gd-plus { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: 8px 0 0; font-size: 12px; line-height: 1.55; color: var(--ink2); }
.gd-plus.center { justify-content: center; text-align: center; margin: 0 0 4px; }
.gd-plus .plus-tag { margin: 0; }
.gd-plus > span:not(.plus-tag) { flex: 1 1 auto; min-width: 0; }
.gd-plus.center > span:not(.plus-tag) { flex: 0 1 auto; }

/* ---------- はじめの案内 ---------- */
.gw {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b)); overflow-y: auto; overscroll-behavior: contain;
}
.gw-bg {
  position: fixed; inset: 0;
  background:
    linear-gradient(rgba(var(--acc-rgb), .045) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(var(--acc-rgb), .045) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(90% 70% at 50% 35%, rgba(11, 24, 52, .9) 0%, rgba(2, 5, 11, .95) 70%);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: gdFade .35s ease;
}
.gw-card {
  position: relative; width: min(440px, 100%); margin: auto; padding: 16px 18px 16px; border-radius: 22px;
  border: 1px solid var(--line2);
  background: radial-gradient(80% 40% at 50% 0%, rgba(var(--acc-rgb), .1), transparent 70%), linear-gradient(180deg, rgba(var(--d1b), .94), rgba(var(--d0b), .97));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(var(--acc-rgb), .08), 0 0 46px rgba(var(--acc-rgb), .14);
  animation: gwPop .45s cubic-bezier(.2, .9, .25, 1);
}
.gw-card::before {
  content: ""; position: absolute; left: 14%; right: 14%; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent);
}
/* 角のかぎ(HUD の括弧) */
.gw-corner { position: absolute; width: 12px; height: 12px; border: 2px solid var(--accent); pointer-events: none; opacity: .9; }
.gw-corner.c1 { top: 5px; left: 5px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.gw-corner.c2 { bottom: 5px; right: 5px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.gw-top { display: flex; align-items: center; gap: 10px; padding-left: 10px; }
.gw-eye { font-size: 11px; letter-spacing: .24em; color: var(--accent); text-shadow: 0 0 10px rgba(var(--acc-rgb), .5); white-space: nowrap; }
.gw-count { margin-left: auto; font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: .04em; white-space: nowrap; }
.gw-count small { font-size: 11.5px; color: var(--ink3); margin-left: 2px; }
.gw-stage { position: relative; overflow: hidden; touch-action: pan-y; }
.gw-slide { padding: 2px 2px 0; }
.gw-slide.fwd { animation: gwInR .38s cubic-bezier(.2, .9, .25, 1); }
.gw-slide.bwd { animation: gwInL .38s cubic-bezier(.2, .9, .25, 1); }
.gw-glyph { position: relative; width: 104px; height: 104px; margin: 10px auto 10px; display: grid; place-items: center; }
.gw-ring {
  position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line2);
  background:
    radial-gradient(circle, transparent 0 33%, var(--line2) 33.5% 34.3%, transparent 35% 66%, var(--line2) 66.5% 67.3%, transparent 68%),
    linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat,
    linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat,
    radial-gradient(circle, rgba(var(--acc-rgb), .14), rgba(var(--d0), .9) 72%);
  box-shadow: 0 0 34px rgba(var(--acc-rgb), .2), inset 0 0 24px rgba(var(--acc-rgb), .12);
}
.gw-sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 70%, rgba(var(--acc-rgb), .12) 88%, rgba(var(--acc-rgb), .55)); animation: sweep 2.8s linear infinite; }
.gw-glyph svg { position: relative; width: 50px; height: 50px; fill: none; stroke: var(--accent); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 8px rgba(var(--acc-rgb), .65)); }
.gw-title { margin: 4px 0 6px; text-align: center; font-size: 21px; font-weight: 900; line-height: 1.4; letter-spacing: .03em; }
.gw-lead { margin: 0; font-size: 14px; line-height: 1.75; color: var(--ink); }
.gw-lead b { color: var(--accent); font-weight: 900; }
.gw-pts { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.gw-pts li { display: flex; gap: 8px; align-items: baseline; padding: 7px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(var(--d2), .4); font-size: 13px; line-height: 1.55; }
.gw-pts li i { flex: none; font-style: normal; font-weight: 900; color: var(--accent); }
.gw-note { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; font-size: 12px; line-height: 1.6; color: var(--ink2); }
.gw-note b { flex: none; width: 18px; height: 18px; margin-top: 1px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--caution); color: var(--caution); font-size: 11px; font-weight: 900; line-height: 1; }
.gw-prog { display: flex; gap: 4px; margin: 14px 0 12px; }
.gw-prog i, .gt-prog i { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--line2); }
.gw-prog i.on, .gt-prog i.on { background: var(--accent); box-shadow: 0 0 8px rgba(var(--acc-rgb), .55); }
.gw-prog i.cur, .gt-prog i.cur { height: 6px; margin-top: -1px; }
.gw-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.gw-row { display: flex; gap: 8px; width: 100%; }

/* ---------- ボタンの説明(スポットライト) ---------- */
.gt { position: absolute; inset: 0; }
.gt-catch { position: fixed; inset: 0; }
.gt-hole {
  position: fixed; left: 50%; top: 50%; width: 0; height: 0; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(1, 4, 10, .76);
  transition: left .4s cubic-bezier(.2, .9, .25, 1), top .4s cubic-bezier(.2, .9, .25, 1), width .4s cubic-bezier(.2, .9, .25, 1), height .4s cubic-bezier(.2, .9, .25, 1), border-radius .4s;
}
.gt-ring { position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(var(--acc-rgb), .18), 0 0 26px rgba(var(--acc-rgb), .6), inset 0 0 16px rgba(var(--acc-rgb), .25); }
.gt-pulse { position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--accent); opacity: 0; animation: gtPulse 1.9s ease-out infinite; }
.gt-scan { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
.gt-scan::before { content: ""; position: absolute; left: 0; right: 0; height: 45%; top: -45%; background: linear-gradient(180deg, transparent, rgba(var(--acc-rgb), .3), transparent); animation: gtScan 2.3s ease-in-out infinite; }
/* 角のかぎ:囲みの外側に4つ */
.gt-hole .k { position: absolute; width: 12px; height: 12px; border: 2px solid var(--accent); filter: drop-shadow(0 0 4px rgba(var(--acc-rgb), .8)); }
.gt-hole .k1 { left: -8px; top: -8px; border-right: 0; border-bottom: 0; }
.gt-hole .k2 { right: -8px; top: -8px; border-left: 0; border-bottom: 0; }
.gt-hole .k3 { left: -8px; bottom: -8px; border-right: 0; border-top: 0; }
.gt-hole .k4 { right: -8px; bottom: -8px; border-left: 0; border-top: 0; }
.gt-hole.round .k { display: none; }

.gt-tip {
  position: fixed; left: 12px; top: 12px; width: min(360px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 14px 12px; border-radius: 18px; border: 1px solid var(--line2);
  background: rgb(var(--d1b));
  box-shadow: 0 22px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(var(--acc-rgb), .1), 0 0 30px rgba(var(--acc-rgb), .18);
  transition: left .4s cubic-bezier(.2, .9, .25, 1), top .4s cubic-bezier(.2, .9, .25, 1), opacity .2s;
}
/* 高さが足りないとき:説明の文だけを中で動かし、上の番号と下のボタンはいつも見せる */
.gt-tip.tight { display: flex; flex-direction: column; overflow: hidden; }
.gt-tip.tight .gt-top, .gt-tip.tight .gt-prog, .gt-tip.tight .gt-nav { flex: none; }
.gt-tip.tight .gt-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; mask-image: linear-gradient(180deg, #000 calc(100% - 18px), transparent); -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 18px), transparent); }
.gt-tip.tight .gt-text { padding-bottom: 14px; }
.gt-tip::before { content: ""; position: absolute; left: 12%; right: 12%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.gt-arrow {
  position: fixed; width: 14px; height: 14px; transform: rotate(45deg); background: rgb(var(--d1b));
  border: 1px solid transparent; z-index: 1; pointer-events: none;
  transition: left .4s cubic-bezier(.2, .9, .25, 1), top .4s cubic-bezier(.2, .9, .25, 1);
}
.gt-arrow[data-side="below"] { border-top-color: var(--line2); border-left-color: var(--line2); }
.gt-arrow[data-side="above"] { border-bottom-color: var(--line2); border-right-color: var(--line2); }
.gt-arrow[data-side="left"] { border-top-color: var(--line2); border-right-color: var(--line2); }
.gt-arrow[data-side="right"] { border-bottom-color: var(--line2); border-left-color: var(--line2); }
.gd-root.gt-wait .gt-tip, .gd-root.gt-wait .gt-arrow { opacity: 0; }
.gd-root.gt-busy .gt-nav .gd-btn { opacity: .5; }
.gt-top { display: flex; align-items: center; gap: 8px; }
.gt-eye { font-size: 10.5px; letter-spacing: .22em; color: var(--accent); white-space: nowrap; }
.gt-count { font-size: 15px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.gt-count small { font-size: 11px; color: var(--ink3); margin-left: 1px; }
.gt-top .gd-skip { margin-left: auto; }
.gt-prog { display: flex; gap: 3px; margin: 8px 0 10px; }
.gt-prog i { height: 3px; }
.gt-prog i.cur { height: 5px; }
.gt-where { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin: 0 0 6px; padding: 3px 10px 3px 7px; border-radius: 99px; border: 1px dashed var(--line2); font-size: 11.5px; line-height: 1.45; color: var(--ink2); }
.gt-where svg, .gd-entry-sub svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.gt-title { margin: 0; font-size: 19px; font-weight: 900; line-height: 1.35; letter-spacing: .03em; }
.gt-text { margin: 6px 0 0; font-size: 13.5px; line-height: 1.72; }
.gt-text b { color: var(--accent); }
.gt-nav { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- 「YOIDOKO について」の中の入口 ---------- */
.gd-entry { display: grid; gap: 6px; margin: 12px 0 4px; }
.gd-entry-main {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 14px 8px 10px; text-align: left;
  border-radius: 16px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: radial-gradient(70% 120% at 0% 50%, rgba(var(--acc-rgb), .16), transparent 70%), rgba(var(--d2), .5);
  box-shadow: 0 0 18px rgba(var(--acc-rgb), .14);
}
.gd-entry-ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--accent); color: var(--accent); font-family: var(--font-num); font-size: 19px; font-weight: 700; box-shadow: 0 0 12px rgba(var(--acc-rgb), .45); }
.gd-entry-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.gd-entry-txt b { font-size: 15px; color: var(--ink); }
.gd-entry-txt small { font-size: 11.5px; color: var(--ink2); }
.gd-entry-go { flex: none; font-size: 22px; color: var(--accent); }
.gd-entry-sub { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line2); background: none; color: var(--ink2); font-size: 12.5px; }

/* ---------- 動き ---------- */
@keyframes gdFade { from { opacity: 0; } }
@keyframes gwPop { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes gwInR { from { opacity: 0; transform: translateX(28px); } }
@keyframes gwInL { from { opacity: 0; transform: translateX(-28px); } }
@keyframes gtPulse { 0% { inset: -2px; opacity: .9; } 100% { inset: -16px; opacity: 0; } }
@keyframes gtScan { 0% { top: -45%; } 100% { top: 100%; } }

/* 狭い画面 */
@media (max-width: 360px) {
  .gw-card { padding: 14px 14px 14px; }
  .gw-glyph { width: 84px; height: 84px; margin: 6px auto 6px; }
  .gw-glyph svg { width: 42px; height: 42px; }
  .gw-title { font-size: 19px; }
  .gw-lead { font-size: 13.5px; }
}
@media (max-height: 640px) {
  .gw-glyph { width: 76px; height: 76px; margin: 4px auto 4px; }
  .gw-glyph svg { width: 38px; height: 38px; }
}

/* 動きを減らす設定:流れる光・広がる輪・回るレーダーは出さない */
@media (prefers-reduced-motion: reduce) {
  .gt-pulse, .gt-scan, .gw-sweep { display: none; }
  .gt-hole, .gt-tip, .gt-arrow { transition: none; }
  .gw-bg, .gw-card, .gw-slide.fwd, .gw-slide.bwd { animation: none; }
}

/* ---------- 白(明るい画面) ---------- */
html.light .gw-bg {
  background:
    linear-gradient(rgba(0, 126, 163, .06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(0, 126, 163, .06) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(90% 70% at 50% 35%, rgba(255, 255, 255, .96) 0%, rgba(221, 230, 240, .97) 75%);
}
html.light .gw-card { background: radial-gradient(80% 40% at 50% 0%, rgba(0, 126, 163, .08), transparent 70%), linear-gradient(180deg, #ffffff, #f2f6fb); box-shadow: 0 24px 60px rgba(16, 40, 70, .22), 0 0 0 1px rgba(16, 40, 70, .06); }
html.light .gw-eye { text-shadow: none; }
html.light .gw-glyph svg { filter: none; }
html.light .gw-ring { box-shadow: 0 0 0 1px rgba(16, 40, 70, .08), inset 0 0 20px rgba(0, 126, 163, .1); background:
    radial-gradient(circle, transparent 0 33%, var(--line2) 33.5% 34.3%, transparent 35% 66%, var(--line2) 66.5% 67.3%, transparent 68%),
    linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat,
    linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat,
    radial-gradient(circle, rgba(0, 126, 163, .1), #eef3f9 72%); }
html.light .gw-lead b, html.light .gt-text b { color: #00627f; }
html.light .gd-btn.primary { color: #fff; background: linear-gradient(135deg, #00a3cc, #007ea3 55%, #3858d6); box-shadow: 0 8px 22px rgba(0, 126, 163, .3); }
html.light .gt-hole { box-shadow: 0 0 0 200vmax rgba(10, 22, 38, .6); }
html.light .gt-ring { box-shadow: 0 0 0 4px rgba(255, 255, 255, .85), 0 0 0 6px rgba(0, 126, 163, .5), 0 0 22px rgba(0, 126, 163, .5); }
html.light .gt-hole .k { border-color: #ffffff; filter: drop-shadow(0 0 2px rgba(10, 22, 38, .9)); }
html.light .gt-tip { box-shadow: 0 18px 50px rgba(10, 22, 38, .35), 0 0 0 1px rgba(16, 40, 70, .1); }
html.light .gw-prog i.on, html.light .gt-prog i.on { box-shadow: none; }
html.light .gd-entry-main { background: radial-gradient(70% 120% at 0% 50%, rgba(0, 126, 163, .1), transparent 70%), #ffffff; }
html.light .gd-entry-ic { box-shadow: none; }

/* ---------- 夜の色(赤・緑):一色・光は控えめ ---------- */
html.night .gw-bg { background: rgba(0, 0, 0, .95); backdrop-filter: none; -webkit-backdrop-filter: none; }
html.night .gw-card { background: rgb(var(--ntd1)); box-shadow: none; }
html.night .gw-card::before { background: linear-gradient(90deg, transparent, var(--accent), transparent); }
html.night .gw-eye, html.night .gw-glyph svg, html.night .gt-hole .k { text-shadow: none; filter: none; }
html.night .gw-ring { box-shadow: none; background:
    radial-gradient(circle, transparent 0 33%, var(--line2) 33.5% 34.3%, transparent 35% 66%, var(--line2) 66.5% 67.3%, transparent 68%),
    linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat,
    linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat, #000; }
html.night .gw-sweep { background: conic-gradient(from 0deg, transparent 70%, rgba(var(--nt), .5)); }
html.night .gd-btn.primary { background: var(--accent); color: #000; box-shadow: none; }
html.night .gt-hole { box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .82); }
html.night .gt-ring { box-shadow: none; }
html.night .gt-tip { background: rgb(var(--ntd1)); box-shadow: none; }
html.night .gt-arrow { background: rgb(var(--ntd1)); }
html.night .gw-prog i.on, html.night .gt-prog i.on { box-shadow: none; }
html.night .gd-entry-main { background: rgba(var(--ntd2), .6); box-shadow: none; }
html.night .gd-entry-ic { box-shadow: none; }
