*{box-sizing:border-box}body{margin:0;background:#091b19;color:#fff7de;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Noto Sans JP",sans-serif}button{font:inherit;touch-action:manipulation;cursor:pointer;min-height:44px;border-radius:10px;border:1px solid #a08a52;background:#213b36;color:#fff7de;padding:10px 14px;font-weight:700}button:disabled{opacity:.5;cursor:default}button:focus-visible{outline:3px solid #79dfff;outline-offset:2px}[hidden]{display:none!important}main{position:relative;padding:6px 8px max(8px,env(safe-area-inset-bottom));min-height:calc(100svh - 52px)}.table{position:relative;border:1px solid #987743;border-radius:18px;overflow:hidden;background:radial-gradient(ellipse at 50% 40%,#205647,#102f29 75%);box-shadow:inset 0 0 35px #081712;padding:8px;min-height:calc(100svh - 72px);display:flex;flex-direction:column}.hud{display:flex;align-items:center;justify-content:space-between;font-size:13px;gap:8px}.hud button{width:44px;padding:0}.hud strong{color:#ffe19c;font-size:22px}.cast-stage{display:flex;align-items:center;gap:8px;min-height:116px}.cast-stage>button{padding:0;border:0;background:none;flex:0 0 112px}.cast-stage img{display:block;width:112px;height:112px;object-fit:contain;filter:drop-shadow(0 4px 6px #001c17)}.cast-stage>div{flex:1;min-width:0}.cast-stage strong{font-size:13px;color:#ffe19c}.cast-stage p{font-size:13px;line-height:1.6;margin:7px 0;background:#08271fcc;border:1px solid #9b805766;padding:8px 10px;border-radius:12px}.history{display:flex;gap:4px}.history span{flex:1;min-width:0;text-align:center;padding:5px 1px;border:1px solid #76968655;border-radius:7px;font-size:11px;color:#b4c8be}.history span.current{border-color:#f9d078;color:#fff0bb}.history span.done{background:#041e19;color:#ffe19c}.target{display:flex;align-items:center;justify-content:space-between;gap:4px;margin-top:10px;font-size:12px}.target strong{color:#ffe29c}.target small{font-size:10px;color:#c9d4c3}.arena{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:240px;padding:18px 0 8px}.dice-row{display:flex;gap:14px;justify-content:center;width:100%;padding:10px 0 18px}.die{width:clamp(62px,20vw,82px);aspect-ratio:1;border-radius:17%;padding:12%;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:3px;background:linear-gradient(135deg,#fffefa,#e5d9b9);border:1px solid #fff2bf;box-shadow:0 6px 0 #a58b57,0 12px 16px #001a18;position:relative}.die{padding:10px}.pip{border-radius:50%;background:#1e302b;box-shadow:inset 1px 1px 1px #0005}.die.danger .pip{background:#b4273f}.die.danger{background:#ffe2dc;border-color:#ff8291}.die.empty{color:#ac9a73;display:flex;align-items:center;justify-content:center;font-size:30px}.roll-label,.pot-label{color:#c6d8c6;font-size:12px;margin:4px 0}.pot{font-size:clamp(40px,12vw,64px);line-height:1.15;color:#ffe19c;text-shadow:0 2px 12px #dab54b35;font-variant-numeric:tabular-nums}.arena p{font-size:13px;min-height:22px;text-align:center;margin:5px 0;line-height:1.5}.controls{display:flex;gap:8px}.controls button{flex:1;min-height:56px;font-size:16px}.gold{background:linear-gradient(#ffdf98,#cba65c);border:1px solid #ffe5ab;color:#35250b;box-shadow:0 3px 0 #856635}.roll{background:linear-gradient(#355b53,#1d3c35)}.risk{font-size:11px;color:#c9d4c3;text-align:center;margin:10px 1px 2px;line-height:1.6}.overlay{position:absolute;inset:6px 8px max(8px,env(safe-area-inset-bottom));z-index:2;border:1px solid #b69b59;border-radius:18px;background:radial-gradient(ellipse at top,#28574a,#0d2621 75%);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px 18px;gap:10px;text-align:center}.overlay img{object-fit:contain;width:136px;height:136px}.overlay h2{font-size:24px;color:#ffe19c;margin:0}.overlay p{font-size:14px;line-height:1.8;margin:0;white-space:pre-line}.overlay>button{width:100%;max-width:320px;min-height:48px}.overlay #best{font-size:12px;color:#d2ceaf}.overlay #ranking{width:100%}dialog{width:calc(100% - 28px);max-width:420px;max-height:85svh;overflow:auto;background:#fff;color:#2a2328;border:0;border-radius:12px;padding:20px;font-size:13px;line-height:1.8}dialog::backdrop{background:#001c19bb}dialog h2{font-size:19px;margin:0 0 12px}dialog ul{padding-left:20px}dialog li{margin:8px 0}dialog>button{width:100%;color:#2a2328;background:#f3f4f6;border-color:#ddd}.cast-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px}.cast-picker button{background:#f3f4f6;color:#2a2328;border-color:#ddd;padding:4px;font-size:10px}.cast-picker img{width:64px;height:64px;object-fit:contain;display:block;margin:auto}.cast-picker button[aria-pressed=true]{border:2px solid #93743c;background:#fff2cf}.table.rolling .dice-row{animation:shake .32s ease}.table.banked .pot{animation:shine .45s ease}@keyframes shake{25%{transform:translateY(-6px) rotate(-3deg)}75%{transform:translateY(-3px) rotate(3deg)}}@keyframes shine{50%{transform:scale(1.12);color:white}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}@media(max-height:680px){.cast-stage{min-height:92px}.cast-stage img{height:92px;width:92px}.cast-stage>button{flex-basis:92px}.arena{min-height:210px;padding-top:10px}.overlay{gap:7px;padding:14px}.overlay img{width:100px;height:100px}.dice-row{padding-bottom:10px}}
.overlay{overflow-y:auto;justify-content:safe center}.overlay>img,.overlay>button{flex-shrink:0}
