/* 今日の勾玉占い */
:root {
  --bg: #f6efe2; --paper: #fffaf1; --ink: #3b2f25; --muted: #8a7864; --line: #e2d5bf;
  --accent: #b5452f; --gold: #c9a227;
  --N: #7a7a7a; --R: #3a7bd5; --SR: #9b4dca; --SSR: #d4a017; --LR: #e0457b;
  --font: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg) radial-gradient(circle at 20% 0%, #fff6e0 0, transparent 50%);
  color: var(--ink); font-family: var(--font); line-height: 1.7; min-height: 100vh;
}
.wrap { max-width: 520px; margin: 0 auto; padding: 56px 16px 48px; } /* 上は BGM ボタンと重ならない余白 */
.screen { display: none; text-align: center; animation: fade .35s ease; }
.screen.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.eyebrow { color: var(--muted); letter-spacing: .2em; font-size: 14px; margin: 0 0 8px; }
.title { font-size: 40px; margin: 0 0 8px; letter-spacing: .08em; }
.title span { color: var(--accent); }
.top-art { display: flex; justify-content: center; gap: 4px; margin: 12px 0; }
.top-art svg { animation: bob 3s ease-in-out infinite; }
.top-art svg:nth-child(2) { animation-delay: .4s; }
.top-art svg:nth-child(3) { animation-delay: .8s; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
.lead { margin: 8px 0 24px; }
.note { color: var(--muted); font-size: 12px; margin-top: 20px; }

.btn {
  display: inline-block; font: inherit; font-weight: 700; border-radius: 999px; padding: 14px 28px;
  border: 2px solid transparent; cursor: pointer; text-decoration: none; min-width: 200px;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 #7d2d1e; }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #7d2d1e; }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn-x { background: #111; color: #fff; }
.btn-ghost { background: none; color: var(--muted); min-width: 0; padding: 8px 12px; margin-top: 16px; font-weight: 400; }
.btn-ghost[hidden] { display: none; }

.progress { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.bar { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.q-text { font-size: 24px; margin: 28px 0 20px; min-height: 2.8em; }
.choices { display: grid; gap: 12px; }
.choice {
  font: inherit; font-size: 17px; text-align: left; padding: 16px 18px; border-radius: 14px;
  background: var(--paper); border: 2px solid var(--line); color: var(--ink); cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.choice:hover { border-color: var(--accent); }
.choice:active { transform: scale(.98); }
.choice:disabled { opacity: .6; cursor: default; }

/* 占い中の演出 */
.reveal { padding-top: 80px; }
.reveal-orb {
  width: 140px; height: 140px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--gold) 60%, #8a6a10);
  animation: spin 1s linear infinite, glow 1s ease-in-out infinite alternate;
}
.reveal-text { font-size: 22px; margin-top: 28px; letter-spacing: .1em; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { from { box-shadow: 0 0 10px var(--gold); } to { box-shadow: 0 0 50px var(--gold); } }
.reveal.r-SR .reveal-orb { background: radial-gradient(circle at 35% 30%, #fff, var(--SR) 60%, #4b1f6b); }
.reveal.r-SSR .reveal-orb { background: conic-gradient(#ffd700, #fff3a0, #d4a017, #fff3a0, #ffd700); animation-duration: .5s, .3s; }
.reveal.r-LR .reveal-orb { background: conic-gradient(red, orange, yellow, lime, cyan, blue, violet, red); animation-duration: .35s, .2s; }
.reveal.r-LR { background: radial-gradient(circle, rgba(255,255,255,.9), transparent 70%); }
.reveal.r-LR .reveal-text { color: var(--LR); font-weight: 800; animation: shake .15s infinite; }
@keyframes shake { 50% { transform: translateX(3px); } }

/* 結果 */
.r-art svg { width: min(240px, 60vw); height: auto; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.2) rotate(-30deg); opacity: 0; } }
.rarity { display: inline-block; font-size: 28px; font-weight: 800; letter-spacing: .1em; padding: 2px 18px; border-radius: 8px; color: #fff; margin: 4px 0; font-family: sans-serif; }
.rarity.N { background: var(--N); } .rarity.R { background: var(--R); } .rarity.SR { background: var(--SR); }
.rarity.SSR { background: linear-gradient(90deg, #b8860b, #ffd700, #b8860b); }
.rarity.LR { background: linear-gradient(90deg, red, orange, gold, limegreen, deepskyblue, violet); }
.r-name { font-size: 32px; margin: 4px 0; }
.r-rate { color: var(--muted); margin: 0; }
.r-oneliner { font-size: 18px; font-weight: 700; margin: 16px 0; }
.r-detail { text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 0 0 20px; }
.r-detail dt { font-size: 13px; color: var(--accent); font-weight: 700; }
.r-detail dd { margin: 0 0 10px; }
.r-detail dd:last-child { margin-bottom: 0; }
.actions { display: grid; gap: 12px; justify-items: center; }
.credit { font-size: 12px; color: var(--muted); }

.sound-toggle {
  position: fixed; top: 10px; right: 10px; z-index: 10; font: inherit; font-size: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--ink); cursor: pointer;
}
.sound-toggle[aria-pressed="false"] { color: var(--muted); }
