/* ============================================================
 * 追加ミッションまわりのスタイル
 * 密書と文字のかけら・文字の並べ替え・日誌・冒険者カード・かめりあーの反応・特別メッセージ
 * ============================================================ */

.nb { display: inline-block; }

/* ---------- 印（あつめ中・記録のみ） ---------- */
.chip--collect { background: var(--info-pale); color: var(--blue-deep); outline: 2px solid var(--blue); outline-offset: -2px; --icon-accent: var(--gold); }
.chip--rec { background: var(--surface-off); color: var(--ink-soft); }
.win--mystery .chip--rec { background: rgba(255, 255, 255, .16); color: var(--white); }
.mark--collect { background: var(--info-pale); color: var(--blue-deep); outline: 2px solid var(--blue); outline-offset: -2px; --icon-accent: var(--gold); }

/* ---------- 「冒険」の切り替え（スポット / スタンプ帳 / 日誌） ---------- */
.seg--3 .seg__btn { padding-left: 4px; padding-right: 4px; font-size: 15px; gap: 5px; }

/* ---------- ひみつ: 分類 ---------- */
.mgroup { margin-top: 24px; }
.mgroup__lead { margin-top: 2px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.mgroup .missions { margin-top: 10px; }

/* ---------- かけら（密書・文字） ---------- */
.pieces { display: grid; gap: 8px; padding: 10px; background: var(--purple-pale); }
.mission--done .pieces { background: var(--surface-quiet); }
.pieces__count { font-family: var(--font-dot); font-size: 14px; line-height: 1.3; color: var(--purple-deep); }
.pieces__count b { margin-left: 4px; font-weight: 400; font-size: 24px; line-height: 1; }
.pieces__count span { margin-left: 8px; font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.letters { display: grid; gap: 6px; }
.letter { display: grid; gap: 6px; padding: 8px; background: var(--white); box-shadow: inset 0 0 0 2px var(--line); }
.letter.is-have { box-shadow: inset 0 0 0 2px var(--purple); }
.letter__label { display: flex; align-items: center; gap: 6px; font-family: var(--font-dot); font-size: 13px; line-height: 1.3; color: var(--purple-deep); }
.letter:not(.is-have) .letter__label { color: var(--ink-soft); }
.letter__text { display: flex; gap: 4px; }
.cell {
  flex: 0 0 auto; width: 36px; height: 40px; display: grid; place-items: center;
  font-style: normal; font-family: var(--font-dot); font-size: 24px; line-height: 1; color: var(--ink);
  background: var(--gold-pale); box-shadow: inset 0 0 0 2px var(--gold);
}
.cell--blank { background: repeating-linear-gradient(45deg, var(--surface-off) 0 4px, var(--white) 4px 8px); box-shadow: inset 0 0 0 2px var(--line); }
.letter__none { font-size: 13px; line-height: 1.5; color: var(--ink-soft); }

.tiles { display: flex; flex-wrap: wrap; gap: 6px; }
.tile {
  appearance: none; border: 0; margin: 0; padding: 0; flex: none;
  width: 52px; height: 56px; display: grid; place-items: center;
  font-family: var(--font-dot); font-size: 30px; line-height: 1; color: var(--ink);
  background: var(--gold-pale); box-shadow: inset 0 0 0 2px var(--gold-deep), inset 0 -5px 0 0 rgba(117, 89, 15, .22);
}
button.tile { cursor: pointer; }
.tile--none { background: var(--white); color: var(--mist); box-shadow: none; outline: 2px dashed var(--line); outline-offset: -2px; }
.tile--slot { background: var(--white); color: var(--slot-ink); font-size: 18px; box-shadow: none; outline: 2px dashed var(--purple); outline-offset: -2px; }
.tile--placed { background: var(--purple); color: var(--white); box-shadow: inset 0 0 0 2px var(--purple-deep), inset 0 -5px 0 0 rgba(0, 0, 0, .22); }
button.tile:active { transform: translateY(2px); }

/* 文字の並べ替え（タップで左から順に置く） */
.arrange { display: grid; gap: 8px; }
.arrange__label { font-family: var(--font-dot); font-size: 14px; line-height: 1.4; color: var(--purple-deep); }
.arrange__label span { margin-left: 6px; font-family: var(--font-body); font-size: 12px; color: var(--ink-soft); }
.arrange__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 56px; }
.arrange__row--slots { padding: 8px; background: var(--purple-pale); }

.mission__locked {
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; font-size: 14px; line-height: 1.6;
  background: var(--surface-quiet); color: var(--ink-soft); box-shadow: inset 0 0 0 2px var(--line);
}
.mission__locked .px-icon { margin-top: 4px; }
.mission:not(.win--mystery) .hint { background: var(--purple-pale); --icon-accent: var(--gold-deep); }
.mission:not(.win--mystery) .hint__no { color: var(--purple-deep); }

/* ---------- かめりあーの反応 ---------- */
.reacts { display: grid; gap: 6px; }
.react {
  appearance: none; border: 0; margin: 0; width: 100%; text-align: left; font: inherit; color: var(--ink);
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px;
  background: var(--white); box-shadow: inset 0 0 0 2px var(--line);
}
button.react { cursor: pointer; box-shadow: inset 0 0 0 2px var(--purple); }
.react__q { flex: none; width: 40px; height: 40px; display: grid; place-items: center; font-family: var(--font-dot); font-size: 22px; color: var(--mist); background: var(--surface-off); }
.react__pix { flex: none; width: 40px; height: 40px; }
.react__text { flex: 1 1 auto; min-width: 0; display: grid; }
.react__text b { font-family: var(--font-dot); font-weight: 400; font-size: 15px; line-height: 1.35; }
.react__text small { font-size: 12px; line-height: 1.4; color: var(--ink-soft); }
.react:not(.is-found) .react__text b { font-size: 13px; color: var(--stop-ink); }   /* 小さい字なので、うすい灰色ではなく読める濃さにする */
.react-view { display: grid; gap: 10px; justify-items: center; text-align: center; }
.react-view__stage { display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.react-view__sd { width: 150px; height: 150px; object-fit: contain; }
.react-view__pix { width: 96px; height: 96px; }
.react-view__line { font-family: var(--font-dot); font-size: 20px; line-height: 1.5; }
.react-view .facts { width: 100%; text-align: left; }
.react-view .facts > div { grid-template-columns: 5.5em minmax(0, 1fr); }

/* ---------- 扉のむこうの特別メッセージ ---------- */
.letter-view { display: grid; gap: 12px; }
.letter-view__art { display: block; width: auto; max-width: 100%; max-height: 280px; margin: 0 auto; object-fit: contain; }
.letter-view__paper {
  display: grid; gap: 10px; padding: 16px 14px; font-size: 16px; line-height: 1.9;
  background: var(--paper); box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--gold-pale);
}
.letter-view__prov {
  display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px;
  font-family: var(--font-dot); font-size: 13px; line-height: 1.5; background: var(--note-bg); color: var(--note-ink); box-shadow: inset 0 0 0 2px var(--gold);
}
.letter-view__prov .px-icon { margin-top: 3px; }
.letter-view__heading { font-family: var(--font-dot); font-weight: 400; font-size: 20px; line-height: 1.4; color: var(--blue-deep); }
.letter-view__from { text-align: right; font-family: var(--font-dot); font-size: 16px; }
.letter-view__audio { width: 100%; }

/* ---------- 冒険日誌 ---------- */
.diary-head > * + * { margin-top: 8px; }
.diary-head__lead { font-size: 14px; line-height: 1.65; }
.diary-head__now { font-family: var(--font-dot); font-size: 15px; line-height: 1.5; color: var(--blue-deep); }
.diary-head__private { display: flex; align-items: flex-start; gap: 6px; }
.diary-head__private .px-icon { margin-top: 4px; }
.book__count small { margin-left: 2px; font-size: 13px; }
.demo-box {
  display: grid; gap: 8px; margin-top: 12px; padding: 12px; font-size: 13px; line-height: 1.6; color: var(--note-ink);
  background-color: var(--note-bg); background-image: repeating-linear-gradient(135deg, rgba(201, 169, 97, .16) 0 8px, transparent 8px 16px);
  box-shadow: inset 0 0 0 2px var(--gold);
}
.demo-box__title { display: flex; align-items: center; gap: 6px; font-family: var(--font-dot); font-weight: 400; font-size: 15px; line-height: 1.4; }
.demo-dates { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.demo-date {
  appearance: none; border: 0; cursor: pointer; min-width: 0; min-height: 52px; padding: 4px 1px;
  display: grid; place-content: center; gap: 3px; text-align: center; line-height: 1.1;
  font-family: var(--font-dot); background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 2px var(--gold-deep);
}
.demo-date span { font-size: 11px; color: var(--ink-soft); }
.demo-date b { font-weight: 400; font-size: 14px; }
.demo-date[aria-pressed="true"] { background: var(--gold-deep); color: var(--white); }
.demo-date[aria-pressed="true"] span { color: var(--on-dark-gold); }
.demo-box__now b { font-family: var(--font-dot); font-weight: 400; font-size: 15px; }
.demo-box .btn { justify-self: start; }
.days { display: grid; gap: 12px; margin-top: 12px; }
.day > * + * { margin-top: 10px; }
.day__head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.day__no { padding: 2px 6px; font-family: var(--font-dot); font-size: 12px; line-height: 1.3; background: var(--ink); color: var(--white); }
.day__date { margin-right: auto; font-family: var(--font-dot); font-weight: 400; font-size: 22px; line-height: 1.2; }
.day__text { margin: 0; padding: 10px 12px; font-size: 16px; line-height: 1.8; background: var(--gold-pale); box-shadow: inset 4px 0 0 0 var(--gold); }
.day__meta { font-size: 12px; line-height: 1.6; color: var(--ink-soft); }
.day__locked { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.day__locked .px-icon { margin-top: 4px; }
.day[data-state="future"], .day[data-state="missed"] { background: var(--surface-quiet); }
.day[data-state="today"], .day[data-state="open"] { --bd: var(--blue); }
.day__count { text-align: right; font-family: var(--font-dot); font-size: 13px; line-height: 1.2; color: var(--ink-soft); }
.day__count.is-over { color: var(--camellia-deep); }
.input--area { display: block; min-height: 96px; padding-top: 10px; padding-bottom: 10px; line-height: 1.7; resize: vertical; }

/* ---------- きみだけの冒険者カード ---------- */
.mycard > * + * { margin-top: 12px; }
.mycard__head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.mycard__view { display: grid; place-items: center; }
.mycard__canvas { display: block; width: 100%; max-width: 360px; height: auto; aspect-ratio: 4 / 5; background: var(--ice); box-shadow: 0 4px 0 0 rgba(14, 26, 94, .18); }
.mycard__lead { font-size: 14px; line-height: 1.65; text-align: center; }
.mycard__lead b { font-family: var(--font-dot); font-weight: 400; font-size: 17px; }
.mycard__actions { display: grid; gap: 8px; }
.card-image { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; box-shadow: 0 4px 0 0 rgba(14, 26, 94, .18); }
.license__title { font-family: var(--font-dot); font-size: 22px; line-height: 1.35; color: var(--blue-deep); }

.card-edit { display: grid; gap: 14px; }
.card-edit__preview { position: sticky; top: -1px; z-index: 2; display: grid; place-items: center; padding: 4px 0 8px; background: var(--white); box-shadow: 0 2px 0 0 var(--ice); }
.card-edit__preview .mycard__canvas { max-width: 132px; box-shadow: 0 3px 0 0 rgba(14, 26, 94, .18); }
.card-edit__form { display: grid; gap: 16px; }
/* 横向きのスマホなど高さの低い画面では、見本を上に固定しない（入力欄が見本とキーボードにはさまれて隠れるため） */
@media (max-height: 560px) { .card-edit__preview { position: static; } }
.field__hint { display: block; margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.field__hint.is-over { color: var(--camellia-deep); }
.pick { min-width: 0; margin: 0; padding: 0; border: 0; }
.pick > * + * { margin-top: 8px; }
.pick legend { padding: 0; margin-bottom: 6px; font-family: var(--font-dot); font-size: 15px; line-height: 1.4; }
.pick__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pick__item { position: relative; display: block; cursor: pointer; }
.pick__item input { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pick__face {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; height: 100%; min-height: 92px; padding: 8px 4px 6px;
  text-align: center; background: var(--white); box-shadow: inset 0 0 0 2px var(--line);
}
.pick__face b { font-family: var(--font-dot); font-weight: 400; font-size: 12px; line-height: 1.3; }
.pick__item input:checked + .pick__face { background: var(--gold-pale); box-shadow: inset 0 0 0 3px var(--blue); }
.pick__item input:checked + .pick__face::after {
  content: '✓'; position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; display: grid; place-items: center;
  font-family: var(--font-dot); font-size: 13px; line-height: 1; background: var(--blue); color: var(--white);
}
.pick__item input:focus-visible + .pick__face { outline: 3px solid var(--gold); outline-offset: 2px; }
.pick__icon { width: 46px; height: 46px; display: grid; place-items: center; color: var(--white); --icon-accent: var(--on-dark-gold); }
.pick__art { width: 56px; height: 56px; object-fit: contain; }
.pick__none { width: 56px; height: 56px; background: repeating-linear-gradient(45deg, var(--surface-off) 0 4px, var(--white) 4px 8px); }
.pick__intro { padding: 6px 10px; font-size: 14px; line-height: 1.6; background: var(--ice); }
.pick__intro:empty { display: none; }

/* ---------- スタンプといっしょに手に入れたもの ---------- */
.gifts { display: grid; gap: 6px; margin-top: 10px; padding: 10px; text-align: left; background: var(--purple-pale); }
.gifts__title { font-family: var(--font-dot); font-size: 13px; line-height: 1.3; color: var(--purple-deep); }
.gifts ul { display: grid; gap: 4px; }
.gift { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 8px; background: var(--white); font-family: var(--font-dot); font-size: 15px; line-height: 1.3; --icon-accent: var(--gold); }
.gift > span { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.gift small { flex: none; font-size: 12px; color: var(--ink-soft); }
.gift__tile { display: inline-grid; place-items: center; width: 30px; height: 32px; font-weight: 400; font-size: 20px; background: var(--gold-pale); box-shadow: inset 0 0 0 2px var(--gold-deep); }
.slot__gifts { display: grid; gap: 2px; justify-items: center; font-family: var(--font-dot); font-size: 11px; line-height: 1.4; color: var(--purple-deep); --icon-accent: var(--gold); }
.slot__gifts li { display: inline-flex; align-items: center; gap: 4px; }

@media (min-width: 920px) {
  .days { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .card-edit { grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
  .card-edit__preview { top: 0; box-shadow: none; }
  .card-edit__preview .mycard__canvas { max-width: 240px; }
  .pick__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mycard { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 8px 24px; align-items: start; }
  .mycard > * { margin-top: 0; }
  .mycard__head { grid-column: 1 / -1; }
  .mycard__view { grid-row: span 4; }
  .mycard__lead { text-align: left; }
}
@media (max-width: 359px) {
  .seg--3 .seg__btn { font-size: 13px; gap: 3px; }
  .cell { width: 32px; height: 36px; font-size: 21px; }
  .tile { width: 48px; height: 52px; font-size: 27px; }
  .demo-date b { font-size: 13px; }
}

/* ---------- ギルド検定（答えを入力するクイズ） ---------- */
.exam__body { display: grid; gap: 16px; }
.exam__meta { gap: 8px; align-items: center; }
.exam__level { display: grid; gap: 8px; }
.exam__rank { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; font-family: var(--font-dot); font-weight: 400; font-size: 15px; line-height: 1.4; }
.exam__badge { padding: 2px 8px; background: var(--purple); color: var(--white); }
.exam__note { font-size: 13px; color: var(--ink-soft); }
.exam__count { margin-left: auto; font-size: 14px; color: var(--ink-soft); }
.exam__list { display: grid; gap: 8px; }
.exam__q { display: grid; gap: 6px; padding: 10px 12px; background: var(--surface-quiet); box-shadow: inset 0 0 0 1px var(--line); }
.exam__q.is-done { background: var(--done-surface); box-shadow: inset 0 0 0 2px var(--purple-pale); }
.exam__q.is-locked { color: var(--stop-ink); }
.exam__text { font-family: var(--font-body); font-size: 15px; line-height: 1.6; color: var(--ink); }
.exam__q.is-locked .exam__text { display: flex; align-items: center; gap: 6px; color: var(--stop-ink); }
.exam__answer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--purple-deep); }
.exam__answer b { font-family: var(--font-dot); font-weight: 400; font-size: 17px; }
.exam__pt { margin-left: auto; font-family: var(--font-dot); font-size: 14px; color: var(--gold-deep); }
.exam__btn-pt { margin-left: 6px; font-size: 13px; opacity: .92; }
.exam__done { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--gold-pale); color: var(--gold-ink); font-family: var(--font-dot); font-size: 15px; }
