@charset "utf-8";
/* ==========================================================
   ノエスタ怪奇調査 / 調査記録アプリ
   LPのトンマナ（暗い赤・ホラー調）に合わせる。
   片手・数タップで完了することを最優先にした寸法にしている。
   ========================================================== */

:root {
  --bg: #0d0708;
  --bg2: #160d0f;
  --panel: #1c1113;
  --line: #3a2226;
  --red: #c8102e;
  --red-dim: #8a1020;
  --text: #ece6e6;
  --muted: #9a8a8c;
  --ok: #2f7d4f;
  --tap: 52px; /* 指で確実に押せる最小サイズ */
  --pad: 16px;
}

* { box-sizing: border-box; }

/* display を指定した要素は hidden 属性が効かなくなる（作成者スタイルが優先されるため）。
   画面切替・写真プレビューの出し分けを hidden で行っているので、ここで一括して打ち消す。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background-image:
    radial-gradient(120% 60% at 50% 0%, rgba(200, 16, 46, .18) 0%, transparent 60%),
    radial-gradient(100% 50% at 50% 100%, rgba(200, 16, 46, .10) 0%, transparent 60%);
  background-attachment: fixed;
}

button, input, textarea { font: inherit; color: inherit; }

.screen { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- 入場 ---------- */
.entry {
  flex: 1;
  padding: calc(var(--pad) + env(safe-area-inset-top)) var(--pad) var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}
.entry_label, .head_label {
  color: var(--red);
  font-size: 11px;
  letter-spacing: .18em;
  margin: 0 0 4px;
  font-weight: 700;
}
.entry_title { font-size: 30px; margin: 0; letter-spacing: .1em; }
.entry_slot {
  margin: 10px 0 24px;
  color: var(--muted);
  font-size: 14px;
  border-left: 3px solid var(--red);
  padding-left: 10px;
}
.entry_lead { margin: 0 0 20px; font-size: 15px; line-height: 1.8; }
.entry_note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.notice {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin: 18px 0;
}
.notice_title { margin: 0 0 8px; font-size: 13px; color: var(--red); font-weight: 700; }
.notice ul { margin: 0; padding-left: 1.1em; }
.notice li { font-size: 13px; line-height: 1.9; color: var(--muted); }

/* ---------- ヘッダー ---------- */
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) var(--pad) 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 7, 8, .92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.head_title { font-size: 18px; margin: 0; letter-spacing: .06em; }
.head_meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.head_slot { font-size: 11px; color: var(--muted); }
.head_sub { justify-content: flex-start; }
.head_sub .head_title { flex: 1; text-align: center; }

.badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge[data-state="synced"] { color: #7fd3a3; border-color: var(--ok); }
.badge[data-state="pending"] { color: #e8b04b; border-color: #6b4d17; }

/* ---------- ホーム ---------- */
.home { flex: 1; padding: var(--pad); padding-bottom: 96px; max-width: 560px; margin: 0 auto; width: 100%; }

/* 表示するのは「自分が記録した件数」だけ。総数・残数は出さない（ネタバレ防止） */
.count { text-align: center; margin: 18px 0 26px; }
.count_num {
  font-size: 52px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.count_unit { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }

.loclist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.loc { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.loc_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
}
.loc_name { font-size: 14px; font-weight: 700; }
.loc_count {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--red-dim);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.notes { list-style: none; margin: 0; padding: 0; }
.note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(58, 34, 38, .5);
  font-size: 14px;
  line-height: 1.6;
  cursor: pointer;
}
.note:first-child { border-top: 0; }
.note:active { background: rgba(200, 16, 46, .12); }
.note_body { flex: 1; }
.note_photo { opacity: .7; font-size: 12px; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.empty p { margin: 0 0 8px; font-size: 14px; }
.empty_sub { font-size: 12px; }

/* ---------- 記録 ---------- */
.record { flex: 1; padding: var(--pad); padding-bottom: 96px; max-width: 560px; margin: 0 auto; width: 100%; }

.field { display: block; margin-bottom: 22px; position: relative; }
.field_label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.field_help { margin: 6px 0 0; font-size: 11px; color: var(--muted); }
.field_count { position: absolute; right: 2px; bottom: -18px; font-size: 11px; color: var(--muted); }

input[type="text"], textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 12px;
  font-size: 16px; /* iOSで自動ズームさせないため16px以上 */
  line-height: 1.6;
  resize: none;
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, .15);
}
::placeholder { color: #6b585a; }

/* 場所選択：一覧から1タップで選べるようにする */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.chip.is_on {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 700;
}

.warn {
  margin: -12px 0 22px;
  padding: 10px 12px;
  background: rgba(232, 176, 75, .1);
  border: 1px solid #6b4d17;
  border-radius: 8px;
  font-size: 12px;
  color: #e8b04b;
}

/* ---------- 写真 ---------- */
.photo_add {
  width: 100%;
  min-height: 96px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
}
.photo_add_icon { font-size: 22px; color: var(--red); }
.photo_preview { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo_preview img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.photo_remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, .7);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* ---------- ボタン ---------- */
.btn {
  width: 100%;
  min-height: var(--tap);
  border: 0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .04em;
}
.btn_primary { background: var(--red); color: #fff; }
.btn_primary:active { background: var(--red-dim); }

.btn_icon {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 0;
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
}
.btn_icon_danger { color: var(--red); font-size: 13px; }

/* 記録ボタンは常に親指の届く位置に固定する */
.fabwrap {
  position: sticky;
  bottom: 0;
  padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

/* ---------- トースト ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translate(-50%, 8px);
  background: #2a1a1d;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 99px;
  font-size: 13px;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 20;
  pointer-events: none;
  white-space: nowrap;
}
.toast.is_show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================
   システムA（リスト採点）用の追加スタイル
   ========================================================== */

.head_spacer { min-width: 44px; }        /* 戻るボタンとの左右バランス取り */

/* ---------- 異変リスト ---------- */
.list_lead { margin: 16px 0 14px; font-size: 13px; line-height: 1.7; color: var(--muted); }

.anolist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ano {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ano:active { background: rgba(200, 16, 46, .1); }
.ano.is_answered { border-color: var(--red-dim); }
.ano_no {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--bg2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ano_body { flex: 1; font-size: 14px; line-height: 1.55; }
.ano_pick {
  flex: none;
  min-width: 46px;
  text-align: right;
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.ano_pick small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 1px; }
.ano_pick_empty { font-size: 12px; font-weight: 400; color: #6b585a; }

/* 採点後の正誤表示 */
.ano_mark { flex: none; width: 26px; height: 26px; display: grid; place-items: center; font-size: 18px; font-weight: 700; }
.ano_mark.is_ok { color: #7fd3a3; }
.ano_mark.is_ng { color: var(--red); }
.ano.is_wrong { opacity: .8; }

/* ---------- 部屋番号の入力 ---------- */
.riddle {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 10px;
  padding: 16px 14px;
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 22px;
}
#input-review-answer { font-size: 13px; line-height: 1.7; margin: -10px 0 20px; }
#input-review-answer .ok { color: #7fd3a3; }
#input-review-answer .ng { color: var(--red); }

.roomgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.room {
  min-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.room_no { font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.room_name { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.2; }
.room.is_on { background: var(--red); border-color: var(--red); }
.room.is_on .room_name { color: rgba(255, 255, 255, .85); }
.room.is_answer { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(47, 125, 79, .35) inset; }
.room:disabled { cursor: default; opacity: .9; }

/* ---------- ボタン派生 ---------- */
.btn_ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn_ghost:active { background: rgba(255, 255, 255, .04); }
.fabwrap_row { display: flex; gap: 10px; }
.fabwrap_row .btn { flex: 1; }
.fabwrap_row .btn_ghost { flex: 0 0 auto; padding: 0 16px; }

/* ---------- 採点結果 ---------- */
.result {
  flex: 1;
  padding: calc(var(--pad) + env(safe-area-inset-top)) var(--pad) calc(var(--pad) + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  text-align: center;
}
.result_label { color: var(--red); font-size: 11px; letter-spacing: .18em; font-weight: 700; margin: 8px 0 4px; }
.result_title { font-size: 24px; margin: 0 0 18px; letter-spacing: .08em; }

.rank {
  width: 116px;
  height: 116px;
  margin: 6px auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 3px solid var(--red);
  background: radial-gradient(circle at 50% 35%, rgba(200, 16, 46, .3), transparent 70%);
}
.rank_key { font-size: 44px; font-weight: 800; letter-spacing: .04em; }
.rank[data-rank="SS"] { border-color: #f4c04b; background: radial-gradient(circle at 50% 35%, rgba(244, 192, 75, .35), transparent 70%); }
.rank[data-rank="SS"] .rank_key { color: #f4c04b; }
.rank[data-rank="S"] { border-color: #e8b04b; }
.rank[data-rank="S"] .rank_key { color: #e8b04b; }
.rank[data-rank="A"] { border-color: var(--red); }
.rank[data-rank="B"] { border-color: var(--muted); }
.rank[data-rank="B"] .rank_key { color: var(--muted); }

.result_verdict { font-size: 16px; margin: 0 0 18px; font-weight: 700; }

.score { margin: 4px 0 22px; }
.score_num { font-size: 20px; color: var(--muted); }
.score_num b { font-size: 40px; color: var(--red); font-weight: 800; font-variant-numeric: tabular-nums; }
.score_unit { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }

.notice_sticker { text-align: left; }
.sticker_lead { margin: 0; font-size: 13px; line-height: 1.7; color: var(--text); }
.sticker_lead b { color: var(--red); }

.result .btn { margin-bottom: 10px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
