/* ---------------------------------------------------------------- base */
:root {
  --bg: #0d1017;
  --panel: rgba(20, 24, 33, 0.90);
  --panel-2: rgba(30, 35, 47, 0.92);
  --line: rgba(255, 255, 255, 0.10);
  --line-2: rgba(255, 255, 255, 0.18);
  --txt: #e8e6e1;
  --muted: #9aa1ae;
  --amber: #f0a83c;
  --amber-2: #ffc978;
  --green: #78bf5a;
  --red: #e0574a;
  --slot: rgba(255, 255, 255, 0.055);
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }

.hidden { display: none !important; }

/* --------------------------------------------------------- boot screen */
#boot {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(120% 90% at 50% 20%, #1b2130 0%, #0b0e14 70%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s ease;
}
#boot.gone { opacity: 0; pointer-events: none; }
.boot-inner { text-align: center; }
.boot-cube { width: 64px; height: 64px; margin: 0 auto 22px; position: relative; animation: bobcube 2.4s ease-in-out infinite; }
.boot-cube i { position: absolute; inset: 0; display: block; }
.boot-cube i:nth-child(1) { background: linear-gradient(#7cc059, #5f9a41); clip-path: polygon(50% 0, 100% 27%, 50% 54%, 0 27%); }
.boot-cube i:nth-child(2) { background: linear-gradient(#8a5f3f, #6b482f); clip-path: polygon(0 27%, 50% 54%, 50% 100%, 0 73%); }
.boot-cube i:nth-child(3) { background: linear-gradient(#6d4a31, #4f3623); clip-path: polygon(100% 27%, 100% 73%, 50% 100%, 50% 54%); }
@keyframes bobcube { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-9px) rotate(3deg); } }
.boot-title { font-size: 26px; letter-spacing: .42em; font-weight: 700; color: #e6dfd2; text-indent: .42em; }
.boot-bar { width: 190px; height: 3px; margin: 20px auto 0; background: rgba(255,255,255,.10); border-radius: 3px; overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 38%; background: var(--amber); border-radius: 3px; animation: slide 1.25s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 105%; } }
.boot-error { color: #ff8b7d; font-size: 15px; padding: 20px; text-align: center; }

/* ---------------------------------------------------------------- HUD */
.hud { position: absolute; inset: 0; }

.crosshair {
  position: absolute; left: 50%; top: 50%;
  width: 20px; height: 20px; margin: -10px 0 0 -10px;
  opacity: .85;
}
.crosshair::before, .crosshair::after {
  content: ""; position: absolute; background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.45);
  mix-blend-mode: difference;
}
.crosshair::before { left: 9px; top: 2px; width: 2px; height: 16px; }
.crosshair::after { top: 9px; left: 2px; height: 2px; width: 16px; }

body.underwater .crosshair { opacity: .6; }

.bottom {
  position: absolute; left: 0; right: 0; bottom: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}

.vitals { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: center; }
.bar { display: flex; gap: 2px; }
.bar i {
  width: 15px; height: 14px; display: block;
  background-repeat: no-repeat; background-size: contain; background-position: center;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.7));
}
.heart.full   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21C6 16.5 2 12.8 2 8.6 2 5.5 4.4 3 7.4 3 9.2 3 10.9 3.9 12 5.3 13.1 3.9 14.8 3 16.6 3 19.6 3 22 5.5 22 8.6c0 4.2-4 7.9-10 12.4z' fill='%23e04b46'/%3E%3C/svg%3E"); }
.heart.half   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21C6 16.5 2 12.8 2 8.6 2 5.5 4.4 3 7.4 3 9.2 3 10.9 3.9 12 5.3 13.1 3.9 14.8 3 16.6 3 19.6 3 22 5.5 22 8.6c0 4.2-4 7.9-10 12.4z' fill='%23000' opacity='.55'/%3E%3Cpath d='M12 21C6 16.5 2 12.8 2 8.6 2 5.5 4.4 3 7.4 3 9.2 3 10.9 3.9 12 5.3V21z' fill='%23e04b46'/%3E%3C/svg%3E"); }
.heart.empty  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21C6 16.5 2 12.8 2 8.6 2 5.5 4.4 3 7.4 3 9.2 3 10.9 3.9 12 5.3 13.1 3.9 14.8 3 16.6 3 19.6 3 22 5.5 22 8.6c0 4.2-4 7.9-10 12.4z' fill='%23000' opacity='.55'/%3E%3C/svg%3E"); }
.drum.full    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.5 3c3.6 0 6 2.6 6 5.8 0 3.4-2.7 5.9-6.2 5.6l-1.6 1.6 1.5 1.5-1.4 1.4-1.5-1.5-1.5 1.5-1.4-1.4L4.6 21 3 19.4l3.5-4.3-1.4-1.4 1.4-1.4 1.5 1.5 1.6-1.6C9.3 8.7 11 3 14.5 3z' fill='%23c07b3e'/%3E%3C/svg%3E"); }
.drum.half    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.5 3c3.6 0 6 2.6 6 5.8 0 3.4-2.7 5.9-6.2 5.6l-1.6 1.6 1.5 1.5-1.4 1.4-1.5-1.5-1.5 1.5-1.4-1.4L4.6 21 3 19.4l3.5-4.3-1.4-1.4 1.4-1.4 1.5 1.5 1.6-1.6C9.3 8.7 11 3 14.5 3z' fill='%23000' opacity='.55'/%3E%3Cpath d='M14.5 3c3.6 0 6 2.6 6 5.8 0 3.4-2.7 5.9-6.2 5.6l-1.6 1.6-1.4-1.4C9.3 8.7 11 3 14.5 3z' fill='%23c07b3e'/%3E%3C/svg%3E"); }
.drum.empty   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.5 3c3.6 0 6 2.6 6 5.8 0 3.4-2.7 5.9-6.2 5.6l-1.6 1.6 1.5 1.5-1.4 1.4-1.5-1.5-1.5 1.5-1.4-1.4L4.6 21 3 19.4l3.5-4.3-1.4-1.4 1.4-1.4 1.5 1.5 1.6-1.6C9.3 8.7 11 3 14.5 3z' fill='%23000' opacity='.55'/%3E%3C/svg%3E"); }
.bubble.full  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8' fill='%236fc3e8'/%3E%3Ccircle cx='9.5' cy='9.5' r='2.2' fill='%23dff2fb'/%3E%3C/svg%3E"); }
.bubble.half  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='5' fill='%236fc3e8' opacity='.7'/%3E%3C/svg%3E"); }
.bubble.empty { background-image: none; }

.held-name {
  height: 18px; font-size: 13px; letter-spacing: .04em; color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.85); opacity: 0;
}
.held-name.show { animation: heldfade 2.4s ease forwards; }
@keyframes heldfade { 0% { opacity: 0; transform: translateY(4px); } 12% { opacity: 1; transform: none; } 72% { opacity: 1; } 100% { opacity: 0; } }

.hotbar {
  display: flex; gap: 5px; padding: 5px;
  background: rgba(10, 13, 19, .55);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  pointer-events: auto;
}

.slot {
  position: relative;
  width: 48px; height: 48px;
  border-radius: 9px;
  background: var(--slot);
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: transform .09s ease, border-color .12s ease, background .12s ease;
}
.slot .icon {
  position: absolute; inset: 5px;
  background-size: contain; background-repeat: no-repeat; background-position: center;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.45));
}
.slot .cnt {
  position: absolute; right: 3px; bottom: 1px;
  font-size: 12px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
}
.slot .key {
  position: absolute; left: 4px; top: 2px;
  font-size: 9px; color: rgba(255,255,255,.34); font-weight: 700;
}
.slot .dur {
  position: absolute; left: 5px; right: 5px; bottom: 4px;
  height: 3px; border-radius: 2px; display: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55);
}
.slot.hot.sel {
  border-color: var(--amber);
  background: rgba(240,168,60,.16);
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 6px 14px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,201,120,.4);
}
.slot.hot.sel .key { color: var(--amber-2); }

.topleft { position: absolute; left: 16px; top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.clock {
  display: flex; align-items: center; gap: 9px;
  background: rgba(10, 13, 19, .5);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 13px 5px 6px;
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  font-size: 12px; letter-spacing: .03em; color: #dfe3ea;
}
.dial {
  width: 20px; height: 20px; border-radius: 50%;
  background: conic-gradient(#12203a 0deg 90deg, #63a8e8 90deg 180deg, #ffd479 180deg 270deg, #2a3c60 270deg 360deg);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35);
  position: relative;
}
.dial::after {
  content: ""; position: absolute; left: 50%; top: -3px;
  width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px;
  background: #fff; box-shadow: 0 0 4px rgba(255,255,255,.6);
}
.biome {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding-left: 4px;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}

.debug {
  position: absolute; right: 14px; top: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; color: #b9c2d0; background: rgba(10,13,19,.5);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

.hint {
  position: absolute; left: 50%; top: 60px; transform: translateX(-50%);
  max-width: min(560px, 84vw); text-align: center;
  background: rgba(10, 13, 19, .62);
  border: 1px solid rgba(240,168,60,.32);
  border-left: 3px solid var(--amber);
  border-radius: 10px; padding: 9px 16px;
  font-size: 13.5px; color: #f3ecdf; line-height: 1.4;
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
}
.hint.pop { animation: hintpop .38s cubic-bezier(.2,1.3,.4,1); }
@keyframes hintpop { from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(.96); } }

.toasts { position: absolute; right: 16px; bottom: 96px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 8px;
  background: rgba(12, 15, 22, .72);
  border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 12px 6px 8px;
  font-size: 12.5px; color: #e9e6e0;
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  animation: toastin .26s cubic-bezier(.2,1.2,.4,1);
  transition: opacity .4s ease, transform .4s ease;
}
.toast img { width: 22px; height: 22px; image-rendering: pixelated; }
.toast.out { opacity: 0; transform: translateX(22px); }
@keyframes toastin { from { opacity: 0; transform: translateX(24px); } }

.damage-flash {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(120% 110% at 50% 50%, transparent 40%, rgba(190, 30, 22, .85) 100%);
  transition: opacity .18s ease;
}
.vignette {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(100% 90% at 50% 50%, transparent 45%, rgba(120, 8, 4, .8) 100%);
  transition: opacity .5s ease;
}
body.underwater #ui::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(20,90,150,.22), rgba(10,50,110,.34));
  mix-blend-mode: screen;
}

/* ------------------------------------------------------------ overlays */
.overlay {
  position: absolute; inset: 0; pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(120% 100% at 50% 30%, rgba(9,12,18,.55), rgba(6,8,12,.86));
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  animation: fadein .22s ease;
  overflow: auto;
}
@keyframes fadein { from { opacity: 0; } }

.panel {
  width: min(560px, 96vw);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 26px 26px 22px;
  box-shadow: 0 26px 70px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.07);
  animation: panelin .3s cubic-bezier(.2,1.1,.35,1);
}
@keyframes panelin { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.panel h1 { font-size: 40px; letter-spacing: .30em; text-indent: .30em; font-weight: 800; }
.panel h2 { font-size: 22px; letter-spacing: .05em; margin-bottom: 16px; }
.panel h3 { font-size: 16px; letter-spacing: .06em; }
.panel p.muted, .muted { color: var(--muted); font-size: 13.5px; line-height: 1.55; }

.menu { text-align: center; }
.logo { margin-bottom: 26px; }
.logo-mark {
  width: 74px; height: 74px; margin: 0 auto 16px; position: relative;
  background:
    linear-gradient(135deg, #7cc059 0 50%, transparent 50%) top left / 100% 46% no-repeat,
    linear-gradient(#8a5f3f, #5f4029) bottom left / 50% 56% no-repeat,
    linear-gradient(#6b482f, #46301f) bottom right / 50% 56% no-repeat;
  clip-path: polygon(50% 0, 100% 26%, 100% 74%, 50% 100%, 0 74%, 0 26%);
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.5));
}
.logo-mark.small { width: 48px; height: 48px; }
.logo .sub { color: var(--muted); font-size: 13px; letter-spacing: .22em; text-transform: uppercase; margin-top: 8px; }

.actions { display: flex; flex-direction: column; gap: 9px; margin-top: 6px; }

.btn {
  font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: .02em;
  color: var(--txt);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform .09s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.btn:hover { background: rgba(48,55,72,.95); border-color: rgba(255,255,255,.3); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #f5b451, #e0932c);
  border-color: rgba(255,220,160,.55);
  color: #24170a;
  box-shadow: 0 6px 18px rgba(224,147,44,.28), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn.primary:hover { background: linear-gradient(180deg, #ffc46a, #eda13a); }
.btn.danger { background: linear-gradient(180deg, #e4685a, #c9483c); color: #fff; border-color: rgba(255,180,170,.4); }
.btn.small { padding: 9px 14px; font-size: 13px; }

.tipline { margin-top: 18px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.tipline b { color: var(--amber-2); }
.foot { margin-top: 18px; display: flex; justify-content: center; }
.langpick { display: flex; gap: 6px; }
.lang {
  font-family: inherit; font-size: 12.5px; padding: 7px 14px; cursor: pointer;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  transition: all .15s ease;
}
.lang:hover { color: var(--txt); border-color: var(--line-2); }
.lang.on { background: rgba(240,168,60,.16); color: var(--amber-2); border-color: rgba(240,168,60,.45); }

.row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.row > label { flex: 0 0 40%; font-size: 13.5px; color: var(--muted); }
.row > *:not(label) { flex: 1; }

.choice { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  font-family: inherit; font-size: 12.5px; padding: 8px 12px; cursor: pointer;
  background: rgba(255,255,255,.05); color: var(--muted);
  border: 1px solid var(--line); border-radius: 9px; flex: 1; min-width: 62px;
  transition: all .13s ease;
}
.chip:hover { color: var(--txt); }
.chip.on { background: rgba(240,168,60,.18); color: var(--amber-2); border-color: rgba(240,168,60,.5); }

.slider { display: flex; align-items: center; gap: 10px; }
.slider input[type=range] {
  flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,.14); outline: none;
}
.slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--amber); border: 2px solid #241a0c; cursor: pointer;
}
.slider input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--amber);
  border: 2px solid #241a0c; cursor: pointer;
}
.slider .val { flex: 0 0 46px; text-align: right; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.seedinput {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px;
  background: rgba(0,0,0,.3); color: var(--txt);
  border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; outline: none;
}
.seedinput:focus { border-color: var(--amber); }

.keys { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.keyrow { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
kbd {
  flex: 0 0 96px; text-align: center;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px;
  background: rgba(255,255,255,.07); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 7px; padding: 5px 6px; color: #dfe4ec;
}
.goal { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin-bottom: 16px; }
.statline { margin-top: 14px; text-align: center; font-size: 12.5px; color: var(--muted); }
.cause { text-align: center; color: var(--amber-2); font-size: 14.5px; margin-bottom: 4px; }
.death h2 { text-align: center; color: #ff8577; }

.loading { text-align: center; }
.progress { width: 100%; height: 6px; background: rgba(255,255,255,.10); border-radius: 6px; overflow: hidden; margin: 18px 0 4px; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--amber), var(--amber-2)); border-radius: 6px; transition: width .25s ease; }

/* ------------------------------------------------------ inventory UI */
.overlay.station { align-items: center; }
.inv-panel { width: min(760px, 97vw); padding: 18px 20px 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head .x {
  font-family: inherit; font-size: 15px; width: 32px; height: 32px; cursor: pointer;
  background: rgba(255,255,255,.06); color: var(--muted);
  border: 1px solid var(--line); border-radius: 9px;
  transition: all .13s ease;
}
.panel-head .x:hover { color: #fff; background: rgba(224,87,74,.25); border-color: rgba(224,87,74,.5); }

.panel-body { display: flex; flex-direction: column; gap: 14px; }
.section { background: rgba(0,0,0,.20); border: 1px solid var(--line); border-radius: 13px; padding: 12px; }
.sec-title { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.sec-title.small { margin-bottom: 5px; }
.note { margin-top: 8px; font-size: 11.5px; color: var(--muted); opacity: .8; }

.grid { display: grid; gap: 4px; }
.inv-grid { grid-template-columns: repeat(9, 1fr); }
.hot-grid { grid-template-columns: repeat(9, 1fr); margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.grid .slot { width: 100%; aspect-ratio: 1; height: auto; cursor: pointer; }
.grid .slot:hover { border-color: var(--amber); background: rgba(240,168,60,.12); }

.craft-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.craft-grid { flex: 0 0 auto; }
.craft-grid.s2 { grid-template-columns: repeat(2, 52px); }
.craft-grid.s3 { grid-template-columns: repeat(3, 52px); }
.craft-grid .slot { width: 52px; height: 52px; aspect-ratio: auto; }
.arrow { color: var(--muted); font-size: 20px; }
.result-wrap { display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; }
.result-wrap .slot {
  width: 62px; height: 62px; aspect-ratio: auto;
  border-color: rgba(240,168,60,.4); background: rgba(240,168,60,.09);
}
.result-wrap .slot.filled { animation: resready .4s ease; box-shadow: 0 0 0 1px rgba(240,168,60,.5), 0 0 20px rgba(240,168,60,.25); }
@keyframes resready { from { transform: scale(.88); } }

.recipes { max-height: 210px; overflow-y: auto; }
.recipe-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 6px; }
.recipe {
  display: flex; align-items: center; gap: 9px; cursor: pointer; text-align: left;
  font-family: inherit; color: var(--txt);
  background: rgba(255,255,255,.045); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 9px;
  transition: all .12s ease;
}
.recipe:hover { background: rgba(240,168,60,.13); border-color: rgba(240,168,60,.45); }
.recipe.dim { opacity: .38; }
.recipe img { width: 30px; height: 30px; image-rendering: pixelated; flex: 0 0 30px; }
.rinfo { min-width: 0; }
.rname { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring { display: flex; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.ing { display: flex; align-items: center; gap: 2px; }
.ing img { width: 15px; height: 15px; }
.ing i { font-style: normal; font-size: 10px; color: var(--muted); }

.furnace-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.fcol { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fcol .slot { width: 54px; height: 54px; aspect-ratio: auto; cursor: pointer; }
.flame { width: 22px; height: 26px; background: rgba(0,0,0,.35); border-radius: 5px; display: flex; align-items: flex-end; overflow: hidden; }
.flame-fill { width: 100%; height: 0%; background: linear-gradient(0deg, #e2621f, #ffcf5c); transition: height .2s linear; }
.fprogress { flex: 0 0 120px; height: 10px; background: rgba(0,0,0,.35); border-radius: 6px; overflow: hidden; }
.smelt-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #d98b2b, #ffce6d); transition: width .2s linear; }

.cursor-stack {
  position: fixed; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  pointer-events: none; z-index: 60;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.6));
}
.cursor-stack .icon { position: absolute; inset: 0; background-size: contain; background-repeat: no-repeat; background-position: center; image-rendering: pixelated; }
.cursor-stack .cnt { position: absolute; right: 0; bottom: 0; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000; }

.tooltip {
  position: fixed; z-index: 70; pointer-events: none;
  background: rgba(10,13,19,.95); border: 1px solid var(--line-2);
  border-radius: 9px; padding: 7px 11px; max-width: 220px;
  box-shadow: 0 10px 26px rgba(0,0,0,.55);
}
.tt-name { font-size: 12.5px; color: #fff; }
.tt-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

@media (max-width: 720px) {
  .panel h1 { font-size: 30px; }
  .slot { width: 40px; height: 40px; }
  .craft-grid.s2 { grid-template-columns: repeat(2, 46px); }
  .craft-grid.s3 { grid-template-columns: repeat(3, 46px); }
  .craft-grid .slot { width: 46px; height: 46px; }
  .recipes { max-height: 170px; }
}
@media (max-height: 620px) {
  .overlay { align-items: flex-start; }
  .recipes { max-height: 130px; }
}

.lock-prompt {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.lock-inner {
  background: rgba(10, 13, 19, .72);
  border: 1px solid var(--line-2);
  border-radius: 12px; padding: 12px 22px;
  font-size: 14px; color: #f1ece2; letter-spacing: .02em;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
  animation: lockpulse 2.2s ease-in-out infinite;
}
@keyframes lockpulse { 0%,100% { opacity: .82; transform: scale(1); } 50% { opacity: 1; transform: scale(1.02); } }

.intro-card {
  position: absolute; left: 16px; bottom: 108px;
  background: rgba(10, 13, 19, .58);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: introin .45s cubic-bezier(.2,1.1,.4,1);
  max-width: 320px;
}
.intro-card .sec-title { margin-bottom: 7px; }
.intro-card .irow { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; font-size: 11.5px; color: #d7dbe3; }
.intro-card kbd { flex: 0 0 78px; font-size: 10px; padding: 3px 4px; }
.intro-card.fade { opacity: 0; transform: translateY(6px); transition: opacity .8s ease, transform .8s ease; }
@keyframes introin { from { opacity: 0; transform: translateX(-14px); } }
