* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fd3f4; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #24323d; user-select: none; -webkit-user-select: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
#top { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: calc(8px + env(safe-area-inset-top)) 10px 0; pointer-events: none; }
.brand { display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 0 #fff8; }
.brand b { font-size: 15px; letter-spacing: .2px; }
#mark { display: block; margin: 1px 0 3px; opacity: .8; }
body.play #mark { display: none; }
#status { font-size: 14px; font-weight: 600; min-height: 18px; }
.right { display: flex; gap: 6px; pointer-events: auto; }
.icon { width: 44px; height: 44px; border-radius: 22px; background: #fffc; font-size: 18px; font-weight: 700; box-shadow: 0 2px 0 #0002; }
.icon.off { opacity: .5; text-decoration: line-through; }
#pips { position: fixed; top: calc(58px + env(safe-area-inset-top)); left: 10px; display: flex; gap: 5px; pointer-events: none; }
#pips i { width: 14px; height: 14px; border-radius: 7px; background: #fff9; box-shadow: inset 0 0 0 2px #24323d44; }
#pips i.x { background: #5b6b7a; } #pips i.z { background: #c9ccc3; box-shadow: inset 0 0 0 2px #24323d22; transform: scale(.8); transition: all .2s; } #pips i.w { background: #e5533d; } #pips i.now { box-shadow: inset 0 0 0 2px #24323d; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: #8fd3f4; font-weight: 700; font-size: 18px; }
#hint { position: fixed; left: 0; right: 0; bottom: calc(202px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: 14px; font-weight: 600; padding: 0 16px; pointer-events: none; text-shadow: 0 1px 0 #fff, 0 0 8px #fff; }
body.play #hint { bottom: calc(18px + env(safe-area-inset-bottom)); }
#tray { position: fixed; left: 0; right: 0; bottom: 0; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); background: #fbf1dcf2; border-radius: 18px 18px 0 0; box-shadow: 0 -2px 0 #0001; display: flex; flex-direction: column; gap: 8px; }
#tray.drop { background: #ffd9d2f2; }
#parts { display: flex; gap: 8px; justify-content: center; }
.part { flex: 1; max-width: 130px; min-height: 64px; border-radius: 14px; background: #fff; box-shadow: 0 2px 0 #0002; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 6px; padding: 6px 8px; text-align: left; touch-action: none; }
.part .pic { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 50%; }
.part b { font-size: 14px; } .part span { font-size: 12px; opacity: .7; } .part span::before { content: "costs "; }
.part.cant { opacity: .45; }
.pic.baffle { background: conic-gradient(from 0deg, #39424d, #6b7885, #39424d); clip-path: polygon(50% 12%, 100% 82%, 0 82%); border-radius: 0; }
.pic.grease { background: radial-gradient(circle at 35% 30%, #fbffb8, #d9e86a 55%, #a7b83d); }
.pic.spin { background: linear-gradient(90deg, #3fa9d8 0 40%, #ffd23f 40% 60%, #3fa9d8 60%); border-radius: 8px; height: 22px; align-self: center; }
.row { display: flex; gap: 8px; align-items: center; }
#budget { flex: 1; font-size: 14px; font-weight: 600; }
.pill { min-height: 46px; padding: 0 16px; border-radius: 23px; background: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 2px 0 #0002; }
.pill.primary { background: #e5533d; color: #fff; padding: 0 26px; }
#ghost { position: fixed; z-index: 5; padding: 8px 12px; border-radius: 14px; background: #fff; font-weight: 700; font-size: 14px; pointer-events: none; transform: translate(-50%, -150%); box-shadow: 0 4px 0 #0002; }
#sheet { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(430px, calc(100% - 20px)); max-height: calc(100% - 32px - env(safe-area-inset-bottom)); overflow-y: auto; background: #fbf1dcf7; border-radius: 22px; padding: 16px 16px 12px; text-align: center; box-shadow: 0 4px 0 #0002; z-index: 4; }
#sheet h2 { margin: 2px 0 6px; font-size: 26px; } #sheet p { margin: 4px 0; font-size: 15px; }
.kicker { font-size: 12px !important; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; opacity: .7; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 8px; }
.stars { font-size: 15px !important; font-weight: 700; color: #b5651d; margin: 0 0 2px !important; }
#vote p { font-size: 13px !important; opacity: .8; margin: 2px 0 6px !important; }
#voteOpts { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
#voteOpts::-webkit-scrollbar { display: none; }
#voteOpts button, #door { flex: none; white-space: nowrap; font-size: 13px; min-height: 44px; font-weight: 600; padding: 0 14px; }
#door { margin-top: 8px; background: transparent; box-shadow: none; border: 2px dashed #24323d55; }
#doorMsg { font-size: 13px !important; } #doorMsg a { color: inherit; }
#yards { display: flex; gap: 6px; align-items: center; }
#yardName { flex: 1; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yard { min-width: 44px; height: 44px; border-radius: 12px; background: #fff; box-shadow: 0 2px 0 #0002; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; padding: 0 6px; }
.yard b { font-size: 15px; } .yard small { font-size: 9px; color: #b5651d; min-height: 9px; }
.yard.on { background: #24323d; color: #fff; } .yard.on small { color: #ffd23f; }
.yard.locked { opacity: .55; } .yard.locked b { font-size: 13px; }
.more { font-size: 12px !important; } .more a { color: inherit; }
#sheetMore { margin: 10px -6px 0; }
#toast { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); background: #24323dee; color: #fff; padding: 10px 16px; border-radius: 16px; font-weight: 700; font-size: 15px; pointer-events: none; text-align: center; max-width: 86%; z-index: 6; }
@media (pointer: fine) { .part:hover, .pill:hover, .icon:hover { filter: brightness(1.06); } }
@media (min-width: 800px) {
  #tray { left: 50%; right: auto; transform: translateX(-50%); width: 480px; border-radius: 18px; bottom: 14px; }
  .brand b { font-size: 18px; } #status { font-size: 16px; }
  #hint { bottom: 230px; }
  #sheet { width: 640px; } /* wide enough for the studio row's cards to sit side by side */
}
@media (max-height: 520px) { #tray { left: auto; right: 8px; width: 330px; border-radius: 18px; bottom: 8px; } #hint { bottom: 8px; left: 8px; right: 350px; } .part { min-height: 50px; } }
@media (max-width: 799px) { body.play .brand b { display: none; } body.play #status { font-size: 15px; padding-top: 4px; max-width: 46vw; } body.play #pips { top: calc(60px + env(safe-area-inset-top)); } }
/* the replay of the fall: a small button in the result's top corner, so the sheet stays the same height */
#replay.mini { position: absolute; top: 8px; right: 8px; min-height: 44px; padding: 0 12px; border-radius: 22px; background: #24323d; color: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 2px 0 #0002; }
#replayTag { position: fixed; top: calc(60px + env(safe-area-inset-top)); left: 10px; background: #e5533d; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; padding: 4px 10px; border-radius: 12px; pointer-events: none; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .55; } }
#replay.mini { z-index: 1; }
#sheet.hasReplay .kicker { text-align: left; padding: 0 96px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 30px; line-height: 30px; margin: 0 !important; }
