/* わくわくルーレット（js/roulette.js） */
.rl { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 12px; background: rgba(40, 24, 8, .5); backdrop-filter: blur(3px); font-family: "M PLUS Rounded 1c", sans-serif; }
.rl-box { position: relative; width: min(560px, 100%); max-height: 100%; overflow: auto; padding: 18px 18px 20px; border-radius: 28px; text-align: center; color: #3b2a14;
  background: repeating-linear-gradient(178deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 12px), linear-gradient(180deg, #c98a4a, #a0622a);
  box-shadow: inset 0 0 0 5px #6b3a12, inset 0 0 0 9px #f2cf7e, 0 24px 60px rgba(0, 0, 0, .45); animation: rl-in .4s cubic-bezier(.3, 1.5, .5, 1); }
.rl-x { position: absolute; right: 12px; top: 12px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: #fffaf0; color: #6b3a12; font-size: 26px; font-weight: 900; cursor: pointer; }
.rl-title { display: inline-flex; flex-direction: column; align-items: center; margin: 0 0 10px; padding: 8px 24px; border-radius: 16px; background: #fffaf0; color: #7a3408; font-size: clamp(24px, 4vw, 32px); font-weight: 900; box-shadow: 0 4px 0 #6b3a12; }
.rl-title img { width: 40px; height: 40px; margin: -30px 0 0; }
.rl-title small { font-size: 14px; color: #e8412d; }
.rl-wheel-wrap { position: relative; width: min(420px, 82vw); aspect-ratio: 1; margin: 6px auto 8px; }
.rl-wheel { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 10px #f2cf7e, 0 0 0 16px #8a4a18, 0 12px 26px rgba(0, 0, 0, .35), inset 0 0 0 4px rgba(255, 255, 255, .6); will-change: transform; }
.rl-seg { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--r)); }
.rl-seg > * { position: absolute; left: 50%; transform: translateX(-50%); }
.rl-seg img { top: calc(min(420px, 82vw) * -.43); width: calc(min(420px, 82vw) * .12); height: auto; }
.rl-seg b { top: calc(min(420px, 82vw) * -.30); white-space: nowrap; font-size: clamp(12px, 2.4vw, 16px); font-weight: 900; color: #3b2a14; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.rl-seg small { top: calc(min(420px, 82vw) * -.235); white-space: nowrap; font-size: clamp(10px, 1.9vw, 12px); font-weight: 900; color: #7a3408; }
.rl-pin { position: absolute; left: 50%; top: -14px; z-index: 2; width: 36px; height: 44px; transform: translateX(-50%); background: linear-gradient(180deg, #ff5a3c, #c82a14); clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .35)); }
.rl-start { position: absolute; left: 50%; top: 50%; z-index: 2; width: 34%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 0; border-radius: 50%; color: #fff; font: inherit; font-weight: 900; font-size: clamp(18px, 3.4vw, 26px); cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #ffc27a, #ff8a1f 55%, #e06a00); box-shadow: inset 0 0 0 5px #fff4dc, 0 6px 0 #a84a00, 0 12px 20px rgba(0, 0, 0, .3); transition: transform .4s cubic-bezier(.34, 1.9, .5, 1); animation: rl-throb 1.6s ease-in-out infinite; }
.rl-start:active { transform: translate(-50%, -46%) scale(.94); }
.rl-start:disabled { animation: none; filter: saturate(.7); cursor: default; }
.rl-msg { margin: 8px 0 0; padding: 10px 14px; border-radius: 14px; background: #fffaf0; font-weight: 900; font-size: 16px; line-height: 1.6; }
.rl-win { margin-top: 10px; }
.rl-win.is-pop { animation: rl-pop .7s cubic-bezier(.3, 1.8, .5, 1); }
.rl-win-big { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 24px; border-radius: 20px; color: #fff; font-size: clamp(30px, 6vw, 44px); font-weight: 900;
  background: linear-gradient(180deg, #ffd23d, #f5a90e); text-shadow: 0 3px 0 rgba(150, 70, 0, .5); box-shadow: 0 6px 0 #9a5a06; }
.rl-win-big img { width: 1.2em; height: 1.2em; }
.rl-win-big small { font-size: .5em; }
.rl-win-say { margin: 8px 0 0; font-weight: 900; font-size: 20px; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.rl-conf { position: fixed; top: -20px; z-index: 95; width: 10px; height: 16px; border-radius: 2px; pointer-events: none; }
.rl-conf.is-star { width: 16px; height: 16px; background: #fff6b0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.rl-open-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 60px; padding: 6px 14px; border: 0; border-radius: 18px; font: inherit; font-weight: 900; font-size: 18px; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #b98cff, #7a5cf6 60%, #5a3ed8); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .35), 0 5px 0 #3e28a0, 0 10px 18px rgba(90, 60, 220, .35); transition: transform .4s cubic-bezier(.34, 1.9, .5, 1); }
.rl-open-btn:active { transform: scale(.95) translateY(3px); }
.rl-open-btn img { width: 36px; height: 36px; }
.rl-open-btn small { display: block; font-size: 12px; opacity: .9; }
@keyframes rl-in { from { transform: scale(.85) translateY(20px); opacity: 0; } }
@keyframes rl-pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.1); opacity: 1; } }
@keyframes rl-throb { 50% { transform: translate(-50%, -50%) scale(1.06); } }

/* ===== 絵の盤面（assets/rpg/roulette/board.webp ＝ 1254px 基準の位置） ===== */
.rl-box.rl-board { width: min(640px, 94vw, 94vh); aspect-ratio: 1; max-height: none; overflow: visible; padding: 0; border-radius: 26px; background: center / 100% 100% no-repeat; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.rl-board .rl-x { right: auto; left: 88.9%; top: 3%; width: 8.8%; height: 8.8%; background: transparent; border-radius: 50%; }
.rl-board .rl-x:focus-visible { outline: 3px solid #fff; }
.rl-board .rl-wheel { position: absolute; left: 50.64%; top: 55.1%; right: auto; bottom: auto; width: 58.4%; height: 58.4%; translate: -50% -50%; border-radius: 50%; box-shadow: none;
  background: center / contain no-repeat; will-change: transform; }
.rl-board .rl-start { left: 50.64%; top: 55.1%; width: 24.3%; background: center / contain no-repeat; box-shadow: none; color: transparent; font-size: 0; border-radius: 50%; z-index: 3; }
.rl-board .rl-msg { position: absolute; left: 19%; top: 89.2%; width: 72%; height: 6.8%; margin: 0; padding: 0 10px; display: grid; place-items: center; border-radius: 10px;
  background: linear-gradient(180deg, #fde2a8, #ffe9b6 40%, #fde4ad); color: #3b2a14; font-size: clamp(10px, 1.9vw, 14px); line-height: 1.2; letter-spacing: -.02em; text-align: center; }
.rl-board .rl-win { position: absolute; left: 50%; top: 52%; z-index: 4; margin: 0; transform: translate(-50%, -50%); width: 86%; text-align: center; pointer-events: none; }
/* 回っている間は まんなかが 赤い「ストップ！」ボタンに（見本の スタートボタンと 同じ 立体感） */
.rl-stop-face { position: absolute; inset: 0; display: none; place-items: center; align-content: center; border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #ff9a8a, #ff3b30 55%, #b8140c); box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .22), inset 0 6px 0 rgba(255, 255, 255, .45), 0 0 0 6px #ffd23d, 0 0 0 10px #b8740c, 0 8px 18px rgba(0, 0, 0, .35); }
.rl-stop-face b { font-weight: 900; font-size: clamp(18px, 4.4vmin, 32px); color: #fff; letter-spacing: .02em; -webkit-text-stroke: 1.5px #8a0c06; paint-order: stroke fill; text-shadow: 0 3px 0 #8a0c06; }
.rl-stop-face i { display: block; width: 26%; aspect-ratio: 1; margin-top: 4%; border-radius: 4px; background: #fff; box-shadow: 0 2px 0 #8a0c06; }
.rl-start.is-stop { background-image: none !important; animation: rl-stop-pulse .5s ease-in-out infinite alternate; }
.rl-start.is-stop .rl-stop-face { display: grid; }
@keyframes rl-stop-pulse { to { transform: translate(-50%, -50%) scale(1.07); } }
.rl-board .rl-wheel { will-change: transform; cursor: pointer; }
/* ストップ！は ChatGPTの 絵（スタートと 同じ 立体感） */
.rl-stop-face { background-color: transparent !important; background-position: center !important; background-size: contain !important; background-repeat: no-repeat !important; box-shadow: none !important; }
.rl-stop-face b, .rl-stop-face i { display: none !important; }
.rl-start.is-stop { animation: rl-stop-pulse .45s ease-in-out infinite alternate; filter: drop-shadow(0 0 14px rgba(255, 80, 60, .8)); }
