.gacha-toolbar-btn[hidden], .gacha-dialog [hidden] { display: none !important; }
.mobile-layout .gacha-toolbar-btn { position: absolute; top: 48px; right: 0; }
.gacha-dialog {
  box-sizing: border-box; width: min(1100px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 24px; overflow: auto; color: #eee5d4; background: radial-gradient(ellipse at top, #342844, #141019 65%);
  border: 1px solid #bba575; border-radius: 16px; box-shadow: 0 24px 90px #000c; font-family: inherit;
}
.gacha-dialog::backdrop { background: #070510cb; backdrop-filter: blur(5px); }
.gacha-dialog header, .gacha-result-heading { display: flex; align-items: center; gap: 12px; }
.gacha-result-heading { position: sticky; top: -14px; z-index: 2; padding: 8px 0; background: #1a1320; }
.gacha-dialog header > div { flex: 1; }
.gacha-dialog h2, .gacha-dialog h3 { margin: 4px 0 10px; color: #f7dfa5; }
.gacha-dialog small { color: #cbb995; }
.gacha-dialog button { min-height: 44px; padding: 10px 14px; color: #fff0c7; border: 1px solid #8d795c; border-radius: 8px; background: #312639; font: inherit; cursor: pointer; touch-action: manipulation; }
.gacha-dialog button:hover { background: #57405f; }
.gacha-dialog button:disabled { opacity: .5; cursor: wait; }
.gacha-dialog button:focus-visible, .gacha-dialog summary:focus-visible { outline: 2px solid #ffe3a6; outline-offset: 3px; }
.gacha-notice { padding: 10px 14px; border-left: 3px solid #e6bd69; background: #ffe0a00b; color: #f5d998; }
.gacha-pools { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 3px 20px; overscroll-behavior: contain; }
.gacha-pool { flex: 0 0 310px; box-sizing: border-box; padding: 20px; background: linear-gradient(155deg, #302b45, #19151f); border: 1px solid #736286; border-radius: 14px; scroll-snap-align: start; display: flex; flex-direction: column; }
.gacha-pool-gold { border-color: #ba945c; background: linear-gradient(155deg, #403224, #19151f); }
.gacha-pool > p { min-height: 3.5em; line-height: 1.65; color: #cdbed4; }
.gacha-pool-art { height: 145px; display: grid; place-items: center; background: radial-gradient(circle, #c0a1ee30, transparent 70%); }
.gacha-pool-art svg { width: 110px; height: 110px; filter: drop-shadow(0 0 16px #ae92d963); }
.gacha-pool details { margin: 6px 0 18px; }
.gacha-pool summary { cursor: pointer; padding: 10px 0; color: #e7d4a3; }
.gacha-pool ul { list-style: none; padding: 0; max-height: 280px; overflow-y: auto; }
.gacha-pool li { display: flex; gap: 8px; align-items: center; border-top: 1px solid #ffffff16; padding: 10px 0; font-size: 12px; }
.gacha-pool li svg { width: 30px; height: 30px; flex-shrink: 0; }
.gacha-pool li span { flex: 1; }
.gacha-pool li small { display: block; line-height: 1.5; margin-top: 4px; }
.gacha-bonus { margin-top: auto; font-size: 13px; padding: 12px 0; color: #f2cf80; }
.gacha-draw-buttons { display: flex; flex-direction: column; gap: 8px; }
.gacha-draw-buttons [data-ten] { background: #685035; border-color: #c1a26a; }
.gacha-confirm { border: 2px solid #f0b964; border-radius: 10px; padding: 20px; background: #33251c; margin-top: 16px; }
.gacha-confirm p { line-height: 1.8; }
.gacha-confirm button { margin: 4px; }
.gacha-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin: 22px 0; }
.gacha-card { height: 215px; perspective: 850px; }
.gacha-card-inner { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform .45s ease; }
.gacha-card.revealed .gacha-card-inner { transform: rotateY(180deg); }
.gacha-card-back, .gacha-card-front { box-sizing: border-box; position: absolute; inset: 0; border: 1px solid #9b83b4; border-radius: 12px; backface-visibility: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 14px; gap: 10px; text-align: center; }
.gacha-card-back { font-size: 58px; color: #d1b687; background: repeating-linear-gradient(45deg, #30243a, #30243a 10px, #3b2b46 10px, #3b2b46 12px); }
.gacha-card-front { background: #211b2d; transform: rotateY(180deg); }
.gacha-card-front svg { width: 64px; height: 64px; }
.gacha-card-front strong { font-size: 14px; overflow-wrap: anywhere; }
.gacha-card-front small { font-size: 12px; }
.revealed .gacha-glow { border-color: #ffcd71; animation: gacha-rarity-glow 1.2s ease-in-out infinite alternate; }
.gacha-no-motion .gacha-card-inner { transition: none; }
@keyframes gacha-rarity-glow { from { box-shadow: 0 0 9px #fbc75b55, inset 0 0 12px #ffd36d22; } to { box-shadow: 0 0 24px #fbc75bb0, inset 0 0 22px #ffd36d44; } }
@media (max-width: 600px) {
  .gacha-dialog { padding: 14px; width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .gacha-dialog header { flex-wrap: wrap; gap: 8px; }
  .gacha-dialog h2 { font-size: 22px; }
  .gacha-pool { flex-basis: min(310px, calc(100vw - 62px)); padding: 16px; }
  .gacha-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gacha-card { height: 205px; }
  .gacha-result-heading { flex-wrap: wrap; }
  .gacha-result-heading h3 { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .gacha-card-inner { transition: none; }
  .revealed .gacha-glow { animation: none; box-shadow: 0 0 16px #fbc75b88; }
}
