/* =====================================================================
   Claude Security Island — 絵本×オプスコンソール UI
   ===================================================================== */
:root {
  --ink: #2e3440;
  --ink-soft: #5b6472;
  --paper: #fdf6e9;
  --paper-2: #f7ecd8;
  --line: #e3d5b8;
  --teal: #2f9e8f;
  --teal-dark: #237c70;
  --coral: #e85d4a;
  --amber: #f0a030;
  --leaf: #7abf5d;
  --sky-1: #aee3f5;
  --sky-2: #d9f2fb;
  --shadow: 0 6px 0 rgba(46, 52, 64, 0.12), 0 14px 30px rgba(46, 52, 64, 0.16);
  --radius: 18px;
  --font-body: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', sans-serif;
  --font-game: 'DotGothic16', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 48%, #bfe9f6 100%);
}
button { font-family: inherit; cursor: pointer; }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; background: rgba(46,52,64,.08); padding: 1px 6px; border-radius: 6px; font-size: .88em; word-break: break-all; }
mark { background: linear-gradient(transparent 55%, #ffe18a 55%); padding: 0 2px; }

/* ---------------- 3D world ---------------- */
#world { position: fixed; inset: 0; }
#world canvas { display: block; }

/* ---------------- HUD ---------------- */
.hud-top {
  position: fixed; top: 14px; left: 14px; right: 14px;
  display: flex; align-items: flex-start; justify-content: space-between;
  pointer-events: none; z-index: 40;
}
.hud-card {
  pointer-events: auto;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 16px;
}
.hud-left { display: flex; flex-direction: column; gap: 6px; min-width: 248px; }
.hud-title { font-family: var(--font-game); font-size: 15px; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.hud-title .isl { font-size: 19px; }
.hud-xp-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
#hud-level { font-family: var(--font-game); background: var(--ink); color: #ffe18a; border-radius: 8px; padding: 2px 8px; font-size: 12px; }
.hud-xp-bar { flex: 1; height: 12px; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
#hud-xp-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--leaf), var(--teal)); transition: width .6s cubic-bezier(.34,1.56,.64,1); }
#hud-xp-num { color: var(--ink-soft); font-size: 11px; min-width: 56px; text-align: right; }
.hud-meta { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--ink-soft); }
#hud-badges { display: flex; gap: 3px; }
.hud-badge { font-size: 16px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.12)); animation: badge-in .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes badge-in { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1); } }
.hud-right { display: flex; gap: 10px; pointer-events: auto; }
.hud-btn {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: var(--shadow); padding: 10px 14px;
  font-family: var(--font-game); font-size: 13px;
  transition: transform .12s;
}
.hud-btn:hover { transform: translateY(-2px); }
.hud-btn:active { transform: translateY(1px); }
.hud-btn .count { display: block; font-size: 10px; color: var(--teal-dark); }
.hud-btn.sm { font-size: 11px; padding: 10px 10px; }
.voice-replay {
  float: right; width: 36px; height: 36px; border-radius: 50%;
  border: 2.5px solid var(--ink); background: var(--paper-2); font-size: 15px;
  transition: transform .12s;
}
.voice-replay:hover { transform: scale(1.1); }

/* ---------------- ガイド（セキュガニ博士） ---------------- */
#guide-box {
  position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 130%);
  width: min(640px, calc(100vw - 28px));
  display: flex; align-items: flex-end; gap: 10px;
  transition: transform .45s cubic-bezier(.34,1.4,.64,1);
  z-index: 50;
}
#guide-box.visible { transform: translate(-50%, 0); }
.guide-avatar {
  flex: 0 0 auto; width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd9c4, #f4a07c);
  border: 3px solid var(--ink); box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 38px;
  animation: bob 3s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.guide-bubble {
  flex: 1; background: var(--paper); border: 3px solid var(--ink);
  border-radius: var(--radius); border-bottom-left-radius: 4px;
  box-shadow: var(--shadow); padding: 14px 18px;
}
.guide-name { font-family: var(--font-game); font-size: 11px; color: var(--teal-dark); margin-bottom: 4px; }
#guide-text { font-size: 14.5px; line-height: 1.75; min-height: 1.6em; }
#guide-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------------- ボタン ---------------- */
.btn {
  border: 3px solid var(--ink); border-radius: 13px;
  background: var(--paper-2); color: var(--ink);
  padding: 9px 18px; font-size: 13.5px; font-weight: 700;
  box-shadow: 0 4px 0 rgba(46,52,64,.18);
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(46,52,64,.18); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(46,52,64,.18); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-dark); }
.btn.ghost { background: var(--paper); }
.btn.big { font-size: 16px; padding: 13px 28px; border-radius: 16px; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.sm { font-size: 12.5px; padding: 8px 12px; font-weight: 500; text-align: left; }
.btn.correct { background: #d8f0c8 !important; border-color: #4f8f3a; }
.btn.wrong { background: #fadbd5 !important; border-color: var(--coral); }
.btn.sev-high { background: #fadbd5; }
.btn.sev-medium { background: #ffeacc; }
.btn.sev-low { background: #eef5cf; }

/* ---------------- モーダル ---------------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(46,52,64,0);
  transition: background .3s;
  padding: 18px;
  overflow-y: auto;
}
.modal-wrap.show { background: rgba(46,52,64,.35); }
.modal-card {
  background: var(--paper); border: 3px solid var(--ink);
  border-radius: 22px; box-shadow: var(--shadow);
  max-width: 660px; width: 100%;
  max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 24px 26px;
  transform: translateY(30px) scale(.96); opacity: 0;
  transition: transform .35s cubic-bezier(.34,1.4,.64,1), opacity .3s;
}
.modal-wrap.show .modal-card { transform: none; opacity: 1; }
.modal-wrap.side { place-items: center end; }
.modal-wrap.side .modal-card { max-width: 480px; margin-right: 8px; }
.modal-wrap.center-sm .modal-card { max-width: 430px; text-align: center; }
.modal-wrap.start { background: rgba(120, 200, 235, .35); backdrop-filter: blur(3px); }
.modal-wrap.start.show { background: rgba(100, 185, 226, .5); }

/* ---------------- スタート画面 ---------------- */
.start-card { text-align: center; padding: 8px 4px; }
.start-emblem { font-size: 52px; animation: bob 3s ease-in-out infinite; }
.start-title { font-family: var(--font-game); font-size: 26px; line-height: 1.25; margin: 8px 0 2px; }
.start-title span { font-size: 40px; color: var(--teal-dark); letter-spacing: 6px; }
.start-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.start-desc { font-size: 14px; line-height: 1.9; background: var(--paper-2); border: 2px dashed var(--line); border-radius: 14px; padding: 12px; margin-bottom: 18px; }
.start-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.start-credit { margin-top: 16px; font-size: 10px; color: var(--ink-soft); }

/* ---------------- 章メニュー ---------------- */
.ch-menu h2 { font-family: var(--font-game); font-size: 20px; margin-bottom: 14px; }
.ch-menu h2 small { font-size: 12px; color: var(--ink-soft); font-family: var(--font-body); }
.ch-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.ch-item {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--paper-2); border: 3px solid var(--ink); border-radius: 15px;
  padding: 11px 14px; transition: transform .12s;
}
.ch-item:hover:not(.locked) { transform: translateX(5px); }
.ch-item.locked { opacity: .5; cursor: not-allowed; }
.ch-item.cleared { background: #e7f3da; }
.ch-item.exam { background: #fdeede; }
.ch-item.sandbox { background: #e3f2fb; }
.ch-icon { font-size: 24px; }
.ch-meta { flex: 1; display: flex; flex-direction: column; }
.ch-meta b { font-size: 14px; }
.ch-meta small { font-size: 11.5px; color: var(--ink-soft); }
.ch-replay { font-size: 11px; background: var(--ink); color: #fff; border-radius: 8px; padding: 2px 8px; }

/* ---------------- 章バナー ---------------- */
.ch-banner {
  position: fixed; top: 38%; left: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0;
  display: flex; align-items: center; gap: 14px;
  background: var(--paper); border: 4px solid var(--ink); border-radius: 20px;
  box-shadow: var(--shadow); padding: 18px 30px; z-index: 55;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1), opacity .35s;
}
.ch-banner.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.ch-banner-icon { font-size: 42px; }
.ch-banner small { font-family: var(--font-game); color: var(--teal-dark); display: block; font-size: 12px; }
.ch-banner b { font-size: 24px; }

/* ---------------- レッスンカード ---------------- */
.lesson-card { }
.lesson-tag { font-family: var(--font-game); font-size: 11px; color: var(--teal-dark); background: #e0f2ee; border-radius: 8px; padding: 3px 10px; }
.lesson-head h3 { font-size: 20px; margin: 10px 0 4px; }
.lesson-body { font-size: 14px; line-height: 1.95; padding: 8px 0 4px; }
.lesson-body ul, .lesson-body ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.lesson-body p { margin: 8px 0; }
.lesson-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.vuln-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.vuln-grid span { background: #fdeaea; border: 2px solid #e8b4ab; border-radius: 999px; padding: 3px 11px; font-size: 12px; }
.warn-box { background: #fdeaea; border: 2px solid var(--coral); border-radius: 12px; padding: 12px 14px; }
.tip-box { background: #e6f4f1; border: 2px solid var(--teal); border-radius: 12px; padding: 12px 14px; }
.sev-table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.sev-table th { width: 46px; font-family: var(--font-game); font-size: 16px; border: 2px solid var(--line); padding: 8px; background: var(--paper-2); }
.sev-table tr:nth-child(1) th { color: var(--coral); }
.sev-table tr:nth-child(2) th { color: var(--amber); }
.sev-table tr:nth-child(3) th { color: #8aa11e; }
.sev-table td { border: 2px solid var(--line); padding: 8px 10px; font-size: 13px; }

/* ---------------- ミニゲーム ---------------- */
.mg-card h3 { font-size: 17px; margin-bottom: 12px; }
.mg-card h3 small { font-size: 11px; color: var(--ink-soft); font-weight: 400; }
.mg-score { font-family: var(--font-game); font-size: 13px; color: var(--teal-dark); margin-bottom: 10px; }
.mg-hint { font-size: 12px; color: var(--ink-soft); margin-top: 10px; text-align: center; }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

.req-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.req-item { border: 2.5px solid var(--ink); border-radius: 12px; background: var(--paper-2); padding: 10px 12px; font-size: 12.5px; font-weight: 700; text-align: left; transition: transform .1s; }
.req-item:hover:not(:disabled) { transform: translateY(-2px); }
.req-item.correct { background: #d8f0c8; border-color: #4f8f3a; }
.req-item.wrong { background: #fadbd5; border-color: var(--coral); opacity: .85; }
.req-item small { display: block; font-weight: 400; font-size: 10.5px; color: var(--ink-soft); margin-top: 4px; }

.step-progress { display: flex; align-items: center; margin-bottom: 14px; }
.step-dot { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--ink); background: var(--paper-2); display: grid; place-items: center; font-family: var(--font-game); font-size: 13px; }
.step-dot.on { background: var(--teal); color: #fff; }
.step-line { flex: 1; height: 3px; background: var(--line); }
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-item { display: flex; gap: 10px; align-items: center; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--paper-2); padding: 10px 13px; font-size: 13px; font-weight: 700; text-align: left; }
.order-item.done { background: #d8f0c8; cursor: default; }
.order-num { flex: 0 0 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--font-game); background: #fff; }
.order-item.done .order-num { background: var(--teal); color: #fff; border-color: var(--teal-dark); }

.repo-list { display: flex; flex-direction: column; gap: 8px; }
.repo-item { display: flex; gap: 12px; align-items: center; border: 2.5px solid var(--ink); border-radius: 13px; background: var(--paper-2); padding: 11px 14px; text-align: left; }
.repo-item:hover:not(:disabled) { transform: translateX(4px); }
.repo-item.done { background: #e7f3da; opacity: .8; }
.repo-icon { font-size: 22px; }
.repo-meta b { font-family: ui-monospace, Consolas, monospace; font-size: 14px; display: block; }
.repo-meta small { color: var(--ink-soft); font-size: 11.5px; }

.cfg-group { margin-bottom: 12px; display: flex; flex-direction: column; gap: 7px; }
.cfg-group label { font-family: var(--font-game); font-size: 12px; color: var(--teal-dark); }
.cfg-opt { border: 2.5px solid var(--ink); border-radius: 11px; background: var(--paper-2); padding: 9px 13px; font-size: 13px; font-weight: 700; text-align: left; }
.cfg-opt.on { background: var(--teal); color: #fff; }

.scan-prog { text-align: center; padding: 14px 6px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.scan-prog small { color: var(--ink-soft); font-size: 11.5px; }
.scan-note { font-style: italic; }
.scan-radar {
  width: 76px; height: 76px; border-radius: 50%;
  border: 3px solid var(--teal);
  background:
    conic-gradient(from 0deg, rgba(47,158,143,.55), transparent 80deg),
    radial-gradient(circle, transparent 58%, rgba(47,158,143,.25) 60%, transparent 62%),
    radial-gradient(circle, transparent 30%, rgba(47,158,143,.25) 32%, transparent 34%),
    #eafaf6;
  animation: radar-spin 1.4s linear infinite;
}
@keyframes radar-spin { to { transform: rotate(360deg); } }

.scenario-text { background: var(--paper-2); border: 2px dashed var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.8; margin-bottom: 12px; }
.quiz-q { font-size: 15px; font-weight: 700; line-height: 1.8; margin-bottom: 12px; }

/* ---------------- Finding カード ---------------- */
.modal-wrap.finding .modal-card { max-width: 560px; border-color: var(--coral); }
.fc-head { border-bottom: 2px dashed var(--line); padding-bottom: 10px; margin-bottom: 10px; position: relative; }
.fc-x { position: absolute; top: -6px; right: -6px; width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper-2); font-size: 14px; font-weight: 700; }
.fc-cat { font-size: 11px; background: var(--ink); color: #ffd1c9; border-radius: 8px; padding: 2px 10px; font-family: var(--font-game); }
.fc-head h3 { font-size: 18px; margin: 7px 0 5px; }
.fc-loc { display: inline-block; font-size: 11.5px; }
.fc-body { font-size: 13px; line-height: 1.75; }
.fc-body dt { font-family: var(--font-game); font-size: 11px; color: var(--teal-dark); margin-top: 7px; }
.fc-body dd { margin-left: 0; }
.fc-step { margin-top: 13px; padding-top: 11px; border-top: 2px dashed var(--line); }
.fc-step p { font-size: 13px; margin-bottom: 9px; }
.fc-step p small { color: var(--ink-soft); font-size: 11px; }
.fc-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.fc-btns.col { flex-direction: column; }
.fc-btns.col .btn { width: 100%; }
.fc-ok { color: #3a7d27; font-weight: 700; }
.fc-ng { color: var(--coral); font-weight: 700; }
.fc-fix { display: block; margin-top: 6px; background: #1f2937; color: #a7f3d0; padding: 8px 12px; border-radius: 9px; }
.fc-verdict { margin-top: 13px; font-size: 13.5px; line-height: 1.8; background: var(--paper-2); border-radius: 12px; padding: 11px 13px; }
.fc-lesson { margin-top: 9px; font-size: 12.5px; line-height: 1.7; background: #fff8e0; border: 2px solid #f0d98a; border-radius: 11px; padding: 9px 12px; }
.hidden { display: none !important; }

/* ---------------- クリア / 認定証 ---------------- */
.clear-card { text-align: center; position: relative; padding-top: 26px; }
.clear-stamp {
  position: absolute; top: -14px; right: -8px; transform: rotate(10deg);
  background: var(--coral); color: #fff; border-radius: 50%;
  width: 92px; height: 92px; display: grid; place-items: center;
  font-family: var(--font-game); font-size: 14px; line-height: 1.3;
  border: 3px solid #b23a2a; box-shadow: var(--shadow);
  animation: stamp .5s cubic-bezier(.34,1.8,.64,1);
}
@keyframes stamp { from { transform: rotate(10deg) scale(2.4); opacity: 0; } to { transform: rotate(10deg) scale(1); opacity: 1; } }
.clear-card h2 { font-size: 21px; margin-bottom: 12px; }
.clear-rewards { list-style: none; display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; font-size: 14px; }
.clear-rewards li { background: var(--paper-2); border-radius: 10px; padding: 8px; }

.modal-wrap.cert .modal-card { max-width: 540px; background: #fffdf6; }
.cert-frame {
  border: 4px double #b08d3f; border-radius: 10px; padding: 26px 20px; text-align: center;
  background: linear-gradient(135deg, #fffdf6 0%, #fdf4dd 100%);
  margin-bottom: 16px;
}
.cert-frame small { letter-spacing: 3px; color: #b08d3f; font-size: 10px; }
.cert-frame h2 { font-size: 26px; margin: 6px 0; }
.cert-name { font-family: var(--font-game); font-size: 21px; color: var(--teal-dark); margin: 10px 0; }
.cert-body { font-size: 12.5px; line-height: 2; color: var(--ink-soft); }
.cert-score { font-weight: 700; margin-top: 10px; }
.cert-date { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.cert-card { text-align: center; }

/* ---------------- 図鑑 ---------------- */
.modal-wrap.codex .modal-card { max-width: 600px; }
.codex-card h2 { font-size: 20px; margin-bottom: 12px; }
.codex-card h2 small { font-size: 12px; color: var(--ink-soft); }
.cdx-list { display: flex; flex-direction: column; gap: 14px; max-height: 56vh; overflow-y: auto; padding-right: 6px; margin-bottom: 14px; }
.cdx-section h4 { font-size: 14px; color: var(--teal-dark); margin-bottom: 7px; }
.cdx-item { background: var(--paper-2); border: 2px solid var(--line); border-radius: 12px; padding: 9px 13px; margin-bottom: 6px; }
.cdx-item b { font-size: 13px; }
.cdx-item p { font-size: 12px; color: var(--ink-soft); line-height: 1.7; margin-top: 3px; }
.cdx-item.locked { opacity: .55; }

/* ---------------- デコトレイ ---------------- */
#decor-tray {
  position: fixed; left: 14px; bottom: 14px; z-index: 45;
  background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 9px; max-width: 300px;
}
#decor-tray > b { font-size: 13px; }
.tray-items { display: flex; flex-wrap: wrap; gap: 6px; }
.tray-item { border: 2.5px solid var(--ink); border-radius: 11px; background: var(--paper-2); padding: 6px 10px; font-size: 12px; font-weight: 700; }
.tray-item.on { background: var(--teal); color: #fff; }
.tray-count { font-size: 10px; margin-left: 4px; opacity: .75; }

/* ---------------- トースト ---------------- */
.toast {
  position: fixed; top: 86px; left: 50%; transform: translate(-50%, -16px);
  background: var(--ink); color: var(--paper); border-radius: 999px;
  padding: 9px 20px; font-size: 13px; z-index: 70; opacity: 0;
  display: flex; align-items: center; gap: 8px;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  box-shadow: 0 8px 22px rgba(46,52,64,.3);
  max-width: min(540px, calc(100vw - 30px));
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast span { font-size: 16px; }

/* ---------------- 島ツアー（シネマティック） ---------------- */
#tour-ui { position: fixed; inset: 0; z-index: 78; pointer-events: none; }
.tour-blocker { position: absolute; inset: 0; pointer-events: auto; z-index: 1; }
/* HUD を隠さない小さなタイトルチップ（上中央） */
.tour-chip {
  position: absolute; top: 16px; left: 50%; transform: translate(-50%, -180%);
  background: rgba(30, 38, 48, .92); color: #ffe18a;
  font-family: var(--font-game); font-size: 13px; letter-spacing: 1px;
  border: 2.5px solid rgba(255, 225, 138, .45); border-radius: 999px;
  padding: 8px 20px; pointer-events: none;
  box-shadow: 0 8px 22px rgba(46,52,64,.3);
  transition: transform .45s cubic-bezier(.34,1.2,.64,1);
}
#tour-ui.show .tour-chip { transform: translate(-50%, 0); }
.tour-chip { z-index: 10; }
.tour-bar {
  position: absolute; left: 0; right: 0;
  background: linear-gradient(180deg, rgba(30, 38, 48, .92), rgba(30, 38, 48, .85));
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; pointer-events: auto;
  transition: transform .45s cubic-bezier(.34,1.2,.64,1);
}
.tour-bar.bottom { bottom: 0; height: 112px; transform: translateY(100%); flex-direction: column; justify-content: center; gap: 8px; border-top: 3px solid rgba(255,255,255,.12); z-index: 10; }
#tour-ui.show .tour-bar { transform: translateY(0); }
#tour-skip {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  border: 2.5px solid rgba(255,255,255,.5); border-radius: 999px;
  background: rgba(255,255,255,.1); color: #fff;
  padding: 8px 18px; font-size: 13px; font-weight: 700;
}
#tour-skip:hover { background: rgba(255,255,255,.22); }

/* スポットライト: 対象だけ明るく残し、周囲を巨大シャドウで暗転
   （#tour-ui 内のレイヤー順: blocker(1) < spot(5) < hand/label(6) < chip/bar(10)） */
#tour-spot {
  position: fixed; z-index: 5; pointer-events: none;
  border: 3.5px solid var(--gold, #f7c948);
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(20, 28, 38, .55), 0 0 22px rgba(247, 201, 72, .9);
  animation: spot-ring 1.2s ease-in-out infinite;
}
@keyframes spot-ring {
  0%, 100% { border-color: #f7c948; box-shadow: 0 0 0 9999px rgba(20,28,38,.55), 0 0 14px rgba(247,201,72,.7); }
  50% { border-color: #ffe18a; box-shadow: 0 0 0 9999px rgba(20,28,38,.55), 0 0 30px rgba(247,201,72,1); }
}
#tour-point {
  position: fixed; z-index: 6; pointer-events: none;
  font-size: 38px; transform: translateX(-50%);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.45));
  animation: point-bounce .8s ease-in-out infinite;
}
@keyframes point-bounce {
  0%, 100% { margin-top: 10px; }
  50% { margin-top: 0; }
}
#tour-spotlabel {
  position: fixed; z-index: 6; pointer-events: none;
  background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 14px;
  padding: 10px 16px; font-size: 14.5px; font-weight: 900;
  box-shadow: var(--shadow);
  animation: label-in .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes label-in { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#tour-caption {
  color: #fdf6e9; font-size: 16.5px; font-weight: 700; line-height: 1.7;
  text-align: center; max-width: 860px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .4s, transform .4s;
}
#tour-caption.in { opacity: 1; transform: translateY(0); }
.tour-dots { display: flex; gap: 7px; }
.tour-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.25); transition: background .3s, transform .3s; }
.tour-dots span.done { background: rgba(255,225,138,.55); }
.tour-dots span.on { background: #ffe18a; transform: scale(1.35); }

#tour-cursor {
  position: fixed; z-index: 92; font-size: 34px;
  transform: translate(-30%, -12%);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.4));
  transition: left .85s cubic-bezier(.45,.05,.35,1), top .85s cubic-bezier(.45,.05,.35,1);
  pointer-events: none;
}
#tour-cursor.click { animation: cursor-click .26s; }
@keyframes cursor-click { 50% { transform: translate(-30%, -12%) scale(.72); } }

.tour-demo-tray { z-index: 90 !important; bottom: 132px !important; }
.modal-wrap.tour-card { z-index: 79; pointer-events: none; }
.modal-wrap.tour-card .modal-card { pointer-events: none; }
.tour-demo-card .fc-btns .btn { pointer-events: none; }

.pulse-attn {
  animation: attn 1.1s ease-in-out infinite;
  position: relative; z-index: 91;
  pointer-events: none;   /* ツアー中の誤クリック防止（強調表示のみ） */
}
@keyframes attn {
  0%, 100% { box-shadow: var(--shadow), 0 0 0 0 rgba(247, 201, 72, .85); }
  50% { box-shadow: var(--shadow), 0 0 0 12px rgba(247, 201, 72, 0); transform: translateY(-3px); }
}

/* ---------------- レスポンシブ ---------------- */
@media (max-width: 720px) {
  .hud-left { min-width: 0; }
  .hud-title .ttl { display: none; }
  .req-grid { grid-template-columns: 1fr; }
  .modal-wrap.side { place-items: end center; }
  .modal-wrap.side .modal-card { margin-right: 0; margin-bottom: 4px; }
  #guide-box { width: calc(100vw - 16px); }
  .guide-avatar { width: 56px; height: 56px; font-size: 28px; }
}
