/* ---------- ガチャ ---------- */
.draw-layer {
  position: fixed; inset: 0;
  background: #07081a;
  z-index: 20;
  display: flex; flex-direction: column; align-items: center;
  padding: env(safe-area-inset-top, 0px) 16px env(safe-area-inset-bottom, 0px);
  overflow: hidden;
}
.draw-inner { width: 100%; max-width: 440px; height: 100%; display: flex; flex-direction: column; gap: 10px; padding-block: 12px 16px; position: relative; }
.draw-head { display: flex; justify-content: space-between; align-items: baseline; }
.draw-kind { font-family: var(--f-disp); font-size: 22px; letter-spacing: 0.04em; }
.draw-age { font-family: var(--f-disp); font-size: 22px; color: var(--sub); }
.draw-rates { font-size: 13px; color: var(--sub); display: flex; gap: 12px; flex-wrap: wrap; }
.draw-rates b { font-weight: 400; }
.stage { position: relative; flex: 1; min-height: 0; border: 3px solid #000; box-shadow: inset 0 0 0 2px #2a2e5a; overflow: hidden; }
.stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
.stage.shake { animation: shake .35s steps(6) 1; }
@keyframes shake { 0%,100% { transform: translate(0,0); } 20% { transform: translate(-6px,3px); } 40% { transform: translate(5px,-4px); } 60% { transform: translate(-4px,-2px); } 80% { transform: translate(3px,4px); } }
.env-wrap {
  position: absolute; left: 50%; top: 50%;
  width: 160px; height: 240px;
  transform: translate(-50%, -54%) scale(0.2);
  opacity: 0;
  transition: transform .45s cubic-bezier(.2,1.4,.4,1), opacity .2s;
  cursor: pointer;
}
.env-wrap.in { transform: translate(-50%, -54%) scale(1); opacity: 1; }
.env-wrap.wobble { animation: wobble 1.1s ease-in-out infinite; }
@keyframes wobble { 0%,100% { rotate: 0deg; } 25% { rotate: -2deg; } 75% { rotate: 2deg; } }
.env-wrap canvas { width: 160px; height: 240px; position: relative; z-index: 2; }
.env-glow {
  position: absolute; inset: -40px; z-index: 1;
  background: radial-gradient(closest-side, var(--glow, #ffffff) 0%, transparent 72%);
  opacity: .55;
  animation: pulse 1.2s ease-in-out infinite;
}
.env-glow.SSR { background: conic-gradient(from 0deg, #ff6a8a, #ffb44a, #ffe66a, #6ae0a0, #5ab4ff, #b07aff, #ff6a8a); filter: blur(22px); opacity: .8; animation: spin 2.4s linear infinite; border-radius: 50%; }
@keyframes pulse { 0%,100% { transform: scale(.92); opacity: .45; } 50% { transform: scale(1.06); opacity: .8; } }
@keyframes spin { to { transform: rotate(360deg); } }
.env-label {
  position: absolute; z-index: 3;
  left: 50%; top: 80px; transform: translateX(-50%);
  writing-mode: vertical-rl;
  font-family: var(--f-doc); font-weight: 800;
  font-size: 32px; letter-spacing: 0.22em;
  white-space: nowrap; display: flex; flex-direction: row; align-items: center;
  color: var(--ink);
  pointer-events: none;
}
.env-label small { font-size: 14px; letter-spacing: 0.08em; margin-top: 8px; color: var(--shu); font-weight: 700; }
.env-wrap.light .env-label { color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.25); }
.env-wrap.light .env-label small { color: #fff; }
.seal {
  position: absolute; z-index: 4;
  right: -18px; bottom: 26px;
  width: 78px; height: 78px;
  border: 5px solid var(--shu);
  color: var(--shu);
  font-family: var(--f-doc); font-weight: 800;
  font-size: 25px; line-height: 1;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; place-items: center;
  padding: 4px;
  background: rgba(255,240,230,.12);
  transform: rotate(-12deg) scale(3);
  opacity: 0;
  filter: url(#rough);
  pointer-events: none;
}
.seal.on { animation: slam .32s cubic-bezier(.3,1.6,.5,1) forwards; }
@keyframes slam { 0% { opacity: 0; transform: rotate(-12deg) scale(3); } 70% { opacity: 1; transform: rotate(-12deg) scale(.9); } 100% { opacity: .95; transform: rotate(-12deg) scale(1); } }
.caption {
  position: absolute; left: 0; right: 0; bottom: 10px; z-index: 5;
  margin: 0; text-align: center;
  font-size: 15px;
  text-shadow: 0 2px 0 #000;
  min-height: 1.6em;
}
.caption b { font-weight: 400; color: var(--sr-l); }
.tap-hint {
  position: absolute; left: 0; right: 0; top: 12px; z-index: 5; margin: 0; text-align: center;
  font-size: 15px; color: #fff; text-shadow: 0 2px 0 #000;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: .2; } }
.flash { position: fixed; inset: 0; z-index: 40; pointer-events: none; background: #fff; opacity: 0; }
.flash.go { animation: flash .5s ease-out 1; }
.flash.rainbow { background: var(--ssr); }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }

