/* ==========================================================================
   探索者シート作成ツール(2026-07-30、ユーザー指示によるキャラクターシート
   作成・保存機能の第一段階)。アカウント不要、ブラウザのlocalStorageのみで
   保存する設計。サイトの他ページと共通のダークトーンに合わせる。
   ========================================================================== */
.shn-cs {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 5vw 80px;
  color: var(--shn-text, #d8cfc0);
  font-size: 14px;
  line-height: 1.8;
}
.shn-cs h1 {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(22px, 3vw, 30px);
  color: var(--shn-paper, #d9d0b8);
  margin: 0 0 8px;
}
.shn-cs-construction {
  font-size: 12.5px;
  line-height: 1.7;
  color: #d6b880;
  background: rgba(201,164,92,.1);
  border: 1px solid rgba(201,164,92,.35);
  padding: 10px 14px;
  margin: 0 0 16px;
  max-width: 640px;
}
.shn-cs-lead a { color: #c9a45c; }
.shn-cs-lead {
  color: var(--shn-text-dim, #9aa79e);
  font-size: 13px;
  max-width: 640px;
  margin: 0 0 28px;
}
.shn-cs-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid rgba(201,164,92,.25);
  background: rgba(201,164,92,.04);
}
.shn-cs-toolbar select {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 10px;
  background: #f2ead8;
  color: #262019;
  border: 1px solid rgba(201,164,92,.4);
  min-width: 180px;
}
.shn-cs-btn {
  font-family: inherit;
  font-size: 12.5px;
  padding: 7px 14px;
  border: 1px solid rgba(201,164,92,.5);
  background: transparent;
  color: #c9a45c;
  cursor: pointer;
  border-radius: 3px;
  transition: background .2s, color .2s;
}
.shn-cs-btn:hover { background: rgba(201,164,92,.15); }
.shn-cs-btn.is-primary { background: #c9a45c; color: #0b0d12; font-weight: 600; }
.shn-cs-btn.is-primary:hover { background: #e0bb70; }
.shn-cs-btn.is-danger { border-color: rgba(180,70,70,.5); color: #d68080; }
.shn-cs-btn.is-danger:hover { background: rgba(180,70,70,.15); }
.shn-cs-status {
  font-size: 11.5px;
  color: #8e9b93;
  margin-left: auto;
}

.shn-cs-section {
  margin: 0 0 28px;
  padding: 18px 20px;
  border: 1px solid rgba(201,164,92,.2);
  background: rgba(255,255,255,.015);
}
.shn-cs-section h2 {
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  letter-spacing: .06em;
  color: #c9a45c;
  margin: 0 0 16px;
  border-bottom: 1px solid rgba(201,164,92,.25);
  padding-bottom: 8px;
}
.shn-cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.shn-cs-field label {
  display: block;
  font-size: 11.5px;
  color: #8e9b93;
  margin-bottom: 4px;
}
.shn-cs-field input, .shn-cs-field select {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  padding: 7px 9px;
  background: #f2ead8;
  color: #262019;
  border: 1px solid rgba(201,164,92,.4);
  box-sizing: border-box;
}
.shn-cs-stat {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.shn-cs-stat input { width: 100%; text-align: center; font-size: 16px; font-weight: 600; }
.shn-cs-stat .shn-cs-roll {
  flex: none;
  font-size: 11px;
  padding: 7px 8px;
}
.shn-cs-stat-desc {
  font-size: 10.5px;
  line-height: 1.5;
  color: #8e9b93;
  margin-top: 5px;
}
.shn-cs-derived {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}
.shn-cs-derived .shn-cs-dcard {
  text-align: center;
  padding: 10px 6px;
  border: 1px solid rgba(201,164,92,.2);
  background: rgba(201,164,92,.03);
}
.shn-cs-dcard .num { font-size: 20px; font-weight: 700; color: #c9a45c; }
.shn-cs-dcard .lbl { font-size: 10.5px; color: #8e9b93; margin-top: 2px; }
.shn-cs-diagnosis { margin-top: 14px; }
.shn-cs-diagnosis .shn-cs-tour-avatar-badge { width: 48px; height: 48px; }
.shn-cs-diagnosis .shn-cs-tour-avatar { width: 38px; height: 38px; }

.shn-cs-skills-toolbar {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.shn-cs-skills-toolbar input[type="text"] {
  flex: 1; min-width: 160px;
  font-family: inherit; font-size: 13px; padding: 7px 9px;
  background: #f2ead8; color: #262019; border: 1px solid rgba(201,164,92,.4);
}
.shn-cs-skill-list { display: flex; flex-direction: column; gap: 6px; }
.shn-cs-skill-row {
  display: grid;
  grid-template-columns: 1fr 70px 32px;
  gap: 8px;
  align-items: center;
}
.shn-cs-skill-row input[type="text"] {
  font-family: inherit; font-size: 13px; padding: 6px 8px;
  background: #f2ead8; color: #262019; border: 1px solid rgba(201,164,92,.35);
}
.shn-cs-skill-row input[type="number"] {
  font-family: inherit; font-size: 13px; padding: 6px 8px; text-align: center;
  background: #f2ead8; color: #262019; border: 1px solid rgba(201,164,92,.35);
}
.shn-cs-skill-remove {
  background: none; border: none; color: #8e9b93; cursor: pointer; font-size: 16px; line-height: 1;
}
.shn-cs-skill-remove:hover { color: #d68080; }

.shn-cs-note {
  font-size: 11.5px;
  color: #8e9b93;
  margin-top: 8px;
}
.shn-cs-note a { color: #c9a45c; }

:root[data-theme="light"] .shn-cs-toolbar,
:root[data-theme="light"] .shn-cs-section { background: rgba(156,113,48,.05); border-color: rgba(156,113,48,.3); }
:root[data-theme="light"] .shn-cs-btn { color: #8a6a2f; border-color: rgba(156,113,48,.4); }
:root[data-theme="light"] .shn-cs-btn.is-primary { background: #8a6a2f; color: #fff; }
/* 継承色(#8e9b93)はライトテーマの薄いクリーム背景に対してコントラスト不足のため明示上書き
   (2026-07-30、能力値の説明文追加を機に、同種の既存要素もあわせて是正。全体レビューで
   .shn-cs-dcard .lbl・.shn-cs-section h2 にも同じ問題が残っていたため追加是正)。 */
:root[data-theme="light"] .shn-cs-note,
:root[data-theme="light"] .shn-cs-field label,
:root[data-theme="light"] .shn-cs-stat-desc,
:root[data-theme="light"] .shn-cs-dcard .lbl,
:root[data-theme="light"] .shn-cs-status,
:root[data-theme="light"] .shn-cs-skill-remove,
:root[data-theme="light"] .shn-cs-modal-close,
:root[data-theme="light"] .shn-cs-tour-count,
:root[data-theme="light"] .shn-cs-dcard .num.is-rolling { color: #5f6f63; }
:root[data-theme="light"] .shn-cs-dcard .num { color: #8a6a2f; }
:root[data-theme="light"] .shn-cs-section h2,
:root[data-theme="light"] .shn-cs-modal h3 { color: #8a6a2f; }
:root[data-theme="light"] .shn-cs-construction { background: rgba(156,113,48,.08); border-color: rgba(156,113,48,.35); color: #7a5a1f; }

@media (max-width: 640px) {
  .shn-cs-skill-row { grid-template-columns: 1fr 60px 28px; }
}

/* ==========================================================================
   演出の強化(2026-07-30、ユーザー指摘「やっつけ感がある、もう少し演出を」)。
   ダイスロールの着地演出とボタンのホバー質感を整える。
   ========================================================================== */
.shn-cs-stat input.is-rolling {
  animation: shn-cs-shake .11s linear infinite;
  border-color: rgba(201,164,92,.5);
}
.shn-cs-stat input.is-landed,
.shn-cs-dcard .num.is-landed {
  animation: shn-cs-pop .32s cubic-bezier(.34,1.56,.64,1);
}
@keyframes shn-cs-shake {
  0% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
  100% { transform: rotate(-2deg); }
}
@keyframes shn-cs-pop {
  0% { transform: scale(1.25); }
  55% { transform: scale(.95); }
  100% { transform: scale(1); }
}
.shn-cs-dcard .num.is-rolling { color: #8e9b93; }
.shn-cs-btn {
  transition: background .18s ease, transform .12s ease, box-shadow .18s ease, border-color .18s ease;
}
.shn-cs-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.shn-cs-btn:active:not(:disabled) { transform: translateY(0); }
.shn-cs-btn.is-primary:hover:not(:disabled) { box-shadow: 0 4px 14px rgba(201,164,92,.3); }
.shn-cs h1 {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(201,164,92,.25);
}
.shn-cs-section { transition: border-color .2s ease; }
.shn-cs-dcard { transition: transform .15s ease; }

/* ==========================================================================
   モーダル(レイヤー表示)。「探索者の作り方」等をページ遷移せず表示する。
   ========================================================================== */
.shn-cs-modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(5,8,7,.75);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.shn-cs-modal-backdrop.is-open { display: flex; }
.shn-cs-modal {
  position: relative;
  max-width: 560px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  background: #14181a;
  border: 1px solid rgba(201,164,92,.4);
  padding: 28px 26px 22px;
  color: var(--shn-text, #d8cfc0);
  font-size: 13.5px;
  line-height: 1.85;
}
.shn-cs-modal h3 {
  font-family: 'Unbounded', sans-serif;
  font-size: 15px;
  color: #c9a45c;
  margin: 0 0 14px;
}
.shn-cs-modal-close {
  position: absolute;
  top: 10px; right: 14px;
  background: none; border: none;
  font-size: 22px; line-height: 1;
  color: #8e9b93; cursor: pointer;
}
.shn-cs-modal-close:hover { color: #d8cfc0; }
:root[data-theme="light"] .shn-cs-modal { background: #fbf7ec; color: #2a2620; border-color: rgba(156,113,48,.4); }

/* ==========================================================================
   使い方ガイド(初回自動表示のオンボーディングツアー)。box-shadowで対象要素の
   周囲だけ暗転させずに残す手法(要素自体に巨大なbox-shadowを与える)。
   ========================================================================== */
.shn-cs-tour-highlight {
  position: relative;
  z-index: 1500;
  box-shadow: 0 0 0 9999px rgba(4,6,5,.8);
  outline: 2px solid #c9a45c;
  outline-offset: 4px;
  border-radius: 3px;
}
.shn-cs-tour-tip {
  display: none;
  position: fixed;
  z-index: 1600;
  width: min(340px, calc(100vw - 24px));
  background: #1c2118;
  border: 1px solid #c9a45c;
  padding: 14px 16px 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.shn-cs-tour-tip.is-open { display: block; }
.shn-cs-tour-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.shn-cs-tour-avatar-badge {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  /* 単なる背景抜き画像がそのまま浮いて見える「不格好」対策(2026-07-30)。
     淡すぎる旧値(.28→.08)だと台座がほぼ見えず効果が無かったため濃くした。 */
  background: radial-gradient(circle at 50% 42%, rgba(201,164,92,.55), rgba(201,164,92,.22) 62%, rgba(201,164,92,.05) 100%);
  border: 1.5px solid rgba(201,164,92,.55);
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.shn-cs-tour-avatar {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.45));
  animation: shn-cs-bob 2.4s ease-in-out infinite;
}
@keyframes shn-cs-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.shn-cs-tour-bubble {
  position: relative;
  flex: 1;
  background: rgba(201,164,92,.08);
  border: 1px solid rgba(201,164,92,.3);
  border-radius: 10px;
  padding: 10px 12px;
}
.shn-cs-tour-bubble::before {
  content: '';
  position: absolute;
  left: -7px; top: 14px;
  width: 12px; height: 12px;
  background: rgba(201,164,92,.08);
  border-left: 1px solid rgba(201,164,92,.3);
  border-bottom: 1px solid rgba(201,164,92,.3);
  transform: rotate(45deg);
}
.shn-cs-tour-text {
  font-size: 13px;
  line-height: 1.75;
  color: #e8e2d0;
}
.shn-cs-tour-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.shn-cs-tour-count {
  font-size: 11px;
  color: #8e9b93;
  margin-right: auto;
}
:root[data-theme="light"] .shn-cs-tour-tip { background: #fbf7ec; border-color: #8a6a2f; }
:root[data-theme="light"] .shn-cs-tour-text { color: #2a2620; }
:root[data-theme="light"] .shn-cs-tour-bubble { background: rgba(156,113,48,.07); border-color: rgba(156,113,48,.35); }
:root[data-theme="light"] .shn-cs-tour-bubble::before { background: rgba(156,113,48,.07); border-color: rgba(156,113,48,.35); }
:root[data-theme="light"] .shn-cs-tour-avatar-badge {
  background: radial-gradient(circle at 50% 42%, rgba(156,113,48,.35), rgba(156,113,48,.15) 62%, rgba(156,113,48,.04) 100%);
  border-color: rgba(156,113,48,.5);
}
