/* スマホのページの見た目。色は青系（地は青みのある黒、強調は青、字は白か青みのある白）。
   角丸は付けない。丸いのはシャッターと、切れたときの点だけ。要素の左端に縦線のアクセントは置かない。 */
:root {
  --bg: #05080f; --bg2: #0b1220; --line: #24365c; --accent: #2f7dff; --accent-d: #1a4fb0;
  --text: #ffffff; --text2: #c9d8f5; --muted: #7f93bd;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; font-weight: 600;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  overflow: hidden;
}
html:lang(zh-Hans) body { font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
html:lang(zh-Hant) body { font-family: -apple-system, "PingFang TC", "PingFang HK", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }
html:lang(ko) body { font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
button { -webkit-appearance: none; appearance: none; border: 0; border-radius: 0; font: inherit; color: inherit; background: none; padding: 0; }

/* 高さは見えている画面に合わせる（iPhone のブラウザの下のバーの裏までページが伸びないように。Alice と同じ）。 */
.page, #play { position: fixed; left: 0; right: 0; top: 0; height: 100%; height: 100dvh; height: var(--view-h, 100dvh); }
.page { display: flex; flex-direction: column; align-items: center;
  padding: calc(28px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom)); }
.fill { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* つなぐ前 */
.brand { font-size: 44px; font-weight: 800; letter-spacing: 0.3em; margin: 8vh 0 6vh; padding-left: 0.3em; color: var(--text); }
#code-box { width: 100%; display: flex; flex-direction: column; align-items: center; }
.label { font-size: 17px; color: var(--text2); margin-bottom: 12px; }
/* iOS は 16px より小さい入力欄を選ぶと画面を拡大するので、字は大きくする。 */
#code { width: min(300px, 100%); height: 76px; background: var(--bg2); color: var(--text); border: 2px solid var(--line); border-radius: 0;
  font: inherit; font-size: 40px; font-weight: 800; letter-spacing: 0.25em; text-align: center; padding: 0 0 0 0.25em; outline: none;
  -webkit-user-select: text; user-select: text; }
#code:focus { border-color: var(--accent); }
.big { margin-top: 28px; width: 100%; min-height: 76px; padding: 10px 12px; background: var(--accent); color: #fff; font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2; overflow-wrap: break-word; flex: none; }
.big:active { background: var(--accent-d); }
.big:disabled { opacity: 0.4; }
.big.huge { min-height: 40%; font-size: 48px; margin-top: 0; }
.minor { min-height: 48px; padding: 8px 14px; font-size: 16px; color: var(--text2); border: 2px solid var(--line); flex: none; }
.minor:active { border-color: var(--accent); color: #fff; }
.hint { margin-top: 22px; font-size: 15px; color: var(--muted); text-align: center; }
.say { font-size: 22px; text-align: center; line-height: 1.5; margin: 18px 0 0; white-space: pre-line; overflow-wrap: break-word; color: var(--text); }
.say.large { font-size: 30px; margin: 0; }
.aim { width: min(280px, 64vw); height: auto; max-height: 42dvh; }

/* 遊んでいるあいだ */
#play { background: #000; overflow: hidden; }
#view, #freeze, #noise { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
#view { object-fit: cover; background: #000; }
#noise { image-rendering: pixelated; pointer-events: none; }
#flash { position: absolute; inset: 0; border: 10px solid #fff; pointer-events: none; }
#jam-say { position: absolute; left: 0; right: 0; top: 38%; text-align: center; white-space: pre-line; font-size: 32px; font-weight: 800; line-height: 1.35;
  color: #fff; text-shadow: 0 0 12px #000, 0 2px 4px #000; pointer-events: none; padding: 0 16px; }

#hud { position: absolute; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top)) 14px 22px;
  background: linear-gradient(rgba(5, 8, 15, 0.85), rgba(5, 8, 15, 0)); pointer-events: none; }
.hud-row { display: flex; justify-content: space-between; align-items: baseline; }
#clock { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
#lamps { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--text2); }
#lamp-marks { display: flex; gap: 5px; }
#lamp-marks i { width: 12px; height: 12px; border: 2px solid var(--text2); }
#lamp-marks i.on { background: var(--accent); border-color: var(--accent); }
#lamp-num { font-variant-numeric: tabular-nums; color: var(--text); }
#an-label, #an-num { font-size: 15px; color: var(--text2); margin-top: 8px; }
#an-num { font-variant-numeric: tabular-nums; color: var(--text); }
#hud.short #an-label { color: var(--text); }
#an-bar { position: relative; height: 8px; margin-top: 5px; background: rgba(201, 216, 245, 0.25); }
#an-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); }
/* 解析の上限の位置の印。 */
#an-cap { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: #fff; }

#controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 26px 18px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(5, 8, 15, 0), rgba(5, 8, 15, 0.85)); }
#shutter { width: 84px; height: 84px; border-radius: 50%; border: 4px solid #fff; display: flex; align-items: center; justify-content: center; flex: none; touch-action: none; }
#shutter i { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: block; }
#shutter:active i { width: 56px; height: 56px; background: var(--text2); }
.side { position: relative; width: 84px; height: 64px; font-size: 18px; font-weight: 800; color: #fff; border: 2px solid var(--text2); background: rgba(5, 8, 15, 0.55);
  display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1; overflow-wrap: anywhere; flex: none; }
#light { touch-action: none; }
/* 光は押しているあいだだけ色を変える。 */
#light.on { background: var(--accent); border-color: #fff; }
#log-new { position: absolute; right: -6px; top: -6px; width: 14px; height: 14px; background: var(--accent); border: 2px solid #fff; }
/* 映像が乱れているあいだは、シャッターと光が効かない見た目にする。 */
#play.jam #shutter, #play.jam #light { opacity: 0.25; }

/* LARU の言葉の帯（シャッターの上）。 */
#band { position: absolute; left: 12px; right: 12px; bottom: calc(138px + env(safe-area-inset-bottom)); padding: 10px 12px;
  background: rgba(5, 8, 15, 0.8); border: 1px solid var(--line); font-size: 17px; line-height: 1.45; color: var(--text); white-space: pre-line; overflow-wrap: break-word;
  max-height: 30%; overflow: hidden; }
#band .who { display: block; font-size: 12px; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 2px; }
#band.fail { color: var(--text2); }

/* 検索の結果の一覧 */
#log { position: absolute; inset: 0; background: rgba(5, 8, 15, 0.96); display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
.log-head { display: flex; justify-content: space-between; align-items: center; font-size: 22px; font-weight: 800; flex: none; }
#log-list { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 12px 0; touch-action: pan-y; }
#log-list .item { padding: 12px 0; border-bottom: 1px solid var(--line); }
#log-list .item h3 { margin: 0 0 6px; font-size: 18px; color: var(--accent); }
#log-list .item p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--text2); white-space: pre-line; overflow-wrap: break-word; font-weight: 400; }
#log-list .empty { padding: 30px 0; text-align: center; color: var(--muted); font-size: 16px; }

/* 画面を覆う知らせ */
.cover { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.cover .t1 { font-size: 34px; font-weight: 800; color: #fff; line-height: 1.35; white-space: pre-line; overflow-wrap: break-word; }
.cover .big { width: min(340px, 100%); }
.dots { display: flex; gap: 14px; margin-top: 30px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); opacity: 0.35; animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.4s; }
.dots i:nth-child(3) { animation-delay: 0.8s; }
@keyframes dot { 0%, 100% { opacity: 0.35; } 30% { opacity: 1; } }
