/* 余白と文字は黄金比（約1.618）の段階: 8 → 13 → 21 → 34 → 55px（DLsiteガチャと同じ作り） */
:root { --s1: 8px; --s2: 13px; --s3: 21px; --s4: 34px; --s5: 55px; --bg: #1a1020; --card: #2c1a33; --text: #f7f0f5; --sub: #c9b6c6; --accent: #ff8fb8; --line: #6b4a66; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0 auto; max-width: 34rem; padding: var(--s3); font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.618; }
a { color: var(--accent); }
header { display: flex; align-items: center; gap: var(--s1); font-size: 1.272rem; }
h2 { font-size: 1.272rem; margin: var(--s5) 0 var(--s2); }
h3 { font-size: 1.272rem; margin: 0; line-height: 1.4; }
.small { font-size: .786rem; color: var(--sub); }
.pr { border: 1px solid; border-radius: 4px; padding: 0 6px; font-size: .786rem; }
#sound { margin-left: auto; min-height: 44px; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--sub); font: inherit; font-size: .786rem; cursor: pointer; }
#sound[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.step { display: block; margin: var(--s3) 0 var(--s2); font-weight: 700; }
/* カップの選択。スマホでは横にスクロール */
.chips { display: flex; gap: var(--s1); overflow-x: auto; padding-bottom: var(--s1); scrollbar-width: thin; }
.chip { flex: none; min-height: 44px; padding: 0 var(--s2); border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--text); font: inherit; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #2a1020; font-weight: 700; }
#count { text-align: center; color: var(--sub); margin: 0 0 var(--s2); }
/* ガチャマシン（DLsiteガチャの絵と動きを色違いで流用） */
#stage { width: min(200px, 55vw); margin: var(--s2) auto; filter: drop-shadow(0 0 28px #ff6fa955); }
#stage svg { display: block; width: 100%; height: auto; }
.knob, .ball { transform-box: fill-box; transform-origin: center; }
.drop { opacity: 0; }
.dropped .drop { opacity: 1; }
.spinning .knob { animation: turn .9s cubic-bezier(.5, 0, .3, 1); }
.spinning .ball { animation: tumble .4s ease-in-out var(--d) 2; }
.spinning svg { animation: rumble .2s linear 4; }
.spinning .drop { animation: fall .7s ease-in .8s both; }
.quick .knob { animation-duration: .5s; }
.quick .ball { animation-duration: .3s; animation-iteration-count: 1; }
.quick svg { animation-iteration-count: 2; }
.quick .drop { animation-duration: .4s; animation-delay: .25s; }
#result article { animation: pop .4s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes tumble { 50% { transform: translate(6px, -24px) rotate(140deg); } }
@keyframes rumble { 25% { transform: translateX(-3px) rotate(-.6deg); } 75% { transform: translateX(3px) rotate(.6deg); } }
@keyframes fall { 0% { transform: translateY(-60px); opacity: 0; } 20% { opacity: 1; } 60% { transform: translateY(0); } 78% { transform: translateY(-9px); } 100% { transform: translateY(0); opacity: 1; } }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #stage *, #result article { animation: none !important; } }
#spin { display: block; width: 100%; min-height: var(--s5); border: 0; border-radius: 999px; background: var(--accent); color: #2a1020; font-size: 1.272rem; font-weight: 700; cursor: pointer; }
#spin:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 3px solid #8fd3ff; outline-offset: 2px; }
/* 結果カード。画像は縦横比を変えない（トリミングもしない） */
article { background: var(--card); border: 2px solid var(--accent); border-radius: var(--s2); padding: var(--s3); margin-top: var(--s3); }
article p { margin: 0; color: var(--sub); }
article .spec { color: var(--text); margin: var(--s1) 0 var(--s2); }
article .label { font-size: .786rem; margin-top: var(--s2); }
article img { display: block; max-width: 100%; height: auto; margin: var(--s1) auto 0; border-radius: 4px; }
article .title { font-size: .786rem; margin-top: 4px; overflow-wrap: anywhere; }
.subs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.noimg { display: grid; place-items: center; height: 120px; margin-top: var(--s1); border: 1px dashed var(--line); border-radius: 4px; color: var(--sub); }
.buy { display: block; text-align: center; padding: var(--s2); margin-top: var(--s3); border-radius: var(--s1); border: 1px solid var(--accent); text-decoration: none; }
.share { display: block; text-align: center; padding: var(--s2); margin-top: var(--s1); color: var(--sub); }
details { margin-top: var(--s4); }
summary { cursor: pointer; font-weight: 700; padding: var(--s2) 0; }
#history { padding-left: 1.5em; }
.link { background: none; border: 0; padding: 4px 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; text-align: left; }
.guide dt { font-weight: 700; margin-top: var(--s2); color: var(--accent); }
.guide dd { margin: 0; }
footer { margin-top: var(--s5); }
footer h2 { font-size: 1rem; margin: var(--s3) 0 var(--s1); }
#gate { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); text-align: center; padding: var(--s3); }
#gate h1 { font-size: 1.618rem; margin: 0 0 var(--s3); }
#gate .spins { display: grid; grid-template-columns: 1fr 1.618fr; gap: var(--s2); margin-top: var(--s4); }
#no { display: grid; place-items: center; min-height: var(--s5); border: 1px solid var(--line); border-radius: 999px; color: var(--sub); text-decoration: none; }
#yes { min-height: var(--s5); border: 0; border-radius: 999px; background: var(--accent); color: #2a1020; font-size: 1rem; font-weight: 700; cursor: pointer; }
