/* その一言、フレネミー？ — 明るくポップで、少しだけミステリアス。スマホ縦画面優先（幅320pxから） */
:root {
  --night: #2a2150; --night2: #45286e; --ink: #2a2150; --muted: #6d6880; --paper: #fffaf2;
  --m: #19a98a; --m2: #7ef0d0; --f: #d93a78; --f2: #ff8fd1; --gold: #ffd84a; --sky: #9fb6ff;
  --font: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --pop: cubic-bezier(.2, 1.5, .4, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100svh; font-family: var(--font); color: #fff; background: var(--night); line-height: 1.6; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 12px; }
/* 背景（連続正解で、色と動きが段階的に変わる） */
.bg { position: fixed; inset: 0; z-index: -1; background: radial-gradient(120% 80% at 50% 0%, #5a3a9a 0%, var(--night2) 40%, var(--night) 100%); transition: filter .8s; overflow: hidden; }
.bg i { position: absolute; width: 38vmax; height: 38vmax; border-radius: 50%; filter: blur(40px); opacity: .35; animation: blob 16s ease-in-out infinite alternate; }
.bg i:nth-child(1) { left: -10%; top: -10%; background: #ff8fd1; } .bg i:nth-child(2) { right: -12%; top: 20%; background: #7ef0d0; animation-delay: -4s; } .bg i:nth-child(3) { left: 20%; bottom: -20%; background: #9fb6ff; animation-delay: -8s; }
.bg i:nth-child(n+4) { width: 6px; height: 6px; filter: none; opacity: .7; background: #fff; animation: twinkle 3s ease-in-out infinite alternate; } .bg i:nth-child(4) { left: 20%; top: 30%; } .bg i:nth-child(5) { left: 80%; top: 12%; animation-delay: -1s; } .bg i:nth-child(6) { left: 66%; top: 70%; animation-delay: -2s; }
@keyframes blob { to { transform: translate(6%, 8%) scale(1.15); } }
@keyframes twinkle { to { opacity: .2; } }
body.lv1 .bg { filter: hue-rotate(20deg) saturate(1.2); } body.lv1 .bg i { animation-duration: 10s; }
body.lv2 .bg { filter: hue-rotate(-30deg) saturate(1.45) brightness(1.08); } body.lv2 .bg i { animation-duration: 7s; opacity: .5; }
body.lv3 .bg { filter: hue-rotate(60deg) saturate(1.7) brightness(1.15); } body.lv3 .bg i { animation-duration: 4.5s; opacity: .6; }
.app { max-width: 520px; margin: 0 auto; padding: 0 14px; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 900px) { .app { max-width: 560px; } body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,.25), transparent 30%, transparent 70%, rgba(0,0,0,.25)); } }
.hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 0 6px; }
.hd-logo { margin: 0; font-weight: 900; font-size: 14px; letter-spacing: .04em; opacity: .9; } .hd-logo b { color: var(--f2); }
.snd { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 4px 12px; border: 1.5px solid rgba(255,255,255,.3); border-radius: 999px; background: rgba(255,255,255,.08); font-size: 15px; }
.snd small { font-size: 12px; font-weight: 700; }
.screen { display: none; } .screen.is-active { display: block; animation: scrIn .35s ease both; }
@keyframes scrIn { from { opacity: 0; transform: translateY(8px); } }
/* タイトル */
.t-art { position: relative; height: 220px; margin: 4px 0 6px; }
.t-p { position: absolute; width: 46%; } .t-p .person { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 0 rgba(0,0,0,.18)); }
.t-p1 { left: 0; top: 30px; animation: bob 3.2s ease-in-out infinite; } .t-p2 { right: 0; top: 50px; animation: bob 3.2s ease-in-out infinite -1.6s; }
.t-b { position: absolute; top: -26px; margin: 0; padding: 6px 12px; border-radius: 16px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 800; white-space: nowrap; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.t-p1 .t-b { left: 4px; } .t-p2 .t-b { right: 4px; } .t-b b { color: var(--f); }
.t-vs { position: absolute; left: 50%; top: 106px; transform: translateX(-50%) rotate(-6deg); padding: 6px 12px; border-radius: 14px; background: var(--gold); color: var(--ink); font-weight: 900; font-size: 14px; line-height: 1.25; text-align: center; box-shadow: 0 5px 0 rgba(0,0,0,.25); animation: wiggle 2.4s ease-in-out infinite; }
.t-vs b { color: var(--f); font-size: 16px; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes wiggle { 50% { transform: translateX(-50%) rotate(4deg) scale(1.05); } }
.t-h { margin: 0; text-align: center; line-height: 1.15; font-weight: 900; letter-spacing: .02em; } .t-h span { display: block; font-size: clamp(24px, 7.5vw, 32px); } .t-h b { display: block; font-size: clamp(40px, 13vw, 58px); color: var(--f2); text-shadow: 0 4px 0 #6a1f48, 0 0 24px rgba(255,143,209,.45); }
.t-copy { margin: 10px 0 14px; text-align: center; font-weight: 800; font-size: clamp(16px, 4.8vw, 19px); }
.go { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 72px; padding: 10px 16px; border: 0; border-radius: 22px; background: linear-gradient(135deg, var(--f) 0%, #ff6a5c 100%); color: #fff; box-shadow: 0 6px 0 #7a1f45, 0 12px 28px rgba(217,58,120,.4); transition: transform .12s; }
.go b { font-size: 22px; font-weight: 900; letter-spacing: .04em; } .go small { font-size: 12.5px; font-weight: 700; opacity: .9; }
.go:active { transform: translateY(4px); box-shadow: 0 2px 0 #7a1f45; }
.t-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.sub { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; padding: 8px 6px; border: 2px solid rgba(255,255,255,.35); border-radius: 18px; background: rgba(255,255,255,.1); text-align: center; }
.sub b { font-size: 16px; font-weight: 900; } .sub small { font-size: 11.5px; opacity: .85; line-height: 1.4; }
.t-best { margin: 12px 0 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--gold); min-height: 1em; }
.t-how { margin: 8px 0 0; text-align: center; font-size: 12.5px; opacity: .85; } .k { display: inline-block; min-width: 1.8em; padding: 0 6px; border-radius: 6px; background: rgba(255,255,255,.18); font-weight: 900; }
.t-note { margin: 12px 0 0; font-size: 11.5px; opacity: .75; }
/* プレイ */
#s-play.is-active { display: flex; flex-direction: column; min-height: calc(100svh - 64px); padding-bottom: 10px; }
.hud { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 6px 10px; align-items: center; }
.h-time { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.h-lab { font-size: 12px; font-weight: 800; opacity: .85; } .h-time b { font-size: clamp(34px, 11vw, 44px); font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; } .h-unit { font-size: 13px; font-weight: 800; }
.h-bar { flex-basis: 100%; display: block; height: 8px; border-radius: 4px; background: rgba(255,255,255,.18); overflow: hidden; } .h-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--m2), var(--gold)); transform-origin: left; }
body.hurry .h-time b { color: #ffb08a; } body.hurry .h-bar i { background: linear-gradient(90deg, #ff8a5c, #ffd84a); }
.h-combo { grid-row: 1 / span 2; grid-column: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 88px; padding: 6px 10px; border-radius: 18px; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.25); }
.h-combo b { font-size: 38px; font-weight: 900; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; } .h-combo span { font-size: 11px; font-weight: 800; }
.h-combo.pop { animation: comboPop .45s var(--pop); } @keyframes comboPop { 40% { transform: scale(1.25) rotate(-4deg); } }
body.lv2 .h-combo, body.lv3 .h-combo { border-color: var(--gold); box-shadow: 0 0 18px rgba(255,216,74,.5); }
.h-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 800; } .h-side span { opacity: .9; }
.quit { margin-left: auto; min-height: 36px; padding: 2px 12px; border: 1.5px solid rgba(255,255,255,.35); border-radius: 999px; background: transparent; font-size: 12.5px; font-weight: 800; }
.deck { position: relative; flex: 1; display: flex; align-items: center; margin: 10px 0 6px; min-height: 240px; }
.card { position: relative; width: 100%; padding: 16px 16px 22px; border-radius: 26px; background: #fff; color: var(--ink); box-shadow: 0 10px 0 rgba(0,0,0,.18), 0 18px 40px rgba(0,0,0,.25); touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; transition: transform .2s ease; }
.card.drag { transition: none; cursor: grabbing; }
.card.in0 { animation: cardIn .4s var(--pop) both; } .card.in { animation: cardIn .26s var(--pop) both; }
@keyframes cardIn { from { transform: translateY(30px) scale(.92); opacity: 0; } }
.card.out-l { transform: translateX(-120%) rotate(-14deg) !important; opacity: 0; transition: transform .17s ease-in, opacity .17s; } .card.out-r { transform: translateX(120%) rotate(14deg) !important; opacity: 0; transition: transform .17s ease-in, opacity .17s; } .card.out-d { transform: translateY(40px) !important; opacity: 0; transition: .17s; }
.card.good { box-shadow: 0 10px 0 rgba(0,0,0,.18), 0 0 0 4px var(--gold), 0 0 40px rgba(255,216,74,.6); }
.card.bad { animation: shake .32s ease; } @keyframes shake { 25% { transform: translateX(-6px) rotate(-1deg); } 75% { transform: translateX(6px) rotate(1deg); } }
.c-who { display: flex; align-items: center; gap: 10px; }
.c-face { flex: none; width: 64px; height: 68px; border-radius: 18px; background: #f2eefc; overflow: hidden; } .c-face svg { width: 100%; height: 100%; display: block; }
.c-who p { margin: 0; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; } .c-who b { font-size: 16px; } .c-who small { font-size: 12px; color: var(--muted); }
.c-cat { margin-left: auto; align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: #f2eefc; color: #6a4fb3; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.c-line { position: relative; margin: 14px 0 0; padding: 16px 16px; border-radius: 20px; background: #f6f2ff; font-size: clamp(18px, 5.4vw, 22px); font-weight: 800; line-height: 1.6; overflow-wrap: anywhere; }
.c-line::before { content: ''; position: absolute; left: 26px; top: -10px; border: 10px solid transparent; border-top: 0; border-bottom-color: #f6f2ff; }
.stamp { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%) rotate(-12deg) scale(.4); padding: 8px 18px; border: 5px solid currentColor; border-radius: 16px; background: rgba(255,255,255,.92); font-size: 30px; font-weight: 900; opacity: 0; pointer-events: none; white-space: nowrap; }
.stamp.on { animation: stamp .3s var(--pop) forwards; } .stamp.ok { color: var(--m); } .stamp.ng { color: var(--f); }
@keyframes stamp { to { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg) scale(1); } }
.drag-l, .drag-r { position: absolute; top: 14px; padding: 4px 12px; border-radius: 10px; font-weight: 900; font-size: 18px; color: #fff; opacity: 0; pointer-events: none; }
.drag-l { left: 14px; background: var(--m); opacity: var(--dl, 0); } .drag-r { right: 14px; background: var(--f); opacity: var(--dr, 0); }
.fb { min-height: 3.2em; margin: 4px 2px 8px; padding: 6px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; background: rgba(255,255,255,.08); }
.fb:empty { background: transparent; } .fb.ok { background: rgba(126,240,208,.16); } .fb.ng { background: rgba(255,143,209,.16); }
.fb b { margin-right: 4px; }
.judge { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.j { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 92px; border: 0; border-radius: 24px; color: #fff; transition: transform .1s; touch-action: manipulation; }
.j b { font-size: clamp(20px, 6vw, 24px); font-weight: 900; } .ji { font-size: 26px; line-height: 1; } .j small { font-size: 11px; font-weight: 800; opacity: .8; }
.j-m { background: linear-gradient(160deg, #2cc8a4, var(--m)); box-shadow: 0 6px 0 #0d6a56; } .j-f { background: linear-gradient(160deg, #ff5f9a, var(--f)); box-shadow: 0 6px 0 #7a1f45; }
.j:active, .j.kp { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
@media (hover: none) { .j small { display: none; } }
.fx { position: fixed; left: 50%; top: 45%; width: 0; height: 0; z-index: 30; pointer-events: none; }
.fx i { position: absolute; width: 12px; height: 12px; border-radius: 3px; animation: spark .7s ease-out forwards; }
@keyframes spark { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--x), var(--y)) scale(.3) rotate(200deg); opacity: 0; } }
.oops { position: absolute; left: -80px; top: -150px; width: 160px; text-align: center; font-size: 24px; font-weight: 900; color: #fff; text-shadow: 0 3px 0 #7a1f45; animation: oops .9s ease forwards; }
@keyframes oops { 0% { transform: translateY(10px); opacity: 0; } 20% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.banner { position: absolute; left: -150px; top: -230px; width: 300px; padding: 8px 0; border-radius: 999px; text-align: center; background: var(--gold); color: var(--ink); font-size: 20px; font-weight: 900; box-shadow: 0 5px 0 rgba(0,0,0,.25); animation: banner 1.3s var(--pop) forwards; }
@keyframes banner { 0% { transform: scale(.4) rotate(-6deg); opacity: 0; } 15% { transform: scale(1.08) rotate(-3deg); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px) rotate(-3deg); } }
/* 結果 */
#s-result.is-active { padding-bottom: 20px; }
.rcard { --tc: #6a4fb3; position: relative; margin: 6px 0 0; padding: 18px 18px 16px; border-radius: 28px; background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 10px 0 rgba(0,0,0,.2); overflow: hidden; }
.rcard::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--tc); }
.rcard.in { animation: rIn .7s var(--pop) both; } @keyframes rIn { from { transform: translateY(40px) scale(.85) rotate(-3deg); opacity: 0; } }
.r-game { margin: 4px 0 0; font-size: 15px; font-weight: 900; } .r-game small { display: block; font-size: 12px; color: var(--muted); }
.r-art { position: relative; width: 150px; height: 150px; margin: 6px auto 0; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tc) 30%, #fff) 0%, #fff 70%); }
.r-you svg { width: 150px; height: 150px; display: block; } .rcard.in .r-art { animation: rArt .9s var(--pop) .2s both; } @keyframes rArt { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.r-k { margin: 6px 0 0; font-size: 12px; font-weight: 800; color: var(--muted); }
.r-title { margin: 2px 0 0; font-size: clamp(24px, 7.4vw, 32px); font-weight: 900; line-height: 1.3; color: var(--tc); outline: none; }
.rcard.in .r-title { animation: rTitle .6s var(--pop) .45s both; } @keyframes rTitle { from { transform: scale(1.6); opacity: 0; letter-spacing: .3em; } }
.r-line { margin: 6px 0 0; font-size: 14px; color: #4a4458; }
.r-score { margin: 10px 0 0; } .r-score b { display: block; font-size: 44px; font-weight: 900; line-height: 1.1; } .r-score span { font-size: 13px; font-weight: 800; color: var(--muted); }
.r-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; } .r-stats li { padding: 6px 2px; border-radius: 12px; background: #f2eefc; font-size: 11px; font-weight: 700; color: var(--muted); } .r-stats b { display: block; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.r-com { margin: 10px 0 0; padding: 0; list-style: none; font-size: 13.5px; font-weight: 700; color: #6a4fb3; } .r-com li { margin: 2px 0; }
.r-best { margin: 6px 0 0; font-size: 13px; font-weight: 900; color: var(--f); min-height: 1em; }
.r-url { display: inline-block; margin: 8px 0 0; padding: 4px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 800; }
.r-note { margin: 6px 0 0; font-size: 11px; color: var(--muted); }
.share, .again { margin-top: 14px; display: grid; gap: 10px; }
.btn { min-height: 52px; padding: 8px 12px; border: 2px solid rgba(255,255,255,.4); border-radius: 16px; background: rgba(255,255,255,.12); font-weight: 800; font-size: 14.5px; }
.btn.x { min-height: 58px; border: 0; background: #000; font-size: 17px; box-shadow: 0 5px 0 rgba(0,0,0,.35); }
.share2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.s-help { margin: 0; font-size: 12px; opacity: .8; }
.link { min-height: 44px; border: 0; background: none; text-decoration: underline; text-underline-offset: 4px; font-weight: 700; font-size: 13.5px; opacity: .9; }
.again .t-sub { margin: 0; }
.review { margin-top: 18px; padding: 14px; border-radius: 20px; background: rgba(255,255,255,.08); } .review h3 { margin: 0 0 8px; font-size: 16px; } .review:has(ol:empty) { display: none; }
.review ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.review li { display: flex; gap: 8px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.08); } .rv-m { flex: none; } .review p { margin: 0; } .rv-t { font-weight: 800; font-size: 14px; } .rv-a { font-size: 12.5px; opacity: .9; } .rv-c { margin-left: 6px; opacity: .7; } .rv-w { font-size: 12.5px; color: var(--m2); }
.review li.ng .rv-w { color: var(--f2); }
.ft { margin: 26px 0 0; padding: 14px 0 24px; border-top: 1px solid rgba(255,255,255,.15); font-size: 11.5px; opacity: .8; } .ft p { margin: 0 0 6px; } .ft .link { min-height: 32px; font-size: 11.5px; padding: 0; }
body[data-screen="s-play"] .ft { display: none; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40; max-width: calc(100% - 32px); margin: 0; padding: 10px 18px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 800; transform: translate(-50%, 180%); opacity: 0; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.toast.show { animation: toast 2.6s var(--pop) both; } @keyframes toast { 10%, 85% { transform: translate(-50%, 0); opacity: 1; } }
.nojs { padding: 20px; text-align: center; }
@media (max-height: 680px) { .card { padding: 12px 14px 16px; } .c-line { margin-top: 10px; padding: 12px 14px; font-size: 17px; } .j { min-height: 76px; } .deck { min-height: 200px; } .c-face { width: 52px; height: 56px; } }
/* 動きを減らす：飛ぶ・揺れる・粒は止めて、色と文字の変化だけにする */
html.rm *, html.rm *::before, html.rm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
html.rm .stamp.on { opacity: 1; transform: translate(-50%, -50%) rotate(-12deg); }
html.rm .bg i { animation: none; } html.rm .card.bad { animation: none; }
.r-stats.three { grid-template-columns: repeat(3, 1fr); } .r-stats.three b { font-size: 14px; }
.go b { line-height: 1.3; }
.t-p { width: min(46%, 180px); } .t-p1 { left: max(0px, calc(50% - 200px)); } .t-p2 { right: max(0px, calc(50% - 200px)); }
.t-p2 .t-b { top: -12px; }
@media (max-width: 360px) { .t-b { font-size: 11.5px; padding: 5px 9px; } .t-art { height: 200px; } }
.r-title { font-size: clamp(22px, 6.6vw, 32px); }
@media (min-width: 420px) { .t-art { height: 252px; } }
.t-art, html .t-art { height: calc(58px + min(46vw - 13px, 180px) * 1.08); }
