/* 攻略記事・メモ — 調査担当（シオ） */
.guides-theme {
  --gr-blue-50: #eff6ff;
  --gr-blue-100: #dbeafe;
  --gr-blue-200: #bfdbfe;
  --gr-blue-300: #93c5fd;
  --gr-blue-600: #2563eb;
  --gr-blue-700: #1d4ed8;
  --gr-blue-800: #1e40af;
  --gr-amber-500: #f59e0b;
}

.guides-theme .gr-stage {
  position: relative;
  overflow: hidden;
  margin: 0 0 1.1rem;
  padding: 1rem 1.1rem 0.95rem;
  border-radius: 14px;
  border: 2px solid var(--gr-blue-300);
  background: linear-gradient(160deg, var(--gr-blue-50) 0%, #f8fbff 55%, #fff 100%);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.1);
}

.guides-theme .gr-layout {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.guides-theme .gr-actor {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.guides-theme .gr-mascot {
  flex: 0 0 72px;
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  z-index: 1;
}

.guides-theme .gr-mascot-icon {
  width: 72px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--gr-blue-200);
  background: #fff;
}

.guides-theme .gr-face {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.guides-theme .gr-mascot-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.06rem;
  width: 100%;
}

.guides-theme .gr-mascot-role {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--gr-blue-600);
  text-align: center;
}

.guides-theme .gr-mascot-name {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--gr-blue-800);
  text-align: center;
}

.guides-theme .gr-bubble-wrap {
  flex: 1;
  min-width: 0;
  z-index: 1;
}

.guides-theme .gr-bubbles {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.guides-theme .gr-bubble {
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--gr-blue-200);
  background: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.06);
}

.guides-theme .gr-bubble--lead {
  border-color: var(--gr-blue-300);
  background: linear-gradient(180deg, #fff 0%, var(--gr-blue-50) 100%);
}

.guides-theme .gr-line {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #1e293b;
}

.guides-theme .gr-standing {
  display: none;
  flex: 0 0 auto;
  align-self: flex-end;
  margin: -0.5rem -0.25rem -0.75rem 0;
  pointer-events: none;
}

.guides-theme .gr-hero-standing {
  display: block;
  width: min(140px, 28vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(30, 64, 175, 0.15));
}

.guides-theme .gr-cats-wrap {
  border-top: 1px dashed var(--gr-blue-200);
  padding-top: 0.75rem;
}

.guides-theme .gr-cats-label {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gr-blue-700);
}

.guides-theme .gr-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr));
  gap: 0.45rem;
}

.guides-theme .gr-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.45rem 0.25rem 0.4rem;
  border: 1px solid var(--gr-blue-200);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.guides-theme .gr-cat:hover {
  border-color: var(--gr-blue-300);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
}

.guides-theme .gr-cat--active {
  border-color: var(--gr-blue-600);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.guides-theme .gr-cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--gr-cat-color) 18%, white);
  color: var(--gr-cat-color);
  font-size: 0.82rem;
  font-weight: 800;
}

.guides-theme .gr-cat-label {
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: #334155;
}

.guides-theme .gr-cat-badge {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--gr-blue-700);
  background: var(--gr-blue-100);
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
  min-width: 1.1rem;
  text-align: center;
}

.guides-theme .gr-cat-badge--zero {
  color: #94a3b8;
  background: #f1f5f9;
}

.guides-theme .gr-cats-hint {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: #64748b;
}

@media (min-width: 720px) {
  /* 立ち絵はステージ（パネル）内の右下に収め、見出しや吹き出しに重ねない */
  .guides-theme .gr-actor,
  .guides-theme .gr-cats-wrap {
    padding-right: 11rem;
  }

  .guides-theme .gr-standing {
    display: block;
    position: absolute;
    right: 0.75rem;
    bottom: 0;
    max-height: calc(100% - 0.5rem);
  }

  .guides-theme .gr-hero-standing {
    width: min(160px, 18vw);
    max-height: 300px;
  }
}

/* ===== 武将個別ページ — 調査担当シオの評価（.guides-theme 外でも使用） ===== */

.char-researcher-note-slot {
  max-width: 640px;
  margin: 0 auto;
}

.char-researcher-note-slot:empty {
  display: none;
}

/* デスクトップでは武将カード＋使い道(top3)・覚醒比較を広いレイアウトで表示。
   シオの評価があればカードの横に並べ、無くてもカード以外はフル幅の段にして
   狭い1カラムに潰れないようにする（編集モード中は除く）。 */
@media (min-width: 960px) {
  body:not(.is-char-editing) .character-detail-wrap {
    max-width: 960px;
    display: flex;
    /* A1で挿入される使い道(top3)・覚醒比較をフル幅の段として下に回す */
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 1.25rem;
  }

  body:not(.is-char-editing) .character-detail-wrap #character-detail-view {
    flex: 0 0 420px;
    max-width: 420px;
  }

  body:not(.is-char-editing) .character-detail-wrap:has(.grn-note) .char-researcher-note-slot {
    /* flex-wrap併用時もカードの隣（1段目）に収まるようbasisを抑える */
    flex: 1 1 320px;
    max-width: 480px;
    margin: 0;
  }

  /* カード・評価スロット以外の直下要素（A1の使い道セクション・覚醒比較など）は
     2カラムの脇に細く差し込まず、フル幅の段として並べる */
  body:not(.is-char-editing)
    .character-detail-wrap
    > *:not(#character-detail-view):not(.char-researcher-note-slot) {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }
}

.grn-note {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem 0.9rem;
  border-radius: 14px;
  border: 2px solid #93c5fd;
  background: linear-gradient(160deg, #eff6ff 0%, #f8fbff 55%, #fff 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

.grn-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.grn-face {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #fff;
}

.grn-head-text {
  min-width: 0;
}

.grn-role {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: #1e40af;
  line-height: 1.3;
}

.grn-updated {
  margin: 0.1rem 0 0;
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.3;
}

.grn-body .grn-line {
  margin: 0 0 0.45rem;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #fff;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #1e293b;
}

.grn-body .grn-line:last-of-type {
  margin-bottom: 0;
}

.grn-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.grn-links-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 0.3rem;
  padding: 0.1rem 0.4rem;
}

.grn-link {
  font-size: 0.76rem;
  font-weight: 600;
  color: #1d4ed8;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  text-decoration: none;
}

.grn-link:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

/* 編集モード中はシオの評価を隠してフォームに集中させる */
body.is-char-editing .char-researcher-note-slot {
  display: none;
}
