* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1622; color: #fff; font-family: "Segoe UI", system-ui, sans-serif; user-select: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.hidden { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
#bars { position: absolute; left: 16px; top: 14px; display: grid; gap: 6px; }
.bar { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.bar > div { width: 170px; height: 13px; background: rgba(0,0,0,.45); border-radius: 7px; overflow: hidden; border: 1px solid rgba(255,255,255,.25); }
.bar i { display: block; height: 100%; width: 100%; border-radius: 7px; transition: width .15s; }
.hp i { background: #e0483f; } .fome i { background: #e39b3a; } .sede i { background: #3fa9e0; } .folego i { background: #d8d24a; }
.bar.low > div { animation: blink .7s infinite; }
@keyframes blink { 50% { border-color: #ff5a4a; box-shadow: 0 0 8px #ff5a4a; } }

#clock { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: 17px; font-weight: 600; background: rgba(0,0,0,.4); padding: 5px 16px; border-radius: 16px; }
#goal { position: absolute; top: 14px; right: 16px; max-width: 320px; font-size: 14px; background: rgba(0,0,0,.42); padding: 8px 12px; border-radius: 10px; border-left: 3px solid #e8c34a; }
#goal b { display: block; font-size: 11px; letter-spacing: 1px; color: #e8c34a; text-transform: uppercase; }

#cross { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.45); }
#cross.on { background: #ffd94a; transform: scale(1.5); }
#prompt { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); font-size: 16px; font-weight: 600; white-space: nowrap; text-align: center; }
#prompt kbd { background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.5); border-radius: 5px; padding: 1px 7px; margin-right: 6px; font: inherit; }
#prompt .life { display: block; width: 120px; height: 7px; margin: 6px auto 0; background: rgba(0,0,0,.5); border-radius: 4px; overflow: hidden; }
#prompt .life i { display: block; height: 100%; background: #e0483f; }

#work { position: absolute; left: 50%; top: calc(50% + 78px); transform: translateX(-50%); text-align: center; font-size: 15px; font-weight: 600; }
#work div { width: 240px; height: 12px; margin-top: 6px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.4); border-radius: 6px; overflow: hidden; }
#work i { display: block; height: 100%; width: 0; background: #ffd94a; }
#hotbar span em { font-style: normal; font-size: 10px; opacity: .85; margin-left: 4px; }
#recipes h3 { grid-column: 1 / -1; margin: 6px 0 0; color: #e8c34a; }
#recipes h3:first-child { margin-top: 0; }
#recipes button span { display: inline-block; }
#banner { position: absolute; left: 0; right: 0; top: 20%; text-align: center; opacity: 0; transition: opacity .6s; }
#banner.show { opacity: 1; }
#banner b { display: block; font-size: 44px; letter-spacing: 2px; }
#banner span { font-size: 18px; color: #ffe9a8; }

#toasts { position: absolute; left: 16px; bottom: 96px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
#toasts div { background: rgba(0,0,0,.45); padding: 4px 10px; border-radius: 8px; animation: toast 3.2s forwards; width: fit-content; }
@keyframes toast { 0% { opacity: 0; transform: translateX(-12px); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

#bottom { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; }
#hotbar, #inv { display: flex; gap: 6px; }
#hotbar span { background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.25); border-radius: 10px; padding: 5px 10px; font-size: 20px; }
#hotbar span small { font-size: 11px; opacity: .8; margin-right: 4px; }
#hotbar span.sel { border-color: #ffd94a; background: rgba(90,70,0,.55); }
#inv span { background: rgba(0,0,0,.45); border-radius: 8px; padding: 3px 9px; font-size: 15px; font-weight: 600; }
#keys { position: absolute; left: 16px; top: 118px; font-size: 11px; opacity: .7; max-width: 220px; }
#hurt { position: absolute; inset: 0; box-shadow: inset 0 0 160px 50px rgba(200,0,0,.75); opacity: 0; }

#craft, .screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5,12,20,.55); }
.box { background: rgba(18,28,38,.94); border: 1px solid rgba(255,255,255,.15); border-radius: 16px; padding: 22px 28px; max-width: 760px; width: calc(100% - 32px); max-height: calc(100% - 24px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.screen .box { text-align: center; }
h1 { font-size: 52px; letter-spacing: 6px; margin: 4px 0 10px; color: #ffd94a; text-shadow: 0 3px 0 #7a4a12; }
h2 { margin: 0 0 12px; font-size: 22px; } h2 small { font-size: 12px; font-weight: 400; opacity: .7; margin-left: 8px; }
h3 { margin: 16px 0 8px; font-size: 15px; opacity: .85; }
.story { font-size: 16px; line-height: 1.55; color: #dfe8ee; }
.controls { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 13px; margin: 14px 0 18px; color: #c5d2da; }
.controls b { color: #fff; background: rgba(255,255,255,.12); border-radius: 5px; padding: 1px 6px; margin-right: 4px; }
.about { font-size: 12px; line-height: 1.5; color: #9fb0bb; margin: 18px 0 0; }
.about a { color: #ffd94a; }
button { font: inherit; color: #fff; cursor: pointer; border: 0; border-radius: 10px; }
.screen button { background: #e08a2e; font-size: 20px; font-weight: 700; padding: 11px 38px; box-shadow: 0 4px 0 #8a4f12; }
.screen button:hover { background: #f09a3a; }
#recipes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#recipes button, #foods button { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); padding: 9px 12px; text-align: left; }
#recipes button b { display: block; font-size: 15px; }
#recipes button small { display: block; font-size: 12px; opacity: .75; margin: 2px 0 4px; }
#recipes button span { font-size: 13px; }
#recipes button span.falta { color: #ff7a6a; }
#recipes button:hover, #foods button:hover { background: rgba(255,255,255,.16); }
#recipes button.no { opacity: .55; }
#recipes button.own { border-color: #6fc46a; opacity: .6; }
#foods { display: flex; flex-wrap: wrap; gap: 8px; }
#foods button { font-size: 14px; }
#foods button:disabled { opacity: .35; cursor: default; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 1.1s; }
#fade.on { opacity: 1; }
/* cara de jogo de blocos: letra quadrada e cantos retos */
html, body, button { font-family: Consolas, "Lucida Console", "Courier New", monospace; }
.bar > div, .bar i, #clock, #goal, #toasts div, #hotbar span, #inv span, .box, button, #work div, #prompt kbd, #prompt .life { border-radius: 0 !important; }
#cross { border-radius: 0; width: 4px; height: 4px; margin: -2px; }
h1 { text-shadow: 4px 4px 0 #7a4a12; }
@media (max-width: 720px) { #recipes { grid-template-columns: 1fr; } h1 { font-size: 36px; } #keys { display: none; } #goal { max-width: 190px; font-size: 12px; } }
