* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f2dcb8; font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif; color: #3b2f22; user-select: none; -webkit-user-select: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }

#top { position: fixed; top: 0; left: 0; right: 0; padding: calc(env(safe-area-inset-top) + 8px) 10px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
#top > * { pointer-events: auto; }
#lvl { background: rgba(255,250,240,.88); border-radius: 14px; padding: 7px 12px; font-weight: 800; font-size: 14px; box-shadow: 0 2px 8px rgba(80,50,20,.15); }
.row { display: flex; gap: 6px; align-items: center; }
.pill { background: rgba(255,250,240,.88); border-radius: 14px; padding: 6px 9px; font-size: 14px; box-shadow: 0 2px 8px rgba(80,50,20,.15); white-space: nowrap; }
.round { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,250,240,.9); box-shadow: 0 2px 8px rgba(80,50,20,.18); font-size: 20px; display: grid; place-items: center; }
.round:active { transform: scale(.92); }

#side { position: fixed; right: 10px; top: calc(env(safe-area-inset-top) + 62px); display: flex; flex-direction: column; gap: 8px; }
#toolbadge { position: fixed; left: 10px; top: calc(env(safe-area-inset-top) + 52px); background: rgba(255,250,240,.75); border-radius: 12px; padding: 4px 9px; font-size: 12px; }

#bins { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 8px calc(env(safe-area-inset-bottom) + 10px); display: flex; gap: 8px; justify-content: center; }
.bin { flex: 1; max-width: 150px; height: 78px; border-radius: 18px 18px 14px 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; color: #fff; font-weight: 800; box-shadow: 0 4px 0 rgba(0,0,0,.22), 0 6px 14px rgba(60,40,20,.25); opacity: .72; transition: transform .15s, opacity .2s; }
.bin .ico { font-size: 26px; line-height: 1; }
.bin .nm { font-size: 14px; margin-top: 3px; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.bin .ct { position: absolute; top: -7px; right: -4px; background: #fffaf0; color: #3b2f22; font-size: 12px; border-radius: 10px; padding: 1px 7px; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.bin.papier { background: linear-gradient(#3d8be0, #2563a8); }
.bin.plastik { background: linear-gradient(#ffd23f, #e0a800); color: #4a3800; }
.bin.plastik .nm { text-shadow: none; }
.bin.metall { background: linear-gradient(#a9b1b9, #6e7780); }
#bins { display: none; } body.inspect #bins { display: flex; }
body.inspect .bin { opacity: 1; transform: translateY(-4px); animation: bob 1.6s ease-in-out infinite; }
body.inspect .bin:active { transform: scale(.94); }
.bin.plastik { animation-delay: .2s; } .bin.metall { animation-delay: .4s; }
@keyframes bob { 50% { transform: translateY(-9px); } }

#inspect { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 64px); transform: translateX(-50%); width: min(78vw, 320px); background: rgba(255,250,240,.92); border-radius: 18px; padding: 10px 44px 10px 14px; box-shadow: 0 4px 16px rgba(80,50,20,.2); display: none; }
body.inspect #inspect { display: block; }
body.inspect #side, body.inspect #toolbadge { display: none; }
#iname { font-weight: 800; font-size: 17px; }
#ibar { height: 9px; background: #6b4f33; border-radius: 6px; margin: 6px 0 3px; overflow: hidden; }
#idirt { height: 100%; width: 0; background: linear-gradient(90deg, #8fd3ff, #c7f0ff); border-radius: 6px; transition: width .15s; }
#ilabel { font-size: 12px; opacity: .8; }
#putback { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; background: #eadfcb; font-size: 15px; }

#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 104px); transform: translate(-50%, 12px); max-width: min(90vw, 460px); background: rgba(59,47,34,.92); color: #fffaf0; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.35; text-align: center; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.float { position: fixed; transform: translate(-50%, -100%); font-weight: 900; font-size: 22px; color: #fff; text-shadow: 0 2px 0 #b07a1c, 0 3px 8px rgba(0,0,0,.3); pointer-events: none; animation: up 1.3s ease-out forwards; }
@keyframes up { to { transform: translate(-50%, -260%); opacity: 0; } }

.screen { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(242,220,184,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); transition: opacity .4s; padding: 20px; }
.screen.hide { opacity: 0; pointer-events: none; }
.card { background: #fffaf0; border-radius: 26px; padding: 26px 22px; max-width: 380px; width: 100%; text-align: center; box-shadow: 0 10px 40px rgba(80,50,20,.25); }
h1 { margin: 0; font-size: 40px; letter-spacing: 1px; color: #2f6fb3; text-shadow: 0 3px 0 #ffd23f; }
h2 { margin: 0 0 8px; font-size: 24px; color: #2f6fb3; }
.sub { margin: 6px 0 14px; opacity: .8; }
.how { text-align: left; padding-left: 18px; margin: 0 0 18px; line-height: 1.6; font-size: 14px; }
#dstats { line-height: 1.6; }
.big { background: linear-gradient(#5fbf5a, #3f9a3b); color: #fff; font-weight: 800; font-size: 19px; padding: 14px 30px; border-radius: 18px; box-shadow: 0 4px 0 #2d7a2a; }
.big:active { transform: translateY(2px); box-shadow: 0 2px 0 #2d7a2a; }
#loading { background: #f2dcb8; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid #e2c99f; border-top-color: #2f6fb3; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
#loading p { text-align: center; }

.coop-only { display: none; } body.coop .coop-only { display: block; } body.coop .solo-only { display: none; }
.hide { display: none !important; }
#done.hide, #title.hide, #loading.hide { display: grid !important; }
#pname { display: block; width: 100%; margin: 0 0 14px; padding: 11px 14px; border-radius: 14px; border: 2px solid #e6d6b8; background: #fff; font: inherit; font-size: 16px; text-align: center; color: #3b2f22; }
.small { background: #eadfcb; border-radius: 14px; padding: 10px 16px; font-weight: 700; margin-top: 12px; }
.room { margin: 0 0 4px; font-size: 15px; } .room b { letter-spacing: 3px; font-size: 20px; color: #2f6fb3; }
#sharehint { font-size: 13px; margin: 4px 0 6px; opacity: .85; }
.coop-only .small { margin: 2px 0 14px; }
#peers { cursor: pointer; } #peers.off { opacity: .45; }

#cross { position: fixed; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 0 0 2px rgba(0,0,0,.25); pointer-events: none; }
body.inspect #cross, body.inspect #aim { display: none; }
#aim { position: fixed; left: 50%; top: calc(50% + 14px); transform: translateX(-50%); color: #fff; font-weight: 700; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.7); pointer-events: none; white-space: nowrap; }
#joy { position: fixed; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.5); pointer-events: none; opacity: 0; transition: opacity .15s; }
#joy.on { opacity: 1; }
#joyk { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(255,255,255,.75); }
#scrub { position: fixed; right: 14px; bottom: calc(env(safe-area-inset-bottom) + 24px); width: 74px; height: 74px; border-radius: 50%; background: rgba(255,250,240,.9); box-shadow: 0 3px 10px rgba(60,40,20,.3); font-size: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
#scrub span { font-size: 10px; font-weight: 800; margin-top: 3px; }
#scrub.on { background: #8fd3ff; box-shadow: 0 0 0 4px #fff, 0 3px 14px rgba(40,120,200,.5); }
body.inspect #scrub { display: none; }
