/* 黒地に白、差し色は桃色と水色。見本（黒地の案 2）の値をそのまま移した物。足した部品は下の「足した部品」にまとめる */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #000000; --surface: #131316; --raised: #1F1F24; --ink: #FFFFFF; --muted: #9B9CA6; --line: #2C2C33;
  --pink: #FF3B5C; --cyan: #20D5EC; --gold: #FFC83D; --ok: #3DDC97;
  --pink-soft: #3A0F19; --cyan-soft: #0B2F35; --gold-soft: #3A2C06;
  --display: "Archivo", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.wrap { max-width: 560px; margin: 0 auto; padding-block: 0 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 18px; }

.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { font-family: var(--display); font-weight: 900; font-size: 19px; margin: 0; letter-spacing: .01em; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: var(--ink); background: var(--pink); padding: 4px 10px; border-radius: 4px; white-space: nowrap; letter-spacing: .04em; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 10px 0 11px; font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--muted); position: relative; min-height: 44px; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 50%; bottom: -1px; width: 28px; height: 3px; margin-left: -14px; border-radius: 2px; background: var(--ink); }

.note { font-size: 12px; color: var(--muted); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border-radius: 14px; padding: 12px 10px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* 数字は影なしのくっきりした白（見本にあった水色と桃色のずらし影は、実機で「ブレて見えて目に悪い」ので外した・2026-11-19） */
.stat b { font-family: var(--display); font-weight: 900; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted); font-weight: 600; }
.stat.hot { background: var(--pink-soft); }
.stat.hot span { color: var(--ink); }
.fresh { font-size: 11px; color: var(--muted); margin: 8px 0 0; }

.sec-h { font-family: var(--display); font-weight: 800; font-size: 14px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.sec-h small { font-family: var(--body); font-weight: 500; font-size: 11px; color: var(--muted); }
.now { display: flex; flex-direction: column; gap: 8px; }
.call { background: var(--surface); border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--pink); }
.call .who { min-width: 0; flex: 1; font-weight: 700; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.call .left { flex: 0 0 auto; font-family: var(--display); font-weight: 800; font-size: 12px; color: var(--ink); background: var(--pink); padding: 5px 9px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.av { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: var(--bg); }
.tools { display: flex; flex-direction: column; gap: 10px; }
.search { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--raised); border: 0; border-radius: 999px; padding: 11px 18px; }
.search::placeholder { color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: 0 0 auto; border: 0; background: var(--raised); padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; min-height: 38px; display: inline-flex; align-items: center; gap: 6px; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.sort { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.sort button { border: 1px solid var(--line); background: transparent; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; min-height: 36px; color: var(--muted); }
.sort button[aria-pressed="true"] { border-color: var(--cyan); color: var(--cyan); }

.list { display: flex; flex-direction: column; gap: 8px; }
.person { background: var(--surface); border-radius: 16px; overflow: hidden; }
.person > button { width: 100%; border: 0; background: transparent; text-align: left; padding: 12px; display: flex; gap: 12px; align-items: flex-start; }
.p-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.p-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.p-name { font-weight: 800; font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.p-name small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.p-exp { font-family: var(--display); font-size: 12px; font-weight: 800; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-exp.warn { color: var(--gold); } .p-exp.hot { color: var(--pink); }
.items { display: flex; flex-wrap: wrap; gap: 6px; }
.item { display: inline-flex; align-items: center; gap: 5px; background: var(--raised); border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ic { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; line-height: 1; flex: 0 0 auto; }
.item .n { font-family: var(--display); font-weight: 900; color: var(--cyan); }
.unknown { background: var(--gold-soft); color: var(--gold); padding-left: 10px; }
.more { font-size: 12px; color: var(--muted); font-weight: 700; }
.person > button[aria-expanded="true"] .more { color: var(--cyan); }

.edit { border-top: 1px solid var(--line); padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.edit h3 { margin: 0; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .08em; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row .lbl { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.row .lbl small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .ic { width: 30px; height: 30px; font-size: 16px; }
.step { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.step button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--raised); font-size: 22px; font-weight: 700; line-height: 1; }
.step button[data-act="inc"] { background: var(--ink); color: var(--bg); }
.step output { min-width: 34px; text-align: center; font-family: var(--display); font-weight: 900; font-size: 20px; font-variant-numeric: tabular-nums; }
.undo { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--cyan-soft); color: var(--cyan); border-radius: 12px; padding: 8px 8px 8px 12px; font-size: 13px; font-weight: 700; }
.undo button { border: 0; background: var(--cyan); color: var(--bg); border-radius: 999px; padding: 9px 14px; font-weight: 800; min-height: 40px; white-space: nowrap; }
.fill { background: var(--gold-soft); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.fill p { margin: 0; font-size: 13px; color: var(--gold); font-weight: 700; }
.pick, .add { display: flex; flex-wrap: wrap; gap: 6px; }
.pick button, .add button { border: 0; background: var(--raised); border-radius: 999px; padding: 6px 12px 6px 6px; font-size: 13px; font-weight: 700; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.add button { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.hist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.hist time { font-variant-numeric: tabular-nums; margin-right: 8px; color: var(--ink); }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; font-size: 14px; }

.lead { font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1.5; margin: 0; text-wrap: balance; }
.lead b { font-weight: 900; color: var(--cyan); font-variant-numeric: tabular-nums; }
.battle { display: flex; flex-direction: column; gap: 6px; }
.battle h2 { font-family: var(--display); font-weight: 800; font-size: 15px; margin: 0 0 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.battle h2 time { font-variant-numeric: tabular-nums; }
.tag { font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 4px; font-family: var(--display); letter-spacing: .04em; }
.tag.win { background: var(--cyan); color: var(--bg); } .tag.lose { background: var(--raised); color: var(--muted); }
.ev { background: var(--surface); border-radius: 14px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.ev .av { width: 32px; height: 32px; font-size: 13px; }
.ev .body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; overflow-wrap: anywhere; }
.ev b { font-weight: 800; } .ev .k { font-size: 12px; font-weight: 800; margin-left: 6px; }
.ev .k.get { color: var(--ok); } .ev .k.use { color: var(--cyan); } .ev .k.unk { color: var(--gold); }
.ev time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; flex: 0 0 auto; padding-top: 2px; }

details { background: var(--surface); border-radius: 14px; padding: 12px 14px; font-size: 13px; }
summary { font-weight: 700; cursor: pointer; }
details ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .live i { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .25; } }
}

/* 頭文字の丸の色（見本の 9 色） */
.av-0 { background: #20D5EC; } .av-1 { background: #FF3B5C; } .av-2 { background: #FFC83D; }
.av-3 { background: #3DDC97; } .av-4 { background: #B79CFF; } .av-5 { background: #FF8A4C; }
.av-6 { background: #7FD1FF; } .av-7 { background: #F78FD0; } .av-8 { background: #C8E36B; }
/* 種類の絵の地（見本の色。番号は種類の番号） */
.ic-t1 { background: #4A1420; } .ic-t9 { background: #6B4E00; } .ic-t2 { background: #10344A; }
.ic-t4 { background: #33204F; } .ic-t7 { background: #4A2410; } .ic-t8 { background: #3F3310; }
.ic-t3 { background: #0D3B33; } .ic-t11 { background: #4A123A; } .ic-tx { background: var(--line); color: var(--muted); }

/* ---- 足した部品（見本の変数だけで作る） ---- */
.panel { display: flex; flex-direction: column; gap: 18px; }
#view-log.panel { gap: 20px; }
/* 「記録中」以外の落ち着いた印 */
.live.calm { background: var(--raised); color: var(--muted); white-space: normal; text-align: right; }
.live.calm.warn { color: var(--gold); }
.rec-more { font-size: 11px; color: var(--muted); margin: 0; text-align: right; display: flex; flex-direction: column; gap: 2px; }
.offline { background: var(--surface); color: var(--ink); border-radius: 12px; padding: 8px 12px; font-size: 13px; margin: 0; }
.unconf { font-size: 10px; font-weight: 600; color: var(--muted); }
.song-note { margin: -4px 0 0; font-size: 12px; font-weight: 500; line-height: 1.5; color: var(--gold); }
.empty.tight { padding: 4px 0; }
.msg { margin: 0; font-size: 13px; font-weight: 700; border-radius: 12px; padding: 8px 12px; }
.msg.bad { background: var(--pink-soft); color: var(--ink); }
.msg.wait { background: var(--raised); color: var(--muted); }
.hist li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.hist li span { min-width: 0; overflow-wrap: anywhere; flex: 1; }
.hist li button, .auto-read button, .fill .go { border: 1px solid var(--line); background: transparent; color: var(--cyan); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 800; min-height: 44px; }
.fill .go { align-self: flex-start; background: var(--gold); color: var(--bg); border: 0; font-size: 13px; padding: 8px 16px; }
.picked { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--gold); }
.picked button { border: 0; background: var(--raised); border-radius: 999px; padding: 6px 12px 6px 6px; font-size: 13px; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.auto-read { background: var(--raised); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.auto-read p { margin: 0; }
.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-nav button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; min-height: 44px; }
.day-nav strong { font-family: var(--display); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.pick button, .add button, .chips button { min-height: 44px; }
.undo button { min-height: 44px; }

/* 入口の画面 */
.gate { min-height: 70vh; justify-content: center; }
.gate h1 { font-size: 24px; }
.gate p { margin: 0; color: var(--muted); font-size: 14px; }
.gate .warn-box { background: var(--gold-soft); color: var(--gold); border-radius: 12px; padding: 12px; font-weight: 700; font-size: 13px; }
.gate .bad { color: var(--pink); font-weight: 700; }
.gate form { display: flex; flex-direction: column; gap: 10px; }
.gate .search { border-radius: 12px; }
.gate .go { border: 0; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 12px 20px; font-weight: 800; font-size: 16px; min-height: 48px; }
.nw { white-space: nowrap; }
