/* 全部大吉おみくじ。枠は game-ui.css の共通UI。ここにあるのはゲームの中身だけ */
a.g-icon-btn, a.g-btn { text-decoration: none; }
.omi-a { display: flex; align-items: center; justify-content: center; }

/* 遊ぶ画面: スマホ縦の1画面に収める */
.omi-play { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding-bottom: .5rem; overflow: hidden; }
.omi-play .g-dots > i { width: 12px; height: 12px; transition: background-color 200ms, transform 300ms var(--spring-fast); }
.omi-play .g-dots > i.now { background: var(--primary-container); transform: scale(1.25); }
.omi-play .g-dots > i.done { background: var(--primary); }
.omi-ask, .omi-shake { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }

/* 質問 */
.omi-q { margin: .5rem 0 1.25rem; text-align: center; font-size: clamp(1.5rem, 7vw, 1.875rem); font-weight: 900; line-height: 1.3; color: var(--on-surface); }
.omi-q.enter { animation: omi-in 340ms var(--spring) both; }
.omi-opts { flex: 1 1 auto; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: .625rem; max-height: 400px; }
.omi-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  min-height: 0; padding: .75rem .5rem; border: 0; border-radius: var(--r-xl); cursor: pointer; font-family: inherit;
  background: var(--secondary-container); color: var(--on-secondary-container);
  font-size: 1.0625rem; font-weight: 800; line-height: 1.3;
  transition: border-radius 300ms var(--emph), transform 300ms var(--spring-fast), background-color 160ms;
}
.omi-opt .icon { font-size: 36px; }
.omi-opt:active { border-radius: var(--r-l); transform: scale(.96); }
.omi-opt.on { background: var(--primary); color: var(--on-primary); border-radius: var(--r-l); }
.omi-opts.enter .omi-opt { animation: omi-in 360ms var(--spring) both; }
.omi-opts.enter .omi-opt:nth-child(2) { animation-delay: 40ms; }
.omi-opts.enter .omi-opt:nth-child(3) { animation-delay: 80ms; }
.omi-opts.enter .omi-opt:nth-child(4) { animation-delay: 120ms; }
@keyframes omi-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* 筒 */
.omi-msg { margin: .25rem 0 0; text-align: center; font-size: 1.25rem; font-weight: 900; color: var(--on-surface); }
.omi-stage { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 220px; padding-top: 5.5rem; }
.omi-box {
  position: relative; width: 132px; height: 230px; padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 50% 85%; -webkit-tap-highlight-color: transparent;
}
.omi-body {
  position: absolute; left: 0; right: 0; top: 30px; bottom: 0; border-radius: 20px 20px 28px 28px;
  background: var(--primary); color: var(--on-primary); z-index: 2;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset -18px 0 0 color-mix(in srgb, var(--on-primary) 10%, transparent), inset 18px 0 0 color-mix(in srgb, var(--on-primary-container) 14%, transparent);
}
.omi-body-label {
  writing-mode: vertical-rl; font-size: 1.75rem; font-weight: 900; letter-spacing: .2em;
  padding: .75rem .375rem; border-radius: var(--r-s); background: var(--primary-container); color: var(--on-primary-container);
}
.omi-cap {
  position: absolute; left: 0; right: 0; top: 14px; height: 34px; border-radius: 50%; z-index: 3;
  background: var(--primary-container);
}
.omi-cap::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 12px; margin: -6px 0 0 -11px;
  border-radius: 50%; background: var(--on-primary-container);
}
.omi-stick {
  position: absolute; left: 50%; top: 22px; width: 26px; height: 150px; margin-left: -13px; z-index: 1;
  border-radius: 6px 6px 3px 3px; background: var(--tertiary-container); color: var(--on-tertiary-container);
  display: flex; justify-content: center; padding-top: 8px; transform: translateY(40px); opacity: 0;
}
.omi-stick b { writing-mode: vertical-rl; font-size: .8125rem; font-weight: 900; letter-spacing: .05em; }
.omi-box.out .omi-stick { opacity: 1; transform: translateY(-112px); transition: transform 520ms var(--spring-fast), opacity 80ms; }
.omi-box.shake { animation: omi-shake 380ms cubic-bezier(.36, .07, .19, .97); }
@keyframes omi-shake {
  0%, 100% { transform: none; }
  20% { transform: translate(-10px, -6px) rotate(-14deg); }
  45% { transform: translate(10px, -10px) rotate(13deg); }
  70% { transform: translate(-6px, -4px) rotate(-7deg); }
  88% { transform: translate(3px, 0) rotate(3deg); }
}
.omi-box.hint { animation: omi-hint 1600ms var(--emph) 600ms 2; }
@keyframes omi-hint { 0%, 30%, 100% { transform: none; } 10% { transform: rotate(-6deg); } 20% { transform: rotate(6deg); } }
.omi-shake .g-dots { margin: .5rem 0 .75rem; }
.omi-go { width: 100%; margin-bottom: .25rem; font-weight: 900; font-size: 1.125rem; }

.omi-foot { display: flex; align-items: center; justify-content: space-between; }
.omi-sound { width: 40px; height: 40px; }

/* おみくじの紙（結果・結果ページ共通） */
.omi-slip {
  display: flex; gap: .875rem; align-items: stretch; padding: .875rem; margin-bottom: .75rem;
  border-radius: var(--r-xl); background: var(--primary-container); color: var(--on-primary-container);
}
.omi-band {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem;
  width: 5.5rem; padding: .875rem .25rem; border-radius: var(--r-l); background: var(--primary); color: var(--on-primary);
}
.omi-band small { font-size: .75rem; font-weight: 800; opacity: .88; white-space: nowrap; }
.omi-band strong { writing-mode: vertical-rl; font-size: 3.5rem; font-weight: 900; line-height: 1; letter-spacing: .02em; }
.omi-head { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.omi-head small { font-size: .75rem; font-weight: 800; color: var(--primary); }
.omi-head h2 { margin: .25rem 0 0; font-size: clamp(1.375rem, 6.4vw, 1.75rem); font-weight: 900; line-height: 1.3; }
.omi-w { display: inline-block; }
.omi-slip.land { animation: omi-land 520ms var(--spring) both; }
@keyframes omi-land { from { transform: scale(.9) translateY(12px); opacity: 0; } }

.omi-rows { margin: 0 0 .5rem; padding: .25rem 1rem; border-radius: var(--r-xl); background: var(--surface-container); }
.omi-row { display: flex; gap: .625rem; padding: .625rem 0; }
.omi-row + .omi-row { border-top: 1px solid var(--outline-variant); }
.omi-row dt { flex: 0 0 4.25rem; font-size: .8125rem; font-weight: 900; color: var(--primary); line-height: 1.6; }
.omi-row dd { margin: 0; font-size: .9375rem; font-weight: 600; line-height: 1.6; color: var(--on-surface); }
.omi-row.me { margin: .25rem -.5rem; padding: .625rem .5rem; border-radius: var(--r-l); background: var(--tertiary-container); }
.omi-row.me + .omi-row { border-top: 0; }
.omi-row.me dt, .omi-row.me dd { color: var(--on-tertiary-container); }
.omi-all { margin: 0 0 .75rem; text-align: center; font-size: .8125rem; font-weight: 800; color: var(--on-surface-variant); }

.omi-card { text-align: center; }
.omi-sub { margin: .5rem 0 0; }
.omi-sub .icon { font-size: 20px; }
/* 広告はボタンから離す（誤タップさせない） */
.omi-ad { margin: 3rem auto 1rem; text-align: center; }
.omi-ad small { display: block; margin-bottom: .25rem; font-size: 11px; color: var(--on-surface-variant); }
.omi-ad iframe { display: block; margin: 0 auto; border: 0; max-width: 100%; }

/* 引いた瞬間: 押した場所から色が広がり、大吉が落ちてくる */
.omi-reveal {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  background: var(--primary); color: var(--on-primary); cursor: pointer; text-align: center; padding: 1rem;
  clip-path: circle(0 at var(--x, 50%) var(--y, 50%)); animation: omi-open 620ms cubic-bezier(.2, 0, 0, 1) forwards;
}
.omi-reveal.out { animation: omi-fade 280ms ease forwards; }
.omi-reveal small { font-size: 1.25rem; font-weight: 800; opacity: .9; }
.omi-reveal strong { writing-mode: vertical-rl; font-size: clamp(6.5rem, 34vw, 9.5rem); font-weight: 900; line-height: 1; opacity: 0; }
.omi-reveal strong.on { animation: omi-drop 560ms var(--spring-fast) 380ms forwards; }
.omi-reveal span { font-size: .9375rem; font-weight: 800; opacity: 0; }
.omi-reveal span.on { animation: omi-show 300ms ease 1100ms forwards; }
@keyframes omi-open { to { clip-path: circle(150vmax at var(--x, 50%) var(--y, 50%)); } }
@keyframes omi-fade { from { clip-path: none; opacity: 1; } to { clip-path: none; opacity: 0; } }
@keyframes omi-drop { from { opacity: 0; transform: scale(1.7) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes omi-show { to { opacity: .9; } }

/* 背の低い画面 */
@media (max-height: 640px) {
  .omi-play .g-header { min-height: 3.25rem; padding: .25rem 0; }
  .omi-q { margin: .25rem 0 .75rem; font-size: 1.375rem; }
  .omi-opt .icon { font-size: 28px; }
  .omi-opt { font-size: 1rem; gap: .25rem; }
  .omi-stage { min-height: 200px; padding-top: 4.5rem; }
  .omi-box { transform: scale(.85); }
  .omi-box.shake { animation-name: omi-shake-s; }
  @keyframes omi-shake-s {
    0%, 100% { transform: scale(.85); }
    20% { transform: scale(.85) translate(-10px, -6px) rotate(-14deg); }
    45% { transform: scale(.85) translate(10px, -10px) rotate(13deg); }
    70% { transform: scale(.85) translate(-6px, -4px) rotate(-7deg); }
  }
  .omi-box.hint { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .omi-box.shake, .omi-box.hint, .omi-q.enter, .omi-opts.enter .omi-opt, .omi-slip.land { animation: none; }
  .omi-reveal { animation: none; clip-path: none; }
  .omi-reveal strong.on, .omi-reveal span.on { animation: none; opacity: 1; }
}
