/* 16タイプ劇場(仮) — トーク画面が主役。明るい灰青の方眼に、4つの組の色
   レイアウト:スマホ1列。PCでは見出しと見本のトークが横に並ぶ */
:root {
  --bg: #eaeef3; --paper: #ffffff; --ink: #1c2130; --mute: #677086; --line: #cfd6e0; --chat: #d7e0ea;
  --pop: #ff5a3c;
  --think: #2f4b7c; --feel: #d9594c; --keep: #2f7d5b; --move: #d99417;
  --f-disp: 'Dela Gothic One', 'Zen Maru Gothic', sans-serif;
  --f-body: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Yu Gothic', sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.2, .9, .3, 1.35);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.7;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px;
}
.wrap { max-width: 980px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
main.wrap { max-width: 980px; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pop); outline-offset: 2px; }
[data-g="think"] { --c: var(--think); } [data-g="feel"] { --c: var(--feel); }
[data-g="keep"] { --c: var(--keep); }   [data-g="move"] { --c: var(--move); }

/* スクロールで現れる(表示域の85%で、下から28px・0.7秒・easeOut3乗) */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.33, 1, .68, 1), transform .7s cubic-bezier(.33, 1, .68, 1); }
.rv.rv-in { opacity: 1; transform: none; }

/* ヘッダー */
.top { padding-block: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: rgba(234,238,243,.9); backdrop-filter: blur(8px); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.logo { font-family: var(--f-disp); font-size: 19px; text-decoration: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo i { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 22px; height: 22px; transition: transform .5s var(--spring); }
.logo:hover i { transform: rotate(90deg); }
.logo i b { border-radius: 3px; }
.logo i b:nth-child(1) { background: var(--think); } .logo i b:nth-child(2) { background: var(--feel); }
.logo i b:nth-child(3) { background: var(--keep); }  .logo i b:nth-child(4) { background: var(--move); }
.top-r { display: flex; gap: 6px; align-items: center; }
.zk-link, .snd { min-height: 40px; border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: 0 12px; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.zk-link b { background: var(--ink); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; font-variant-numeric: tabular-nums; }
.snd[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge { display: inline-block; font-size: 12px; color: var(--mute); border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: 2px 10px; }

/* 見出し+見本のトーク */
.hero { padding-block: 20px 8px; display: grid; gap: 22px; align-items: center; }
.hero-text { display: grid; gap: 12px; justify-items: start; }
.hero h1 { font-family: var(--f-disp); font-weight: 400; font-size: clamp(32px, 9vw, 58px); line-height: 1.2; margin: 0; }
.hero h1 span { display: block; overflow: hidden; }
.hero h1 em { font-style: normal; color: var(--pop); display: inline-block; animation: wobble 2.8s ease-in-out 1.6s infinite; }
@keyframes wobble { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-8deg) scale(1.12); } 95% { transform: rotate(6deg) scale(1.08); } }
.hero p { margin: 0; color: var(--mute); }
/* 見出しは枠の中からせり上がる(0.65秒、0.12秒ずつずらす) */
.hero h1 span { animation: rise .65s var(--ease) both; }
.hero h1 span:nth-child(2) { animation-delay: .12s; } .hero h1 span:nth-child(3) { animation-delay: .24s; }
@keyframes rise { from { clip-path: inset(0 0 100% 0); transform: translateY(60%); } to { clip-path: inset(0 0 0 0); transform: none; } }

.demo { background: var(--chat); border-radius: 26px; border: 6px solid var(--ink); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 18px 40px -18px rgba(28,33,48,.45); max-width: 420px; width: 100%; justify-self: center; transform: rotate(1.2deg); }
.demo-bar { background: var(--paper); display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 14px; }
.demo-body { height: clamp(190px, 28vh, 260px); overflow: hidden; padding: 12px; display: flex; flex-direction: column; gap: 6px; transition: opacity .4s; }
.demo-body.fade { opacity: 0; }
.dm { align-self: flex-start; max-width: 85%; animation: pop .28s var(--spring) both; }
.dm span { display: inline-block; background: var(--paper); padding: 6px 12px; border-radius: 16px; border-bottom-left-radius: 5px; font-size: 14px; line-height: 1.5; }
.dm.me { align-self: flex-end; }
.dm.me span { background: var(--c); color: #fff; border-radius: 16px; border-bottom-right-radius: 5px; }
.dm .big { font-family: var(--f-disp); font-size: 18px; animation: shake .45s ease both; }
.dm .dots3 { display: inline-flex; gap: 3px; padding: 10px 12px; }
.dm .dots3 i { width: 6px; height: 6px; border-radius: 50%; background: var(--mute); animation: dot 1s infinite; }
.dm.me .dots3 i { background: rgba(255,255,255,.8); }
.dm .dots3 i:nth-child(2) { animation-delay: .15s; } .dm .dots3 i:nth-child(3) { animation-delay: .3s; }
.demo-go { border: 0; border-top: 1px solid var(--line); background: var(--paper); min-height: 48px; font-weight: 700; cursor: pointer; }
.demo-go:hover { background: var(--ink); color: #fff; }

section { padding-block: 26px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sec-h h2 { font-family: var(--f-disp); font-weight: 400; font-size: 24px; margin: 0; }
.sec-h small { color: var(--mute); font-size: 13px; }

/* タイプを選ぶ */
.pick { background: var(--paper); border-radius: 22px; padding: 18px; display: grid; gap: 18px; box-shadow: 0 1px 0 var(--line); }
.pick-step { display: grid; gap: 10px; min-width: 0; }
.pick-step h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pick-step h3 > span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 13px; }
.pick-step h3 small { font-size: 12px; color: var(--mute); font-weight: 500; }
.grid16 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tchip {
  min-height: 54px; border: 2px solid transparent; border-radius: 12px; background: var(--bg);
  display: grid; place-items: center; cursor: pointer; padding: 4px 2px; position: relative; color: var(--c);
  font-weight: 700; letter-spacing: .04em; font-size: 15px; transition: transform .25s var(--spring), background .2s, color .2s;
}
.tchip small { display: block; font-size: 10px; font-weight: 500; letter-spacing: 0; color: var(--mute); line-height: 1.2; }
@media (hover: hover) { .tchip:hover { transform: translateY(-2px); border-color: var(--c); } }
.tchip:active { transform: scale(.94); }
.tchip[aria-pressed="true"] { background: var(--c); color: #fff; animation: boing .45s var(--spring); }
.tchip[aria-pressed="true"] small { color: rgba(255,255,255,.85); }
.tchip.flick { background: var(--c); color: #fff; }
.tchip.has::after { content: ''; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--pop); }
.tchip[aria-pressed="true"].has::after { background: #fff; }
@keyframes boing { 0% { transform: scale(.9); } 50% { transform: scale(1.08); } 100% { transform: none; } }

/* ×でぶつかる */
.matchup { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; background: var(--bg); border-radius: 18px; padding: 14px 12px 10px; position: relative; overflow: hidden; }
.slot { display: grid; justify-items: center; gap: 4px; min-height: 76px; align-content: center; text-align: center; }
.slot small { font-size: 11px; color: var(--mute); line-height: 1.3; }
.slot .q { width: 52px; height: 52px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--mute); font-weight: 700; }
.slot.l.in { animation: inL .5s var(--ease) both; } .slot.r.in { animation: inR .5s var(--ease) both; }
@keyframes inL { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes inR { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.matchup .x { font-family: var(--f-disp); font-size: 28px; color: var(--line); transition: color .2s; }
.matchup.clash .slot.l { animation: hitL .5s var(--ease) both; } .matchup.clash .slot.r { animation: hitR .5s var(--ease) both; }
.matchup.clash .x { color: var(--pop); animation: burst .5s var(--spring) .32s both; }
@keyframes hitL { 0% { transform: none; } 60% { transform: translateX(26px); } 100% { transform: none; } }
@keyframes hitR { 0% { transform: none; } 60% { transform: translateX(-26px); } 100% { transform: none; } }
@keyframes burst { 0% { transform: scale(.3) rotate(-30deg); } 70% { transform: scale(1.6) rotate(10deg); } 100% { transform: scale(1) rotate(0); } }
.mtopic { grid-column: 1 / -1; margin: 2px 0 0; text-align: center; font-size: 13px; color: var(--mute); font-weight: 700; }
.matchup.clash .mtopic { color: var(--ink); animation: pop .3s ease .4s both; }

.go { min-height: 58px; border: 0; border-radius: 16px; background: var(--pop); color: #fff; font-family: var(--f-disp); font-size: 18px; cursor: pointer; width: 100%; transition: transform .25s var(--spring), box-shadow .25s; }
.go:disabled { background: var(--line); color: var(--mute); cursor: default; }
.go.ready { box-shadow: 0 6px 0 #c63f26; animation: riseBtn .45s var(--spring); }
.go.ready:active { transform: translateY(4px); box-shadow: 0 2px 0 #c63f26; }
@keyframes riseBtn { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }
.aux { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ghost { min-height: 48px; border: 2px solid var(--ink); background: var(--paper); border-radius: 14px; font-weight: 700; font-size: 14px; cursor: pointer; padding: 0 8px; }
.ghost:active { transform: scale(.97); }
.invite-btn { min-height: 64px; border: 0; border-radius: 16px; background: var(--ink); color: #fff; cursor: pointer; display: grid; gap: 2px; padding: 10px 16px; text-align: center; transition: transform .25s var(--spring); }
.invite-btn b { font-family: var(--f-disp); font-weight: 400; font-size: 17px; }
.invite-btn small { font-size: 12px; color: #c6ccd8; }
.invite-btn:active { transform: scale(.97); }
.pick .invite-btn { grid-column: 1 / -1; }
.inv-preview { background: var(--chat); border-radius: 16px; padding: 14px; display: grid; gap: 6px; }
.inv-preview .bubble { justify-self: start; font-size: 14px; }
.inv-url { display: flex; gap: 6px; }
.inv-url input { flex: 1; min-width: 0; font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; min-height: 50px; background: var(--bg); color: var(--ink); }
.inv-url .btn { flex: none; }
.ask-from { margin-right: 44px; display: flex; align-items: center; gap: 10px; background: var(--chat); border-radius: 16px; padding: 12px; font-weight: 700; font-size: 14px; animation: pop .4s var(--spring) both; }
.legend { font-size: 12px; color: var(--mute); display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--c); }
.note { font-size: 13px; color: var(--mute); margin: 0; text-align: center; }

/* 図鑑 */
.zk { background: var(--paper); border-radius: 22px; padding: 16px; display: grid; gap: 12px; }
.zk-bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.zk-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--think), var(--feel), var(--keep), var(--move)); border-radius: 99px; transition: width 1s var(--ease); }
.zk-grid { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; max-width: 480px; width: 100%; margin: 0 auto; }
.zc { aspect-ratio: 1; max-width: 100%; border: 0; padding: 0; border-radius: 3px; background: var(--bg); cursor: pointer; }
.zc.empty { background: none; cursor: default; }
.zc.s2 { background: var(--paper); box-shadow: inset 0 0 0 2px var(--pop); }
.zc.s1 { background: var(--pop); }
.zc.mine { outline: 1.5px solid var(--ink); outline-offset: -1px; }
.zc:not(.empty):hover { transform: scale(1.4); position: relative; z-index: 1; }
.zk-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; font-size: 12px; color: var(--mute); }
.zk-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.zk-legend .s1::before { background: var(--pop); } .zk-legend .s2::before { box-shadow: inset 0 0 0 2px var(--pop); }
.zk-legend .s3::before { background: var(--bg); } .zk-legend .s4::before { outline: 1.5px solid var(--ink); outline-offset: -1px; }

/* 組み合わせのボタン */
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.pair { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 0; border-radius: 14px; padding: 10px 12px; min-height: 58px; cursor: pointer; text-align: left; position: relative; transition: transform .25s var(--spring); }
@media (hover: hover) { .pair:hover { transform: translateY(-3px) rotate(-.6deg); } }
.pair .pt { min-width: 0; }
.pair .vs { font-size: 12px; color: var(--mute); }
.pair b { font-size: 14px; }
.pair p { margin: 0; font-size: 12px; color: var(--mute); line-height: 1.4; }
.pair.seen { background: #f6f7f9; }
.seen-tag { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--pop); border: 1.5px solid var(--pop); border-radius: 99px; padding: 0 8px; transform: rotate(-6deg); flex: none; }

/* アイコン(キャラの代わり。あとで絵に差しかえられる) */
.av { font-family: var(--f-body); overflow: hidden; flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; background: var(--c); }
.av.lg { width: 56px; height: 56px; font-size: 14px; }
.mini { display: flex; }
.mini .av { width: 30px; height: 30px; font-size: 9px; border: 2px solid var(--paper); }
.mini .av + .av { margin-left: -8px; }

/* 16タイプ */
.types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tcard { position: relative; aspect-ratio: 1 / 1.05; max-width: 100%; border-radius: 16px; background: var(--c); color: #fff; text-decoration: none; display: flex; flex-direction: column; justify-content: flex-end; padding: 8px; overflow: hidden; transition: transform .3s var(--spring); }
.tcard::before { content: ''; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.14); transition: transform .4s var(--ease); }
@media (hover: hover) { .tcard:hover { transform: translateY(-4px); } .tcard:hover::before { transform: scale(2.4); } }
.tcard b { font-size: 15px; letter-spacing: .04em; position: relative; }
.tcard span { font-size: 10px; line-height: 1.3; opacity: .9; position: relative; }
.room-tag { position: absolute !important; top: 7px; left: 7px; background: #fff; color: var(--c); border-radius: 99px; padding: 0 6px; font-weight: 700; font-size: 9.5px !important; opacity: 1 !important; }

/* 今日の1問 */
.quiz { background: var(--ink); color: #fff; border-radius: 22px; padding: 22px; display: grid; gap: 12px; position: relative; overflow: hidden; }
.quiz-tag { justify-self: start; font-size: 12px; background: var(--pop); border-radius: 99px; padding: 2px 10px; font-weight: 700; }
.quiz h3 { margin: 0; font-family: var(--f-disp); font-weight: 400; font-size: 24px; }
.quiz p { margin: 0; color: #c6ccd8; font-size: 14px; }
.quiz-sample { display: grid; gap: 6px; justify-items: start; }
.quiz-sample .bubble { background: #2c3347; color: #fff; font-size: 14px; }
.quiz-grid { font-size: 22px; letter-spacing: 4px; }

footer { padding-block: 32px 56px; color: var(--mute); font-size: 12px; text-align: center; }
footer p { margin: 4px 0; }

/* 通知 */
.notif[hidden] { display: none; }
.notif {
  position: fixed; z-index: 40; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 10px); width: min(420px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px; text-align: left; border: 0; cursor: pointer;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-radius: 18px; padding: 10px 14px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.35);
  transform: translate(-50%, -140%); transition: transform .45s var(--spring);
}
.notif.show { transform: translate(-50%, 0); }
.notif b { display: block; font-size: 13px; }
.notif small { display: block; font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.notif > span:last-child { min-width: 0; }

/* トーク画面 */
.talk[hidden] { display: none; }
.talk { position: fixed; inset: 0; z-index: 30; background: var(--chat); display: flex; flex-direction: column; transform: translateY(100%); transition: transform .45s var(--ease); }
.talk.show { transform: none; }
.talk-bar {
  background: var(--paper); display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--line);
}
.back { width: 48px; height: 48px; border: 0; background: none; font-size: 22px; cursor: pointer; border-radius: 12px; }
.talk-title { flex: 1; min-width: 0; line-height: 1.3; }
.talk-title b { display: block; font-size: 16px; }
.talk-title small { color: var(--mute); font-size: 12px; }
.talk-body { flex: 1; overflow-y: auto; padding: 16px max(12px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 24px) max(12px, env(safe-area-inset-left, 0px)); }
.talk-inner { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.topic { align-self: center; background: rgba(28,33,48,.72); color: #fff; font-size: 12px; padding: 3px 12px; border-radius: 99px; margin-bottom: 6px; }
.sys { align-self: center; color: var(--mute); font-size: 12px; background: rgba(255,255,255,.6); padding: 2px 10px; border-radius: 99px; text-align: center; animation: pop .3s ease both; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; animation: pop .28s var(--spring) both; }
.msg .av { width: 34px; height: 34px; font-size: 9.5px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg .col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.msg.me .col { align-items: flex-end; }
.msg .who { font-size: 11px; color: var(--mute); }
.bubble { background: var(--paper); padding: 8px 13px; border-radius: 18px; border-bottom-left-radius: 6px; font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; }
.msg.me .bubble { background: var(--c); color: #fff; border-radius: 18px; border-bottom-right-radius: 6px; }
.bubble.file { display: flex; align-items: center; gap: 10px; background: var(--paper) !important; color: var(--ink) !important; border: 1px solid var(--line); }
.bubble.file::before { content: ''; width: 30px; height: 36px; flex: none; border-radius: 4px; background: linear-gradient(135deg, transparent 70%, rgba(0,0,0,.15) 70%), var(--keep); }
.bubble.draft { background: transparent !important; color: var(--mute) !important; border: 1.5px dashed var(--mute); font-size: 13px; }
.bubble.stamp { background: transparent !important; color: var(--ink) !important; font-family: var(--f-disp); font-size: 20px; padding: 18px 16px; border: 3px solid var(--ink); border-radius: 50% 46% 52% 44% !important; animation: stampIn .4s var(--spring) both; }
@keyframes stampIn { from { transform: scale(2) rotate(-14deg); opacity: 0; } to { transform: rotate(-4deg); opacity: 1; } }
.bubble.big { font-family: var(--f-disp); font-size: 24px; line-height: 1.35; padding: 12px 16px; animation: shake .45s ease .05s both; }
.bubble.del { background: transparent !important; color: var(--mute) !important; border: 1.5px solid var(--line); font-size: 13px; animation: pop .25s ease both; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-5px) rotate(-1.5deg); } 40% { transform: translateX(5px) rotate(1.5deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.read { font-size: 10px; color: var(--mute); }
/* 新しい吹き出し */
.bubble { position: relative; }
.bubble.voice { cursor: pointer; min-width: 190px; }
.vrow { display: flex; align-items: center; gap: 8px; }
.vplay { width: 26px; height: 26px; border-radius: 50%; background: currentColor; flex: none; position: relative; opacity: .9; }
.vplay::after { content: ''; position: absolute; left: 10px; top: 7px; border-left: 9px solid var(--paper); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.msg.me .vplay::after { border-left-color: var(--c); }
.wave { display: flex; align-items: center; gap: 2px; height: 26px; flex: 1; }
.wave i { width: 3px; border-radius: 2px; background: currentColor; opacity: .55; }
.bubble.voice.open .wave i, .bubble.voice:not(.open) .wave i:nth-child(-n+0) { opacity: .9; }
.vt { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; }
.vtxt { display: none; font-size: 13px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed currentColor; opacity: .85; }
.bubble.voice.open .vtxt { display: block; }
.bubble.voice:not(.open)::after { content: '押すと文字で読めます'; display: block; font-size: 10px; opacity: .6; margin-top: 2px; }
.bubble.photo { padding: 6px; display: grid; gap: 4px; background: var(--paper) !important; color: var(--ink) !important; }
.ph { display: block; width: 180px; max-width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; position: relative; overflow: hidden; background: linear-gradient(180deg, var(--p1), var(--p2)); }
.ph::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 32%; background: linear-gradient(180deg, transparent, rgba(0,0,0,.25)); }
.ph svg { display: block; width: 100%; height: 100%; position: relative; z-index: 1; }
.ph:has(svg)::before { display: none; }
.ph i { position: absolute; width: 34%; aspect-ratio: 1; border-radius: 50%; background: var(--p3); left: 54%; top: 22%; box-shadow: 0 0 24px var(--p3); }
.phc { font-size: 12px; color: var(--mute); padding: 0 6px 2px; }
.react { position: absolute; bottom: -12px; right: -6px; background: var(--paper); border: 1px solid var(--line); border-radius: 99px; font-size: 13px; line-height: 1; padding: 3px 5px; animation: reactIn .45s var(--spring) both; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.msg.me .react { right: auto; left: -6px; }
@keyframes reactIn { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
.msg:has(.react) { margin-bottom: 8px; }
.msg.vanish { animation: vanish .5s ease both; }
@keyframes vanish { to { opacity: 0; transform: scale(.8); } }
.typing { display: flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); animation: dot 1s infinite; }
.msg.me .typing i { background: rgba(255,255,255,.8); }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.skip { align-self: center; font-size: 12px; color: var(--mute); border: 0; background: none; min-height: 40px; cursor: pointer; text-decoration: underline; }

/* 終わりのカード */
.endcard { margin-top: 18px; background: var(--paper); border-radius: 22px; padding: 20px; display: grid; gap: 14px; animation: cardUp .5s var(--ease) both; }
@keyframes cardUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.endcard .pairline { display: flex; align-items: center; gap: 10px; font-family: var(--f-disp); font-size: 20px; }
.endcard .combo small { display: block; font-size: 12px; color: var(--mute); font-weight: 700; letter-spacing: .08em; }
.stampw { display: inline-block; }
.stamp-in { display: inline-block; font-family: var(--f-disp); font-size: clamp(18px, 5.2vw, 28px); line-height: 1.3; color: var(--pop); border: 3px solid var(--pop); border-radius: 10px; padding: 4px 12px; transform: rotate(-3deg); opacity: 0; }
.stampw.hit .stamp-in { animation: slam .45s var(--spring) both; }
@keyframes slam { 0% { opacity: 0; transform: scale(2.6) rotate(-12deg); } 60% { opacity: 1; transform: scale(.94) rotate(-2deg); } 100% { opacity: 1; transform: rotate(-3deg); } }
/* 相性メーター(半円の針) */
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meter { background: var(--bg); border-radius: 14px; padding: 12px 10px 10px; display: grid; justify-items: center; gap: 2px; }
.meter.fight { --m1: #ffd2c7; --m2: var(--pop); } .meter.love { --m1: #cdeedd; --m2: var(--keep); }
.dial { width: 112px; max-width: 100%; aspect-ratio: 2 / 1; border-radius: 112px 112px 0 0; position: relative; overflow: hidden;
  background: conic-gradient(from 270deg at 50% 100%, var(--m1) 0deg, var(--m2) 180deg, transparent 180deg); }
.dial::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 0; height: 56%; border-radius: 99px 99px 0 0; background: var(--bg); }
.needle { position: absolute; left: calc(50% - 2px); bottom: 0; width: 4px; height: 92%; background: var(--ink); border-radius: 4px; transform-origin: 50% 100%; transform: rotate(-90deg); z-index: 1; }
.needle::after { content: ''; position: absolute; left: -5px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); }
.meters.swing .needle { animation: swing 1.4s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes swing { 0% { transform: rotate(-90deg); } 35% { transform: rotate(calc(var(--v) * 1.8deg - 90deg + 25deg)); } 60% { transform: rotate(calc(var(--v) * 1.8deg - 90deg - 10deg)); } 100% { transform: rotate(calc(var(--v) * 1.8deg - 90deg)); } }
.meter .mnum { font-family: var(--f-disp); font-weight: 400; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 4px; }
.meter span { font-size: 12px; color: var(--mute); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .needle { transform: rotate(calc(var(--v) * 1.8deg - 90deg)); } }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--bg); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.stat span { font-size: 12px; color: var(--mute); line-height: 1.4; }
.stat b { font-family: var(--f-disp); font-weight: 400; font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.endcard blockquote { margin: 0; font-size: 16px; line-height: 1.8; font-weight: 700; }
.btns { display: grid; gap: 8px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { min-height: 50px; border-radius: 14px; border: 2px solid var(--ink); background: var(--paper); display: grid; place-items: center; text-decoration: none; font-weight: 700; cursor: pointer; padding: 0 12px; text-align: center; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.gift-btn { background: #ff7a9c; border-color: #ff7a9c; color: #fff; }
.gift-band { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #ffe3ea; border-radius: 20px; padding: 16px 18px; text-decoration: none; }
.gift-band b { font-family: var(--f-disp); font-weight: 400; font-size: 18px; display: block; }
.gift-band small { color: var(--mute); font-size: 13px; }
.gift-band span.arrow { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #ff7a9c; color: #fff; display: grid; place-items: center; font-size: 20px; }
.btn:disabled { opacity: .6; }
.ghost-btn { border-color: var(--line); color: var(--mute); }
.nexts { display: grid; gap: 6px; }
.nexts > p { margin: 0; font-size: 12px; color: var(--mute); font-weight: 700; letter-spacing: .06em; }
.nexts .pair { background: var(--bg); }

/* モーダル(タイプ選びの手助け・画像) */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(28,33,48,.5); display: grid; align-items: end; justify-items: center; opacity: 0; transition: opacity .25s; }
.modal.show { opacity: 1; }
.sheet { background: var(--paper); width: min(520px, 100%); border-radius: 24px 24px 0 0; padding: 22px max(18px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 24px) max(18px, env(safe-area-inset-left, 0px)); position: relative; display: grid; gap: 14px; transform: translateY(40px); transition: transform .35s var(--spring); max-height: 92vh; overflow-y: auto; }
.modal.show .sheet { transform: none; }
.x-close { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border: 0; background: var(--bg); border-radius: 50%; font-size: 20px; cursor: pointer; }
.dots { display: flex; gap: 6px; }
.dots i { width: 28px; height: 6px; border-radius: 99px; background: var(--bg); transition: background .3s; }
.dots i.on { background: var(--ink); } .dots i.now { background: var(--pop); }
.help-lead { margin: 0; font-size: 13px; color: var(--mute); }
.sheet h3 { margin: 0; font-family: var(--f-disp); font-weight: 400; font-size: 24px; line-height: 1.35; }
.help-a { display: grid; gap: 8px; }
.ans { min-height: 64px; border: 2px solid var(--ink); background: var(--paper); border-radius: 16px; font-weight: 700; font-size: 16px; cursor: pointer; text-align: left; padding: 10px 16px; animation: pop .35s var(--spring) both; transition: background .15s; }
.ans:hover { background: var(--bg); }
.ans:active { transform: scale(.98); }
.help-res { display: flex; align-items: center; gap: 12px; font-size: 32px; }
.help-res small { display: block; font-family: var(--f-body); font-size: 14px; color: var(--mute); }
.help-line { margin: 0; }
.img-sheet img { width: auto; max-width: 100%; max-height: 62vh; justify-self: center; border-radius: 12px; box-shadow: 0 8px 24px -10px rgba(0,0,0,.4); }

/* お知らせ */
#toasts { position: fixed; z-index: 60; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; padding: 10px 18px; border-radius: 99px; animation: toastIn .35s var(--spring) both; transition: opacity .4s, transform .4s; text-align: center; }
.toast.out { opacity: 0; transform: translateY(10px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.9); } to { opacity: 1; transform: none; } }

@media (max-width: 370px) {
  .logo { font-size: 15px; gap: 6px; } .logo i { width: 18px; height: 18px; }
  .zk-link, .snd { padding: 0 8px; font-size: 12px; }
  .top { gap: 6px; }
}
@media (min-width: 760px) {
  .hero { grid-template-columns: 1.1fr 1fr; padding-block: 40px 16px; }
  .pick { grid-template-columns: 1fr 1fr; padding: 24px; }
  .pick .matchup, .pick .go, .pick .aux, .pick .legend, .pick .note { grid-column: 1 / -1; }
  .types { grid-template-columns: repeat(8, 1fr); }
  .modal { align-items: center; }
  .sheet { border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .stamp-in { opacity: 1; }
  .talk { transform: none; }
}
