*{box-sizing:border-box}body{margin:0;background:#394840;color:var(--ink,#574430);font-family:system-ui,sans-serif}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer;border:2px solid #fffae9;border-radius:21px;background:var(--panel,#fff0d8);box-shadow:0 4px 0 #b99873,0 6px 12px #47352626}button:disabled{cursor:default;filter:saturate(.3);opacity:.58}button:active:not(:disabled){transform:translateY(2px)}button:focus-visible,a:focus-visible{outline:3px solid var(--accent);outline-offset:3px}[hidden]{display:none!important}#stage{width:450px;height:800px;position:absolute;left:50%;margin-left:-225px;transform-origin:top center;background-position:center;background-size:cover;overflow:hidden}header{position:absolute;top:13px;left:14px;right:14px;display:flex;align-items:center;gap:8px;z-index:8}header a,nav button{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;text-decoration:none;background:var(--panel);color:var(--ink);font-size:23px;border:1px solid #fff8}header .wallet{background:#fff7e7e8;border-radius:19px;padding:7px 9px;font-size:12px;display:flex;align-items:center;gap:4px}header nav{margin-inline-start:auto;display:flex;gap:7px}nav button{font-size:18px}dialog{width:min(92vw,400px);max-height:85vh;overflow:auto;border:3px solid #d3b38c;border-radius:24px;background:var(--panel);color:var(--ink);padding:22px}dialog::backdrop{background:#192a256b}dialog p{white-space:pre-line;font-size:14px;line-height:1.65}dialog h2{font-size:20px;padding-right:24px}#close{float:right;width:32px;height:32px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#titleArt{position:absolute;left:65px;top:54px;width:320px;height:105px;object-fit:contain}
#hero{position:absolute;left:135px;top:153px;width:180px;height:175px;object-fit:contain}
.parcels{position:absolute;left:29px;top:224px;width:392px;height:143px;display:flex;gap:42px;direction:ltr;z-index:2}
.parcel{position:relative;width:175px;height:143px;flex:none}
.parcel img{width:100%;height:100%;object-fit:contain}
.parcel b{position:absolute;left:46px;top:55px;width:80px;height:66px;display:grid;place-items:center;font-size:48px;color:var(--ink);font-weight:850}
.parcel .label{position:absolute;top:7px;left:22px;width:130px;text-align:center;font-size:11px;background:#fff3dce8;border-radius:10px;padding:2px}
.next .label{display:none}
#ruler{position:absolute;top:452px;left:20px;width:410px;height:40px;display:flex;direction:ltr;padding:5px;background:#fff5e5;border:2px solid #fff9;border-radius:15px;box-shadow:0 3px 0 #ccb48f}
#ruler span{flex:1;display:grid;place-items:center;font-size:15px;font-weight:750;color:var(--ink)}
#ruler .selected{background:var(--primary);color:white;border-radius:8px}
#choices{position:absolute;top:512px;left:20px;width:410px;display:flex;gap:12px}
#choices button{width:199px;height:118px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:#fff;background:linear-gradient(#4fc4bc,var(--primary));border:2px solid #d9fff1;box-shadow:inset 0 2px 3px #fffa,0 4px 0 #368b83}
#choices #high{background:linear-gradient(#ffbb7b,var(--secondary));border-color:#ffe2be;box-shadow:inset 0 2px 3px #fffa,0 4px 0 #c77e50}
#choices strong{font-size:24px}#choices span{font-size:12px;text-align:center;max-width:187px;line-height:1.3}
#choices button:disabled{opacity:.5}
.feedback{position:absolute;left:20px;top:650px;width:410px;padding:10px 12px;background:#fff5e5e8;border:1px solid #dfc59d;border-radius:17px}
.totals{display:flex;align-items:center;gap:7px;padding-inline-end:86px;min-height:32px}
.totals>div:first-child{display:none}.totals>div:last-child{display:flex;align-items:baseline;gap:6px}.totals span{font-size:12px}.totals b{font-size:24px;color:var(--accent)}
#cashout{position:absolute;inset-inline-end:10px;top:9px;width:83px;min-height:34px;font-size:12px;background:transparent;border:1px solid #be9971;border-radius:12px;box-shadow:none}
#trail{display:flex;align-items:center;flex-wrap:wrap;gap:4px;font-size:10px;direction:ltr;margin-top:5px}
#trail span{padding:2px 4px;background:#e6efe0;border-radius:5px}#trail .miss{background:#f6d9cc}
#message{font-size:10px;margin:5px 0 0;line-height:1.4}
.feedback.first-guess .totals{display:none}
footer{position:absolute;left:20px;top:675px;width:410px;text-align:center}
#bets{display:flex;gap:10px}#bets button{width:130px;height:65px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;background:linear-gradient(#dbefe3,#8dc7b1)}#bets span{font-size:15px;font-weight:700}#bets b{font-size:14px}footer small{display:block;font-size:7px;margin-top:12px}
.playing footer{top:775px}.has-result:not(.playing) footer{top:720px}.has-result:not(.playing) #bets button{height:49px}
#retry{position:absolute;top:742px;left:140px;width:170px;z-index:9;font-size:12px}
.opening .next{animation:shake .65s ease-in-out}.success #hero{animation:happy .6s}.failure .next{animation:shake .45s}
.number-transfer{position:absolute;left:292px;top:279px;width:80px;height:66px;display:grid;place-items:center;font-size:48px;font-weight:850;z-index:5;color:var(--ink);background:#fff3dc;border-radius:8px;animation:transfer .55s ease-in-out both;pointer-events:none}
@keyframes transfer{to{transform:translateX(-217px)}}@keyframes shake{25%,75%{transform:rotate(-3deg)}50%{transform:rotate(3deg)}}@keyframes happy{50%{transform:translateY(-7px)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important}}

/* Rounded glossy controls and a single compact collection strip. */
#choices button{border-radius:32px;gap:8px;padding:10px 8px;background:linear-gradient(155deg,#45d8d2 0%,var(--primary) 55%,#05878f 100%);border:2px solid #91e6dc;box-shadow:inset 0 3px 2px #ffffff88,inset 0 -4px 0 #006f792f,0 4px 5px #5e432326}
#choices #high{background:linear-gradient(155deg,#ffb377 0%,var(--secondary) 55%,#f15c3b 100%);border-color:#ffcca3;box-shadow:inset 0 3px 2px #ffffff88,inset 0 -4px 0 #b94e282f,0 4px 5px #5e432326}
#choices strong{font-size:26px;text-shadow:0 2px 1px #65452e33}
#choices .choice-details{width:100%;max-width:none;background:#00545a24;border-radius:17px;padding:6px 3px;display:flex;flex-direction:column;gap:4px}
#choices #high .choice-details{background:#b6402224}
#choices .choice-details b{color:#ffec82;font-size:14px}
.feedback{padding:9px 12px;border-radius:20px;background:linear-gradient(#fff9ed,#f9e8d0);box-shadow:inset 0 2px #fff,0 3px 4px #98734a20}
.feedback.compact-active #trail{display:none}
.feedback.first-guess{width:330px;left:60px;padding:7px 10px;box-shadow:none;background:#fff4e4a8}
.feedback.first-guess #message{text-align:center;margin:0;font-size:12px}
.feedback .totals>div:last-child{flex-wrap:wrap;row-gap:0}
#cashout{background:linear-gradient(#ffe7a1,#ffc15b);border:1px solid #d89d42;box-shadow:inset 0 2px #fff8,0 2px 0 #dbb17c;color:#59391f;border-radius:15px;font-weight:750}
#bets button{border-radius:21px;box-shadow:inset 0 2px #fff9,0 3px 0 #b9987370;border-width:1px}

/* Terminal result uses one row; details remain in the round history dialog. */
.feedback.settled{display:flex;align-items:center;min-height:49px;padding:8px 12px}
.feedback.settled .totals{padding:0;min-height:30px;width:100%}
.feedback.settled .totals>div:last-child{width:100%;justify-content:space-between;flex-wrap:nowrap}
.feedback.settled #trail,.feedback.settled #message{display:none}

/* Shipping-label center is above the parcel center. */
.parcel b{top:47px;left:43px;width:80px;height:66px;line-height:1}
.parcel .label{display:none}
.number-transfer{left:289px;top:271px;line-height:1}

/* Before starting, entry actions take priority over the inactive guess preview. */
.idle:not(.has-result) #choices button{height:94px;gap:4px;padding:7px 8px;box-shadow:none}
.idle:not(.has-result) #choices strong{font-size:22px}
.idle:not(.has-result) #choices .choice-details{padding:3px;gap:2px;background:transparent}
.idle:not(.has-result) footer{top:635px}
.idle:not(.has-result) #bets button{height:90px}
#bets button{background:linear-gradient(155deg,color-mix(in srgb,var(--primary),white 32%),var(--primary));color:#fff;border:2px solid color-mix(in srgb,var(--primary),white 62%);box-shadow:inset 0 3px 2px #ffffff77,0 3px 0 color-mix(in srgb,var(--primary),black 20%)}
#bets b{font-size:17px}

#bets span,#bets b{font-weight:850}
#entryHint{margin:0 0 12px;font-size:13px;font-weight:650;color:var(--ink);text-align:center;line-height:1.4}
.idle:not(.playing) #choices .choice-details{display:none}
.idle:not(.has-result) #choices button{height:64px}
.idle:not(.has-result) footer{top:605px}
.has-result:not(.playing) #choices button{height:64px;box-shadow:none}
.has-result:not(.playing) .feedback{top:592px}
.has-result:not(.playing) footer{top:658px}
.has-result:not(.playing) #bets button{height:70px}
.feedback.settled #amount{font-size:20px}

/* Expand only the scene into the blank area above the unchanged ruler. */
#stage{background-size:450px 896px;background-position:center top}
#hero{left:119px;top:163px;width:212px;height:206px}
.parcels{left:17px;top:258px;width:416px;height:165px;gap:12px}
.parcel{width:202px;height:165px}
.parcel b{left:50px;top:54px;width:92px;height:76px;font-size:55px}
.number-transfer{left:281px;top:312px;width:92px;height:76px;font-size:55px}
@keyframes transfer{to{transform:translateX(-214px)}}

/* Independent status layer stays visible before start and after settlement. */
#notice{position:absolute;z-index:20;bottom:18px;left:35px;width:380px;box-sizing:border-box;margin:0;padding:8px 12px;border-radius:14px;background:var(--panel);color:var(--ink);font-size:13px;text-align:center;box-shadow:0 2px 8px #583d2b22;pointer-events:none}
#notice[hidden]{display:none}

#stage:has(#retry:not([hidden])) #notice{padding-right:108px;min-height:40px}
#retry{top:auto;bottom:24px;left:auto;right:43px;width:92px;z-index:21}

footer small.round-deadline{font-size:10px;line-height:1.4;margin-top:5px;overflow-wrap:anywhere}
