/* 見た目は社内チャット（ライト）。寒くなるほど画面のふちに霜がつく（--cold 0〜1）。
   文字 #17202a・補助 #5b6b7a・氷 #2f6fd6 / #d8ecff・赤 #e0364d */
* { box-sizing: border-box; }
:root { --ink: #17202a; --sub: #5b6b7a; --line: #e3e9ef; --ice: #2f6fd6; --ice2: #d8ecff; --red: #e0364d; }
html, body { margin: 0; background: #dfe6ec; color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
#app { max-width: 440px; margin: 0 auto; min-height: 100dvh; background: #fff; position: relative; overflow-x: clip; }
button { font: inherit; color: inherit; }
.btn { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 50px; margin: 10px 0 0; padding: 10px 14px; border: 1px solid #cfd8e0; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 700; font-size: 16px; text-align: center; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--ice); border-color: var(--ice); color: #fff; }
.btn.ghost { border-color: transparent; color: var(--sub); font-weight: 500; }
.btn.xpost { background: #0f1419; border-color: #0f1419; color: #fff; }
.btn.xpost svg { width: 18px; height: 18px; fill: #fff; }
.av { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-style: normal; font-weight: 800; font-size: 15px; }

/* タイトル */
.title { padding: 64px 24px 32px; text-align: center; background: linear-gradient(#eaf3fc, #fff 60%); min-height: 100dvh; }
.title .logo { font-size: 64px; line-height: 1; }
.title h1 { font-size: 62px; margin: 8px 0 2px; letter-spacing: .06em; font-weight: 900; color: var(--ice); text-shadow: 0 2px 0 #fff, 0 4px 14px #2f6fd633; }
.catch { font-size: 19px; font-weight: 700; margin: 0 0 22px; }
.who { display: flex; justify-content: center; gap: 14px; }
.who span { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--sub); }
.title .btn.primary { margin-top: 28px; font-size: 18px; min-height: 56px; }
.best { color: var(--sub); font-size: 14px; margin: 12px 0 0; }
.guide { margin-top: 14px; font-size: 13px; }
.note { font-size: 11px; color: var(--sub); margin-top: 18px; }

/* プレイ */
.play { --cold: 0; height: 100dvh; display: flex; flex-direction: column; position: relative; overflow: hidden; background: #eef3f7; }
.hud { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px 0 14px; background: #fff; border-bottom: 1px solid var(--line); flex: none; position: relative; z-index: 5; }
.room { line-height: 1.15; min-width: 0; }
.room b { display: block; font-size: 16px; }
.room small { font-size: 12px; color: var(--sub); }
.pts { flex: 1; text-align: center; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.thermo { display: flex; align-items: center; gap: 6px; }
.thermo .bar { width: 64px; height: 10px; border-radius: 99px; background: #e4ebf1; overflow: hidden; }
.thermo .bar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #6fb5ff, #ff8a4c); transition: width .3s; }
.thermo b { font-size: 15px; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.thermo.low b { color: var(--ice); }
.thermo.low .bar span { background: #6fb5ff; }
.thermo.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

.chat { flex: 1; min-height: 0; overflow: hidden; padding: 10px 12px 26px; display: flex; flex-direction: column; gap: 10px; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.chat > :first-child { margin-top: auto; }
/* 最新の行を画面のいちばん下ではなく、真ん中より少し下に置く（下に空きを残してスクロールする） */
.chat::after { content: ""; flex: none; height: 28dvh; }
.sep { text-align: center; flex: none; }
.sep span { display: inline-block; padding: 3px 12px; border-radius: 99px; background: #d5dee6; color: #46586a; font-size: 12px; font-weight: 700; }
.msg { display: flex; gap: 8px; align-items: flex-start; flex: none; animation: in .18s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }
.msg .body { position: relative; min-width: 0; max-width: calc(100% - 50px); }
.nm { display: block; font-size: 11px; color: var(--sub); margin: 0 0 2px 2px; }
.bub { margin: 0; padding: 9px 13px; background: #fff; border-radius: 4px 16px 16px 16px; box-shadow: 0 1px 2px #17202a14; font-size: 18px; line-height: 1.6; letter-spacing: .02em; min-height: 47px; word-break: break-all; }
.c { border-radius: 3px; transition: background .2s, color .2s; }
.c.ice { background: var(--ice2); color: var(--ice); font-weight: 800; }
.c.gone { color: #9aa8b5; text-decoration: line-through; text-decoration-color: #9aa8b588; }
.c.gone.ice { color: #7fa6dd; text-decoration: none; }
.c.missed { background: #e8edf2; text-decoration: underline dotted #8b9aa8; text-underline-offset: 4px; }
.bub.bad { animation: bad .6s; }
@keyframes bad { 0%, 60% { background: #ffd9de; color: var(--red); box-shadow: 0 0 0 2px #ffb3bd; } }
.msg.tut .bub { animation: tut 1s ease-in-out infinite; }
@keyframes tut { 50% { box-shadow: 0 0 0 4px #6fb5ff, 0 0 18px #6fb5ffaa; } }
.msg.caught .bub { box-shadow: 0 0 0 2px #9fcbff, 0 1px 2px #17202a14; }
.msg.cold .bub { background: #f4f7fa; color: #63727f; }
.tm { display: block; height: 3px; margin: 4px 6px 0; border-radius: 2px; background: #dbe3ea; overflow: hidden; transition: opacity .3s; }
.tm i { display: block; height: 100%; background: #8fb4dc; transform-origin: left; }
.tm.low i { background: #f08a4b; }
.tm.off { opacity: 0; }
.msg.me { justify-content: flex-end; align-items: flex-end; gap: 6px; }
.msg.me .bub { background: var(--ice); color: #fff; border-radius: 16px 4px 16px 16px; font-weight: 800; min-height: 0; animation: pop .25s ease-out; }
.msg.me.big .bub { background: var(--red); font-size: 21px; }
.gain { font-size: 12px; font-weight: 800; color: var(--ice); margin-bottom: 4px; }
.msg.me.big .gain { color: var(--red); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.rx { display: block; min-height: 0; font-size: 12px; color: var(--sub); margin: 3px 0 0 4px; }
.rx:empty { display: none; }
.rx.ng { color: var(--red); font-weight: 700; }

.frost { position: absolute; inset: 56px 0 0; pointer-events: none; opacity: var(--cold); transition: opacity .5s; box-shadow: inset 0 0 calc(40px + 80px * var(--cold)) #bfe0ff; background: radial-gradient(ellipse at center, transparent 55%, #d8ecffaa 100%); }
.play.frozen .frost { opacity: 1; background: #d8ecffcc; transition: background 1.2s; }
.play.frozen .chat { filter: saturate(.3) brightness(1.05); }
.play.over .chat { overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
.play.frozen.over .frost { opacity: .55; }
.endbtn { position: absolute; left: 20px; right: 20px; bottom: calc(18px + env(safe-area-inset-bottom)); width: auto; z-index: 6; min-height: 54px; font-size: 17px; box-shadow: 0 6px 20px #2f6fd655; animation: rise .35s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.combo { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); padding: 3px 12px; border-radius: 99px; background: #17202ae0; color: #fff; font-weight: 800; font-size: 14px; opacity: 0; pointer-events: none; }
.combo.on { animation: combo 1s ease-out both; }
@keyframes combo { 0% { opacity: 0; transform: translate(-50%, 6px); } 15%, 70% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.hint { position: absolute; left: 16px; right: 16px; bottom: 18px; margin: 0; padding: 10px 14px; border-radius: 14px; background: #17202ad9; color: #fff; text-align: center; font-weight: 700; font-size: 15px; pointer-events: none; animation: hint 1.6s ease-in-out infinite alternate; }
@keyframes hint { to { transform: translateY(-4px); } }

/* 結果 */
.result { padding: 40px 22px 32px; text-align: center; }
.result.clear { background: linear-gradient(#fff6e8, #fff 40%); }
.result.dead { background: linear-gradient(#e2efff, #fff 45%); }
.rh { font-size: 18px; font-weight: 800; }
.ttl { margin: 14px 0 0; font-size: 34px; font-weight: 900; }
.ttl em { display: block; margin-top: 4px; font-size: 14px; font-style: normal; font-weight: 700; color: var(--sub); }
.ttl small { display: block; font-size: 12px; color: var(--sub); font-weight: 700; letter-spacing: .1em; }
.headline { margin: 12px 0 0; font-size: 34px; font-weight: 900; color: var(--ice); }
.score { margin-top: 10px; font-size: 44px; font-weight: 900; font-variant-numeric: tabular-nums; }
.score small { font-size: 18px; margin-left: 2px; }
.sub { margin: 2px 0 0; font-size: 14px; color: var(--sub); min-height: 1em; }
.sub b { color: var(--red); }
.rows { margin: 14px 0 0; font: 20px/1.3 system-ui, sans-serif; white-space: pre-wrap; word-break: break-all; letter-spacing: .05em; }
.rcard { display: block; width: 100%; height: auto; margin: 14px 0 0; border-radius: 14px; box-shadow: 0 4px 18px #17202a1f; }
.sharebtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.sharebtns .btn { min-height: 52px; font-size: 15px; }
.stats { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 6px; padding: 0; }
.stats li { padding: 8px 2px; border-radius: 12px; background: #f2f6f9; font-size: 14px; color: var(--sub); }
.stats b { font-size: 22px; color: var(--ink); }
.stats small { display: block; font-size: 11px; }
.lost { margin-top: 22px; text-align: left; }
.lost h3 { font-size: 13px; letter-spacing: .1em; color: var(--sub); margin: 0 0 6px; }
.lost ul, .zlist { list-style: none; margin: 0; padding: 0; }
.lost li, .zlist li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 2px; border-top: 1px solid var(--line); }
.lost p, .zlist p { margin: 0; font-size: 15px; line-height: 1.55; }
.lost small, .zlist small { display: block; font-size: 11px; color: var(--sub); }
mark { background: var(--ice2); color: var(--ice); font-weight: 800; border-radius: 3px; }
.result .sn-after { margin-top: 26px; }

/* 図鑑 */
.zov { position: fixed; inset: 0; z-index: 50; max-width: 440px; margin: 0 auto; background: #fff; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 32px; }
.zhead { position: sticky; top: 0; display: flex; align-items: center; gap: 8px; height: 54px; background: #fff; border-bottom: 1px solid var(--line); margin: 0 -16px 4px; padding: 0 12px; }
.zhead h2 { flex: 1; margin: 0; font-size: 17px; }
.zhead span { color: var(--sub); font-weight: 700; }
.back { width: 40px; height: 40px; border: 0; background: none; font-size: 30px; line-height: 1; cursor: pointer; }
.zlist li.un p { color: #9aa8b5; }
.zlist li.new { background: #fff8e1; }
