html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  touch-action: none;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

#c{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

.debug{
  position: fixed;
  top: 10px;
  left: 10px;
  max-width: 92vw;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  line-height: 1.25;
  z-index: 50;
  pointer-events: none;
  white-space: pre-wrap;
}

.stick{
  position: fixed;
  width: 210px;
  height: 210px;
  z-index: 20;
  pointer-events: none;
}
.stick-left{ left: 14px; bottom: 58px; }
.stick-right{ right: 14px; bottom: 58px; }

.stick-base{
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
}
.stick-knob{
  position: absolute;
  width: 86px;
  height: 86px;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.12);
}

.pill{
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: rgba(240,245,255,0.92);
  color: #111;
  font-weight: 700;
}

.pill.small{ padding: 10px 14px; font-weight: 700; }

.jump{
  position: fixed;
  right: 22px;
  bottom: 300px; /* moved up a bit */
  z-index: 30;
}

.action{
  /* Middle action button removed (actions are triggered via look-stick tap). */
  display: none !important;
}

.hotbar{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  z-index: 30;
}

.slotbox{
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(10,20,35,0.65);
  border: 1px solid rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
  color: white;
  user-select: none;
}
.slotbox .icon{ font-size: 22px; filter: saturate(0.2) brightness(1.35); }
.slotbox.selected{
  outline: 3px solid rgba(255,255,255,0.25);
  box-shadow: 0 0 0 4px rgba(0,0,0,0.15) inset;
}
.slotbox.empty{
  background: rgba(0,0,0,0.08);
  border: 2px dashed rgba(255,255,255,0.12);
}

.buildbar{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 92px;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  z-index: 35;
}
.hidden{ display:none !important; }

.wheel{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  z-index: 60;
  display: grid;
  place-items: center;
}
.wheel-card{
  width: min(420px, 92vw);
  border-radius: 18px;
  padding: 14px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.92);
}
.wheel-title{
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
}
.wheel-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.wheel-item{
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(240,245,255,0.92);
  color: #111;
  font-weight: 800;
  padding: 16px 12px;
  border-radius: 14px;
}

.invpanel{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 70px;
  width: min(560px, 94vw);
  border-radius: 18px;
  padding: 12px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  z-index: 55;
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.92);
  max-height: 62vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.invhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.invtitle{ font-size: 18px; font-weight: 900; }
.invgrid{
  display:grid;
  grid-template-columns: repeat(6, 56px);
  gap: 10px;
  justify-content: center;
  padding-bottom: 10px;
}

.craftlist{
  display: grid;
  gap: 10px;
  padding-bottom: 10px;
}

.recipe{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(10,20,35,0.42);
  border: 1px solid rgba(255,255,255,0.12);
}
.recipe .left{
  display:flex;
  align-items:center;
  gap: 10px;
}
.recipe .rname{ font-weight: 900; }
.recipe .req{ font-size: 12px; opacity: 0.9; }
.recipe button{ white-space: nowrap; }
.recipe button:disabled{ opacity: 0.45; }

.loothelp{
  font-size: 12px;
  opacity: 0.9;
  margin: 6px 2px 10px;
}
.lootactions{
  display:flex;
  justify-content: flex-end;
  padding-top: 10px;
}
.invslot{
  width:56px;height:56px;border-radius:12px;
  background: rgba(10,20,35,0.65);
  border: 1px solid rgba(255,255,255,0.12);
  display:grid;place-items:center;color:white;
  position: relative;
}
.badge{
  position:absolute;
  right:6px; top:6px;
  font-size: 11px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 2px 6px;
  border-radius: 999px;
}

.invtitle{display:flex;gap:8px;align-items:center;}
.tabbtn{
  appearance:none;
  border:1px solid rgba(255,255,255,0.22);
  background:rgba(0,0,0,0.25);
  color:#fff;
  font-weight:700;
  padding:8px 10px;
  border-radius:10px;
  font-size:13px;
}
.tabbtn.active{
  background:rgba(255,255,255,0.14);
  border-color:rgba(255,255,255,0.35);
}
.invtab{
  max-height:min(60vh,520px);
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right:2px;
}
.invpanel.legacy{display:none !important;}

/* Chest storage layout */
.chestcols{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
}
.chestcol{
  flex: 1 1 240px;
}
.coltitle{
  font-weight: 900;
  font-size: 13px;
  opacity: 0.9;
  margin: 6px 0 6px;
}

/* --- Radial build wheel (Rust-ish) --- */
.radial{
  width: min(360px, 92vw);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  position: relative;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.radial-center{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 74px;
  height: 74px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.92);
  color: #111;
  font-weight: 900;
  font-size: 22px;
}
.radial-item{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92px;
  height: 72px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(240,245,255,0.92);
  color: #111;
  font-weight: 900;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px 10px;
  transform: translate(-50%, -50%) rotate(var(--ang)) translate(0, -132px) rotate(calc(var(--ang) * -1));
}
.radial-item .ri{ font-size: 20px; line-height: 1; }
.radial-item .rl{ font-size: 12px; opacity: 0.9; }

@media (max-width: 420px){
  .radial-item{ width: 86px; height: 68px; transform: translate(-50%,-50%) rotate(var(--ang)) translate(0, -120px) rotate(calc(var(--ang) * -1)); }
  .radial-center{ width: 68px; height: 68px; }
}


/* Toast popup */
.toast{
  position:fixed;
  left:50%;
  top:10px;
  transform:translateX(-50%);
  background:rgba(20,20,20,0.85);
  color:#fff;
  padding:10px 14px;
  border-radius:12px;
  font-size:14px;
  z-index:9999;
  max-width:min(92vw,420px);
  text-align:center;
  pointer-events:none;
  box-shadow:0 6px 18px rgba(0,0,0,0.35);
}
.toast.hidden{display:none;}
